Skip to content
My vim as IDE setup
VimL

README.rst

My vim setup

My vim IDE setup for python, html, css, javascript, typescript, gettext and more

Features

  • vimrc handling
  • Incremental and smart case search.
  • Sublime Text style multiple selections
  • Trailing whitespace highlightling and cleaning shortcut
  • Logical and Visual layout (for Right-To-Left lanaguegs) editing.
  • Tabs expand to 4 spaces by default
  • Remap `<Leader> to <SPACE> and jj` to ``<ESC>
  • Highlight current row and color column 80
  • 70+ language packs support
  • Syntax checking
  • Snippets
  • Quotes, parens etc pair, surround
  • Extended pair matching with %
  • ASCII drawing
  • Fuzzy file, buffer, mru, tag, etc finder
  • Task list
  • VCS plugins (Fugitive, Lawrencium)
  • Tab completion
  • Commenting

Prerequisites

Vim with Python support.

YouCompleteMe

You can override the installation of YouCompleteMe by setting the variable g:dotvim_ycm_build_command in your vimrc.before (for more info, see Overrides section and YouCompleteMe docs), e.g.:

let g:dotvim_ycm_build_command='./install.py --clang-completer --gocode-completer --tern-completer --racer-completer'
  • CMake
  • for Go support: install Go and add --gocode-completer to g:dotvim_ycm_build_command.
  • TypeScript support: install Node.js and npm then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install Node.js and npm and add --tern-completer to g:dotvim_ycm_build_command.
  • Rust support: install Rust and add --racer-completer to g:dotvim_ycm_build_command.

For more info, see https://github.com/valloric/youcompleteme.

Usage

The following commands will clone the repo, symlink ~/.vimrc and update the bundles:

git clone https://github.com/MeirKriheli/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
cd ~/.vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Install plugins from the command line:

vim +PlugUpdate +qa

To add or override settings, place them in ~/.vim/vimrc.local.

To update submodules in the future, when you have vim running, source vimrc to make sure plugins list is updated (or restart vim):

:PlugUpdate

Upgrading

In case you're updating from previous Vundle based to vim-plug, remove the bundle directory as it's not needed anymore, get vim-plug and install the plugins:

cd ~/.vim
rm -rf bundle
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugUpdate +qa

Go tags

For CtrlPBufTag search in go lang files, make sure you have an updated version of ctags (>=5.8) and put in your ~/.ctags:

--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/

Overrides

  • ~/.vim/vimrc.before, if exists, is sourced before everything allowing definitions of variables to act upon.
  • ~/.vim/vimrc.local, or ~/.vim/vimrc.after if exists, is sourced after all the files in ~/.vim/vimrc.d allowing override of default settings (e.g: color schemes, plugin configuration, etc.).

Plugins

  • Solarized - color scheme
  • base16-vim - color scheme
  • MiniBufExplorer - Elegant buffer explorer
  • vim-distpach - asynchronous build and test dispatcher
  • Fugitive - a Git wrapper so awesome, it should be illegal
  • Lawrencium - Mercurial wrapper for Vim, inspired by Tim Pope's Fugitive
  • ctrlp.vim - Fuzzy file, buffer, mru, tag, etc finder.
  • YouCompleteMe - A code-completion engine for Vim.
  • SuperTab - Insert mode completions with Tab
  • Syntastic - Syntax checking hacks for vim.
  • UltiSnips - The ultimate snippet solution for Vim.
  • vim-snippets - vim-snipmate default snippets
  • python-mode - Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box
  • DrawIt - Ascii drawing plugin: lines, ellipses, arrows, fills, and more!
  • vim-surround - quoting/parenthesizing made simple
  • Shebang - Make executable by setting the correct shebang and executable bit
  • Tagbar - Displays tags in a window, ordered by class etc
  • NERD tree - A tree explorer
  • ack.vim - Plugin for the Perl module / CLI script 'ack'
  • auto-pairs - Insert or delete brackets, parens, quotes in pair
  • po.vim - Easier editing of GNU gettext PO files
  • TaskList - Eclipse like task list
  • MatchIt - Extended % matching for HTML, LaTeX, and many other languages
  • MatchTag - Highlight matching HTML tags
  • vim-airline - Light weight statusline utility
  • tabular - text filtering and alignment
  • vim-plugin-viewdoc - Flexible viewer for any documentation
  • tcomment_vim - An extensible & universal comment vim-plugin that also handles embedded filetypesludovicchabant/vim-lawrencium
  • vim-unimpaired - pairs of handy bracket mappings
  • vim-multiple-cursors - True Sublime Text style multiple selections for Vim
  • splitjoin.vim - A vim plugin that simplifies the transition between multiline and single-line code
  • vim-repeat - enable repeating supported plugin maps with "."

Shortcuts and re-Mappings

Key Command
jj <Esc> in insert and command modes
<SPACE> <Leader>
<Leader>v Load .vimrc
<Leader>V Activate changes to .vimrc (Make sure to save it before)
<F2> Close current split (window)
<F3> Toggle NERD tree
<F4> Toggle search highlight
<F5> Toggle Tagbar
<Leader>S Remove trailing whitespace
<CTRL>hjkl Window movement commands (mapped via MiniBufExplorer settings)
<CTRL>arrow Window movement commands (mapped via MiniBufExplorer settings)
<Leader>d Delete buffer, keep the split
<CTRL-TAB> Next buffer in current window (via MiniBufExplorer settings)
<CTRL-SHIFT-TAB> Previous buffer in current window (via MiniBufExplorer settings)
-, + Resize horizontal splits
<ALT>< <ALT>> Resize vertical splits
<F9> Toggle logical (RTL, e.g: Hebrew) editing
<F8> Toggle visual (RTL, e.g: Hebrew) editing
g/ :Ack<Space>
g* :Ack -w current_word
ga :AckAdd! (add results to the current search)
gr :CtrlPBufTag (fuzzy tag search in current file)
Something went wrong with that request. Please try again.