set nocompatible " be iMproved, required filetype indent plugin on " required set modeline set modelines=1 set nowrap set viminfo='100,<100,s20 " vim file history set hidden set shiftwidth=2 set tabstop=2 set number set relativenumber set mouse= set listchars=tab:→\ ,nbsp:␣,trail:␣,extends:⟩,precedes:⟨ set list set autoindent set smartindent set undolevels=1000 set undoreload=10000 set updatetime=300 let mapleader = " " nmap :w imap :w vmap gv noremap y "+y noremap p "+p noremap i noremap j noremap k noremap h i vnoremap K L vnoremap I H vnoremap H I nnoremap K L nnoremap I H nnoremap H I map wi :wincmd k map wj :wincmd h map wk :wincmd j map wl :wincmd l map wq :wincmd q map wI :wincmd K map wJ :wincmd H map wK :wincmd J map wL :wincmd L " replay macro for each line of a visual selection xnoremap @q :normal @q xnoremap @@ :normal @@ " reselect and re-yank any text that is pasted in visual mode xnoremap p pgvy " Escape overwrite inoremap jj " Open new buffer nmap bn :enew nmap l :bnext nmap bn :bnext nmap j :bprevious nmap bp :bprevious nmap q :bp bd # nmap bq :bp bd # " Clear quickfix shortcut nmap c :ccl " Remember cursor position " Vim jumps to the last position when reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif