Add null-ls, mac settings, zoomwin
This commit is contained in:
@@ -18,7 +18,8 @@ local on_attach = function(_, bufnr)
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', '<leader>a', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('v', '<leader>a', vim.lsp.buf.range_code_action, bufopts)
|
||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
|
||||
33
lua/plugins/null-ls-nvim.lua
Normal file
33
lua/plugins/null-ls-nvim.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- Linter
|
||||
null_ls.builtins.diagnostics.eslint_d,
|
||||
null_ls.builtins.diagnostics.jsonlint,
|
||||
null_ls.builtins.diagnostics.markdownlint,
|
||||
null_ls.builtins.diagnostics.stylelint,
|
||||
null_ls.builtins.diagnostics.tidy,
|
||||
null_ls.builtins.diagnostics.todo_comments,
|
||||
null_ls.builtins.diagnostics.tsc,
|
||||
-- Formatter
|
||||
null_ls.builtins.formatting.eslint_d,
|
||||
null_ls.builtins.formatting.markdownlint,
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
null_ls.builtins.formatting.sqlfluff.with({
|
||||
extra_args = { "--dialect", "postgres" },
|
||||
}),
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.rustfmt,
|
||||
null_ls.builtins.formatting.tidy,
|
||||
null_ls.builtins.formatting.taplo,
|
||||
-- Refactoring
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
-- Shells
|
||||
null_ls.builtins.diagnostics.fish,
|
||||
-- Git
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
-- Spelling
|
||||
null_ls.builtins.diagnostics.codespell,
|
||||
},
|
||||
})
|
||||
@@ -16,20 +16,20 @@ rt.setup({
|
||||
capabilities = nvim_cmp_capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
lsp_on_attach(client, bufnr)
|
||||
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<C-space>', rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<Leader>a', rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rc', rt.open_cargo_toml.open_cargo_toml, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rp', rt.parent_module.parent_module, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rm', rt.expand_macro.expand_macro, { buffer = bufnr })
|
||||
end,
|
||||
settings = {
|
||||
-- to enable rust-analyzer settings visit:
|
||||
-- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
|
||||
["rust-analyzer"] = {
|
||||
['rust-analyzer'] = {
|
||||
-- enable clippy on save
|
||||
checkOnSave = {
|
||||
command = "clippy"
|
||||
command = 'clippy'
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user