docs:vim:vimrc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:vim:vimrc [2010/01/05 14:09] – added changelog.txt textwidth billhdocs:vim:vimrc [2011/12/16 10:24] (current) – [my .vimrc] fixed bug where browse listing was lost and a file was sometimes showing in place on that tab billh
Line 13: Line 13:
  :set columns=120  :set columns=120
  :set lines=50  :set lines=50
 +
 + " highlight the entire line the cursor is on
 + ":set cul
 +    :map <F9> :set cul!<CR>
 + "autocmd ColorScheme * hi CursorLine guibg=#E9EFF8
 else else
  " allow ctrl-z to suspend during terminal usage since it may be mapped to  " allow ctrl-z to suspend during terminal usage since it may be mapped to
Line 73: Line 78:
 " color theme " color theme
 if has("gui_running") if has("gui_running")
- colo delek+ "colo delek 
 + "colo mustang 
 + "colo two2tango 
 + colo darkZ 
 + "colo biogoo 
 + set gfn=Courier_New:h12:cANSI 
 + 
 + " gui font (Mac) 
 + if has("mac"
 + set gfn=Monaco:h13 
 + elseif has("win32"
 + "set gfn=Courier_New:h12:cANSI 
 + set gfn=Courier_New:h11:cANSI 
 + elseif has("unix"
 + set gfn=Courier\ New\ 12 
 + endif 
 else else
- colo evening+ "colo evening 
 + "colo morning 
 + "colo zellner 
 + colo delek
 endif endif
  
Line 147: Line 171:
  
 " // commenting/uncommenting on visual block selections " // commenting/uncommenting on visual block selections
-map g/ :s/^\([ \t]*\)/\1\/\/ /g<CR>:let @/=''<CR> +map g/ :s/^\([ \t]*\)/\1\/\/ /g<CR>:let @/=histget("search", -2)<CR> 
-map g? :s/^\([ \t]*\)\/\/ \{0,1}\([ \t]*\)/\1\2/g<CR>:let @/=''<CR>+map g? :s/^\([ \t]*\)\/\/ \{0,1}\([ \t]*\)/\1\2/g<CR>:let @/=histget("search", -3)<CR>
  
 " use , and . to shift indent and keep selection " use , and . to shift indent and keep selection
Line 248: Line 272:
  amenu WMH.highlight\ rows :autocmd ColorScheme * hi CursorLine guibg=#E9EFF8<CR> :set cul<CR>  amenu WMH.highlight\ rows :autocmd ColorScheme * hi CursorLine guibg=#E9EFF8<CR> :set cul<CR>
  amenu WMH.nohighlight\ rows :set nocul<CR>  amenu WMH.nohighlight\ rows :set nocul<CR>
 + amenu WMH.remove\ closed\ folds :call RemoveFolds()<CR>
  amenu WMH.-Sep- :  amenu WMH.-Sep- :
  amenu WMH.Filetype.reload\ as\ unix\ file :set ffs=unix<CR>:e ++ff=unix<CR>  amenu WMH.Filetype.reload\ as\ unix\ file :set ffs=unix<CR>:e ++ff=unix<CR>
Line 255: Line 280:
  amenu WMH.Filetype.utf-8\ encoding :set encoding=utf-8<CR>:e!<CR>  amenu WMH.Filetype.utf-8\ encoding :set encoding=utf-8<CR>:e!<CR>
  amenu WMH.Filetype.latin1\ encoding :set encoding=latin1<CR>:e!<CR>  amenu WMH.Filetype.latin1\ encoding :set encoding=latin1<CR>:e!<CR>
- amenu WMH.Bookmarks.AddNewPhysicians :Explore C:\prog\ClaimsSystem\BRnC\trunk\AddNewPhysicians\<CR> 
- amenu WMH.Bookmarks.SysMenu :Explore C:\prog\ClaimsSystem\menu\trunk\New Menu\<CR> 
- amenu WMH.Bookmarks.WebClaims :Explore C:\prog\ClaimsSystem\webdata\trunk\WebClaims\<CR> 
  amenu WMH.Bookmarks.projects :Explore C:\htdocs\projects\<CR>  amenu WMH.Bookmarks.projects :Explore C:\htdocs\projects\<CR>
  amenu WMH.Doctypes.HTML\ 4\.01\ Strict i<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"<CR>   "http://www.w3.org/TR/html4/strict.dtd"><CR><ESC>  amenu WMH.Doctypes.HTML\ 4\.01\ Strict i<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"<CR>   "http://www.w3.org/TR/html4/strict.dtd"><CR><ESC>
Line 279: Line 301:
 " default of sorting specific file types before others " default of sorting specific file types before others
 let g:netrw_sort_sequence = '[\/]$' let g:netrw_sort_sequence = '[\/]$'
 +
 +" case-insensitive sorting in netrw
 +let g:netrw_sort_options="i"
  
 " always change current (local) directory to directory of current buffer " always change current (local) directory to directory of current buffer
 " http://vim.wikia.com/wiki/Change_to_the_directory_of_the_current_file " http://vim.wikia.com/wiki/Change_to_the_directory_of_the_current_file
-if exists('+autochdir'+autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
-  set autochdir +
-else +
-  autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ / +
-endif+
  
 " make diff colors more like winmerge " make diff colors more like winmerge
Line 310: Line 331:
 " allow control space to act as omni-completion trigger, like IntelliSense " allow control space to act as omni-completion trigger, like IntelliSense
 inoremap <C-space> <C-x><C-o> inoremap <C-space> <C-x><C-o>
 +
 +if has("win32")
 +
 + " open an explorer window at the current directory
 + map <silent> <leader>E :silent !"explorer.exe ."<CR>
 +
 + " http://vim.wikia.com/wiki/Call_TortoiseSVN_commands_from_within_Vim
 + " http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html
 +
 + " Save current buffer and diff the file using Tortoise SVN
 + map <silent> <Leader>td :w<CR>:silent !"C:/Progra~1/TortoiseSVN/bin/TortoiseProc.exe /command:diff /path:"%" /notempfile /closeonend"<CR>
 +
 + " Save the current buffer and execute the Tortoise SVN interface's log
 + map <silent> <Leader>tl :w<CR>:silent !"C:/Progra~1/TortoiseSVN/bin/TortoiseProc.exe /command:log /path:"%" /notempfile /closeonend"<CR>
 +
 + " show the Tortoise SVN check for modifications screen for the current directory
 + map <silent> <Leader>ts :silent !"C:/Progra~1/TortoiseSVN/bin/TortoiseProc.exe /command:repostatus /path:. /closeonend"<CR>
 +
 + " show the Tortoise SVN commit screen for the current directory
 + map <silent> <Leader>tc :silent !"C:/Progra~1/TortoiseSVN/bin/TortoiseProc.exe /command:commit /path:. /closeonend"<CR>
 +endif
 +
 +" don't allow NERDTree to take over our :E (explore) functionality
 +let NERDTreeHijackNetrw = 0
 +
 +" don't allow large php files to stop vim from folding, etc...
 +" see http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg143762.html
 +let php_large_file = 0
 +
 +let g:statusline_mode = 0
 +function! ToggleStatusLine()
 + " a more informative status line
 + " http://www.linux.com/archive/feature/120126
 +
 + let g:statusline_mode += 1
 +
 + if( g:statusline_mode == 0 )
 + " default status line
 + :set statusline=
 + elseif( g:statusline_mode == 1 )
 + " file name, mod flags, and lots of file/cursor info
 + :set statusline=%t%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
 + elseif( g:statusline_mode == 2 )
 + " full path to filename
 + :set statusline=%F%m%r%h%w
 + elseif( g:statusline_mode == 3 && exists("*GitBranch") )
 + " relative path to filename with git info
 + :set statusline=%f%m%r%h%w\ [GITBRANCH=%{GitBranch()}]
 + else
 + " restore default (wrap around)
 + :set statusline=
 + let g:statusline_mode = 0
 + endif
 +endfunction
 +nnoremap <F10> :call ToggleStatusLine()<CR>
 +:call ToggleStatusLine()
 +
 +" use ctrl-v to paste clipboard in insert mode
 +if has("win32")
 + inoremap <C-v> <C-r>*
 +endif
 +
 +" use ctrl-f2 to toggle toolbar/menubar
 +" http://www.linux.com/archive/feature/120126
 +map <silent> <C-F2> :if &guioptions =~# 'T' <Bar> set guioptions-=T <Bar> set guioptions-=m <bar> else <Bar> set guioptions+=T <Bar> set guioptions+=m <Bar> endif<CR>
 +
 +" git-vim settings
 +let g:git_bin = 'c:\cygwin\bin\git'
 +
 +" VCSCommand settings
 +let VCSCommandGitExec = 'c:\cygwin\bin\git'
 +"let VCSCommandSVNExec = 'C:\Program Files\svn-win32-1.6.6\bin\svn.exe'
 +let VCSCommandSVNExec = 'c:\cygwin\bin\svn'
 +
 +function! RemoveFolds()
 + folddoc :d
 +endfunction
 +
 +" we need to override the default php indenting for heredoc to always put the
 +" first line at the far left margin
 +function! MyGetPhpIndent()
 + if v:lnum > 1 && getline(v:lnum - 1) =~ '\s*<<<\s*'
 + return 0
 + else
 + return GetPhpIndent()
 + endif
 +endfunction
 +autocmd BufReadPost *.php setlocal indentexpr=MyGetPhpIndent()
 +
 </code> </code>
  • docs/vim/vimrc.1262725774.txt.gz
  • Last modified: 2010/01/05 14:09
  • (external edit)