/ mozey.co / blog

vim

December 22, 2016

🔗 PHP

TODO

🔗 How To Learn Vim: A Four Week Plan

🔗 spf13-vim

Install vim with lua

brew install vim --with-lua

brew install macvim --with-cscope --with-lua
brew linkapps macvim

🔗 Vim 8

Reference

🔗 Install from source

🔗 Config

.vimrc

🔗 Plugins

NerdTree

Display your file system as a tree, enabling you to easily explore and open various files and directories.

NerdCommenter

Easily toggle the comment status of various amounts of code based on your key mappings.

Snipmate

Glide through often-typed code, or snippets, that you can quickly insert into your file. Update variables as you type.

Ctrl-P

Find full paths to files, buffers, and tags. Open multiple files at once and create new files or directories.

Syntastic

Check your syntax and be notified about errors before compiling your code or executing your script.

🔗 Spell checking

Enable spell checking

set spell

set spelllang=en,af

Show suggestions

z=

🔗 Diff

Compare two files

vimdiff file1 file2

Use vimdiff with git

git config --global diff.tool vimdiff

Put changes under the cursor into the other file

dp

Change under the cursor is replaced by the content of the other file

do

Jump to the next / previous diff

]c
[c

🔗 iTerm2 cmd-click

cmd-click in iTerm2 to open file in vi

Preferences -> Profiles -> Advanced

Semantic History > Run coprocess..

echo vim \1 +\2