Skip to content

apetenchea/VimScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VimScripts

Some vim scripts that make my life easier.

Besides, I have the following plugins installed:

  1. pathogen
  2. nerdtree
  3. vim-localvimrc
  4. syntastic
  5. YouCompleteMe
  6. rust.vim

My .vimrc file. Nowadays it's actually much more minimalist, but my nostalgia makes me keep this one up here.


My .ideavimrc file. I use it together with IdeaVim when coding in JetBrains IDEs.


This script adds some features on top of the Eclim plugin. The lack of a command which could start Eclim from within Vim was annoying. The StartEclim command in this script does exactly just that!
How it works
It first checks if the Eclim server is already running. If not, it starts it in background. When the Vim instance which started the server is closed, the server is also stopped automatically.
Also, this script adds some nice features that go along with Eclim, such as Javadoc comment folding and useful mappings.

Configuration
Details about Eclim can be found here.
Set s:eclimd_path to the path of your Eclim server
The variable s:eclimd_path should contain the path to eclimd, which can be found in the folder where Eclim was installed.
Using vim-localvimrc
The best way to use eclim-extra is alongside vim-localvimrc. This will enable you to automatically run the Eclim server in background, whenever Vim is started inside your Eclipse workspace. If not, you can manually start it by using the StartEclim command.
After you've installed vim-localvimrc, you should disable sandbox mode. Add this to your .vimrc:

" Disable sandbox mode for localvimrc.
g:localvimrc_sandbox = 0

In order to load .lvimrc files automatically, without asking, add this to your .vimrc:

" Don't ask before loading a .lvimrc file.
g:localvimrc_ask = 0

NOTE: if there are multiple users on the same machine, first make sure that it is safe to disable sanbox mode!
Then, simply put the contents of the eclim-extra script inside a file named .lvimrc, created in your eclipse workspace.
Now, the Eclim server will start automatically with Vim, inside the Eclipse workspace.
When you don't want the Eclim server to be started automatically, you can start Vim like this:

vim --cmd 'let g:noeclim=1' 

Usage
To start the Eclim server from whithin Vim use:

:StartEclim

Mappings

  1. CTRL+b -> build project + toggle quickfix window.

Tips

  1. Regarding Eclim and checkstyle, I ran into some problems, which I fixed by following this advice.
  2. How to check your default Eclipse workspace:
    1. Go to $HOME/eclipse/configuration
    2. In the config.ini file you should see a line:
      osgi.instance.area.default=your_default_workspace
    

About the code
The code aims to follow the Google Vimscript Style Guide.

About

Some vim scripts that make my life easier.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published