Compare commits
2 commits
ef436dbbba
...
48b93a848e
| Author | SHA1 | Date | |
|---|---|---|---|
| 48b93a848e | |||
| b99f7b5386 |
6 changed files with 63 additions and 260 deletions
|
|
@ -11,15 +11,13 @@
|
|||
./plugins/collections/mini.nix
|
||||
./plugins/collections/snacks.nix
|
||||
|
||||
# LSP and Formatting
|
||||
./plugins/lsp/conform.nix
|
||||
./plugins/lsp/lsp.nix
|
||||
|
||||
# Completion & AI Assistancee
|
||||
./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
|
||||
./plugins/editor/commentary.nix
|
||||
./plugins/editor/harpoon.nix
|
||||
|
|
@ -34,10 +32,6 @@
|
|||
./plugins/ui/web-devicons.nix
|
||||
./plugins/ui/whichkey.nix
|
||||
|
||||
# LSP and Formatting
|
||||
./plugins/lsp/conform.nix
|
||||
./plugins/lsp/lsp.nix
|
||||
|
||||
# Git Integration
|
||||
./plugins/git/fugitive.nix
|
||||
./plugins/git/gitsigns.nix
|
||||
|
|
|
|||
|
|
@ -6,47 +6,76 @@
|
|||
|
||||
# Options provided to the require('cmp').setup function.
|
||||
settings = {
|
||||
# Disable autocompletion by default
|
||||
completion.autocomplete = false;
|
||||
|
||||
# The sources to use
|
||||
sources = [
|
||||
{ # Language Server Protocol
|
||||
name = "nvim_lsp";
|
||||
}
|
||||
# Language Server Protocol
|
||||
{ name = "nvim_lsp"; }
|
||||
|
||||
{ # Buffer Words
|
||||
name = "buffer";
|
||||
}
|
||||
# Buffer Words
|
||||
{ name = "buffer"; }
|
||||
|
||||
{ # Filesystem paths
|
||||
name = "path";
|
||||
}
|
||||
# Filesystem paths
|
||||
{ name = "path"; }
|
||||
|
||||
{ # Markdown
|
||||
name = "render_markdown";
|
||||
}
|
||||
# Markdown
|
||||
{ name = "render_markdown"; }
|
||||
|
||||
{ # VimTex
|
||||
name = "vimtex";
|
||||
}
|
||||
# VimTex
|
||||
{ name = "vimtex"; }
|
||||
|
||||
{ # Neorg
|
||||
name = "neorg";
|
||||
}
|
||||
# Neorg
|
||||
{ name = "neorg"; }
|
||||
];
|
||||
|
||||
# Key mappings for the completion menu.
|
||||
mapping = {
|
||||
"<esc>" =
|
||||
# Lua
|
||||
"cmp.mapping.close()";
|
||||
"<Down>" =
|
||||
# Lua
|
||||
"cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
|
||||
"<Up>" =
|
||||
# Lua
|
||||
"cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
|
||||
"<cr>" =
|
||||
# Lua
|
||||
"cmp.mapping.confirm({ select = true })";
|
||||
# Confirm candidate on TAB immediately when there's only one completion entry
|
||||
"<Tab>" = /* lua */ ''
|
||||
cmp.mapping(function(fallback)
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
|
||||
-- When the selection menu is open select the next item
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item({behavior = cmp.SelectBehavior.Select})
|
||||
-- Ensure we are mid word
|
||||
elseif col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil then
|
||||
-- Open the selection menu
|
||||
cmp.complete()
|
||||
-- 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()
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
{ ... }: {
|
||||
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";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{...}: {
|
||||
plugins.dap-ui = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<leader>du";
|
||||
action = {
|
||||
__raw = "require('dapui').toggle";
|
||||
};
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle UI";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }: {
|
||||
plugins.dap-virtual-text = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
{...}: {
|
||||
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;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue