plugins: Have gutentags also for tex
[vimconf.git] / init-plugins-noroot-nolowendbox.vim
1 " The denite settings are largely stolen from spacevim
2 let s:denite_options = {
3 \ 'default' : {
4 \ 'winheight' : 15,
5 \ 'mode' : 'insert',
6 \ 'start_filter' : 1,
7 \ 'quit' : 1,
8 \ 'highlight_matched_char' : 'MoreMsg',
9 \ 'highlight_matched_range' : 'MoreMsg',
10 \ 'direction': 'rightbelow',
11 \ }}
12
13 augroup spacevim_layer_denite
14 autocmd!
15 autocmd FileType denite call s:denite_my_settings()
16 augroup END
17
18 function! s:denite_my_settings() abort
19 nnoremap <silent><buffer><expr> i
20 \ denite#do_map('open_filter_buffer')
21 nnoremap <silent><buffer><expr> '
22 \ denite#do_map('toggle_select').'j'
23 nnoremap <silent><buffer><expr> q
24 \ denite#do_map('quit')
25 nnoremap <silent><buffer><expr> <C-t>
26 \ denite#do_map('do_action', 'tabopen')
27 nnoremap <silent><buffer><expr> <C-v>
28 \ denite#do_map('do_action', 'vsplit')
29 nnoremap <silent><buffer><expr> <C-s>
30 \ denite#do_map('do_action', 'split')
31 nnoremap <silent><buffer><expr> <CR>
32 \ denite#do_map('do_action')
33 nnoremap <silent><buffer><expr> p
34 \ denite#do_map('do_action', 'preview')
35 nnoremap <silent><buffer><Tab> j
36 nnoremap <silent><buffer><S-Tab> k
37 endfunction
38
39 " FIND and GREP COMMANDS
40 if executable('rg')
41 " Ripgrep command on grep source
42 call denite#custom#var('grep', 'command', ['rg'])
43 call denite#custom#var('grep', 'default_opts',
44 \ ['--vimgrep', '--no-heading'])
45 call denite#custom#var('grep', 'recursive_opts', [])
46 call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
47 call denite#custom#var('grep', 'separator', ['--'])
48 call denite#custom#var('grep', 'final_opts', [])
49 endif
50
51 let s:insert_mode_mappings = [
52 \ ['jk', '<denite:enter_mode:normal>', 'noremap'],
53 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
54 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
55 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
56 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
57 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
58 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
59 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
60 \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
61 \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
62 \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
63 \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
64 \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
65 \ ['<C-Y>', '<denite:redraw>', 'noremap'],
66 \ ]
67
68 let s:normal_mode_mappings = [
69 \ ["'", '<denite:toggle_select_down>', 'noremap'],
70 \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
71 \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
72 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
73 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
74 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
75 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
76 \ ['gg', '<denite:move_to_first_line>', 'noremap'],
77 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
78 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
79 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
80 \ ['q', '<denite:quit>', 'noremap'],
81 \ ['r', '<denite:redraw>', 'noremap'],
82 \ ]
83
84
85 if has('nvim-0.5')
86 set foldexpr=nvim_treesitter#foldexpr()
87
88 lua <<EOF
89 require'nvim-treesitter.configs'.setup {
90 -- one of "all", "maintained" (parsers with maintainers), or a list of languages
91 ensure_installed = "maintained",
92 -- List of parsers to ignore installing
93 ignore_install = {},
94 -- Modules and its options go here
95 highlight = { enable = true },
96 indent = { enable = true },
97 textobjects = { enable = true },
98 incremental_selection = {
99 enable = true,
100 keymaps = {
101 init_selection = "gnn",
102 node_incremental = "grn",
103 scope_incremental = "grc",
104 node_decremental = "grm",
105 },
106 },
107 refactor = {
108 highlight_definitions = { enable = true },
109 smart_rename = {
110 enable = true,
111 keymaps = { smart_rename = "grr" },
112 },
113 navigation = {
114 enable = true,
115 keymaps = {
116 goto_definition = "gnd",
117 list_definitions = "gnD",
118 list_definitions_toc = "gO",
119 goto_next_usage = "<a-*>",
120 goto_previous_usage = "<a-#>",
121 },
122 },
123 },
124 }
125 EOF
126
127 endif