""== set the following two lines in vimrc == "set runtimepath^=path/to/vimfiles/folder "source path/to/vimrc/file function! EscapeString (string) let string=a:string let string = escape(string, '^$.*\/~[]') let string = substitute(string, '\n', '\\n', 'g') return string endfunction function! GetVisual() range " rang argument??? let reg_save = getreg('"') let regtype_save = getregtype('"') let cb_save = &clipboard set clipboard& normal! ""gvy let selection = getreg('"') call setreg('"', reg_save, regtype_save) let &clipboard = cb_save let escaped_selection = EscapeString(selection) return escaped_selection endfunction ""==== global ==== ""return to last edit position when opening files autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif ""disable .swp file set noswapfile set nobackup set nowritebackup color desert "color murphy set guioptions=e set guifont=menlo:h16 ""indent "set cindent set autoindent "set smartindent ""high light search set hlsearch ""set line number set nu ""tab set tabstop=2 set softtabstop=2 set shiftwidth=2 set expandtab ""==== netrw ==== let g:netrw_list_hide= '.*\.swp$,.*\.class' ""tree style listing let g:netrw_liststyle= 3 let g:netrw_winsize= 75 ""==== pathogen ==== execute pathogen#infect() execute pathogen#helptags() ""===== NERDTree ===== let NERDTreeIgnore= ['\.swp$', '\.pyc$'] nmap n :NERDTreeToggle nmap f :NERDTreeFind ""===== tabbar ===== nmap t :TagbarTogglel ""===== vim-scala ===== let g:scala_scaladoc_indent = 1 ""==== shortcuts ==== ""next tab nmap :tabn ""previous tab nmap :tabp ""edit: go left imap ""edit: go right imap ""edit: delete imap ""edit: backspace imap ""edit: delete till begin of line imap d0xi ""edit: delete till end of line imap d$a ""select all nmap a GVgg ""save nmap :w ""copy vmap y "*y ""cursor: right nmap l l ""cursor: left nmap h h ""cursor: down nmap j j ""cursor: up nmap k k ""jump between last two frames nmap ""wrap text nmap o :set wrap! ""replace selected in current file vmap r :%s/=GetVisual()//gc ""replace selected in multi-files nmap q :args **/*.* vmap w :argdo %s/=GetVisual()//gc \| update ""vimgrep nmap g :vimgrep //g **/*.* vmap g :vimgrep /=GetVisual()/g **/*.* nmap go :copen nmap gc :cclose nmap gn :cn nmap gp :cp ""hex mode nmap b :%!xxd nmap v :%!xxd -r ""json format nmap i :%!python -m json.tool