Guest User

Untitled

a guest
Jun 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. """"""""""""""""
  2. " Vundle plugins
  3. """"""""""""""""
  4.  
  5. set nocompatible
  6. filetype off
  7. set rtp+=~/.vim/bundle/Vundle.vim
  8. call vundle#begin()
  9. Plugin 'VundleVim/Vundle.vim' "Let's Vundle manage Vundle
  10. Plugin 'wakatime/vim-wakatime' "Wakatime for time tracking
  11. call vundle#end()
  12. filetype plugin indent on
  13.  
  14. """""""""""""""""
  15. " Basic Settings
  16. """""""""""""""""
  17. set nocompatible
  18. filetype off
  19. filetype plugin indent on
  20. set autowrite
  21. set autoindent
  22. set cindent
  23. set number
  24. set encoding=utf-8
  25. set autoread
  26. set incsearch
  27. set hlsearch
  28. set showcmd
  29. set nobackup
  30. set pumheight=10
  31. " This enables us to undo files even if you exit Vim.
  32. if has('persistent_undo')
  33. set undofile
  34. set undodir=~/.config/vim/tmp/undo//
  35. endif
  36.  
  37. """""""""""""""
  38. " Pathogen
  39. """""""""""""""
  40.  
  41. execute pathogen#infect()
  42. syntax on
  43. filetype plugin indent on
  44. call plug#begin()
  45. Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
  46. call plug#end()
  47.  
  48. """""""""""
  49. " Color Scheme
  50. """""""""""
  51.  
  52. syntax enable
  53. set background=light
  54. let g:solarized_termcolors=256
  55. colorscheme solarized
  56.  
  57. """"""""""""""""""""""
  58. " Mappings
  59. """"""""""""""""""""""
  60.  
  61. map <C-n> :cnext<CR> " for vim-go error highlight
  62. map <C-m> :cprevious<CR> " for vim-go error highlight
  63. map <C-w> :tabp<CR>
  64. map <C-e> :tabn<CR>
  65. map <C-t> :NERDTreeToggle<CR>
  66.  
  67. nnoremap <leader>a :cclose<CR>
  68.  
  69. if has("gui_running")
  70. inoremap <C-Space> <C-n>
  71. else " no gui
  72. if has("unix")
  73. inoremap <Nul> <C-n>
  74. endif
  75. endif
  76.  
  77.  
  78.  
  79. """"""""""""""""""""
  80. " Settings for vim-go
  81. """"""""""""""""""""
  82. let g:go_fmt_command = "goimports"
  83. let g:go_autodetect_gopath = 1
  84. let g:go_list_type = "quickfix"
  85. let g:go_highlight_types = 1
  86. let g:go_highlight_fields = 1
  87. let g:go_highlight_functions = 1
  88. let g:go_highlight_function_calls = 1
  89. let g:go_highlight_extra_types = 1
  90. let g:go_highlight_generate_tags = 1
  91.  
  92. augroup go
  93. autocmd!
  94.  
  95. " Show by default 4 spaces for a tab
  96. autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
  97.  
  98. " :GoBuild and :GoTestCompile
  99. autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
  100.  
  101. " :GoTest
  102. autocmd FileType go nmap <leader>t <Plug>(go-test)
  103.  
  104. " :GoRun
  105. autocmd FileType go nmap <leader>r <Plug>(go-run)
  106.  
  107. " :GoDoc
  108. autocmd FileType go nmap <Leader>d <Plug>(go-doc)
  109.  
  110. " :GoCoverageToggle
  111. autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
  112.  
  113. " :GoInfo
  114. autocmd FileType go nmap <Leader>i <Plug>(go-info)
  115.  
  116. " :GoMetaLinter
  117. autocmd FileType go nmap <Leader>l <Plug>(go-metalinter)
  118.  
  119. " :GoDef but opens in a vertical split
  120. autocmd FileType go nmap <Leader>v <Plug>(go-def-vertical)
  121. " :GoDef but opens in a horizontal split
  122. autocmd FileType go nmap <Leader>s <Plug>(go-def-split)
  123.  
  124. " :GoAlternate commands :A, :AV, :AS and :AT
  125. autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
  126. autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
  127. autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
  128. autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
  129. augroup END
  130. " build_go_files is a custom function that builds or compiles the test file.
  131. " It calls :GoBuild if its a Go file, or :GoTestCompile if it's a test file
  132. function! s:build_go_files()
  133. let l:file = expand('%')
  134. if l:file =~# '^\f\+_test\.go$'
  135. call go#test#Test(0, 1)
  136. elseif l:file =~# '^\f\+\.go$'
  137. call go#cmd#Build(0)
  138. endif
  139. endfunction
  140.  
  141. """""""""""""""
  142. " vim-latex "
  143. """""""""""""""
  144. filetype plugin on
  145. set shellslash
  146. filetype indent on
  147. let g:text_flavor='latex'
  148. map <C-Space> <C-n>
  149. """""""""""""""
Add Comment
Please, Sign In to add comment