Skip to content

Instantly share code, notes, and snippets.

@henvic
Created May 8, 2020 14:19
Show Gist options
  • Save henvic/88cb4edff412e4b21e4da219aeb0dc52 to your computer and use it in GitHub Desktop.
Save henvic/88cb4edff412e4b21e4da219aeb0dc52 to your computer and use it in GitHub Desktop.
.vimrc
set backspace=indent,eol,start
nnoremap <BS> X
if version >= 703
set undofile
set undodir=$HOME/.vim/undo
set undolevels=1000
set undoreload=10000
endif
" see https://github.com/fatih/vim-go-tutorial
set autowrite
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>
nnoremap <leader>a :cclose<CR>
" Build: \b
autocmd FileType go nmap <leader>b <Plug>(go-build)
" Run: \r
autocmd FileType go nmap <leader>r <Plug>(go-run)
" Test: \t
autocmd FileType go nmap <leader>t <Plug>(go-test)
" Coverage: \c
autocmd FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <Leader>ds <Plug>(go-def-split)
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>gb <Plug>(go-doc-browser)
au FileType go nmap <Leader>s <Plug>(go-implements)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <Leader>e <Plug>(go-rename)
" We can improve it to control how it opens the alternate file.
autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
" see https://raw2.github.com/lucasoman/Conf/master/.vimrc
" set colorcolumn=80
" highlight OverLength ctermbg=red ctermfg=white guibg=#592929
" match OverLength /\%81v.\+/
let &colorcolumn=join(range(81,999),",")
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1
let g:go_auto_sameids = 1
let g:go_fmt_command = "goimports"
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
let g:go_list_type = "quickfix"
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
set tabstop=4
set shiftwidth=8
set expandtab
set ttymouse=xterm2
let airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
set mouse=a
set scrolloff=5
set showmatch
set matchtime=1
set number
set ruler
set rulerformat=%=%h%m%r%w\ %(%c%V%),%l/%L\ %P
set hlsearch
set incsearch
set cursorline
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
set laststatus=2
set ttyfast
set omnifunc=syntaxcomplete#Complete
set nocompatible " be iMproved
filetype on " see https://github.com/gmarik/Vundle.vim/wiki#mac
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My bundles here:
"
Bundle 'majutsushi/tagbar'
Bundle 'tpope/vim-dispatch'
Bundle 'myusuf3/numbers.vim'
nnoremap <F3> :NumbersToggle<CR>
nnoremap <F4> :NumbersOnOff<CR>
" original repos on GitHub
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'fatih/vim-go'
Bundle 'AndrewRadev/splitjoin.vim'
" Plugin 'SirVer/ultisnips'
Plugin 'ctrlpvim/ctrlp.vim'
" non-GitHub repos
" Bundle 'git://git.wincent.com/command-t.git'
" Git repos on your local machine (i.e. when working on your own plugin)
" Bundle 'file:///Users/gmarik/path/to/plugin'
" ...
filetype plugin indent on " required!
setlocal shiftwidth=4
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install (update) bundles
" :BundleSearch(!) foo - search (or refresh cache first) for foo
" :BundleClean(!) - confirm (or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle commands are not allowed.
Bundle 'rizzatti/funcoo.vim'
Bundle 'rizzatti/dash.vim'
Bundle 'scrooloose/syntastic'
Bundle 'scrooloose/nerdcommenter'
Plugin 'Shougo/neocomplete'
Plugin 'Shougo/neosnippet'
Plugin 'Shougo/neosnippet-snippets'
Bundle 'sjl/badwolf'
Bundle 'bling/vim-airline'
Bundle 'nvie/vim-togglemouse'
syntax on
colorscheme badwolf
"colorscheme molokai
let g:EasyMotion_smartcase = 1
set omnifunc=syntaxcomplete#Complete
vmap <Tab> >gva
vmap <S-Tab> <gv
map <C-l> gt
map <C-h> gT
map <C-up> <esc>ddkP
map <C-down> ddp
map <C-c> "+y
map <C-x> :q<cr>
map <C-c> "+y<CR>
Bundle 'wakatime/vim-wakatime'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment