Compare commits

..

No commits in common. "48b93a848e5132c007cfbd0075f264a7719d75a8" and "ef436dbbbabe11d3a36707335350b1b1a36b7d1f" have entirely different histories.

6 changed files with 260 additions and 63 deletions

View file

@ -11,13 +11,15 @@
./plugins/collections/mini.nix ./plugins/collections/mini.nix
./plugins/collections/snacks.nix ./plugins/collections/snacks.nix
# LSP and Formatting
./plugins/lsp/conform.nix
./plugins/lsp/lsp.nix
# Completion & AI Assistancee # Completion & AI Assistancee
./plugins/cmp/cmp.nix ./plugins/cmp/cmp.nix
# Debugging (DAP)
./plugins/dap/dap.nix
./plugins/dap/dap-ui.nix
./plugins/dap/dap-virtual-text.nix
./plugins/dap/dap-python.nix
# Editor Enhancements # Editor Enhancements
./plugins/editor/commentary.nix ./plugins/editor/commentary.nix
./plugins/editor/harpoon.nix ./plugins/editor/harpoon.nix
@ -32,6 +34,10 @@
./plugins/ui/web-devicons.nix ./plugins/ui/web-devicons.nix
./plugins/ui/whichkey.nix ./plugins/ui/whichkey.nix
# LSP and Formatting
./plugins/lsp/conform.nix
./plugins/lsp/lsp.nix
# Git Integration # Git Integration
./plugins/git/fugitive.nix ./plugins/git/fugitive.nix
./plugins/git/gitsigns.nix ./plugins/git/gitsigns.nix

View file

@ -6,76 +6,47 @@
# Options provided to the require('cmp').setup function. # Options provided to the require('cmp').setup function.
settings = { settings = {
# Disable autocompletion by default
completion.autocomplete = false;
# The sources to use # The sources to use
sources = [ sources = [
# Language Server Protocol { # Language Server Protocol
{ name = "nvim_lsp"; } name = "nvim_lsp";
}
# Buffer Words { # Buffer Words
{ name = "buffer"; } name = "buffer";
}
# Filesystem paths { # Filesystem paths
{ name = "path"; } name = "path";
}
# Markdown { # Markdown
{ name = "render_markdown"; } name = "render_markdown";
}
# VimTex { # VimTex
{ name = "vimtex"; } name = "vimtex";
}
# Neorg { # Neorg
{ name = "neorg"; } name = "neorg";
}
]; ];
# Key mappings for the completion menu. # Key mappings for the completion menu.
mapping = { mapping = {
# Confirm candidate on TAB immediately when there's only one completion entry "<esc>" =
"<Tab>" = /* lua */ '' # Lua
cmp.mapping(function(fallback) "cmp.mapping.close()";
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) "<Down>" =
# Lua
-- When the selection menu is open select the next item "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
if cmp.visible() then "<Up>" =
cmp.select_next_item({behavior = cmp.SelectBehavior.Select}) # Lua
-- Ensure we are mid word "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
elseif col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil then "<cr>" =
-- Open the selection menu # Lua
cmp.complete() "cmp.mapping.confirm({ select = true })";
-- Autocomplete when there is only 1 selection available
if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
end
-- Select the firt item
cmp.select_next_item({behavior = cmp.SelectBehavior.Select})
-- Keep regular functionality of tab
else
fallback()
end
end, {'i', 's'})
'';
# Confirm selection
"<CR>" = /* lua */ ''
cmp.mapping.confirm({ select = true })
'';
# Select the next item in the menu
"<Down>" = /* lua */ ''
cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})
'';
# Select the prev item in the menu
"<Up>" = /* lua */ ''
cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})
'';
# Exit the completion menu
"<esc>" = /* lua */ ''
cmp.mapping.close()
'';
}; };
}; };
}; };

View 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";
};
}
];
}

View file

@ -0,0 +1,19 @@
{...}: {
plugins.dap-ui = {
enable = true;
};
keymaps = [
{
mode = ["n"];
key = "<leader>du";
action = {
__raw = "require('dapui').toggle";
};
options = {
silent = true;
desc = "Toggle UI";
};
}
];
}

View file

@ -0,0 +1,5 @@
{ ... }: {
plugins.dap-virtual-text = {
enable = true;
};
}

143
config/plugins/dap/dap.nix Normal file
View 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"];
key = "<leader>dc";
action = "<cmd>DapContinue<cr>";
options = {
silent = true;
};
}
{
mode = ["n"];
key = "<leader>dq";
action = "<cmd>DapDisconnect<cr>";
options = {
silent = true;
};
}
{
mode = ["n"];
key = "<leader>dn";
action = "<cmd>DapNew<cr>";
options = {
silent = true;
};
}
{
mode = ["n"];
key = "<leader>dQ";
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;
};
}
];
}