set nocompatible "< No vi bugs filetype on filetype indent on if &term == "rxvt" "colorscheme elisex colorscheme grencez elseif &term == "xterm" colorscheme default else colorscheme default endif set bs=2 "< Enable backspace while insert "set cursorcolumn "set cursorline set formatoptions+=cro "< Auto-insert characters "^ to begin each new line of a comment.^ set foldmethod=indent "< Enable code folding set foldnestmax=1 set foldminlines=5 set hls "< Turn off highlight after search set incsearch "< Incremental searching set lazyredraw "< No redraw when executing macros set nowrap "< No line wrap set tabstop=4 "< Tab width set shiftwidth=4 set expandtab "< Exand tabs into spaces "set cindent set ruler "< Gotta know where i am in a file "set timeoutlen=0 "< Breaks some bindings! set ttimeoutlen=0 set vb t_vb= "< Screen flash instead of beeps set virtualedit=all "< Free cursor set cinoptions=j1,/4,(0 set cinkeys+=/ "--- MAPPINGS --- "V Toggle spell checking with F5.V map :setlocal spell! spelllang=en_us "V Space bar inserts a space.V nmap i "V Enter key inserts new line below.V nmap o "V Delete the current line.V nmap D m`^d$`` nmap t :tabedit "V Half page up, Half page down V nmap gk Hzz nmap gj Lzz "V Page up, Page down V nmap gK HzbM nmap gJ LztM "V Commenting helpers V nmap ,CC I/** A **/ nmap ,Cc ^lla/$hhi/ nmap ,cC I/* A */ nmap ,cc :s/\/\* \(.*\) \*\/$/\1/== "V Syntax highlighting if monitor supports it.V if &t_Co > 1 syntax enable endif "PHP stuffs let PHP_DEFAULT_INDENTING=1 let PHP_removeCRwhenUnix=1 au BufNewFile,BufRead *.asd setf lisp "VIlisp (version 2.3) "autocmd BufRead *.lsp,*.lisp so ~/hacking/vim/VIlisp/VIlisp.vim " LyX document editing autocmd BufRead *.lyx set syntax=lyx foldmethod=syntax foldcolumn=3 autocmd BufRead *.lyx syntax sync fromstart autocmd BufRead *.s set ft=mips autocmd BufRead *.ms set ft=scheme lisp autocmd BufRead *.gplt set ft=gnuplot autocmd BufRead *.sxpr set ft=lisp lisp autocmd BufRead *.blag set ft=txt tw=78 command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand() function! s:RunShellCommand(cmdline) echo a:cmdline let expanded_cmdline = a:cmdline for part in split(a:cmdline, ' ') if part[0] =~ '\v[%#<]' let expanded_part = fnameescape(expand(part)) let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '') endif endfor botright new setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap call setline(1, 'You entered: ' . a:cmdline) call setline(2, 'Expanded Form: ' .expanded_cmdline) call setline(3,substitute(getline(2),'.','=','g')) execute '$read !'. expanded_cmdline setlocal nomodifiable 1 endfunction