My .vimrc and vim plugins

by Niki on November 10, 2011

My .vimrc . Very simple yet super effective ( especially for a web developer)

set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cindent

"Setting how the statusline must look
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]

"Always show the statusline
set laststatus=2

"Make working with tabs more usefull(this calls a script defined further in this file)
set tabline=%!ShortTabLine()

"Needed for smarty syntax files
au BufRead,BufNewFile *.tpl set filetype=smarty

set incsearch

"Open include files in a new tab
:map gf :tabnew <cfile><CR>

filetype plugin on

au FileType php set omnifunc=phpcomplete#CompletePHP

let php_sql_query=1
let php_htmlInStrings=1

filetype indent on

let PHP_removeCRwhenUnix = 1

let PHP_BracesAtCodeLevel = 1

function ShortTabLine()
let ret = ''
for i in range(tabpagenr('$'))
" select the color group for highlighting active tab
if i + 1 == tabpagenr()
let ret .= '%#errorMsg#'
let ret .= '%#TabLine#'

" find the buffername for the tablabel
let buflist = tabpagebuflist(i+1)
let winnr = tabpagewinnr(i+1)
let buffername = bufname(buflist[winnr - 1])
let filename = fnamemodify(buffername,':t')
" check if there is no name
if filename == ''
let filename = 'noname'
" only show the first 6 letters of the nameĀ  and
" .. if the filename is more than 8 letters long
if strlen(filename) >=8
let ret .= '['. filename[0:8].'..]'
let ret .= '['.filename.']'

" after the last tab fill with TabLineFill and reset tab page #
let ret .= '%#TabLineFill#%T'
return ret


Here is listing of my .vim directory

html.vim javascript.vim


html.vim javascript.vim


{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: