Vim Bindings

Vim is Fun

How to customize your .vimrc

It's like building a house

Mine

Code Example

What you need to know

Mapping

Basic mappings

  • map (recursive)
  • noremap

 

Specific to Modes

  • inoremap
  • nnoremap

Important Mappings

inoremap jj <ESC>

 

nnoremap   <up>   <nop>
nnoremap  <down>  <nop>
nnoremap  <left>  <nop>
nnoremap  <right> <nop>

 

<leader>

let mapleader="\<Space>"

 

Useful Examples

noremap <leader>s :w<CR>
nnoremap <leader>w :wq<CR>
nnoremap <leader>fq :q!<CR>
nnoremap <leader>q :xa<CR>

 

Set

Setting Defaults

set number

set tabstop=2

set wrap!

set noswapfile               

set statusline=%<\ %f\ %m%y%=%-35.(Line:\ %l\ of\ %L,\ Col:\ %c%V\ (%P)%)

 

Other Commands

syntax on

call vundle#begin()

autocmd VimEnter * NERDTree

 

Functions

function! ToggleDark()
  if &background == "dark"
    set background=light
  else
    set background=dark
  endif
endfunction

 

 

Package Manager

 

  • vim plug
  • Vundle
  • NeoVundle
  • Pathogen

Vundle Example

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()            

 

 

 

Plugin 'fatih/vim-go'
Plugin 'terryma/vim-multiple-cursors'
 

Set Up

Requiring

Let me help you build your house

Thank you

Vim

By Roberto Ortega