plugins: Merge init files into plugin files
[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
17 " Prevent slow foling update, e.g., for vimtex
18 Plug 'Konfekt/FastFold'
19 Plug 'lervag/vimtex', {'for': 'tex'}
20
21 Plug 'mhinz/vim-signify'
22 Plug 'tpope/vim-fugitive'
23 Plug 'gko/vim-coloresque'
24
25 Plug 'vimwiki/vimwiki'
26 Plug 'jceb/vim-orgmode', {'for': ['org']}
27
28 Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'}
29 Plug 'hail2u/vim-css3-syntax', {'for': ['scss', 'css']}
30
31 Plug 'https://gitlab.com/dbeniamine/vim-mail'
32 Plug 'Konfekt/vim-DetectSpellLang', {'do': 'spell'}
33
34 Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons)
35 Plug 'joom/latex-unicoder.vim', {'on': '<Plug>Unicoder'}
36
37 Plug 'sjl/splice.vim', {'on': 'SpliceInit'}
38
39 " Costs a second startup time
40 Plug 'dbeniamine/cheat.sh-vim', {'on': 'Cheat'}
41
42 if has('nvim-0.5')
43 Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
44 Plug 'nvim-treesitter/nvim-treesitter-refactor', {'do': ':TSUpdate'}
45 else
46 Plug 'sheerun/vim-polyglot'
47 endif
48
49
50 function PluginsNorootNolowendboxConfig()
51
52 " The denite settings are largely stolen from spacevim
53 let s:denite_options = {
54 \ 'default' : {
55 \ 'winheight' : 15,
56 \ 'mode' : 'insert',
57 \ 'start_filter' : 1,
58 \ 'quit' : 1,
59 \ 'highlight_matched_char' : 'MoreMsg',
60 \ 'highlight_matched_range' : 'MoreMsg',
61 \ 'direction': 'rightbelow',
62 \ }}
63
64 augroup spacevim_layer_denite
65 autocmd!
66 autocmd FileType denite call s:denite_my_settings()
67 augroup END
68
69 function! s:denite_my_settings() abort
70 nnoremap <silent><buffer><expr> i
71 \ denite#do_map('open_filter_buffer')
72 nnoremap <silent><buffer><expr> '
73 \ denite#do_map('toggle_select').'j'
74 nnoremap <silent><buffer><expr> q
75 \ denite#do_map('quit')
76 nnoremap <silent><buffer><expr> <C-t>
77 \ denite#do_map('do_action', 'tabopen')
78 nnoremap <silent><buffer><expr> <C-v>
79 \ denite#do_map('do_action', 'vsplit')
80 nnoremap <silent><buffer><expr> <C-s>
81 \ denite#do_map('do_action', 'split')
82 nnoremap <silent><buffer><expr> <CR>
83 \ denite#do_map('do_action')
84 nnoremap <silent><buffer><expr> p
85 \ denite#do_map('do_action', 'preview')
86 nnoremap <silent><buffer><Tab> j
87 nnoremap <silent><buffer><S-Tab> k
88 endfunction
89
90 " FIND and GREP COMMANDS
91 if executable('rg')
92 " Ripgrep command on grep source
93 call denite#custom#var('grep', 'command', ['rg'])
94 call denite#custom#var('grep', 'default_opts',
95 \ ['--vimgrep', '--no-heading'])
96 call denite#custom#var('grep', 'recursive_opts', [])
97 call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
98 call denite#custom#var('grep', 'separator', ['--'])
99 call denite#custom#var('grep', 'final_opts', [])
100 endif
101
102 let s:insert_mode_mappings = [
103 \ ['jk', '<denite:enter_mode:normal>', 'noremap'],
104 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
105 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
106 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
107 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
108 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
109 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
110 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
111 \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
112 \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
113 \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
114 \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
115 \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
116 \ ['<C-Y>', '<denite:redraw>', 'noremap'],
117 \ ]
118
119 let s:normal_mode_mappings = [
120 \ ["'", '<denite:toggle_select_down>', 'noremap'],
121 \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
122 \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
123 \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
124 \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
125 \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
126 \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
127 \ ['gg', '<denite:move_to_first_line>', 'noremap'],
128 \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
129 \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
130 \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
131 \ ['q', '<denite:quit>', 'noremap'],
132 \ ['r', '<denite:redraw>', 'noremap'],
133 \ ]
134
135 " Have deoplete completion for vimtex (e.g., bibtex entries)
136 au Filetype tex call deoplete#custom#var('omni', 'input_patterns', {
137 \ 'tex': g:vimtex#re#deoplete })
138
139 if has('nvim-0.5')
140 set foldexpr=nvim_treesitter#foldexpr()
141
142 lua <<EOF
143 require'nvim-treesitter.configs'.setup {
144 -- one of "all", "maintained" (parsers with maintainers), or a list of languages
145 ensure_installed = "maintained",
146 -- List of parsers to ignore installing
147 ignore_install = {},
148 -- Modules and its options go here
149 highlight = { enable = true },
150 -- Indentation is still quite buggy, e.g., for multi-line C comments
151 -- or for comments right after a preproc definition.
152 -- indent = { enable = true },
153 textobjects = { enable = true },
154 incremental_selection = {
155 enable = true,
156 keymaps = {
157 init_selection = "gnn",
158 node_incremental = "grn",
159 scope_incremental = "grc",
160 node_decremental = "grm",
161 },
162 },
163 refactor = {
164 highlight_definitions = { enable = true },
165 smart_rename = {
166 enable = true,
167 keymaps = { smart_rename = "grr" },
168 },
169 navigation = {
170 enable = true,
171 keymaps = {
172 goto_definition = "gnd",
173 list_definitions = "gnD",
174 list_definitions_toc = "gO",
175 goto_next_usage = "<a-*>",
176 goto_previous_usage = "<a-#>",
177 },
178 },
179 },
180 }
181 EOF
182 endif
183 endfunction