Compare commits
2 Commits
e2bdd71b08
...
ebe143ee28
| Author | SHA1 | Date | |
|---|---|---|---|
| ebe143ee28 | |||
| ba7cec969f |
@@ -1 +1 @@
|
||||
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
||||
vim.cmd [[autocmd BufWritePre *.go lua vim.lsp.buf.format()]]
|
||||
|
||||
14
nvim/after/ftplugin/javascriptreact.lua
Normal file
14
nvim/after/ftplugin/javascriptreact.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
vim.opt_local.expandtab = true
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- pattern = { "javascript", "javascriptreact" },
|
||||
-- callback = function()
|
||||
-- -- Your JS/JSX settings here
|
||||
-- vim.bo.tabstop = 2
|
||||
-- vim.bo.shiftwidth = 2
|
||||
-- vim.bo.softtabstop = 2
|
||||
-- vim.bo.expandtab = true
|
||||
-- end
|
||||
-- })
|
||||
7
nvim/after/ftplugin/json.lua
Normal file
7
nvim/after/ftplugin/json.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.json",
|
||||
callback = function()
|
||||
-- vim.cmd([[%!jq . 2>/dev/null || cat]])
|
||||
vim.cmd([[%!jq . ]])
|
||||
end,
|
||||
})
|
||||
4
nvim/after/ftplugin/nix.lua
Normal file
4
nvim/after/ftplugin/nix.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
vim.opt_local.expandtab = true
|
||||
@@ -33,7 +33,7 @@ local on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, Append(bufopts, "desc", "Go to definition"))
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, Append(bufopts, "desc", "Go to implementation"))
|
||||
vim.keymap.set("n", "gr", require'telescope.builtin'.lsp_references, Append(bufopts, "desc", "Go to references"))
|
||||
vim.keymap.set("n", "gr", require 'telescope.builtin'.lsp_references, Append(bufopts, "desc", "Go to references"))
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
@@ -121,6 +121,37 @@ require("lspconfig").bashls.setup { capabilities = capabilities, handlers = hand
|
||||
}
|
||||
}
|
||||
}
|
||||
require("lspconfig").nixd.setup { capabilities = capabilities, handlers = handlers,
|
||||
cmd = { 'nixd' },
|
||||
filetypes = { 'nix' },
|
||||
root_dir = function(fname)
|
||||
return require('lspconfig.util').root_pattern(
|
||||
'flake.nix',
|
||||
'shell.nix',
|
||||
'default.nix',
|
||||
'.git'
|
||||
)(fname) or vim.fn.getcwd()
|
||||
end,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
command = { "nixpkgs-fmt" } -- Uses nixpkgs-fmt for formatting
|
||||
},
|
||||
eval = {
|
||||
depth = 3, -- Evaluation depth
|
||||
workers = 2, -- Number of evaluation workers
|
||||
},
|
||||
completion = {
|
||||
autoImport = true -- Auto-import completions
|
||||
},
|
||||
nixpkgs = {
|
||||
expr = "import <nixpkgs> {}", -- Default nixpkgs expression
|
||||
-- path = "/path/to/your/nixpkgs" -- Optional explicit path
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers,
|
||||
on_attach = on_attach,
|
||||
-- more details on configuring pyright can be found here
|
||||
|
||||
@@ -28,9 +28,9 @@ local plugins = {
|
||||
-- ...
|
||||
})
|
||||
|
||||
vim.cmd('colorscheme github_light_colorblind')
|
||||
-- vim.cmd('colorscheme github_light_colorblind')
|
||||
-- vim.cmd('colorscheme github_light')
|
||||
-- vim.cmd('colorscheme github_dark_colorblind')
|
||||
vim.cmd('colorscheme github_dark_colorblind')
|
||||
-- vim.cmd('colorscheme github_dark')
|
||||
end,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user