]> git.sthu.org Git - vimconf.git/blob - plugins-noroot-nolowendbox.vim
84828779fe72a4a4e4e9c5db739909c4bff129be
[vimconf.git] / plugins-noroot-nolowendbox.vim
1 if has('nvim')
2 Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
3 Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' }
4 else
5 Plug 'Shougo/deoplete.nvim'
6 Plug 'Shougo/denite.nvim'
7
8 Plug 'roxma/nvim-yarp'
9 Plug 'roxma/vim-hug-neovim-rpc'
10 endif
11
12 " java extension to deoplete
13 Plug 'artur-shaik/vim-javacomplete2', {'for': 'java'}
14
15 Plug 'neomake/neomake'
16 Plug 'puremourning/vimspector'
17
18 " Prevent slow foling update, e.g., for vimtex
19 Plug 'Konfekt/FastFold'
20 Plug 'lervag/vimtex', {'for': 'tex'}
21
22 Plug 'mhinz/vim-signify'
23 Plug 'tpope/vim-fugitive'
24 Plug 'gko/vim-coloresque'
25
26 Plug 'vimwiki/vimwiki'
27 Plug 'jceb/vim-orgmode', {'for': ['org']}
28
29 Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'}
30 Plug 'hail2u/vim-css3-syntax', {'for': ['scss', 'css']}
31
32 Plug 'https://gitlab.com/dbeniamine/vim-mail'
33 Plug 'Konfekt/vim-DetectSpellLang', {'do': 'spell'}
34
35 " Disable devicons on linux terminal
36 if $TERM == 'linux'
37 let g:enable_plugin_devicons=0
38 " Enable loading of devicons on all others
39 else
40 let g:enable_plugin_devicons=1
41 endif
42
43 Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons)
44 Plug 'joom/latex-unicoder.vim', {'on': '<Plug>Unicoder'}
45
46 Plug 'sjl/splice.vim', {'on': 'SpliceInit'}
47
48 " Costs a second startup time
49 Plug 'dbeniamine/cheat.sh-vim', {'on': 'Cheat'}
50
51 Plug 'sheerun/vim-polyglot'
52
53 if has('nvim-0.5')
54 Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
55 Plug 'nvim-treesitter/nvim-treesitter-refactor', {'do': ':TSUpdate'}
56 endif
57
58 function PluginsNorootNolowendboxConfig()
59 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
60 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
61 let g:clang_compilation_database = '.'
62
63 " Taken from neomake
64 if OnBattery()
65 call neomake#configure#automake('w')
66 else
67 call neomake#configure#automake('nw', 1000)
68 endif
69
70 " Speedup deoplete startup time, see deoplete FAQ
71 let g:python3_host_prog = '/usr/bin/python3'
72 " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
73 let g:deoplete#enable_at_startup = 0
74 call deoplete#custom#option({
75 \ 'smart_case' : v:true,
76 \ 'auto_refresh_delay' : 100,
77 \ })
78 au InsertEnter * call deoplete#enable()
79
80 " The denite settings are largely stolen from spacevim
81 let s:denite_options = {
82 \ 'default' : {
83 \ 'winheight' : 15,
84 \ 'mode' : 'insert',
85 \ 'start_filter' : 1,
86 \ 'quit' : 1,
87 \ 'highlight_matched_char' : 'MoreMsg',
88 \ 'highlight_matched_range' : 'MoreMsg',
89 \ 'direction': 'rightbelow',
90 \ }}
91
92 augroup spacevim_layer_denite
93 autocmd!
94 autocmd FileType denite call s:denite_my_settings()
95 augroup END
96
97 function! s:denite_my_settings() abort
98 nnoremap <silent><buffer><expr> i
99 \ denite#do_map('open_filter_buffer')
100 nnoremap <silent><buffer><expr> '
101 \ denite#do_map('toggle_select').'j'
102 nnoremap <silent><buffer><expr> q
103 \ denite#do_map('quit')
104 nnoremap <silent><buffer><expr> <C-t>
105 \ denite#do_map('do_action', 'tabopen')
106 nnoremap <silent><buffer><expr> <C-v>
107 \ denite#do_map('do_action', 'vsplit')
108 nnoremap <silent><buffer><expr> <C-s>
109 \ denite#do_map('do_action', 'split')
110 nnoremap <silent><buffer><expr> <CR>
111 \ denite#do_map('do_action')
112 nnoremap <silent><buffer><expr> p
113 \ denite#do_map('do_action', 'preview')
114 nnoremap <silent><buffer><Tab> j
115 nnoremap <silent><buffer><S-Tab> k
116 endfunction
117
118 " FIND and GREP COMMANDS
119 if executable('rg')
120 " Ripgrep command on grep source
121 call denite#custom#var('grep', 'command', ['rg'])
122 call denite#custom#var('grep', 'default_opts',
123 \ ['--vimgrep', '--no-heading'])
124 call denite#custom#var('grep', 'recursive_opts', [])
125 call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
126 call denite#custom#var('grep', 'separator', ['--'])
127 call denite#custom#var('grep', 'final_opts', [])
128 endif
129
130 let s:insert_mode_mappings = [
131 \ ['jk', '<denite:enter_mode:normal>', 'noremap'],
132 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
133 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
134 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
135 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
136 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
137 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
138 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
139 \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
140 \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
141 \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
142 \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
143 \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
144 \ ['<C-Y>', '<denite:redraw>', 'noremap'],
145 \ ]
146
147 let s:normal_mode_mappings = [
148 \ ["'", '<denite:toggle_select_down>', 'noremap'],
149 \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
150 \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
151 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
152 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
153 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
154 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
155 \ ['gg', '<denite:move_to_first_line>', 'noremap'],
156 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
157 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
158 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
159 \ ['q', '<denite:quit>', 'noremap'],
160 \ ['r', '<denite:redraw>', 'noremap'],
161 \ ]
162
163 " Have deoplete completion for vimtex (e.g., bibtex entries)
164 au Filetype tex call deoplete#custom#var('omni', 'input_patterns', {
165 \ 'tex': g:vimtex#re#deoplete })
166
167 if has('nvim-0.5')
168 set foldexpr=nvim_treesitter#foldexpr()
169
170 lua <<EOF
171 require'nvim-treesitter.configs'.setup {
172 -- one of "all", "maintained" (parsers with maintainers), or a list of languages
173 ensure_installed = "maintained",
174 -- List of parsers to ignore installing
175 ignore_install = {},
176 -- Modules and its options go here
177 highlight = { enable = true },
178 -- Indentation is still quite buggy, e.g., for multi-line C comments
179 -- or for comments right after a preproc definition.
180 -- indent = { enable = true },
181 textobjects = { enable = true },
182 incremental_selection = {
183 enable = true,
184 keymaps = {
185 init_selection = "gnn",
186 node_incremental = "grn",
187 scope_incremental = "grc",
188 node_decremental = "grm",
189 },
190 },
191 refactor = {
192 highlight_definitions = { enable = true },
193 smart_rename = {
194 enable = true,
195 keymaps = { smart_rename = "grr" },
196 },
197 navigation = {
198 enable = true,
199 keymaps = {
200 goto_definition = "gnd",
201 list_definitions = "gnD",
202 list_definitions_toc = "gO",
203 goto_next_usage = "<a-*>",
204 goto_previous_usage = "<a-#>",
205 },
206 },
207 },
208 }
209 EOF
210 endif
211
212 let g:fastfold_minlines = 0
213
214 let g:detectspelllang_langs = {}
215 let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
216
217 au FileType mail let g:VimMailSpellLangs=['de', 'en']
218 let g:VimMailContactsProvider=['khard']
219 let g:VimMailContactsCommands={
220 \'khard':
221 \{ 'query' : "khard email --parsable --search-in-source-files",
222 \'sync': "/bin/true"}
223 \}
224
225 let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
226 \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
227 \ ['CANCELED(c)']]
228
229 let g:vimwiki_list = [{'path': '~/.vimwiki/',
230 \ 'template_path': '~/.vim/vimwiki/templates',
231 \ 'template_default': 'default',
232 \ 'template_ext': '.html'}]
233 let g:vimwiki_global_ext = 0
234
235
236 " Java completion
237 au FileType java setlocal omnifunc=javacomplete#Complete
238 au FileType java JCEnable
239
240 let g:vimtex_fold_enabled = 1
241 let g:vimtex_fold_levelmarker = '➜'
242
243 au FileType c,cpp,obj,java,python packadd! vimspector
244 let g:vimspector_base_dir = expand('~/.vim/vimspector-config')
245 let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-cpptools' ]
246 "let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
247
248 function VimspectorRestartOrCreateConfig()
249 if !filereadable('.vimspector.json')
250 echo "Missing .vimspector.json, created one."
251 execute 'tabe .vimspector.json'
252 else
253 call vimspector#Restart()
254 endif
255 endfunction
256
257 nmap <leader>dc <Plug>VimspectorContinue
258 nmap <leader>ds <Plug>VimspectorStop
259 nmap <leader>dr :call VimspectorRestartOrCreateConfig()<CR>
260 "nmap <leader>dr :call vimspector#Restart()<CR>
261 nmap <leader>drr :call vimspector#Reset()<CR>
262 nmap <leader>dp <Plug>VimspectorPause
263 nmap <leader>db <Plug>VimspectorToggleBreakpoint
264 nmap <leader>dcb <Plug>VimspectorToggleConditionalBreakpoint
265 nmap <leader>dfb <Plug>VimspectorAddFunctionBreakpoint
266 nmap <leader>dtc <Plug>VimspectorRunToCursor
267 nmap <leader>do <Plug>VimspectorStepOver
268 nmap <leader>di <Plug>VimspectorStepInto
269 nmap <leader>dof <Plug>VimspectorStepOut
270 " for normal mode, the word under the cursor
271 nmap <Leader>de <Plug>VimspectorBalloonEval
272 " for visual mode, the visually selected text
273 xmap <Leader>de <Plug>VimspectorBalloonEval
274
275 au BufNewFile .vimspector.json read ~/.vim/vimspector-config/vimspector.json
276
277 endfunction