renames, refactors, comment updates
This commit is contained in:
parent
967da5ad93
commit
215778e9c4
3 changed files with 31 additions and 36 deletions
|
@ -61,19 +61,18 @@ return {
|
||||||
},
|
},
|
||||||
-- Note that all these need to be available at runtime, add them to flake.nix#runtimeDependencies
|
-- Note that all these need to be available at runtime, add them to flake.nix#runtimeDependencies
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua", lsp_format = "fallback" },
|
lua = { "stylua", lsp_format = "first" },
|
||||||
nix = { "nixfmt", lsp_format = "fallback" },
|
nix = { "nixfmt", lsp_format = "first" },
|
||||||
-- vlang = { "v_fmt" },
|
typescript = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "first" }),
|
||||||
typescript = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "fallback" }),
|
typescriptreact = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "first" }),
|
||||||
typescriptreact = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "fallback" }),
|
javascript = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "first" }),
|
||||||
javascript = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "fallback" }),
|
javascriptreact = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "first" }),
|
||||||
javascriptreact = expandFormatters({ { "prettierd", "prettier" }, "rustywind", lsp_format = "fallback" }),
|
|
||||||
|
|
||||||
-- TODO revisit these I'd like to use them but they are not in nixpkgs yet
|
-- TODO revisit these I'd like to use them but they are not in nixpkgs yet
|
||||||
-- https://nixos.org/guides/nix-pills/
|
-- https://nixos.org/guides/nix-pills/
|
||||||
-- markdown = { "mdslw", "mdsf"},
|
-- markdown = { "mdslw", "mdsf"},
|
||||||
markdown = { "markdownlint-cli2", lsp_format = "fallback" },
|
markdown = { "markdownlint-cli2", lsp_format = "first" },
|
||||||
-- rust = { "rustfmt" },
|
rust = { "rustfmt", lsp_format = "first" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
|
@ -1,3 +1,14 @@
|
||||||
|
vim.g.rustaceanvim = {
|
||||||
|
tools = {
|
||||||
|
enable_clippy = true,
|
||||||
|
enable_nextest = true,
|
||||||
|
reload_workspace_from_cargo_toml = true,
|
||||||
|
},
|
||||||
|
server = {
|
||||||
|
-- cmd = { "nix", "run", "nixpkgs#rust-analyzer" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- LSP helper plugins for various languages
|
-- LSP helper plugins for various languages
|
||||||
{ "folke/neodev.nvim", event = { "BufRead *.lua", "BufRead *.vim" }, opts = {}, main = "neodev" },
|
{ "folke/neodev.nvim", event = { "BufRead *.lua", "BufRead *.vim" }, opts = {}, main = "neodev" },
|
||||||
|
@ -8,10 +19,19 @@ return {
|
||||||
-- },
|
-- },
|
||||||
-- TODO add some hotkeys for opening the popup menus on crates
|
-- TODO add some hotkeys for opening the popup menus on crates
|
||||||
{ "Saecki/crates.nvim", event = "BufRead Cargo.toml", tag = "stable", opts = {}, main = "crates" },
|
{ "Saecki/crates.nvim", event = "BufRead Cargo.toml", tag = "stable", opts = {}, main = "crates" },
|
||||||
|
{
|
||||||
|
"mrcjkb/rustaceanvim",
|
||||||
|
version = "^5",
|
||||||
|
lazy = false, -- already lazy
|
||||||
|
ft = { "rust" },
|
||||||
|
keys = {},
|
||||||
|
command = "RustLsp",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = "BufEnter",
|
event = "BufEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
{ "hrsh7th/nvim-cmp" },
|
||||||
{
|
{
|
||||||
"lvimuser/lsp-inlayhints.nvim",
|
"lvimuser/lsp-inlayhints.nvim",
|
||||||
init = function()
|
init = function()
|
||||||
|
@ -66,7 +86,7 @@ return {
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspDetach", {
|
vim.api.nvim_create_autocmd("LspDetach", {
|
||||||
group = vim.api.nvim_create_augroup("myconfig-lsp-detach", { clear = true }),
|
group = vim.api.nvim_create_augroup("myconfig-lsp-detach", { clear = true }),
|
||||||
callback = function(event)
|
callback = function() -- function (event)
|
||||||
vim.lsp.buf.clear_references()
|
vim.lsp.buf.clear_references()
|
||||||
-- vim.api.nvim_clear_autocmds({ group = "myconfig-lsp-highlight", buffer = event.buf })
|
-- vim.api.nvim_clear_autocmds({ group = "myconfig-lsp-highlight", buffer = event.buf })
|
||||||
end,
|
end,
|
||||||
|
@ -83,7 +103,7 @@ return {
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- Note that `rust-analyzer` is done via mrcjkb/rustaceanvim plugin above, do not register it here.
|
-- Note that `rust-analyzer` is done via mrcjkb/rustaceanvim plugin above, do not register it here.
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
@ -120,6 +140,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- Using rustaceanvim now
|
||||||
-- rust_analyzer = {
|
-- rust_analyzer = {
|
||||||
-- capabilities = capabilities,
|
-- capabilities = capabilities,
|
||||||
-- settings = {
|
-- settings = {
|
||||||
|
@ -136,12 +157,6 @@ return {
|
||||||
nil_ls = { -- nix
|
nil_ls = { -- nix
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
},
|
},
|
||||||
-- tsserver = {
|
|
||||||
-- -- typescript/javascript
|
|
||||||
-- implicitProjectConfiguration = {
|
|
||||||
-- checkJs = true,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
ts_ls = {
|
ts_ls = {
|
||||||
-- typescript/javascript
|
-- typescript/javascript
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
vim.g.rustaceanvim = {
|
|
||||||
tools = {
|
|
||||||
enable_clippy = true,
|
|
||||||
enable_nextest = true,
|
|
||||||
reload_workspace_from_cargo_toml = true,
|
|
||||||
},
|
|
||||||
server = {
|
|
||||||
-- cmd = { "nix", "run", "nixpkgs#rust-analyzer" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"mrcjkb/rustaceanvim",
|
|
||||||
version = "^5",
|
|
||||||
lazy = false, -- already lazy
|
|
||||||
ft = { "rust" },
|
|
||||||
keys = {},
|
|
||||||
command = "RustLsp",
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue