Vim tips - xZixz/TDIL GitHub Wiki

June 26 2017

Bind Caps Lock key as Esc to work with Vim more efficiently

Create a file with the content:

! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_lock
keysym Caps_lock = Escape
add Lock = Caps_Lock

call it ".speedswapper". Then type in the terminal: $ xmodmap ~/.speedswapper

July 9 2017

Show line number

Put this in ~/.vimrc file

set number

July 11 2017

Install pathogen.vim

Execute these commands

mkdir ~/.vim/autoload && mkdir ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Add this to .vimrc

execute pathogen#infect()

Install unimpaired.vim

Need install pathogen.vim first

Executes these commands

cd ~/.vim/bundle
git clone git://github.com/tpope/vim-unimpaired.git

Add %:h expansion

Add this to .vimrc

cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'

Enable matchit.vim

Add this to .vimrc

set nocompatible
filetype plugin on
runtime macros/matchit.vim

Screen cast of Vim

Vimcast: http://vimcast.org/

Upcase: https://upcase.com/vim

Derekwyatt: http://derekwyatt.org/vim/tutorials

August 8 2017

Install ctags

Ubuntu:

$ sudo apt-get install exuberant-ctags

OSX:

$ brew install ctags

Check ctags is installed:

$ ctags --help

⚠️ **GitHub.com Fallback** ⚠️