This is my entire vimrc (vim settings) file. I have tried many plugins over the years and I feel the current setup is quite ideal. I've also added some custom vim functions and shortcuts. I would invite you to read through the file to learn about all its features.
- You have to use the official python distrubutor in shell (avoid from anaconda)
- You may need update your vim.
cd ~/git
git clone --recursive [email protected]:mjlaali/vimrc.git
./install.sh
or to install YouCompleteMe with CLang support:
./install.sh --YCM-clang --YCM-install-libs
Now launch vim
and enjoy! you're all set.
Plugins
: all plugins organized by VundlePlugin options
: customize your plugins hereGeneral settings
: vim settings, such as tabs, syntax color, etcKey remap
: useful shortcuts, such as F7 to launch NERDTreeFunctions
: my own Vim functions
Here are a few plugins you absolutely need to know about, check .vimrc
for the rest. Remember to checkout the plugins' respective github page for usage info on the plugins. In case you're not aware, if the plugin name is godlygeek/tabular
, then the webpage is https://github.com/godlygeek/tabular
.
Vim startify
: simply typevim
in your CLI, look at the beautiful menuVim-easymotion
: most used plugin ever. Type leaderw, now every word in the buffer has a quick shortcut combination. You can do the same with lines and more.NERDtree
: tree explorer for Vim. Shortcut: F7Vim session
: a session manager for Vim. Saved sessions will also appear inVim startify
.Tabular
: align things easily in Vim. Shortcut: tt
I'll highlight a few functions and feature which I wrote and find handy.
Note, your leader key is probably the backspace key.
This function is a huge timesaver. After splitting your views vertically with CTRL-wv, you'll notice the windows are numbered. To switch to window [2]
, simply type leader2.
Pressing leadert will generate a to-do list in a quickfix window. Jump to the next item in the list with CTRL-j and the previous with CTRL-k.
In normal mode, type :Clip
and the entire buffer is copied to the clipboard. This requires xclip
on Linux.
Some key remaps I can't live without.
- j-k: switch to normal mode. No more searching for ESC!!!
- F7: Toggle NERDTree
- tt: Shortcut for
:Tabularize /
, the second most used plugin ever. - F8: Opens a tag bar on the right. Assumes you ran
ctags
. - F12: Toggles "pastemode" on and off. Required when pasting code from clipboard.
If the solarized theme is not displaying properly, you need to set it up for Terminal as well. Simply do the following.
wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
mv dircolors.ansi-dark .dircolors
eval `dircolors ~/.dircolors`
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./set_dark.sh
rm -Rf gnome-terminal-colors-solarized