I am a vim lover and I use vim for a very long time. This repo is my vimrc file which contains some useful plugins and convinient keymapping for me.
If you encounter some problems, please refer to the Q&A sections. And if the Q&A section can not solve your problems, send a issue to me, I'll deal with it ASAP.
- Installation
- First Time
- Update
- Feature
- Help
- Project Layout
- File Search
- Misc Search
- Buffer/Window Navigation
- Q&A
The following is the installation guide of how to setup the settings
cd ~
git clone https://github.com/mike820324/vimrc.git .vim
ln -s ~/.vim/vimrc ~/.vimrc
OR
- download a compress file from Release Page
- decompress the downloaded file
- rename to .vim
- put to your home folder
- soft link ~/.vimrc
wget https://github.com/mike820324/vimrc/archive/v1.0.tar.gz
tar xvf v1.0.tar.gz
mv vimrc-1.0 ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
I'm using neobundle as my plugin manager, if someone is using other plugin manager such as vundle, just modify the vim/neobundles.vim and vim/plugins folders.
From version 1.3, I have added the autoupdate feature to the configuration files.
Just type <leader>,
and choose the update sections, you will see the avaliable version of this vimrc.
If you prefer manually update, and you are familiar with git command, the following instructions should help.
cd ~/.vim
git fetch
# to latest version
git checkout origin/master
# to specific version
git checkout vX.Y
Since this vimrc contains so many keymapping for different plugins. I have mapped two keys to quick navigate through the commands of this vimrc.
By typing <leader>h
, the unite mappings will show you the current keymapping of this editor.
And by typing <leader>,
, a unite menu will pop up to you with the avaliable commands.
key: ,h (Unite Keymappings view)
key: ,, (Fast Command Menu)
A Project layout related commands use the following plugins:
- VimFiler : Project Directory Layout
- TagBar : Source Code Layout
- UndoTree : vim undo tree layout
- Syntastic : Syntastic Checker
key: ,pco (TagBar toggle)
key: ,pdt (VimFiler toggle)
key: ,put (UndoTree toggle)
key: ,pce (Syntastic check)
All the file related search is using the Unite.vim plugin. The following is the keymappings.
I strongly prefer compiling vim with lua and luajit enable.
key: ,ff (file search)
key: ,fm (most recent use file search)
key: ,fg (file grep search)
Except the file search, I also mapped some useful functionalities in Unite.vim.
- mark search : search through the vim marks currently added.
- buffer search : search through all the buffers.
- window search : search through windows.
- tag search : search the tag, very similar to tagbar but much more faster when you know the function name.
key: ,ms (marks search)
key: ,bs (buffer search)
key: ,ws (window search)
key: ,tcs (function search)
Instead of using tabs, the airline.vim have present a great features called tabline, which will show the buffers that you are using on the very top of your vim window. But the problem is that there is no keymapping for moving around the Buffer, so here is my keymappings.
Buffer Navigations
key: ,bt (create a new buffer)
key: ,bq (quit buffer)
key: ,bj (next buffer)
key: ,bk (prev buffer)
Window Navigations
key: ,wn (create new window)
key: ,wq (quit the current window)
key: ,wj (move to bottom window)
key: ,wk (move to upper window)
key: ,wh (move to left window)
key: ,wl (move to right window)
key: ,ws (search the window)
- Error Message when using TarBar
Please download Exuberant Ctags from ctags.sourceforge.net and install it in a directory in your $PATH o
r set g:tagbar_ctags_bin.
Since tagbar is using ctags to generate the tag files; therefore, if you want to use TagBar plugin, you should install ctags first.
- There are some special character when using airline layout
Since I'm using airline powerline theme, and there are some special character in powerline theme. As a result, if you want to use the powerline theme, download the font from https://github.com/powerline/fonts and set up the font in your terminal. After that, the airline should work as what it expeted to be.
- When update to v1.2, my unite file history is gone, what happened??
The reason is that, in version 1.2, I have change the .cache directory. And as a result, the new vimrc will not load the old cache folder. The way to fix it is pretty simple, the following instructions should fix the issue.
cp -R ~/.cache ~/.vim/