diff options
Diffstat (limited to '.config/nvim/lua/plugin_settings.lua')
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 135 |
1 files changed, 121 insertions, 14 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 60bbbe1..e9c4cd4 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -66,7 +66,7 @@ require'lualine'.setup { | |||
66 | } | 66 | } |
67 | -- }}} requi -- | 67 | -- }}} requi -- |
68 | 68 | ||
69 | -- Cutlass suite {{{1 -- | 69 | -- cutlass suite {{{ -- |
70 | 70 | ||
71 | -- cutlass/yoink/subverse suite | 71 | -- cutlass/yoink/subverse suite |
72 | g.yoinkIncludeDeleteOperations = 1 | 72 | g.yoinkIncludeDeleteOperations = 1 |
@@ -85,7 +85,7 @@ g.clipboard = { | |||
85 | cache_enabled = 1, | 85 | cache_enabled = 1, |
86 | } | 86 | } |
87 | 87 | ||
88 | -- 1}}} -- | 88 | -- }}} cutlass suite -- |
89 | 89 | ||
90 | -- UltiSnips {{{ -- | 90 | -- UltiSnips {{{ -- |
91 | opt.runtimepath:append('/home/yigit/.vim/my-snippets/') | 91 | opt.runtimepath:append('/home/yigit/.vim/my-snippets/') |
@@ -101,12 +101,6 @@ g.beacon_shrink = 1 | |||
101 | cmd('highlight Beacon guibg=red ctermbg=15') | 101 | cmd('highlight Beacon guibg=red ctermbg=15') |
102 | -- }}} beacon -- | 102 | -- }}} beacon -- |
103 | 103 | ||
104 | -- vim-slime {{{ -- | ||
105 | g.slime_target = "tmux" | ||
106 | g.slime_paste_file = "/home/yigit/.slime_paste" | ||
107 | -- g.slime_default_config = {socket_name = get(split($TMUX, ","), 0), target_pane = "{last}"} | ||
108 | -- }}} vim-slime -- | ||
109 | |||
110 | -- vimtex {{{ -- | 104 | -- vimtex {{{ -- |
111 | g.vimtex_view_method = 'zathura' | 105 | g.vimtex_view_method = 'zathura' |
112 | g.vimtex_quickfix_mode = 0 | 106 | g.vimtex_quickfix_mode = 0 |
@@ -138,15 +132,20 @@ g.ledger_fillstring = ' -' | |||
138 | require'nvim-web-devicons'.setup { | 132 | require'nvim-web-devicons'.setup { |
139 | override = { | 133 | override = { |
140 | wiki = { | 134 | wiki = { |
141 | icon = "", | 135 | icon = "", |
142 | color = "#D7827E", | 136 | color = "#D7827E", |
143 | name = "vimwiki" | 137 | name = "vimwiki" |
144 | }, | 138 | }, |
145 | rem = { | 139 | rem = { |
146 | icon = "", | 140 | icon = "", |
147 | color = "#B4637A", | 141 | color = "#B4637A", |
148 | name = "remind" | 142 | name = "remind" |
149 | } | 143 | }, |
144 | mail = { | ||
145 | icon = "", | ||
146 | color = "#907AA9", | ||
147 | name = "mail" | ||
148 | }, | ||
150 | }; | 149 | }; |
151 | 150 | ||
152 | default = true | 151 | default = true |
@@ -193,7 +192,115 @@ g.gutentags_ctags_exclude = { | |||
193 | } | 192 | } |
194 | -- }}} gutentags -- | 193 | -- }}} gutentags -- |
195 | 194 | ||
196 | -- float preview | 195 | -- telescope {{{ -- |
196 | require('telescope').setup { | ||
197 | extensions = { | ||
198 | fzf = { | ||
199 | fuzzy = true, -- false will only do exact matching | ||
200 | override_generic_sorter = true, -- override the generic sorter | ||
201 | override_file_sorter = true, -- override the file sorter | ||
202 | case_mode = "smart_case", -- or "ignore_case" or "respect_case" | ||
203 | -- the default case_mode is "smart_case" | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | |||
208 | require('telescope').load_extension('fzf') | ||
209 | -- }}} telescope -- | ||
210 | |||
211 | -- dashboard {{{ -- | ||
212 | g.dashboard_default_executive = 'telescope' | ||
213 | g.dashboard_preview_command = 'cat' | ||
214 | g.dashboard_preview_pipeline = 'lolcat' | ||
215 | g.dashboard_preview_file = '~/.config/nvim/neovim.cat' | ||
216 | g.dashboard_preview_file_height = 14 | ||
217 | g.dashboard_preview_file_width = 90 | ||
218 | -- }}} dashboard -- | ||
219 | |||
220 | -- treesitter {{{ -- | ||
221 | |||
222 | require'nvim-treesitter.configs'.setup { | ||
223 | ensure_installed = "maintained", | ||
224 | ignore_install = { "javascript" }, | ||
225 | highlight = { | ||
226 | enable = true, | ||
227 | additional_vim_regex_highlighting = false, | ||
228 | }, | ||
229 | } | ||
230 | -- }}} treesitter -- | ||
231 | |||
232 | -- nvim-cmp {{{ -- | ||
233 | local cmp = require'cmp' | ||
234 | |||
235 | cmp.setup({ | ||
236 | snippet = { | ||
237 | expand = function(args) | ||
238 | vim.fn["UltiSnips#Anon"](args.body) | ||
239 | end, | ||
240 | }, | ||
241 | mapping = { | ||
242 | ['<C-d>'] = cmp.mapping.scroll_docs(-4), | ||
243 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
244 | ['<C-Space>'] = cmp.mapping.complete(), | ||
245 | ['<C-e>'] = cmp.mapping.close(), | ||
246 | ['<C-l>'] = cmp.mapping.confirm({ select = true }), | ||
247 | }, | ||
248 | sources = { | ||
249 | { name = 'nvim_lsp' }, | ||
250 | { name = 'ultisnips' }, | ||
251 | { name = 'buffer' }, | ||
252 | { name = "latex_symbols" }, | ||
253 | } | ||
254 | }) | ||
255 | |||
256 | -- }}} nvim-cmp -- | ||
257 | |||
258 | -- nvim-lsp {{{ -- | ||
259 | local nvim_lsp = require('lspconfig') | ||
260 | |||
261 | local on_attach = function(client, bufnr) | ||
262 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end | ||
263 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end | ||
264 | |||
265 | -- Enable completion triggered by <c-x><c-o> | ||
266 | buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') | ||
267 | |||
268 | -- Mappings. | ||
269 | local opts = { noremap=true, silent=true } | ||
270 | |||
271 | -- See `:help vim.lsp.*` for documentation on any of the below functions | ||
272 | buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) | ||
273 | buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) | ||
274 | buf_set_keymap('n', 'vh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) | ||
275 | buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) | ||
276 | buf_set_keymap('n', 'vs', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) | ||
277 | buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) | ||
278 | buf_set_keymap('n', '<leader>wd', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) | ||
279 | buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) | ||
280 | buf_set_keymap('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) | ||
281 | buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) | ||
282 | buf_set_keymap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) | ||
283 | buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) | ||
284 | buf_set_keymap('n', '<leader>d', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts) | ||
285 | buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts) | ||
286 | buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts) | ||
287 | buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts) | ||
288 | buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) | ||
289 | end | ||
290 | |||
291 | local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab' } | ||
292 | for _, lsp in ipairs(servers) do | ||
293 | nvim_lsp[lsp].setup { | ||
294 | on_attach = on_attach, | ||
295 | flags = { | ||
296 | debounce_text_changes = 150, | ||
297 | }, | ||
298 | capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) | ||
299 | } | ||
300 | end | ||
301 | |||
302 | -- }}} nvim-lsp -- | ||
303 | |||
197 | g["float_preview#docked"] = 0 | 304 | g["float_preview#docked"] = 0 |
198 | 305 | ||
199 | -- highlight on yank | 306 | -- highlight on yank |