Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bootstrap/config_dirs/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require("user.core")
require("user.lazy")
require("core")
require("plugins")
7 changes: 2 additions & 5 deletions bootstrap/config_dirs/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
"conform.nvim": { "branch": "master", "commit": "3bad87250ed85246fe8c5bc10005ab5a6289ae4c" },
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
Expand All @@ -22,17 +22,14 @@
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a1067cf84b4ff81b66d2bf4d01f4cbdb5de40bd0" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"mason.nvim": { "branch": "main", "commit": "b3689a41dd77e5294498dba9757fb22cc80cbebd" },
"neogit": { "branch": "master", "commit": "add70101fab5913cad33ab2f84f1a6ee092e7220" },
"nerdy.nvim": { "branch": "main", "commit": "a8e3f70dc0232e956adfb12c647b7e9e2b2e6c89" },
"noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lint": { "branch": "master", "commit": "335a6044be16d7701001059cba9baa36fbeef422" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "336b388c272555d2ae94627a50df4c2f89a5e257" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
Expand Down
4 changes: 4 additions & 0 deletions bootstrap/config_dirs/nvim/lsp/bashls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
cmd = { "bash-language-server", "start" },
filetypes = { "bash", "sh", "zsh", "dotenv" },
}
110 changes: 110 additions & 0 deletions bootstrap/config_dirs/nvim/lsp/gopls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl", "gosum" },
root_markers = { "go.mod", "go.work", ".git" },
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = false,
compositeLiteralFields = false,
compositeLiteralTypes = false,
constantValues = false,
functionTypeParameters = false,
parameterNames = false,
rangeVariableTypes = false,
},
analyses = {
-- NOTE: To temporarily enable disabled analyzers for specific debugging:
-- :lua vim.lsp.stop_client(vim.lsp.get_clients({name = "gopls"}))
-- Then edit this file and save, LSP will restart with new settings

-- Essential analyzers for catching common issues
nilness = true, -- Check for nil pointer dereferences
unusedparams = true, -- Find unused function parameters
unusedwrite = true, -- Find unused writes to variables
useany = true, -- Suggest using 'any' instead of 'interface{}'
unreachable = true, -- Find unreachable code
unusedresult = true, -- Check for unused results of calls to certain functions

-- Helpful but not critical (enable as needed)
simplifyslice = true, -- Simplify slice expressions
simplifyrange = true, -- Simplify range loops
simplifycompositelit = true, -- Simplify composite literals

-- Performance-intensive analyzers (disabled for better performance)
shadow = false, -- Check for shadowed variables (can be slow)
printf = false, -- Check printf-style functions (can be slow)
structtag = false, -- Check struct tags (can be slow)
-- fieldalignment = false, -- Check struct field alignment (very slow)
-- unusedvariable = false, -- Can be slow on large codebases

-- Less commonly needed analyzers (disabled)
modernize = false,
stylecheck = false,
appends = false,
asmdecl = false,
assign = false,
atomic = false,
atomicalign = false,
bools = false,
buildtag = false,
cgocall = false,
composite = false,
composites = false,
contextcheck = false,
copylocks = false,
deba = false,
deepequalerrors = false,
defers = false,
deprecated = false,
directive = false,
embed = false,
errorsas = false,
fillreturns = false,
framepointer = false,
gofix = false,
hostport = false,
httpresponse = false,
ifaceassert = false,
infertypeargs = false,
loopclosure = false,
lostcancel = false,
nilfunc = false,
nonewvars = false,
noresultvalues = false,
shift = false,
sigchanyzer = false,
slog = false,
sortslice = false,
stdmethods = false,
stdversion = false,
stringintconv = false,
testinggoroutine = false,
tests = false,
timeformat = false,
unmarshal = false,
unsafeptr = false,
unusedfunc = false,
unusedvariable = false,
waitgroup = false,
yield = false,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
semanticTokens = false,
},
},
}
45 changes: 45 additions & 0 deletions bootstrap/config_dirs/nvim/lsp/lua-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = {
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
settings = {
Lua = {
diagnostics = {
disable = { "missing-fields" },
globals = {
"vim",
"Snacks",
},
},
hint = {
enable = true,
setType = false,
paramType = true,
paramName = "Disable",
semicolon = "Disable",
arrayIndex = "Disable",
},
},
},
-- capabilities = vim.tbl_deep_extend(
-- "force",
-- {},
-- vim.lsp.protocol.make_client_capabilities(),
-- blink.get_lsp_capabilities(),
-- {
-- fileOperations = {
-- didRename = true,
-- willRename = true,
-- },
-- }
-- ),
}
46 changes: 46 additions & 0 deletions bootstrap/config_dirs/nvim/lua/core/autocmds.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
local map = function(keys, func, desc)
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
end

map("gl", vim.diagnostic.open_float, "Open Diagnostic Float")
map("K", vim.lsp.buf.hover, "Hover Documentation")
map("gs", vim.lsp.buf.signature_help, "Signature Documentation")
map("gD", vim.lsp.buf.declaration, "Goto Declaration")

map("<leader>v", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>", "Goto Definition in Vertical Split")

local wk = require("which-key")
wk.add({
{ "<leader>la", vim.lsp.buf.code_action, desc = "Code Action" },
{ "<leader>lA", vim.lsp.buf.range_code_action, desc = "Range Code Actions" },
{ "<leader>ls", vim.lsp.buf.signature_help, desc = "Display Signature Information" },
{ "<leader>lr", vim.lsp.buf.rename, desc = "Rename all references" },
{ "<leader>lf", vim.lsp.buf.format, desc = "Format" },
{
"<leader>lc",
require("core.utils").copyFilePathAndLineNumber,
desc = "Copy File Path and Line Number",
},
{ "<leader>Wa", vim.lsp.buf.add_workspace_folder, desc = "Workspace Add Folder" },
{ "<leader>Wr", vim.lsp.buf.remove_workspace_folder, desc = "Workspace Remove Folder" },
{
"<leader>Wl",
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end,
desc = "Workspace List Folders",
},
})

local client = vim.lsp.get_client_by_id(event.data.client_id)
if client:supports_method(client, "textDocument/completion", event.bufbuf) then
vim.opt.completeopt = { "menu", "menuone", "noinsert", "fuzzy", "popup" }
vim.lsp.completion.enable(true, client.id, event.buf, { autotrigger = true })
vim.keymap.set("i", "<C-Space>", function()
vim.lsp.completion.get()
end)
end
end,
})
6 changes: 6 additions & 0 deletions bootstrap/config_dirs/nvim/lua/core/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require("core.options")
require("core.keymaps")
require("core.filetypes")
require("core.lazy")
require("core.lsp")
require("core.autocmds")
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
{ import = "user.plugins" },
{ import = "user.plugins.lsp" },
{ import = "plugins" },
{ import = "plugins.mason" },
}, {
install = {
colorscheme = { "gruvbox-material" },
Expand Down
Loading
Loading