-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.vim.bak
241 lines (183 loc) · 6.69 KB
/
init.vim.bak
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin(stdpath('data') . '/plugged')
Plug 'tzwm/vim-beancount'
"let g:beancount_account_completion = "chunks"
" to see something more: ./ftplugin/beancount.vim
Plug 'scrooloose/nerdtree'
let NERDTreeShowHidden=1
map <F3> :NERDTreeToggle<CR>
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline#extensions#syntastic#enabled = 1
"Plug 'nathanaelkane/vim-indent-guides'
"let g:indent_guides_enable_on_vim_startup = 1
"let g:indent_guides_auto_colors = 1
Plug 'easymotion/vim-easymotion'
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
"nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)
" Turn on case-insensitive feature
let g:EasyMotion_smartcase = 1
Plug 'terryma/vim-expand-region' " +/-
Plug 'ctrlpvim/ctrlp.vim'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
Plug 'mileszs/ack.vim'
if executable('ag')
"let g:ackprg = 'ag --vimgrep'
let g:ackprg = 'ag --nogroup --nocolor --column --ignore-case' " use ag instead of ack, https://github.com/ggreer/the_silver_searcher
endif
Plug 'tpope/vim-endwise'
Plug 'dag/vim-fish'
"Plug 'altercation/vim-colors-solarized'
Plug 'lifepillar/vim-solarized8'
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Use deoplete.
"let g:deoplete#enable_at_startup = 1
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
let g:UltiSnipsSnippetDirectories=["UltiSnips", "my_snippets"]
" Trigger configuration. You need to change this to something other than <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<C-Tab>"
let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
Plug 'elixir-editors/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'vim-ruby/vim-ruby'
Plug 'habamax/vim-godot'
" :CocConfig
"{
""languageserver": {
""godot": {
""host": "127.0.0.1",
""filetypes": ["gdscript"],
""port": 6008
"}
"}
"}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" :CocInstall coc-elixir
" gem install solargraph
" :CocInstall coc-solargraph
" :CocInstall coc-rust-analyzer
" :CocInstall coc-tsserver
" :CocInstall coc-svelte
" :CocInstall https://github.com/joshuaharry/coc-svelte
" :CocInstall coc-prettier
"
" npm install -g emmet-ls
" https://codechips.me/vim-setup-for-svelte-development/
Plug 'leafOfTree/vim-svelte-plugin'
let g:vim_svelte_plugin_use_typescript = 1
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <TAB> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use <c-space> to trigger completion
if has('nvim')
inoremap <silent><expr> <c-c> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
"nmap <silent> gy <Plug>(coc-type-definition)
"nmap <silent> gi <Plug>(coc-implementation)
"nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
"autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" :TSInstall ruby
" :TSInstall elixir
" :TSInstall css
Plug 'rust-lang/rust.vim'
"Plug 'Exafunction/codeium.vim'
"let g:airline_section_y = '{…}%3{codeium#GetStatusString()}'
"let g:codeium_disable_bindings = 1
"imap <script><silent><nowait><expr> <C-g> codeium#Accept()
Plug 'prisma/vim-prisma'
" TypeScript
Plug 'HerringtonDarkholme/yats.vim'
Plug 'sbdchd/neoformat'
" Initialize plugin system
call plug#end()
syntax on "关键字高亮
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
filetype plugin indent on
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set number
set sm "括号匹配
set selection=inclusive
set wildmenu
set laststatus=2
set vb "turn off visual bell
set updatetime=400
" NFA engine(2) is 30 times slower than old engine tested by tzwm using 5k lines C code with syntax and ctags set regexpengine=1
set cursorline
" set cursorcolumn
set nowrap
set background=light
set termguicolors
"autocmd vimenter * ++nested colorscheme solarized8
colorscheme solarized8
"set guifont=Anonymous\ Pro\ Regular:h16
set guifont=IBM\ Plex\ Mono\ Regular:h16
"set guifont=Source\ Code\ Pro\ Regular:h18
set wildignore+=*/node_modules/*
" 删除行尾空格
autocmd BufWritePre * %s/\s\+$//e
" remove ugly red comments in JSON
autocmd FileType json syntax match Comment +\/\/.\+$+
" 插入当前日期
noremap cd i<C-R>=strftime('%F')<CR>
" auto format elixir files
noremap mf :!mix format --check-equivalent %
" autocmd BufWritePost *.exs,*.ex silent :!mix format --check-equivalent %