Skip to content

Instantly share code, notes, and snippets.

@Tishka17
Last active June 28, 2016 14:46
Show Gist options
  • Save Tishka17/e838de52701826a00bf733b04cf40e13 to your computer and use it in GitHub Desktop.
Save Tishka17/e838de52701826a00bf733b04cf40e13 to your computer and use it in GitHub Desktop.
set mouse=a
set tabstop=4 shiftwidth=4 expandtab
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
set list listchars=tab:··
set number "show line numbers
highlight LineNr ctermfg=darkgrey guibg=darkgrey
"jump to last cursor position when opening a file
"dont do it when writing a commit log entry
autocmd BufReadPost * call SetCursorPosition()
function! SetCursorPosition()
if &filetype !~ 'svn\|commit\c'
if line("'\"") > 0 && line("'\"") <= line("$")
exe "normal! g`\""
normal! zz
endif
end
endfunction
if exists("+showtabline")
function MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let s .= i . ')'
let s .= ' '
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
endif
hi TabLineSel ctermfg=Yellow ctermbg=Black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment