" vim: filetype=vim " ============================== " Universal (Works on any OS... probably) Configuration " ============================== " ----- Vim Initial Config set encoding=UTF-8 set hls set number set ignorecase set smartcase set mouse=a syntax on filetype indent plugin on " map :NERDTreeToggle " ----- Mapping " Norm but in shortcut vnoremap . :normal . " Map ctrl + u as U noremap U " Map U as redo (ctrl + r) noremap U " Yank and Put to/from clipboard/primary noremap "+y noremap "+p noremap "+y noremap "+P " NERDComment thing map gcc vmap gc imap gc " ----- 'vim -b' = edit binary using xxd-format! augroup Binary au! au BufReadPre *.bin let &bin=1 au BufReadPost *.bin if &bin | %!xxd au BufReadPost *.bin set ft=xxd | endif au BufWritePre *.bin if &bin | %!xxd -r au BufWritePre *.bin endif au BufWritePost *.bin if &bin | %!xxd au BufWritePost *.bin set nomod | endif augroup END " ----- Auto refresh vimrc augroup myvimrc au! au BufWritePost vimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif au BufWritePost vim_nix so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif au BufWritePost vim_plug so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif au BufWritePost vim_uni so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif au BufWritePost vim_win so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif augroup END