- Run
git clone https://github.com/BbrianWwright/Vim_Config.git
to grab vim config - Run
:PluginInstall
to install plugins - Move
_vimrc
(corresponds to.vimrc
) andvimfiles
(corresponds to.vim
) to your home directory (Slightly different for windows). Could also symlink, copy, or whatever...- Symlink ex.
# must be absolute ln -s ~/Vim_Config/_vimrc ~/.vimrc ln -s ~/Vim_Config/vimfiles ~/.vim
- For Vundle
- Just add in
_vimrc
and do:PluginInstall
when ready
- Just add in
- Iosevka is pretty neat
- http://paulherron.com/blog/vim_cheatsheet/
- http://nvie.com/posts/how-i-boosted-my-vim/
- http://blog.sanctum.geek.nz/vim-annoyances/
- http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/
- http://www.bestofvim.com/tip/trailing-whitespace/
- http://www.bestofvim.com/tip/auto-reload-your-vimrc/
- https://bluz71.github.io/2017/05/21/vim-plugins-i-like.html
So when first starting to learn vim
I
suggest not going crazy with plugins at first.
Remember in vim
you can generally
type :help <something>
in
normal mode and it'll tell you what <something>
does.
For example, :help gg
.
To start though, you'll want an updated vim
.
If you have Homebrew you can use that. I go a simpler route and install MacVim and then add an alias to my.profile
:
alias vim=/Applications/MacVim.app/Contents/MacOS/Vim
This gets me vim
7.4 which
has some nice features.
There are definitely some .vimrc
things
you want to add though. To start, these two are good resources:
- http://nvie.com/posts/how-i-boosted-my-vim/
- http://blog.sanctum.geek.nz/vim-annoyances/
- http://dougblack.io/words/a-good-vimrc.html
Really, start fairly vanilla and when you don't like something or are looking for a feature you add it or change it.
I think relative line numbers is a really awesome feature since you can jump lines by doing something like 10j
to
go down ten lines.
Note that feature is only available in vim
7.4
or higher.
For plugins I suggest using vim-pathogen because it's super easy to use. The guy who wrote it, Tim Pope, writes a ton of great vim
plugins.
Another great plugin is vim-easymotion.
For syntax checking and linting syntastic is probably the best game in town. I have mines set up to use flake8
for
Python.
Some commands I find useful are:
gg
: top of fileG
: bottom of filezz
: center screen on current lineo
: insert line below and go into insert modegqq
: hard wrap current line to max width (default 80 characters)ci(
: delete all characters in between my current paren level and go into insert modeci"
: same as above but with quotesCtrl+V
: go into block edit mode%s/regex_search/regex_replace/g
: search and replace all instances on all lines%s/\vsearch/replace
: use perl style regex instead of vim's weird regex style (see this)