I assume that you are under a Unix based system. Don't hesitate to change anything to fit your needs.
- Installation
- BÉPO friendly
- Plugins
- About Ack
- About auto-completion
- About snippets
- About multiples cursors
- About syntax checker : Syntastic
- About Eclim
- Better Java syntax highlighting
- Considerations about Windows
- Good resources to learn more about VIM editor
Backup your ~/.vim
folder if you want to.
Get this config from github.
$ git clone https://github.com/CBenoit/vim-config ~/.vim
I noticed that creating a symbolic link to ~/.vim/vimrc isn't necessary.
Plugins managed using Vundle! You can easily install or remove plugins, and they are installed into ~/.vim/bundle/. See https://github.com/gmarik/vundle for more information. Everything will automatically be installed at vim first start with this config. If you want to remove some plugins, do it before launching vim. You should restart vim after plugins installation. If gvim isn't appearing, try to run text based vim from terminal.
You'll need vim 7.4+ compiled with python, ruby and lua support (if you use all plugins in my .vimrc file).
You can check with vim --version | grep '+python'
, vim --version | grep '+ruby'
and vim --version | grep '+ruby'
or you can use vim command mode : :echo has('python')
, :echo has('ruby')
and :echo has('lua')
.
This configuration works for BÉPO, QWERTY and AZERTY layouts.
You just have to tell whether you are using BÉPO or not by modifying isbepo.vim file.
You should add conf/isbepo.vim
to your .gitignore
file.
If isbepo
variable is set to 1
. Then, all keys are remaped to QWERTY while in NORMAL and VISUAL mode.
If you want my french cheatsheet for this config, see bepo-french-vim-cheatsheet.md file.
- Ack — Search for pattern in files.
- Airline — A beautiful status bar.
- ctrlp — Search for files.
- Colorizer — To colorize text in the form #rrggbb or #rgb.
- Cpp Enhanced Highlight — Better C++ highlight.
- EditorConfig — Help to define and maintain consistent coding styles.
- Fugitive — An awesome Git wrapper.
- LustyExplorer & LustyJuggler — A fuzzy file and buffer explorer.
- Multiple cursors — Sublime Text-like multiple cursors feature.
- Markdown — Support for markdown.
- NeoComplete — Handle completion.
- Syntastic — Syntax checking.
- Tabular — To align regions of text.
- UltiSnips — Excellent solution to handle snippets in VIM.
- vim2hs — A collection of vimscripts for Haskell development.
Colorscheme used : Monokai
- AutoClose — Automatically close any character that could have a closing counterpart.
- YouCompleteMe — Handle autocompletion.
Ack.vim is a frontend for the Perl module Ack.
You need Ack (>= 2.0) to use the plugin. To install follow the manual.
You may have to change the g:ackprg
variable in conf/ack.vim file (for instance, under Debian, the name is ack-grep
instead of ack
).
My config uses NeoComplete plugin to handle autocompletion.
Some alternatives :
- YouCompleteMe — you'll need to build a third party program.
- supertab
- clang_complete
- python-mode
- jedi-vim
- AutoComplPop
They may fit your needs or not. Just make your choice and modify the .vimrc file.
This config uses SirVer's UltiSnips to handle snippets.
You can learn more about it with :help UltiSnips
and by looking at its github page UltiSnips' readme.
SirVer made some screencasts very useful to start using it.
Since YouCompleteMe/NeoComplete already use "Tab" key, I choose "c-j" (Ctrl + J) as UltiSnips' trigger key.
By the way, YouCompleteMe/NeoComplete provides a nice completion menu for UltiSnips.
My .vimrc file comes with tons of snippets from honza repository.
In order to go back to regular VIM, you cannot use an "esc" alias ("ii" in my case). You have to use the actual "esc" key.
See :h multiple-cursors-mappings
for more information.
Syntastic does not know how to check syntax by itself. So, you need to install external checkers corresponding to the types of files you use. See Syntastic wiki for a fair list of syntax checkers.
To check Python syntax, I use Pylint. Since I'm a Python 3 developer, I set a Python 3 interpreter in my syntastic.vim conf file.
Eclim provides the ability to access Eclipse code editing features
(code completion, searching, code validation, and many more) via the
command line or a local network connection, allowing those features
to be integrated with your favorite editor. Eclim provides an integration
with Vim, but third party clients have been created to add eclim support
to other editors as well (emacs, sublime text 2, textmate).
See Eclim website to get it.
You can find a better java syntax highlighting here.
This configuration may have some issues under Windows. I haven't tested it under Windows yet, but here are some notes about how to port it.
- vimrc — set proper paths for Vundle installation and others conf files at the end.
- ack.vim — set a proper ack program :
let g:ackprg = "…"
- syntastic.vim — set a proper path to python interpreter :
let g:syntastic_python_python_exec = '…'
- http://bepo.fr/wiki/Vim : VIM and bépo disposition! [FRENCH]
- http://vim-fr.org/ : french wiki about VIM. [FRENCH]
- https://vimebook.com/ : book to start learning how to use VIM. [FRENCH]
- http://www.vim.org/index.php : official website of course! [ENGLISH]
- http://vim.wikia.com/ : wiki about VIM. [ENGLISH]
- http://vim.wikia.com/wiki/Vim_Tips_Wiki : some tips. [ENGLISH]
- http://vimcasts.org/ : various nice screencasts about VIM. [ENGLISH]