" basic .vimrc
" use with Project
set nocompatible
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
"set sw=4
"set paste - breaks abbreviations ?
" commented text is too dark
"set background=dark
set autoindent
set expandtab
set tabstop=8
set shiftwidth=4
set softtabstop=4
set nowrap
set nohls
"syntax on
syntax enable "turn on syntax highlighting
set ruler
set number
" instead when hitting the 'TAB' key. And here's more options to fine-
" tune vim's autocompletion behaviour:
"
" "list" When more than one match, list all matches.
" "list:full" When more than one match, list all matches and
" complete first match.
" "list:longest" When more than one match, list all matches and
" complete till longest common stri
set wildmode=list
" unicode stuff http://vim.wikia.com/wiki/Working_with_Unicode
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
setglobal fileencoding=utf-8 bomb
set fileencodings=ucs-bom,utf-8,latin1
endif
" vim hangs running vmware: http://taint.org/2008/03/12/122601a.html
set swapsync=
set nofsync
"To have vim mark a wrapped line with a few special characters at the beginning of
the wrapped part
set showbreak=+++
"http://wwwcdf.pd.infn.it/vim/spell.html#]s
"Finding suggestions for bad words: z=
setlocal spell spelllang=en_us
" tabs in vim7 by default wow!
" navigate tabs
" :b#/:bn/:bp
set t_Co=256 "enable 256 colors
colorscheme desert
"ls -l /home/y/share/vim/vim71/colors/
" http://ruturajv.wordpress.com/2006/12/21/vim-7-autocomplete/
" Once done, Open any PHP file and within the
" press Ctrl-x Ctrl-o , and here is what happens
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
" not one for perl
"autocmd FileType perl set omnifunc=perlcomplete#CompletePERL
"javascriptcomplete.vim
"ccomplete.vim
"phpcomplete.vim
"xmlcomplete.vim
"csscomplete.vim
"htmlcomplete.vim
"sqlcomplete.vim
"rubycomplete.vim
"syntaxcomplete.vim
"pythoncomplete.vim
"adacomplete.vim
"javascriptcomplete.vim
"ccomplete.vim
"phpcomplete.vim
"xmlcomplete.vim
"csscomplete.vim
"htmlcomplete.vim
"sqlcomplete.vim
"rubycomplete.vim
"syntaxcomplete.vim
"pythoncomplete.vim
"adacomplete.vim
"To do this, jump inside the if-statement type zfi{
"http://www.vim.org/tips/tip.php?tip_id=419
"Tip #419: Auto-fold perl subs (and possibly other languages)
" :help perl.vim
"If you want to use folding with perl, set perl_fold: >
"Once you open a perl file, you'll see all functions are folded.
" You can then move to a function and (space) or "zo" to open it, "zc" to close it,
" "zR" to open all folds (normal file) and "zM" to re-fold all folds. It makes skimming over a file a breeze.
"See ":help folding" for more info on folding in general. "can also set in vim vim: set fdl=0 fdm=marker:
let perl_fold=1
"If you want to fold blocks in if statements, etc. as well set the following: >
let perl_fold_blocks = 1
"To avoid folding packages or subs when perl_fold is let, let the appropriate variable(s): >
":unlet perl_nofold_packages
":unlet perl_nofold_subs
":help php.vim
"If you like SQL syntax highlighting inside Strings: >
let php_sql_query = 1
"For highlighting the Baselib methods: >
let php_baselib = 1
"Enable HTML syntax highlighting inside strings: >
"let php_htmlInStrings = 1
"Enable folding for classes and functions: >
let php_folding = 1
" Preserve indentation with '# - perl
"filetype indent on
"autocmd FileType perl
"set cindent
" TAB as a visible character
highlight Tabs ctermbg=1
match Tabs "\t"
set list
set listchars=tab:>-
"set encoding=utf-8
"take care of the correct indentation automatically, no more ':set paste'
" reindent pasted text
nnoremap p p'[v']=
" use with tagslist
filetype on
"let Tlist_Auto_Open=1
let Tlist_Use_Right_Window=1
let Tlist_Enable_Fold_Column=0
let Tlist_Inc_Winwidth=0
let Tlist_Compact_Format=1
"http://www.vim.org/tips/tip.php?tip_id=696
" dont let mouse switch into selection mode
set mouse-=a
"make .t files perl syntax
"autocmd BufNewFile,BufRead *.t setf perl
au BufReadPost *.t set syntax=perl
au BufReadPost *.cgi set syntax=perl
" see page 482 'Editor configurations' from Perl Best Prac.
" I assume you own a copy of PBP, (if not buy it!) in which case you can use this illegal
" copy http://perl.find-info.ru/perl/028/perlbp-app-c-sect-1.html
"set autoindent "Preserve current indent on new lines
set textwidth=78 "Wrap at this column
set backspace=indent,eol,start "Make backspaces delete sensibly
"set tabstop=4 "Indentation levels every four columns
"set expandtab "Convert all tabs typed to spaces
"set shiftwidth=4 "Indent/outdent by four columns
""set shiftround "Indent/outdent to nearest tabstop
set matchpairs+=<:> "Allow % to bounce between angles too
set matchpairs+==:; "jump between a '=' of an assignment and the corresponding end of the statement, indicated by ';'
" Note: \012 newlines, [CTRL-V][ENTER] in insert mode
" NOTE!!! the following dont' work when set nocompatible is on ?
"Inserting these abbreviations inserts the corresponding Perl statement...
iab ppsb #! /usr/local/bin/perl -w
iab ppbp ^Muse strict;^Muse warnings;^M^Muse criticism 'brutal'; #uncomment on dev only ; enforces PBP coding^M^Muse vars qw{$VERSION};^M^M$VERSION = '0.0.1';^M^M
iab pudd use Data::Dumper 'Dumper';^Mwarn Dumper [];^[hi
iab pubm use Benchmark qw( cmpthese );^Mcmpthese -10, {};^[O
iab pusc use Smart::Comments;^M^M###
iab putm use Test::More qw( no_plan );
" ^[ is produced by hitting Ctrl-V then Esc
" ^M is produced by hitting Ctrl-V then Enter
iab papp ^[:r ~/perl/templates/script.pl^M
iab pmod ^[:r ~/perl/templates/module.pm^M
"" custom color schemas - in terminal
"" color terminal definitions
"set t_Co=256 "enable 256 colors
set t_Co=280 "enable 280 colors
"set t_Co=262-273
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkblue
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
hi Search cterm=NONE ctermfg=grey ctermbg=blue
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=3
hi Question ctermfg=green
hi StatusLine cterm=bold,reverse
hi StatusLineNC cterm=reverse
hi VertSplit cterm=reverse
hi Title ctermfg=5
hi Visual cterm=reverse
hi VisualNOS cterm=bold,underline
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=darkgrey ctermbg=NONE
hi FoldColumn ctermfg=darkgrey ctermbg=NONE
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=darkcyan
hi Constant ctermfg=brown
hi Special ctermfg=5
"hi Identifier ctermfg=2
"hi Identifier ctermfg=6
"hi Identifier ctermfg=darkgrey
"hi Identifier ctermfg=lightred
"hi Identifier ctermfg=lightblue ctermbg=white cterm=reverse,underline
"hi Identifier ctermfg=yellow
hi Identifier ctermfg=7
hi Statement ctermfg=3
hi PreProc ctermfg=5
hi Type ctermfg=2
hi Underlined cterm=underline ctermfg=5
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1