-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.old
162 lines (143 loc) · 4.66 KB
/
.vimrc.old
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
set nocompatible
set hlsearch
set nu
set enc=utf-8 fenc=utf-8
set autoindent smartindent
set ts=4 sw=4 sts=4
set background=dark
let g:python3_host_prog = '$HOME/.pyenv/shims/python'
"disable ESC
"VIM Visual Block
hi Visual ctermbg=255 guibg=#B2FFE0
filetype off
""" Plug start
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'pearofducks/ansible-vim'
Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'tpope/vim-commentary'
Plug 'fatih/vim-go'
Plug 'hashivim/vim-terraform'
Plug 'yaegassy/coc-ansible', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-json', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-highlight', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'}
Plug 'josa42/coc-docker', {'do': 'yarn install --frozen-lockfile'}
Plug 'josa42/coc-go', {'do': 'yarn install --frozen-lockfile'}
Plug 'josa42/coc-sh', {'do': 'yarn install --frozen-lockfile'}
Plug 'fannheyward/coc-markdownlint', {'do': 'yarn install --frozen-lockfile'}
Plug 'yaegassy/coc-nginx', {'do': 'yarn install --frozen-lockfile'}
Plug 'fannheyward/coc-pyright', {'do': 'yarn install --frozen-lockfile'}
Plug 'iamcco/coc-spell-checker', {'do': 'yarn install --frozen-lockfile'}
"Plug 'Valloric/YouCompleteMe'
call plug#end()
let g:coc_filetype_map = {
\ 'yaml.ansible': 'ansible',
\ }
au BufRead,BufNewFile */soda-provisioning/*.yml set filetype=yaml.ansible
filetype plugin indent on " Put your non-Plugin stuff after this line
let g:NERDTreeShowBookmarks=1
let g:NERDTreeShowHidden=1
let g:NERDTreeWinSize=30
let g:NERDTreeWinSize = 35
let g:go_term_mode = "split"
let g:go_fmt_autosave = 0
let b:ycm_largefile = 1
let g:ycm_disable_for_files_larger_than_kb = 500
let g:ycm_goto_buffer_command = "vertical-split"
"set completeopt-=preview
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype erb setlocal ts=2 sts=2 sw=2
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype crystal setlocal ts=2 sts=2 sw=2
"autocmd Filetype vue setlocal ts=2 sts=2 sw=2
autocmd FileType vue set tabstop=2|set shiftwidth=2|set expandtab
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2
autocmd Filetype json setlocal foldmethod=syntax
"autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" show existing tab with 4 spaces width
set tabstop=2
" when indenting with '>', use 4 spaces width
set shiftwidth=2
" On pressing tab, insert 4 spaces
set expandtab
let mapleader=","
let maplocalleader=","
"noremap <F3> :Autoformat<CR>
map <silent> <F3> :Autoformat<CR>
map <silent> <F10> :TagbarToggle<CR>
" NERDTree
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
"nnoremap <C-f> :NERDTreeFind<CR>
" Make `jj` and `jk` throw you into normal mode
inoremap jj <esc>
inoremap jk <esc>
" Press * to search for the term under the cursor or a visual selection and
" then press a key below to replace all instances of it in the current file.
nnoremap <Leader>r :%s///g<Left><Left>
nnoremap <Leader>rc :%s///gc<Left><Left><Left>
" The same as above but instead of acting on the whole file it will be
" restricted to the previously visually selected range. You can do that by
" pressing *, visually selecting the range you want it to apply to and then
" press a key below to replace all instances of it in the current selection.
xnoremap <Leader>r :s///g<Left><Left>
xnoremap <Leader>rc :s///gc<Left><Left><Left>
" Tab shortcut
nnoremap th :tabnext<CR>
nnoremap tl :tabprev<CR>
nnoremap tn :tabnew<CR>
" NERDTree
nnoremap <C-W>, :vertical resize +5<CR>
nnoremap <C-W>. :vertical resize -5<CR>
"Bundle 'Tagbar'
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
let g:tagbar_type_crystal = {
\'ctagstype': 'crystal',
\'ctagsbin': 'crystalctags',
\'kinds': [
\'c:classes',
\'m:modules',
\'d:defs',
\'x:macros',
\'l:libs',
\'s:sruct or unions',
\'f:fun'
\],
\'sro': '.',
\'kind2scope': {
\'c': 'namespace',
\'m': 'namespace',
\'l': 'namespace',
\'s': 'namespace'
\},
\}