/  4
 
set nocompatible " must be the first linefiletype onfiletype indent onfiletype plugin on"autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete"autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1"if you want rails support add the following in addition"autocmd FileType ruby,eruby let g:rubycomplete_rails = 1"if you want classes included in global completions add the following"autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1"autocmd FileType html set omnifunc=htmlcomplete#CompleteTags" saves and restores things like folds when closing a fileau BufWinLeave * silent! mkviewau BufRead * silent loadviewau BufRead * set autoindentau BufWinEnter * silent set nopasteau BufWinEnter * set autoindentau BufWinEnter * set nuau BufWinEnter * silent set sw=4au BufReadPost SCons* set syntax=pythonau BufReadPost *py set syntax=pythonau BufReadPost *rb set syntax=rubyau BufReadPost *html set syntax=html"au BufReadPost *py set complete+=k/home/mats/.vim/pycmpl/pydictionau BufReadPost *py vmap \em :call PythonExtractMethod()<cr>"au BufWritePost *py set complete=k/home/mats/.vim/pycmpl/pydiction"au BufWritePost *py set complete+=k/home/mats/.vim/allwords"column of cursorset nocuccolo delek"for vim windowsset noeaset scsset nuset dict=/home/mats/.vim/allwordsset expandtabset autoindentset history=50set rulerset showcmdset incsearchset tabstop=4set sw=4set scrolloff=6"set mouse=let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']command! -range Bash :!bash<Space>-c<Space>"`sed<Space>-ne<Space>'<line1>,<line2><Space>p'<Space>%`"command! -range Tidy :<line1>,<line2>!tidy -iq --indent-spaces 4 -xml -omit -w 120command! -range Filter :<line1>,<line2>!bash"MAPSmap <F2> :!python %<CR>map <F3> .j|1
 
map <F4> :winc p<cr>map <F7> :Filter<CR>map <F8> :NERDTree<cr>:set nonu<cr>"map kj:set<space>cul!<cr>:set<space>cuc!<cr>:set<space>cul!<cr>:set<space>cuc!<cr>map <BS> g;map \s :Swap(0)<cr>map \S :Swap(1)<cr>map <F9> I#<Esc>jmap <F10> I<del><esc>jmap \<F11> :w! /tmp/a<CR>map \<F12> :w<CR>:Bash<CR>" map <F5> :let g:file=expand('%').'/'.getline('.') <bar> wincmd p <bar> exec ':e'.g:file<cr>map <F5> :tabp<cr>map <F6> :tabn<cr>map <F11> :q<cr>map <F12> :w<cr>map <S-Tab> <C-W><C-W>map \<Tab> <C-W>Wimap <F11> <esc><F11>imap <F12> <esc><F12>amap \<Ins> :set invpaste<cr>map \f "syiw:Find<space>^Rs<cr>map \* "syiw:Grep<space>#s<cr>imap \\ ()<esc>iimap '' ''<esc>iimap "" ""<esc>iimap [] []<esc>iimap \<Ins> <Esc>:set invpaste<cr>iimap <C-s> <C-o>:w<CR>imap #TO #TODO:<space>imap <table> <table><tr><td></td></tr></table><esc>17hmap <C-s> :w<CR>map <space> 10jmap #<space> 10k"LANGUAGE-RELATEDimap ~try except:<Esc>Otry:imap ~init def __init__(self,imap ~im def (self,<Esc>hhhhhiimap ~ife if: <cr>else:<Esc>kAset path=.,**"set completefunc=rubycomplete#Complete"set omnifunc=htmlcomplete#CompleteTagsset laststatus=2set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \\%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%Phi StatusLine ctermbg=7 ctermfg=0 gui=undercurl guisp=Yellowhi ModeMsg ctermbg=1 ctermfg=3function! Grep(name)let l:pattern = input("Other pattern: ")"let l:_name = substitute(a:name, "\\s", "*", "g")let l:list=system("grep -nIR '".a:name."' * | grep -v 'svn-base' | grep '".l:pattern. "' | cat -n -")let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))if l:num < 1
 
echo "'".a:name."' not found"returnendifecho l:listlet l:input=input("Which?\n")if strlen(l:input)==0returnendifif strlen(substitute(l:input, "[0-9]", "", "g"))>0echo "Not a number"returnendifif l:input<1 || l:input>l:numecho "Out of range"returnendiflet l:line=matchstr("\n".l:list, "".l:input."\t[^\n]*")let l:lineno=matchstr(l:line,":[0-9]*:")let l:lineno=substitute(l:lineno,":","","g")"echo "".l:linelet l:line=substitute(l:line, "^[^\t]*\t", "", "")"echo "".l:linelet l:line=substitute(l:line, "\:.*", "", "")"echo "".l:line"echo "\n".l:lineexecute ":e ".l:lineexecute "normal ".l:lineno."gg"endfunctioncommand! -nargs=1 Grep :call Grep("<args>")function! Find(name)let l:_name = substitute(a:name, "\\s", "*", "g")let l:list=system("find . -iname '*".l:_name."*' -not -name \"*.class\" -and-not -name \"*.swp\" | perl -ne 'print \"$.\\t$_\"'")let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))if l:num < 1echo "'".a:name."' not found"returnendifif l:num != 1echo l:listlet l:input=input("Which ? (<enter>=nothing)\n")if strlen(l:input)==0returnendifif strlen(substitute(l:input, "[0-9]", "", "g"))>0echo "Not a number"returnendif

Share & Embed

More from this user

Add a Comment

Characters: ...