/
.vimrc
163 lines (136 loc) · 4.44 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTree' }
Plug 'scrooloose/nerdcommenter'
Plug 'fatih/vim-go'
Plug 'fatih/molokai'
Plug 'ctrlpvim/ctrlp.vim'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'zchee/deoplete-go', { 'do': 'make'}
"Plug 'nsf/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }
Plug 'mdempsky/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }
"Plug 'SirVer/ultisnips'
Plug 'Valloric/YouCompleteMe'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'wikitopian/hardmode'
" Plug 'vim-airline/vim-airline'
call plug#end()
let g:go_version_warning=0
" neocomplete like
set completeopt+=noinsert
" deoplete.nvim recommend
set completeopt+=noselect
" Path to python interpreter for neovim
let g:python3_host_prog = '/usr/bin/python3'
" Skip the check of neovim module
let g:python3_host_skip_check = 1
" Run deoplete.nvim automatically
let g:deoplete#enable_at_startup = 1
" deoplete-go settings
let g:deoplete#sources#go#gocode_binary = $GOPATH.'/bin/gocode'
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const']
" General VIM
" set clipboard=unnamed
set clipboard=unnamedplus
set number
syntax enable
set ts=2
set autoindent
set expandtab
set shiftwidth=2
set showmatch
let python_highlight_all = 1
set nocursorcolumn
set ttimeoutlen=100
set ttyfast
set lazyredraw
set nocursorline
set norelativenumber
syntax sync minlines=256
set synmaxcol=128
set re=1
" SirVer/ultisnips
" Trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
" let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>"
" let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" let g:UltiSnipsUsePythonVersion = 3
" If you want :UltiSnipsEdit to split your window.
" let g:UltiSnipsEditSplit="vertical"
" let g:UltiSnipsSnippetsDir="~/.vim/UltiSnips/snips"
" NERDTree
let NERDTreeShowHidden = 1
" fatih/vim-go
set autowrite
" mappings
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>
nnoremap <leader>a :cclose<CR>
autocmd FileType go nmap <leader>b <Plug>(go-build)
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>t <Plug>(go-test)
autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
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')
" prefs
let g:go_fmt_command = "goimports"
let g:go_fmt_autosave = 1
"let g:go_metalinter_autosave = 1
"let g:go_metalinter_autosave_enabled = ['gofmt', 'vet', 'golint', 'errcheck']
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck', 'gosec', 'deadcode', 'gotype']
let g:go_metalinter_deadline = "90s"
let g:go_addtags_transform = "camelcase"
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_build_constraints = 1
" let g:go_auto_type_info = 1
let g:go_auto_sameids = 1
let g:go_list_type = "quickfix"
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
" color scheme
let g:rehash256 = 1
let g:molokai_original = 1
colorscheme molokai
set term=screen-256color
hi QuickFixLine term=reverse ctermbg=52
" statusline
" set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" " Use 256 colours (Use this setting only if your terminal supports 256
" colours)
set t_Co=256
" autocomplete
filetype plugin on
setlocal omnifunc=go#complete#Complete
" WSL yank support
" let s:clip = '/mnt/c/Windows/System32/clip.exe' " default location
" if executable(s:clip)
" augroup WSLYank
" autocmd!
" autocmd TextYankPost * call system('echo
" '.shellescape(join(v:event.regcontents, "\<CR>")).' |
" '.s:clip)
" augroup END
" end
func! GetSelectedText()
normal gv"xy
let result = getreg("x")
return result
endfunc
noremap <C-C> :call system('clip.exe', GetSelectedText())<CR>
noremap <C-X> :call system('clip.exe', GetSelectedText())<CR>gvx