-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
305 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ | |
}; | ||
globals = { | ||
mapleader = " "; | ||
maplocalleader = ","; | ||
maplocalleader = " "; | ||
# maplocalleader = ","; | ||
}; | ||
}; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
home-manager/server/shell/nvim/plugins/coding/completion/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
imports = [ | ||
#./autopairs.nix | ||
./cmp.nix | ||
#./copilot.nix | ||
#./lspkind.nix | ||
#./luasnip.nix | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
programs.nixvim = { | ||
plugins.dap = { | ||
enable = true; | ||
extensions.dap-ui = { | ||
enable = true; | ||
}; | ||
}; | ||
keymaps = [ | ||
{ | ||
mode = ["n"]; | ||
key = "<leader>db"; | ||
action = "<cmd>DapToggleBreakpoint<cr>"; | ||
options = { | ||
silent = true; | ||
desc = "Toggle Breakpoint"; | ||
}; | ||
} | ||
{ | ||
mode = ["n"]; | ||
key = "<leader>dpr"; | ||
action.__raw = ''function() require("dap-python").test_method() end''; | ||
options = { | ||
silent = true; | ||
desc = "Toggle Breakpoint"; | ||
}; | ||
} | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
imports = [ | ||
./languages | ||
|
||
./completion | ||
|
||
./debug.nix | ||
./lsp.nix | ||
./none-ls.nix | ||
]; | ||
} |
6 changes: 6 additions & 0 deletions
6
home-manager/server/shell/nvim/plugins/coding/languages/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
imports = [ | ||
./nix.nix | ||
./python.nix | ||
]; | ||
} |
30 changes: 30 additions & 0 deletions
30
home-manager/server/shell/nvim/plugins/coding/languages/nix.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
programs.nixvim = { | ||
plugins = { | ||
lsp = { | ||
servers = { | ||
nil-ls.enable = true; | ||
nixd.enable = true; | ||
}; | ||
}; | ||
none-ls = { | ||
sources = { | ||
code_actions = { | ||
statix.enable = true; | ||
}; | ||
diagnostics = { | ||
statix.enable = true; | ||
}; | ||
formatting = { | ||
alejandra.enable = true; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
38 changes: 38 additions & 0 deletions
38
home-manager/server/shell/nvim/plugins/coding/languages/python.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
programs.nixvim = { | ||
plugins = { | ||
lsp = { | ||
servers = { | ||
pyright.enable = true; | ||
ruff.enable = true; | ||
}; | ||
}; | ||
none-ls = { | ||
sources = { | ||
diagnostics = { | ||
pylint.enable = true; | ||
}; | ||
formatting = { | ||
black = { | ||
enable = true; | ||
withArgs = '' | ||
{ | ||
extra_args = { "--fast" }, | ||
} | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
dap.extensions.dap-python = { | ||
enable = true; | ||
# package = pkgs.dap-python; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
programs.nixvim = { | ||
plugins = { | ||
lsp-format.enable = true; | ||
lsp = { | ||
enable = true; | ||
keymaps = { | ||
silent = true; | ||
lspBuf = { | ||
gd = { | ||
action = "definition"; | ||
desc = "Goto Definition"; | ||
}; | ||
gr = { | ||
action = "references"; | ||
desc = "Goto References"; | ||
}; | ||
gD = { | ||
action = "declaration"; | ||
desc = "Goto Declaration"; | ||
}; | ||
gI = { | ||
action = "implementation"; | ||
desc = "Goto Implementation"; | ||
}; | ||
gT = { | ||
action = "type_definition"; | ||
desc = "Type Definition"; | ||
}; | ||
K = { | ||
action = "hover"; | ||
desc = "Hover"; | ||
}; | ||
"<leader>cw" = { | ||
action = "workspace_symbol"; | ||
desc = "Workspace Symbol"; | ||
}; | ||
"<leader>cr" = { | ||
action = "rename"; | ||
desc = "Rename"; | ||
}; | ||
}; | ||
diagnostic = { | ||
"<leader>dl" = { | ||
action = "open_float"; | ||
desc = "Line Diagnostics"; | ||
}; | ||
"<leader>dn" = { | ||
action = "goto_next"; | ||
desc = "Next Diagnostic"; | ||
}; | ||
"<leader>dp" = { | ||
action = "goto_prev"; | ||
desc = "Previous Diagnostic"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
extraConfigLua = '' | ||
local cmp_lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() | ||
cmp_lsp_capabilities.textDocument.foldingRange = { | ||
dynamicRegistration = false, | ||
lineFoldingOnly = true | ||
} | ||
-- used to enable autocompletion (assign to every lsp server config) | ||
local language_servers = require("lspconfig").util.available_servers() | ||
for _, ls in ipairs(language_servers) do | ||
require('lspconfig')[ls].setup({ | ||
capabilities = cmp_lsp_capabilities, | ||
}) | ||
end | ||
-- -- list all LSPs from above | ||
-- local lsps = {${lib.concatMapStringsSep "," (x: ''"${x}"'') (lib.filter (server: config.programs.nixvim.plugins.lsp.servers."${server}".enable) (lib.attrNames config.programs.nixvim.plugins.lsp.servers))}} | ||
-- for i, v in ipairs(lsps) do | ||
-- lsps[i] = lsps[i]:gsub("-", "_") | ||
-- -- if v == "ruff-lsp" then | ||
-- -- lsps[i] = "ruff_lsp" | ||
-- -- elseif v == "lua-ls" then | ||
-- -- lsps[i] = "lua_ls" | ||
-- -- end | ||
-- end | ||
-- -- combinatination what been done in: | ||
-- -- joseans blog: https://www.josean.com/posts/how-to-setup-neovim-2024 (nvim-lspconfig section) | ||
-- -- and in this config: https://github.com/pete3n/nixvim-flake/blob/main/config/lsp.nix | ||
-- for _, lsp in pairs(lsps) do | ||
-- require("lspconfig")[lsp].setup({ | ||
-- capabilities = capabilities, | ||
-- }) | ||
-- end | ||
local _border = "rounded" | ||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( | ||
vim.lsp.handlers.hover, { | ||
border = _border | ||
} | ||
) | ||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( | ||
vim.lsp.handlers.signature_help, { | ||
border = _border | ||
} | ||
) | ||
vim.diagnostic.config{ | ||
float={border=_border} | ||
}; | ||
require('lspconfig.ui.windows').default_options = { | ||
border = _border | ||
} | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
programs.nixvim = { | ||
plugins.none-ls = { | ||
enable = true; | ||
enableLspFormat = true; | ||
updateInInsert = false; | ||
}; | ||
keymaps = [ | ||
{ | ||
mode = ["n" "v"]; | ||
key = "<leader>cf"; | ||
action = "<cmd>lua vim.lsp.buf.format()<cr>"; | ||
options = { | ||
silent = true; | ||
desc = "Format"; | ||
}; | ||
} | ||
]; | ||
}; | ||
} |
9 changes: 0 additions & 9 deletions
9
home-manager/server/shell/nvim/plugins/completion/default.nix
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.