Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docs:vim:vimrc [2009/12/30 09:47] – added unmap ctrl-z for terminal usage billh | docs: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!< | ||
+ | " | ||
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(" | if has(" | ||
- | colo delek | + | "colo delek |
+ | "colo mustang | ||
+ | "colo two2tango | ||
+ | colo darkZ | ||
+ | "colo biogoo | ||
+ | set gfn=Courier_New: | ||
+ | |||
+ | " gui font (Mac) | ||
+ | if has(" | ||
+ | set gfn=Monaco: | ||
+ | elseif has(" | ||
+ | "set gfn=Courier_New: | ||
+ | set gfn=Courier_New: | ||
+ | elseif has(" | ||
+ | set gfn=Courier\ New\ 12 | ||
+ | endif | ||
else | else | ||
- | colo evening | + | "colo evening |
+ | "colo morning | ||
+ | "colo zellner | ||
+ | colo delek | ||
endif | endif | ||
Line 112: | Line 136: | ||
" make .js.php files be recognized as javascript | " make .js.php files be recognized as javascript | ||
au BufReadPost *.js.php setl filetype=javascript | au BufReadPost *.js.php setl filetype=javascript | ||
+ | |||
+ | " make changelog.txt files have a set textwidth | ||
+ | au BufReadPost changelog.txt setl textwidth=80 | ||
" don't use changelog filetype | " don't use changelog filetype | ||
Line 144: | Line 171: | ||
" // commenting/ | " // commenting/ | ||
- | map g/ :s/^\([ \t]*\)/ | + | map g/ :s/^\([ \t]*\)/ |
- | map g? :s/^\([ \t]*\)\/\/ \{0,1}\([ \t]*\)/ | + | map g? :s/^\([ \t]*\)\/\/ \{0,1}\([ \t]*\)/ |
" use , and . to shift indent and keep selection | " use , and . to shift indent and keep selection | ||
Line 163: | Line 190: | ||
" set the hide pattern for browsing (use ' | " set the hide pattern for browsing (use ' | ||
- | let g: | + | let g: |
" clear previous search highlighting | " clear previous search highlighting | ||
Line 245: | Line 272: | ||
amenu WMH.highlight\ rows :autocmd ColorScheme * hi CursorLine guibg=# | amenu WMH.highlight\ rows :autocmd ColorScheme * hi CursorLine guibg=# | ||
amenu WMH.nohighlight\ rows :set nocul< | amenu WMH.nohighlight\ rows :set nocul< | ||
+ | amenu WMH.remove\ closed\ folds :call RemoveFolds()< | ||
amenu WMH.-Sep- : | amenu WMH.-Sep- : | ||
amenu WMH.Filetype.reload\ as\ unix\ file :set ffs=unix< | amenu WMH.Filetype.reload\ as\ unix\ file :set ffs=unix< | ||
Line 252: | Line 280: | ||
amenu WMH.Filetype.utf-8\ encoding :set encoding=utf-8< | amenu WMH.Filetype.utf-8\ encoding :set encoding=utf-8< | ||
amenu WMH.Filetype.latin1\ encoding :set encoding=latin1< | amenu WMH.Filetype.latin1\ encoding :set encoding=latin1< | ||
- | amenu WMH.Bookmarks.AddNewPhysicians :Explore C: | ||
- | amenu WMH.Bookmarks.SysMenu :Explore C: | ||
- | amenu WMH.Bookmarks.WebClaims :Explore C: | ||
amenu WMH.Bookmarks.projects :Explore C: | amenu WMH.Bookmarks.projects :Explore C: | ||
amenu WMH.Doctypes.HTML\ 4\.01\ Strict i< | amenu WMH.Doctypes.HTML\ 4\.01\ Strict i< | ||
Line 276: | Line 301: | ||
" default of sorting specific file types before others | " default of sorting specific file types before others | ||
let g: | let g: | ||
+ | |||
+ | " case-insensitive sorting in netrw | ||
+ | let g: | ||
" always change current (local) directory to directory of current buffer | " always change current (local) directory to directory of current buffer | ||
" http:// | " http:// | ||
- | if exists(' | + | autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ / |
- | set autochdir | + | |
- | else | + | |
- | | + | |
- | endif | + | |
" make diff colors more like winmerge | " make diff colors more like winmerge | ||
Line 307: | 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 < | inoremap < | ||
+ | |||
+ | if has(" | ||
+ | |||
+ | " open an explorer window at the current directory | ||
+ | map < | ||
+ | |||
+ | " http:// | ||
+ | " http:// | ||
+ | |||
+ | " Save current buffer and diff the file using Tortoise SVN | ||
+ | map < | ||
+ | |||
+ | " Save the current buffer and execute the Tortoise SVN interface' | ||
+ | map < | ||
+ | |||
+ | " show the Tortoise SVN check for modifications screen for the current directory | ||
+ | map < | ||
+ | |||
+ | " show the Tortoise SVN commit screen for the current directory | ||
+ | map < | ||
+ | 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:// | ||
+ | let php_large_file = 0 | ||
+ | |||
+ | let g: | ||
+ | function! ToggleStatusLine() | ||
+ | " a more informative status line | ||
+ | " http:// | ||
+ | |||
+ | let g: | ||
+ | |||
+ | if( g: | ||
+ | " default status line | ||
+ | :set statusline= | ||
+ | elseif( g: | ||
+ | " file name, mod flags, and lots of file/cursor info | ||
+ | :set statusline=%t%m%r%h%w\ [FORMAT=%{& | ||
+ | elseif( g: | ||
+ | " full path to filename | ||
+ | :set statusline=%F%m%r%h%w | ||
+ | elseif( g: | ||
+ | " 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: | ||
+ | endif | ||
+ | endfunction | ||
+ | nnoremap <F10> :call ToggleStatusLine()< | ||
+ | :call ToggleStatusLine() | ||
+ | |||
+ | " use ctrl-v to paste clipboard in insert mode | ||
+ | if has(" | ||
+ | inoremap <C-v> < | ||
+ | endif | ||
+ | |||
+ | " use ctrl-f2 to toggle toolbar/ | ||
+ | " http:// | ||
+ | map < | ||
+ | |||
+ | " git-vim settings | ||
+ | let g:git_bin = ' | ||
+ | |||
+ | " VCSCommand settings | ||
+ | let VCSCommandGitExec = ' | ||
+ | "let VCSCommandSVNExec = ' | ||
+ | let VCSCommandSVNExec = ' | ||
+ | |||
+ | 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: | ||
+ | return 0 | ||
+ | else | ||
+ | return GetPhpIndent() | ||
+ | endif | ||
+ | endfunction | ||
+ | autocmd BufReadPost *.php setlocal indentexpr=MyGetPhpIndent() | ||
+ | |||
</ | </ |