set nocompatible "< No vi bugs if exists("g:vimrcsourced") finish endif let g:vimrcsourced = 1 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 foldmethod=manual "< Enable code folding set nofoldenable 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 wildmode=longest,list,full set wildmenu 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/==:nohlsearch "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 " GDB "set previewheight=12 "run macros/gdb_mappings.vim "set asm=0 "set gdbprg=gdb_invocation "augroup filetypedetect " " Promela " au BufNewFile,BufRead *.promela,*.prm setf promela "augroup END 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 if filereadable(".vimrc") source .vimrc endif