Compare commits
2 commits
7dd9c63f32
...
c2227b86a2
Author | SHA1 | Date | |
---|---|---|---|
c2227b86a2 | |||
a6f234cc57 |
12 changed files with 310 additions and 25 deletions
|
@ -10,6 +10,12 @@
|
|||
# Completion
|
||||
./plugins/cmp/cmp.nix
|
||||
|
||||
# Debug Adapter Protocol
|
||||
./plugins/dap/dap.nix
|
||||
./plugins/dap/dap-ui.nix
|
||||
./plugins/dap/dap-virtual-text.nix
|
||||
./plugins/dap/dap-python.nix
|
||||
|
||||
# Editor plugins and configurations
|
||||
./plugins/editor/buffers.nix
|
||||
./plugins/editor/comment.nix
|
||||
|
|
53
config/plugins/dap/dap-python.nix
Normal file
53
config/plugins/dap/dap-python.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{ ... }: {
|
||||
plugins.dap-python = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>dP";
|
||||
action = "<NOP>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "+python";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dPm";
|
||||
action = {
|
||||
__raw = "require('dap-python').test_method";
|
||||
};
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Test method";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dPc";
|
||||
action = {
|
||||
__raw = "require('dap-python').test_class";
|
||||
};
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Test Class";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["v"];
|
||||
key = "<leader>dPs";
|
||||
action = {
|
||||
__raw = "require('dap-python').debug_selection";
|
||||
};
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Debug selection";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
18
config/plugins/dap/dap-ui.nix
Normal file
18
config/plugins/dap/dap-ui.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{...}: {
|
||||
plugins.dap-ui = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>du";
|
||||
action = {
|
||||
__raw = "require('dapui').toggle";
|
||||
};
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle UI";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
5
config/plugins/dap/dap-virtual-text.nix
Normal file
5
config/plugins/dap/dap-virtual-text.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
plugins.dap-virtual-text = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
143
config/plugins/dap/dap.nix
Normal file
143
config/plugins/dap/dap.nix
Normal file
|
@ -0,0 +1,143 @@
|
|||
{...}: {
|
||||
plugins.dap = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
# Prefix: dap
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>d";
|
||||
action = "<NOP>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "+dap";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# Session management:
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>dc";
|
||||
action = "<cmd>DapContinue<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dd";
|
||||
action = "<cmd>DapDisconnect<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dn";
|
||||
action = "<cmd>DapNew<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dt";
|
||||
action = "<cmd>DapTerminate<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# Stepping:
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dr";
|
||||
action = "<cmd>DapRestartFrame<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>di";
|
||||
action = "<cmd>DapStepInto<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dO";
|
||||
action = "<cmd>DapStepOut<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>do";
|
||||
action = "<cmd>DapStepOver<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dp";
|
||||
action = "<cmd>DapPause<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# Repl:
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dE";
|
||||
action = "<cmd>DapEval<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dR";
|
||||
action = "<cmd>DapToggleRepl<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# Breakpoints:
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>dB";
|
||||
action = "<cmd>DapClearBreakpoints<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>db";
|
||||
action = "<cmd>DapToggleBreakpoint<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
{
|
||||
# goto next buffer
|
||||
mode = ["n"];
|
||||
key = "<leader>bn";
|
||||
key = "]b";
|
||||
action = ":bnext<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
@ -27,7 +27,7 @@
|
|||
{
|
||||
# goto previous buffer
|
||||
mode = ["n"];
|
||||
key = "<leader>bp";
|
||||
key = "[b";
|
||||
action = ":bprevious<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
|
|
@ -19,25 +19,23 @@
|
|||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars;
|
||||
};
|
||||
|
||||
# Refactor modules for nvim-treesitter
|
||||
plugins.treesitter-refactor = {
|
||||
enable = true;
|
||||
|
||||
# Highlights definitions and usages.
|
||||
highlightDefinitions = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Provides "go to usage"
|
||||
navigation = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
gotoNextUsage = "<leader>n";
|
||||
gotoPreviousUsage = "<leader>N";
|
||||
};
|
||||
};
|
||||
|
||||
smartRename = {
|
||||
enable = true;
|
||||
# Go to the next / previous usage.
|
||||
keymaps = {
|
||||
smartRename = "<leader>r";
|
||||
gotoNextUsage = "]u";
|
||||
gotoPreviousUsage = "[u";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g<cr>";
|
||||
key = "<leader>gL";
|
||||
action = "<cmd>LazyGit<cr>";
|
||||
options = {
|
||||
desc = "Open LazyGit";
|
||||
|
@ -16,7 +16,9 @@
|
|||
{
|
||||
mode = "n";
|
||||
key = "<leader>glr";
|
||||
action = "<cmd>lua require(\"telescope\").extensions.lazygit.lazygit()<cr>";
|
||||
action = {
|
||||
__raw = "require('telescope').extensions.lazygit.lazygit";
|
||||
};
|
||||
options = {
|
||||
desc = "List repositories";
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
# Keymaps for conform.nvim
|
||||
keymaps = [
|
||||
{
|
||||
mode = "";
|
||||
mode = ["n"];
|
||||
key = "<leader>F";
|
||||
action.__raw = ''
|
||||
function()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{...}: {
|
||||
plugins.lsp = {
|
||||
enable = true; # Enable neovim's built-in LSP.
|
||||
inlayHints = true;
|
||||
|
||||
# Configure our language servers
|
||||
servers = {
|
||||
|
@ -53,7 +54,66 @@
|
|||
gi = "implementation"; # Lists all the implementations¹
|
||||
gt = "type_definition"; # Jumps to the definition of the type¹
|
||||
# ¹ for the symbol under the cursor
|
||||
|
||||
# Renames all references to the symbol under the cursor.
|
||||
"<leader>r" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
};
|
||||
|
||||
# Extra keymaps to register when an LSP is attached
|
||||
extra = [
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>l";
|
||||
action = "<NOP>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "+lsp";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>lc";
|
||||
action = "<cmd>LspStop<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Stop server";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>ls";
|
||||
action = "<cmd>LspStart<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Start server";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>lr";
|
||||
action = "<cmd>LspRestart<cr>";
|
||||
options = {
|
||||
desc = "Restart server";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>fd";
|
||||
action = {
|
||||
__raw = "require('telescope.builtin').lsp_definitions";
|
||||
};
|
||||
options = {
|
||||
desc = "Find definitions";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,6 +26,15 @@
|
|||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>n";
|
||||
action = "<cmd>NvimTreeToggle<cr>";
|
||||
options = {
|
||||
desc = "Toggle NvimTree";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>e";
|
||||
|
|
|
@ -9,16 +9,7 @@
|
|||
# Prefixes, No operation.
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>s";
|
||||
action = "<Nop>";
|
||||
options = {
|
||||
desc = "+search";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>g";
|
||||
action = "<Nop>";
|
||||
options = {
|
||||
|
@ -27,7 +18,7 @@
|
|||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
mode = ["n"];
|
||||
key = "<leader>gl";
|
||||
action = "<Nop>";
|
||||
options = {
|
||||
|
@ -36,7 +27,7 @@
|
|||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
mode = ["n"];
|
||||
key = "<leader>gt";
|
||||
action = "<Nop>";
|
||||
options = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue