Skip to content

Instantly share code, notes, and snippets.

@dobrokot
Created January 11, 2013 13:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dobrokot/4510589 to your computer and use it in GitHub Desktop.
.vimrc
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
set showmatch
set hlsearch
nnoremap <esc> :noh<return><esc>
set backspace=indent,eol,start
"no beeps, just flash screen.
set vb t_vb=
" each window contains a statusline that displays the current cursor position.
set ruler
set incsearch
"should restore cursor pos after exit/lauhch, but lead to a lot of ui bugs if file changed/edited, and comlains about ~/.vim/view
"au BufWinLeave * mkview
"au BufWinEnter * silent loadview
syntax enable
set encoding=utf-8
set autochdir
autocmd FileType make setlocal noexpandtab
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with
" save via Ctrl+S
map <C-s> :w<CR>
imap <C-s> <Esc>:w<CR>
set listchars=eol:`,tab:>-,trail:~,extends:>,precedes:<
autocmd BufRead *.* call AutoDetectTabsSpaces()
fun AutoDetectTabsSpaces()
let output=(system("python $(~/bin/host-os-path ~/bin/tab_space_select.py) --vim-settings " . @% . " | tr -d '\\r' > ~/.tab_space_autodetect_tmp.vim"))
source ~/.tab_space_autodetect_tmp.vim
endfun
autocmd FileType c,cpp,h autocmd BufWritePre <buffer> :%s/\s\+$//e
:set number
:highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
map ,t :NERDTreeToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment