From 3838164165be28cddf55ddf8cb3e49145b6796aa Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Fri, 11 Mar 2011 15:15:01 -0800 Subject: [PATCH] Lots of new vimrc shinys for MacVim --- .vimrc | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.vimrc b/.vimrc index 4c79b03..5b35be7 100644 --- a/.vimrc +++ b/.vimrc @@ -226,10 +226,25 @@ if has('title') && (has('gui_running') || &title) set titlestring= set titlestring+=%f\ " file name set titlestring+=%h%m%r%w " flags - set titlestring+=\ -\ %{v:progname} " program name + "set titlestring+=\ -\ %{v:progname} " program name set titlestring+=\ -\ %{substitute(getcwd(),\ $HOME,\ '~',\ '')} " working directory endif +" Backups and undos across edits +if v:version >= 702 + set backupdir=~/.vim/backups +endif +" NB: :help usr_32.txt or undo-branches +if v:version >= 703 + set undodir=~/.vim/backups + set undofile +endif + +" For :X encryption +if v:version >= 703 + set cryptmethod=blowfish +endif + " If possible, try to use a narrow number column. if v:version >= 700 try @@ -262,7 +277,7 @@ else endif endif map :set noet:set sw=8:set ts=8 -map :set nolist listchars +map :set list! listchars " Show lines longer than 80 characters "au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>77v', -1) @@ -316,7 +331,7 @@ if has("autocmd") augroup helphelp " For help files, move them to the top window and make " behave like (jump to tag) - autocmd FileType help :call WindowToTop() + "autocmd FileType help :call WindowToTop() autocmd FileType help nmap augroup END augroup interplangs @@ -562,6 +577,9 @@ noremap noremap noremap +" Scroll only one line with ^U an ^D +set scroll=1 + " Useful things from inside imode inoremap w :w inoremap q gq}k$ @@ -589,8 +607,9 @@ nmap n \i " Pull the following line to the cursor position noremap J :s/\%#\(.*\)\n\(.*\)/\2\1 -" In normal mode, jj escapes +" In normal mode, jj or jl escapes inoremap jj +inoremap jl " Kill line noremap "_dd @@ -983,7 +1002,7 @@ au Filetype html,xml,xsl,sgml ",docbook " explorador vertical let g:explVertical=1 " define leader como = -"let mapleader = "=" +let mapleader = "=" " Terminal companability map @@ -1027,14 +1046,16 @@ map :TC nmap :X :x nmap :W :w nmap :Q :q +nmap :B :b noremap rg :color relaxedgreen noremap ip :color inkpot +map t :FufFile noremap :syntax sync fromstart inoremap :syntax sync fromstart syntax sync minlines=200 " NERD tree. Yay! -nmap :NERDTreeToggle +nmap :NERDTreeToggle " Javac "set makeprg=javac\ %