From 0e4fb32f0a8b76a72a2f6b293b6ac846dd2df9c9 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 17 Dec 2024 10:41:02 +0100 Subject: nvim: use harper and vale at the same time --- .config/nvim/lua/plugins/lsp.lua | 56 ++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 22 deletions(-) (limited to '.config/nvim/lua/plugins') diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index cda35bf..e8ff863 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -155,26 +155,7 @@ return { filetypes = { 'sh', 'tex' }, }) - vim.g.rustaceanvim = { - -- Plugin configuration - tools = { - }, - -- LSP configuration - server = { - on_attach = on_attach, - vim.lsp.inlay_hint.enable(true), - default_settings = { - -- rust-analyzer language server configuration - ['rust-analyzer'] = { - }, - }, - }, - -- DAP configuration - dap = { - }, - } - - lspconfig.harper_ls.setup { + require("lspconfig")["harper_ls"].setup { on_attach = on_attach, capabilities = capabilities, settings = { @@ -199,8 +180,30 @@ return { } }, filetypes = { - "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua", "gitcommit", "java", "html", "vimwiki" - } + "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua", "gitcommit", "java", "html", "vimwiki", "tex" + }, + root_dir = function(fname) + return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + end, + } + + vim.g.rustaceanvim = { + -- Plugin configuration + tools = { + }, + -- LSP configuration + server = { + on_attach = on_attach, + vim.lsp.inlay_hint.enable(true), + default_settings = { + -- rust-analyzer language server configuration + ['rust-analyzer'] = { + }, + }, + }, + -- DAP configuration + dap = { + }, } end, }, @@ -246,5 +249,14 @@ return { } } } + }, + { + 'marcelofern/vale.nvim', + config = function() + require("vale").setup({ + bin = "/usr/bin/vale", + vale_config_path = "$HOME/.config/vale/.vale.ini", + }) + end, } } -- cgit v1.2.3-70-g09d2