Skip to content

Instantly share code, notes, and snippets.

@ckolderup
Created June 29, 2010 15:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ckolderup/457346 to your computer and use it in GitHub Desktop.
Save ckolderup/457346 to your computer and use it in GitHub Desktop.
set lines=35
set columns=90
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
set bg=dark
colorscheme molokai
set guifont=Envy_Code_R:h15.00
set transp=7
syntax enable
" set up tab labels with tab number, buffer name, number of windows
function! GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
" Append the tab number
let label .= tabpagenr().': '
" Append the buffer name
let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
if name == ''
" give a name to no-name documents
if &buftype=='quickfix'
let name = '[Quickfix List]'
else
let name = '[No Name]'
endif
else
" get only the file name
let name = fnamemodify(name,":t")
endif
let label .= name
" Append the number of windows in the tab page
let wincount = tabpagewinnr(v:lnum, '$')
return label . ' [' . wincount . ']'
endfunction
" set up tab tooltips with every buffer name
function! GuiTabToolTip()
let tip = ''
let bufnrlist = tabpagebuflist(v:lnum)
for bufnr in bufnrlist
" separate buffer entries
if tip!=''
let tip .= ' | '
endif
" Add name of buffer
let name=bufname(bufnr)
if name == ''
" give a name to no name documents
if getbufvar(bufnr,'&buftype')=='quickfix'
let name = '[Quickfix List]'
else
let name = '[No Name]'
endif
endif
let tip.=name
" add modified/modifiable flags
if getbufvar(bufnr, "&modified")
let tip .= ' [+]'
endif
if getbufvar(bufnr, "&modifiable")==0
let tip .= ' [-]'
endif
endfor
return tip
endfunction
set guitablabel=%{GuiTabLabel()}
set guitabtooltip=%{GuiTabToolTip()}
set backspace=indent,eol,start
set tabstop=2
set hidden
set smartindent
set expandtab
set shiftwidth=2
filetype indent on
set incsearch
set hlsearch
set wildmenu
set wildmode=list:longest
set smartcase
set notitle
nmap <silent> <leader>s :set nolist!<CR>
nmap <silent> <leader>n :silent :nohlsearch<CR>
set listchars=tab:>-,trail:·,eol:$
set showbreak=.
set statusline=%F%m%r%h%w\ [TYPE=%Y\ %{&ff}]\ [%l/%L\ (%p%%)]
set numberwidth=5
set number
vmap <D-j> gj
vmap <D-k> gk
vmap <D-4> g$
vmap <D-6> g^
vmap <D-0> g^
nmap <D-j> gj
nmap <D-k> gk
nmap <D-4> g$
nmap <D-6> g^
nmap <D-0> g^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment