diff options
Diffstat (limited to '.config/nvim/lua/plugin_settings.lua')
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 96 |
1 files changed, 71 insertions, 25 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 41a663a..734efd3 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -38,11 +38,6 @@ local function lualine_spell() | |||
38 | end | 38 | end |
39 | end | 39 | end |
40 | 40 | ||
41 | -- Grinds vim to a halt | ||
42 | local function lualine_tex_wordcount() | ||
43 | return vim.fn['vimtex#misc#wordcount']() .. " ‽" | ||
44 | end | ||
45 | |||
46 | local conditions = { | 41 | local conditions = { |
47 | spell_on = function () | 42 | spell_on = function () |
48 | return vim.wo.spell | 43 | return vim.wo.spell |
@@ -337,38 +332,38 @@ local nvim_lsp = require('lspconfig') | |||
337 | 332 | ||
338 | -- Mappings. | 333 | -- Mappings. |
339 | local opts = { noremap=true, silent=true } | 334 | local opts = { noremap=true, silent=true } |
340 | vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) | 335 | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts) |
341 | vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) | 336 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) |
342 | vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) | 337 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) |
343 | vim.api.nvim_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts) | 338 | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) |
344 | 339 | ||
345 | local on_attach = function(client, bufnr) | 340 | local on_attach = function(client, bufnr) |
346 | -- Enable completion triggered by <c-x><c-o> | 341 | -- Enable completion triggered by <c-x><c-o> |
347 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') | 342 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') |
348 | 343 | ||
349 | -- See `:help vim.lsp.*` for documentation on any of the below functions | 344 | -- See `:help vim.lsp.*` for documentation on any of the below functions |
350 | vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) | 345 | local bufopts = { noremap=true, silent=true, buffer=bufnr } |
351 | vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) | 346 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) |
352 | vim.api.nvim_buf_set_keymap(bufnr, 'n', 'vh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) | 347 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) |
353 | vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gh', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) | 348 | vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts) |
354 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) | 349 | vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts) |
355 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) | 350 | vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) |
356 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) | 351 | vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) |
357 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) | 352 | vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) |
358 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) | 353 | vim.keymap.set('n', '<leader>wl', function() |
359 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) | 354 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) |
360 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) | 355 | end, bufopts) |
361 | vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) | 356 | vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) |
362 | vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) | 357 | vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) |
358 | vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) | ||
359 | vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) | ||
360 | vim.keymap.set('n', '<leader>fm', vim.lsp.buf.formatting, bufopts) | ||
363 | end | 361 | end |
364 | 362 | ||
365 | local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd', 'ltex' } | 363 | local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd', 'ltex' } |
366 | for _, lsp in ipairs(servers) do | 364 | for _, lsp in ipairs(servers) do |
367 | nvim_lsp[lsp].setup { | 365 | nvim_lsp[lsp].setup { |
368 | on_attach = on_attach, | 366 | on_attach = on_attach, |
369 | flags = { | ||
370 | debounce_text_changes = 150, | ||
371 | }, | ||
372 | capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) | 367 | capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) |
373 | } | 368 | } |
374 | end | 369 | end |
@@ -555,3 +550,54 @@ require('rose-pine').setup({ | |||
555 | -- set colorscheme after options | 550 | -- set colorscheme after options |
556 | vim.cmd('colorscheme rose-pine') | 551 | vim.cmd('colorscheme rose-pine') |
557 | -- }}} Rose Pine -- | 552 | -- }}} Rose Pine -- |
553 | |||
554 | -- dial.nvim {{{ -- | ||
555 | |||
556 | local augend = require("dial.augend") | ||
557 | require("dial.config").augends:register_group{ | ||
558 | -- default augends used when no group name is specified | ||
559 | default = { | ||
560 | augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) | ||
561 | augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) | ||
562 | augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) | ||
563 | augend.date.alias["%Y-%m-%d"], | ||
564 | augend.semver.alias.semver, | ||
565 | augend.constant.new{ | ||
566 | elements = {"and", "or"}, | ||
567 | word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. | ||
568 | cyclic = true, -- "or" is incremented into "and". | ||
569 | }, | ||
570 | augend.constant.new{ | ||
571 | elements = {"&&", "||"}, | ||
572 | word = false, | ||
573 | cyclic = true, | ||
574 | }, | ||
575 | }, | ||
576 | } | ||
577 | |||
578 | -- }}} dial.nvim -- | ||
579 | |||
580 | -- leap.nvim {{{ -- | ||
581 | require('leap').setup { | ||
582 | max_aot_targets = nil, | ||
583 | highlight_unlabeled = false, | ||
584 | case_sensitive = false, | ||
585 | -- Groups of characters that should match each other. | ||
586 | -- Obvious candidates are braces & quotes ('([{', ')]}', '`"\''). | ||
587 | character_classes = { ' \t\r\n', }, | ||
588 | -- Leaving the appropriate list empty effectively disables "smart" mode, | ||
589 | -- and forces auto-jump to be on or off. | ||
590 | -- safe_labels = { . . . }, | ||
591 | -- labels = { . . . }, | ||
592 | -- These keys are captured directly by the plugin at runtime. | ||
593 | -- (For `prev_match`, I suggest <s-enter> if possible in the terminal/GUI.) | ||
594 | special_keys = { | ||
595 | repeat_search = '<enter>', | ||
596 | next_match = '<enter>', | ||
597 | prev_match = '<tab>', | ||
598 | next_group = '<space>', | ||
599 | prev_group = '<tab>', | ||
600 | }, | ||
601 | } | ||
602 | |||
603 | -- }}} leap.nvim -- | ||