Skip to content

Instantly share code, notes, and snippets.

@bmount
Created May 5, 2014 09:05
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 bmount/dc1e2b3c4ffe4e60263c to your computer and use it in GitHub Desktop.
Save bmount/dc1e2b3c4ffe4e60263c to your computer and use it in GitHub Desktop.
Vimrc, go fmt, def, makefile, markdown
" runtime
set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
execute pathogen#infect()
" tabs in makefiles
set nocompatible
set visualbell
" global
set backspace=indent,eol,start
syntax on
" show visual etc
set showcmd
" show matching brace
set showmatch
set mat=5
set ignorecase
set smartcase
set incsearch
set hlsearch
set autowrite
set ruler
set number
set hidden
set laststatus=2
" clipboard
set ruler
" gui
set guioptions=
set background=dark
if has('gui_running')
set background=dark
colorscheme solarized
set lines=42 columns=120
endif
set gfn=Menlo:h14
set mousehide
"set mouse=a
"set textwidth=120
" search
runtime macros/matchit.vim
set wildmenu
set wildmode=list:longest
set scrolloff=3
" formatting
set expandtab
set tabstop=2
set shiftwidth=2
set smarttab
" whitespace
set listchars=tab:▸\ ,eol:¬
" folding
" set foldmethod=syntax
" set whichwrap=h,l,[,]
set nofoldenable
" file-specific
filetype plugin on
filetype indent on
" external commands
" * grep
set grepprg=grep\ -nH\ $*
" custom bindings
nmap <leader>w :set list!<CR>
nmap <leader>h :noh<CR>
map . .`[
nmap , :b
" tabs
" au BufAdd,BufNewFile,BufRead * nested tab sball
" environment
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function! s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
autocmd FileType make setlocal noexpandtab
autocmd FileType go setlocal noexpandtab
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4
let g:ycm_confirm_extra_conf = 0
nnoremap th :tabnext<CR>
nnoremap tl :tabprev<CR>
nnoremap tn :tabnew<CR>
nnoremap <S-h> gT
nnoremap <S-l> gt
au BufRead,BufNewFile *.go set filetype=go
au FileType go au BufWritePre <buffer> Fmt
au BufRead,BufNewFile *.md set filetype=markdown
let g:godef_split=2
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment