Skip to content

Instantly share code, notes, and snippets.

@aisuii
Created January 18, 2011 09:53
Show Gist options
  • Save aisuii/784229 to your computer and use it in GitHub Desktop.
Save aisuii/784229 to your computer and use it in GitHub Desktop.
.vimrc.minimal
set nocompatible
set hidden
set nobackup
set history=100
filetype plugin indent on
scriptencoding utf-8
autocmd!
set tabstop=4 softtabstop=4 shiftwidth=4
autocmd FileType ruby setlocal tabstop=2 softtabstop=2 shiftwidth=2
set expandtab
set ai si cin
set background=dark
colo slate
syn enable
set nu ru
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']('.(&ft!=''?(&ft):'text').')'}%=%l,%c%V%8P
set laststatus=2
set showcmd
set wildmenu
set grepprg=ack-grep
set showmatch
set hls ws nois ic scs
"__END__
noh
" tabline
function! MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
let buflen = tabpagewinnr(a:n, '$')
let bufname = fnamemodify(bufname(buflist[winnr - 1]), ':t')
let label = a:n . ": "
let label .= bufname == '' ? 'No name' : bufname
let label .= '[' . buflen . ']'
return label
endfunction
function! MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
if i + 1 == tabpagenr()
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif
let s .= '%' . (i + 1) . 'T'
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
endfor
let s .= '%#TabLineFill#%T'
if tabpagenr('$') > 1
let s .= '%=%#TabLine#%999Xx'
endif
return s
endfunction
set tabline=%!MyTabLine()
set showtabline=2
highlight TabLine term=reverse cterm=reverse ctermfg=white ctermbg=black
highlight TabLineSel term=underline cterm=underline ctermfg=red ctermbg=black
highlight TabLineFill term=reverse cterm=reverse ctermfg=white ctermbg=black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment