"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Start-up"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Use Vim settings, rather then Vi settings (much better!).set nocompatible" First clear any existing autocommands:autocmd!" have syntax highlighting in terminals which can display colours:if has('syntax') && (&t_Co > 2)syntax onset hlsearchendif" Filetype pluginsfiletype plugin indent onsetlocal spell spelllang=en"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" General"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set history=1000set viminfo=/10,'10,r/mnt/zip,r/mnt/floppy,f0,h,\"100set wildmode=list:longest,fullset titleset showmodeset showcmdset sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize" Status lineset laststatus=2set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]set modelines=3"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Text Formatting/Layout"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set backspace=indent,eol,startset formatoptions-=tset textwidth=0set isk+=_,$,@,%,#,- " These aren't word dividersset incsearch " do incremental searchingset ignorecase " Do case insensitive matchingset nosmartcase " No smart case matchingset smartindent " smart indentation" Tab settingsset expandtabset showtabline=2set tabstop=2 " tab stop 2 spacesset shiftwidth=2set shiftround" Commentsset comments-=s1:/*,mb:*,ex:*/set comments+=s:/*,mb:**,ex:*/set comments+=fb:*"set comments=s5:/**,mb5:*,ex:*/"set comments=sr:/*,mb:**,ex:*/"set comments+=fb:*"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Theme/Visuals"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set showmatch " Show matching brackets.set background=darkset foldmethod=indentset foldlevel=50set mouse=i " Enable mouse usage in Insert, View and Command line modes in terminalsset ruler " show the cursor position all the timeset number " show line numbers"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" File Handling"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set autowrite " Automatically save before commands like :next and :makeset nobackup " do not keep a backup file, use versions insteadset noswapfileif has("autocmd")" Enabled file type detection and file-type specific plugins." filetype plugin on indentfiletype plugin on" Drupal *.module and *.engine files.augroup moduleautocmd BufRead *.install,*.schema,*.inc,*.module,*.engine set filetype=phpaugroup END" Python code.augroup pythonautocmd BufReadPre,FileReadPre *.py set tabstop=4autocmd BufReadPre,FileReadPre *.py set expandtabaugroup END" PHP code.augroup phpautocmd BufReadPre,FileReadPre *.php set tabstop=2autocmd BufReadPre,FileReadPre *.php set expandtabaugroup END" ANT build.xml files.augroup xmlautocmd BufReadPre,FileReadPre build.xml set tabstop=2augroup ENDendif" Set Drupal files as php syntax-like filesau BufNewFile,BufRead *.module,*.install,*.schema,*.inc set filetype=php"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" PHP Specific Settings"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" PHP Error checkset makeprg=php\ -l\ %set errorformat=%m\ in\ %f\ on\ line\ %l"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Cool Abbreviations""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" HTML"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Print an empty <a> tag.map! ;h <a href=""></a><ESC>5hi" Wrap an <a> tag around the URL under the cursor.map ;H lBi<a href="<ESC>Ea"></a><ESC>3hi"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Cool Shortcuts"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Some keymaps:nnoremap <C-M> <Esc>:w<CR> "Savennoremap <C-O> <Esc>:Texplore<CR> "Show Explorer in a new tabnnoremap <C-N> <Esc>:tabnew<CR> "CTRL+N to open a new tabmap <C-Right> <Esc>:tabn<CR> "CTRL+Down to view next tabmap <C-Left> <Esc>:tabp<CR> "CTRL+Up to view previous tabno <C-E> <Esc>:mks! ~/.vimsession<CR> "CTRL+E saves the current session to ~/.vimsession" Don't use Ex mode, use Q for formattingmap Q gqmap q :q<CR>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Explorer""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Make Explorer open files in new tabslet g:netrw_browse_split=3
Thursday, February 2, 2012
My .vimrc
My .vimrc:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment