[nvim] smth

This commit is contained in:
2025-07-04 00:52:22 +03:00
parent e0f933c26c
commit ba7cec969f
6 changed files with 60 additions and 4 deletions

View File

@@ -1 +1 @@
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] vim.cmd [[autocmd BufWritePre *.go lua vim.lsp.buf.format()]]

View 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
-- })

View 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,
})

View 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

View File

@@ -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, require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers,
on_attach = on_attach, on_attach = on_attach,
-- more details on configuring pyright can be found here -- more details on configuring pyright can be found here

View File

@@ -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_light')
-- vim.cmd('colorscheme github_dark_colorblind') vim.cmd('colorscheme github_dark_colorblind')
-- vim.cmd('colorscheme github_dark') -- vim.cmd('colorscheme github_dark')
end, end,
}, },