[nvim] smth
This commit is contained in:
@@ -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
|
||||
@@ -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