Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """"""""""""""""
- " Vundle plugins
- """"""""""""""""
- set nocompatible
- filetype off
- set rtp+=~/.vim/bundle/Vundle.vim
- call vundle#begin()
- Plugin 'VundleVim/Vundle.vim' "Let's Vundle manage Vundle
- Plugin 'wakatime/vim-wakatime' "Wakatime for time tracking
- call vundle#end()
- filetype plugin indent on
- """""""""""""""""
- " Basic Settings
- """""""""""""""""
- set nocompatible
- filetype off
- filetype plugin indent on
- set autowrite
- set autoindent
- set cindent
- set number
- set encoding=utf-8
- set autoread
- set incsearch
- set hlsearch
- set showcmd
- set nobackup
- set pumheight=10
- " This enables us to undo files even if you exit Vim.
- if has('persistent_undo')
- set undofile
- set undodir=~/.config/vim/tmp/undo//
- endif
- """""""""""""""
- " Pathogen
- """""""""""""""
- execute pathogen#infect()
- syntax on
- filetype plugin indent on
- call plug#begin()
- Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
- call plug#end()
- """""""""""
- " Color Scheme
- """""""""""
- syntax enable
- set background=light
- let g:solarized_termcolors=256
- colorscheme solarized
- """"""""""""""""""""""
- " Mappings
- """"""""""""""""""""""
- map <C-n> :cnext<CR> " for vim-go error highlight
- map <C-m> :cprevious<CR> " for vim-go error highlight
- map <C-w> :tabp<CR>
- map <C-e> :tabn<CR>
- map <C-t> :NERDTreeToggle<CR>
- nnoremap <leader>a :cclose<CR>
- if has("gui_running")
- inoremap <C-Space> <C-n>
- else " no gui
- if has("unix")
- inoremap <Nul> <C-n>
- endif
- endif
- """"""""""""""""""""
- " Settings for vim-go
- """"""""""""""""""""
- let g:go_fmt_command = "goimports"
- let g:go_autodetect_gopath = 1
- let g:go_list_type = "quickfix"
- let g:go_highlight_types = 1
- let g:go_highlight_fields = 1
- let g:go_highlight_functions = 1
- let g:go_highlight_function_calls = 1
- let g:go_highlight_extra_types = 1
- let g:go_highlight_generate_tags = 1
- augroup go
- autocmd!
- " Show by default 4 spaces for a tab
- autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
- " :GoBuild and :GoTestCompile
- autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
- " :GoTest
- autocmd FileType go nmap <leader>t <Plug>(go-test)
- " :GoRun
- autocmd FileType go nmap <leader>r <Plug>(go-run)
- " :GoDoc
- autocmd FileType go nmap <Leader>d <Plug>(go-doc)
- " :GoCoverageToggle
- autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
- " :GoInfo
- autocmd FileType go nmap <Leader>i <Plug>(go-info)
- " :GoMetaLinter
- autocmd FileType go nmap <Leader>l <Plug>(go-metalinter)
- " :GoDef but opens in a vertical split
- autocmd FileType go nmap <Leader>v <Plug>(go-def-vertical)
- " :GoDef but opens in a horizontal split
- autocmd FileType go nmap <Leader>s <Plug>(go-def-split)
- " :GoAlternate commands :A, :AV, :AS and :AT
- 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')
- augroup END
- " build_go_files is a custom function that builds or compiles the test file.
- " It calls :GoBuild if its a Go file, or :GoTestCompile if it's a test file
- function! s:build_go_files()
- let l:file = expand('%')
- if l:file =~# '^\f\+_test\.go$'
- call go#test#Test(0, 1)
- elseif l:file =~# '^\f\+\.go$'
- call go#cmd#Build(0)
- endif
- endfunction
- """""""""""""""
- " vim-latex "
- """""""""""""""
- filetype plugin on
- set shellslash
- filetype indent on
- let g:text_flavor='latex'
- map <C-Space> <C-n>
- """""""""""""""
Add Comment
Please, Sign In to add comment