diff options
author | Yigit Sever | 2022-12-14 17:41:28 +0300 |
---|---|---|
committer | Yigit Sever | 2022-12-14 17:41:28 +0300 |
commit | fa31f10efeefbd10fcdfc386968cc4bd0e282e46 (patch) | |
tree | 6c62c1fbeaaa6be2008ddd6db1ac8a3800ffc943 | |
parent | 820b522113c8ad02198e00eb4e4f71611545d15b (diff) | |
download | dotfiles-fa31f10efeefbd10fcdfc386968cc4bd0e282e46.tar.gz dotfiles-fa31f10efeefbd10fcdfc386968cc4bd0e282e46.tar.bz2 dotfiles-fa31f10efeefbd10fcdfc386968cc4bd0e282e46.zip |
feat(nvim): use ltex-extra plugin
https://valentjn.github.io/ltex/settings.html
we use ltex-ls for prose, add to dictionary and hide false positives were pain, this plugin fixes that
still need to invoke ltex-ls on save instead of on every keypress
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 27 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 2 |
2 files changed, 25 insertions, 4 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index d103607..2149db0 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -331,10 +331,10 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) | |||
331 | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) | 331 | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) |
332 | 332 | ||
333 | local on_attach = function(client, bufnr) | 333 | local on_attach = function(client, bufnr) |
334 | -- Enable completion triggered by <c-x><c-o> | 334 | -- enable completion triggered by <c-x><c-o> |
335 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') | 335 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') |
336 | 336 | ||
337 | -- See `:help vim.lsp.*` for documentation on any of the below functions | 337 | -- see `:help vim.lsp.*` for documentation on any of the below functions |
338 | local bufopts = { noremap=true, silent=true, buffer=bufnr } | 338 | local bufopts = { noremap=true, silent=true, buffer=bufnr } |
339 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) | 339 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) |
340 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) | 340 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) |
@@ -356,7 +356,7 @@ end | |||
356 | -- bring in cmp_nvim_lsp | 356 | -- bring in cmp_nvim_lsp |
357 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | 357 | local capabilities = require('cmp_nvim_lsp').default_capabilities() |
358 | 358 | ||
359 | local servers = { 'jedi_language_server', 'texlab', 'clangd', 'ltex' } | 359 | local servers = { 'jedi_language_server', 'texlab', 'clangd' } |
360 | for _, lsp in ipairs(servers) do | 360 | for _, lsp in ipairs(servers) do |
361 | nvim_lsp[lsp].setup { | 361 | nvim_lsp[lsp].setup { |
362 | on_attach = on_attach, | 362 | on_attach = on_attach, |
@@ -364,12 +364,31 @@ for _, lsp in ipairs(servers) do | |||
364 | } | 364 | } |
365 | end | 365 | end |
366 | 366 | ||
367 | nvim_lsp['efm'].setup{ | 367 | nvim_lsp['efm'].setup { |
368 | on_attach = on_attach, | 368 | on_attach = on_attach, |
369 | filetypes = { 'sh' }, | 369 | filetypes = { 'sh' }, |
370 | capabilities = capabilities | 370 | capabilities = capabilities |
371 | } | 371 | } |
372 | 372 | ||
373 | nvim_lsp.ltex.setup { | ||
374 | capabilities = capabilities, | ||
375 | on_attach = function(client, bufnr) | ||
376 | on_attach(client, bufnr) | ||
377 | require("ltex_extra").setup { | ||
378 | load_langs = { "en-GB" }, | ||
379 | init_check = true, | ||
380 | path = "/home/yigit/.local/share/nvim/ltex", | ||
381 | log_level = "none", | ||
382 | } | ||
383 | end, | ||
384 | settings = { | ||
385 | ltex = { | ||
386 | -- my settings here | ||
387 | } | ||
388 | } | ||
389 | } | ||
390 | |||
391 | |||
373 | -- rust-tools {{{ -- | 392 | -- rust-tools {{{ -- |
374 | 393 | ||
375 | -- Configure LSP through rust-tools.nvim plugin. | 394 | -- Configure LSP through rust-tools.nvim plugin. |
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 38c1acc..9855045 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua | |||
@@ -16,6 +16,8 @@ return require('packer').startup(function(use) | |||
16 | 16 | ||
17 | -- latex suite | 17 | -- latex suite |
18 | use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}} | 18 | use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}} |
19 | -- provides external ltex file handling and other functions | ||
20 | use 'barreiroleo/ltex-extra.nvim' | ||
19 | 21 | ||
20 | -- treesitter | 22 | -- treesitter |
21 | use { | 23 | use { |