Skip to content

Instantly share code, notes, and snippets.

@sebk
Created November 25, 2011 10:05
Show Gist options
  • Save sebk/1393188 to your computer and use it in GitHub Desktop.
Save sebk/1393188 to your computer and use it in GitHub Desktop.
vimrc
filetype on "autodetect filetype
syntax on
filetype plugin indent on
set title
set nocompatible
set tabstop=2
set backspace=2
set ai
set si
set expandtab
set shiftwidth=2
set smarttab "insert blanks instead of tabs at fron of the line
set number "show line numbers
set showmatch "klammern anzeigen
colorscheme pablo
:set completeopt=longest,menuone
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
\ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
filetype on " Automatically detect file types.
map <F2> :NERDTreeToggle<CR>
function! GuiTabLabel()
" add the tab number
let label = '['.tabpagenr()
" modified since the last save?
let buflist = tabpagebuflist(v:lnum)
for bufnr in buflist
if getbufvar(bufnr, '&modified')
let label .= '*'
break
endif
endfor
" count number of open windows in the tab
let wincount = tabpagewinnr(v:lnum, '$')
if wincount > 1
let label .= ', '.wincount
endif
let label .= '] '
" add the file name without path information
let n = bufname(buflist[tabpagewinnr(v:lnum) - 1])
let label .= fnamemodify(n, ':t')
return label
endfunction
set guitablabel=%{GuiTabLabel()}
" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc
set ruler "Always show current position
set ignorecase "Ignore case when searching
set smartcase
set hlsearch "Highlight search things
" No sound on errors
set noerrorbells
set novisualbell
set autoindent "remember indentation of prev line
set incsearch
call pathogen#infect()
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment