X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=vim%2Fvimrc;h=344e5732fd4f8439d72312eb4fd2e345b86cc886;hb=7be7c4895081c29d848853149f95d19f12df4cb7;hp=5bdef27f2bc3bf9dbc93d4c3c9e3b0d45b148e6d;hpb=eefc930bbf39f7bd5c2571802086719298568529;p=smckown%2Fdotfiles.git diff --git a/vim/vimrc b/vim/vimrc index 5bdef27..344e573 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -76,11 +76,12 @@ if has("autocmd") autocmd filetype sh,ld setlocal sts=4 sw=4 tw=80 fo-=t fo+=j autocmd filetype python setlocal sts=4 sw=4 tw=79 fo-=t fo+=j autocmd filetype html,xml setlocal listchars-=tab:>. tw=80 fo-=t fo+=j - autocmd filetype text,markdown,mkd,md setlocal tw=80 fo-=t fo+=j + autocmd filetype markdown,mkd,md setlocal tw=80 fo-=t fo+=j autocmd filetype c,cpp,java setlocal tw=80 fo-=t fo+=j autocmd filetype nesc setlocal syntax=c.doxygen tw=80 fo-=t fo+=j + autocmd filetype text setlocal tw=80 fo+=jt - autocmd BufReadPre *.txt,README*,TODO*,INSTALL* setlocal tw=80 fo-=t fo+=j + autocmd BufReadPre README*,TODO*,INSTALL* setlocal tw=80 fo+=t " Whitelist for auto-stripping trailing whitespace on buffer write autocmd BufWritePre *.c,*.h,*.nesc,*.py,*.java,*.sh,make :call StripTrailingWhitespace() @@ -175,12 +176,6 @@ set tags=tags;/ " %% on an ex command line expands to the dir path of the current buffer cnoremap %% getcmdtype() == ':' ? expand('%:h').'/' : '%%' -" Create some edit maps for opening new files -map ew :e %% -map es :sp %% -map ev :vsp %% -map et :tabe %% - " Make and g] work like g, which uses :tjump nnoremap g] g nnoremap g @@ -269,10 +264,10 @@ nmap w (easymotion-bd-w) nmap b (easymotion-bd-w) nmap W (easymotion-bd-W) nmap B (easymotion-bd-W) -nmap e (easymotion-bd-e) -nmap E (easymotion-bd-E) -nmap ge (easymotion-bd-e) -nmap gE (easymotion-bd-E) +"nmap e (easymotion-bd-e) +"nmap E (easymotion-bd-E) +"nmap ge (easymotion-bd-e) +"nmap gE (easymotion-bd-E) nmap j (easymotion-bd-jk) nmap k (easymotion-bd-jk) nmap n (easymotion-bd-n) @@ -348,10 +343,14 @@ let g:delimitMate_matchpairs = "{:},[:],(:)" let g:delimitMate_autoclose = 1 let g:delimitMate_expand_cr = 1 let g:delimitMate_expand_space = 1 -nnoremap coa :DelimitMateSwitch +" cop means to toggle auto pairing +nnoremap cop :DelimitMateSwitch " Rainbow Parenthesis -- off by default but set toggle -nnoremap cop :RainbowParenthesesToggle +nnoremap co( :RainbowParenthesesToggle + +" mkbuild tools +nnoremap e :call mkbuild#DmenuOpen('e') " Turn on doxygen syntax highlighting for C, C++, C# and IDL files. let g:load_doxygen_syntax=1 @@ -385,8 +384,24 @@ function! ToggleFormatOptionT() endif endfunction +" Implement 'coa' -- Toggle formatoption 'a' -- auto-wrap paragraphs +nnoremap coa :call ToggleFormatOptionA() +function! ToggleFormatOptionA() + let tmp = substitute(&formatoptions, 'a', '', '') + if &formatoptions == tmp + set fo+=a + :echo "Enable auto-wrap paragraphs" + else + set fo-=a + :echo "Disable auto-wrap paragraphs" + endif +endfunction + " Insert date and time in insert mode. Have to use the native , not " its re-mapped version -imap d =strftime("%Y%m%d") -imap D =strftime("%Y-%m-%d") -imap t =strftime("%H:%M:%S") +"nmap dd "=strftime('%Y%m%d')p +"imap dd =strftime('%Y%m%d') +"nmap dD "=strftime('%Y-%m-%d')p +"imap dD =strftime('%Y-%m-%d') +"nmap dt "=strftime('%H:%M:%S')p +"imap dt =strftime('%H:%M:%S')