Skip to content

Instantly share code, notes, and snippets.

@mkocikowski
Last active April 18, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkocikowski/3e8ce171dcab12ad173f to your computer and use it in GitHub Desktop.
Save mkocikowski/3e8ce171dcab12ad173f to your computer and use it in GitHub Desktop.
.vimrc
syntax on
filetype indent plugin on
map <C-\> {gq}
execute pathogen#infect()
" yaml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" always display status line
set laststatus=2
" auto change dir to current file
set autochdir
" display file name, line, column
set statusline+=%F\ %l\:%c
" where to look for ctags
" start in the current directory, work your way all the way up to $HOME
set tags=./tags;$HOME
" Wrapping and tabs.
set tabstop=4 softtabstop=4 shiftwidth=4 sta expandtab autoindent
" Strip trailing whitespace on save
autocmd FileType python,javascript,json,markdown,sql autocmd BufWritePre <buffer> :%s/\s\+$//e
" ignore case in search
"set ic
" turn on line numbers
"set number
" set marked column at 73
set colorcolumn=73
" set additional escape key in insert mode
imap jj <Esc>`^
imap ;; <Esc>`^
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
nnoremap <C-n> :bnext<CR>
nnoremap <C-p> :bprevious<CR>
" https://github.com/fatih/vim-go
let g:go_fmt_command = "goimports"
" https://github.com/scrooloose/nerdtree
nmap <F9> :NERDTreeToggle<CR>
" https://github.com/majutsushi/tagbar
nmap <F8> :TagbarToggle<CR>
let g:tagbar_width = 70
" https://github.com/jstemmer/gotags
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
" https://dev.launchpad.net/UltimateVimPythonSetup
" Wrapping and tabs.
set tw=78 ts=4 sw=4 sta et sts=4 ai
" More syntax highlighting.
let python_highlight_all = 1
" Auto completion via ctrl-space (instead of the nasty ctrl-x ctrl-o)
set omnifunc=pythoncomplete#Complete
inoremap <Nul> <C-x><C-o>
" Wrap at 72 chars for comments.
set formatoptions=cq textwidth=72 foldignore= wildignore+=*.py[co]
" Highlight end of line whitespace.
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment