refactor + add some QoL plugins
This commit is contained in:
parent
526e41767c
commit
f42c1c8fdf
15 changed files with 113 additions and 138 deletions
|
@ -1,54 +1,57 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
# General configuration.
|
# General Configuration
|
||||||
./keymaps.nix
|
./keymaps.nix
|
||||||
./options.nix
|
./options.nix
|
||||||
|
|
||||||
# Themes
|
# Themes & Appearance
|
||||||
./plugins/themes/default.nix
|
./plugins/themes/default.nix
|
||||||
|
|
||||||
# Completion
|
# Plugin Collections
|
||||||
|
./plugins/collections/mini.nix
|
||||||
|
./plugins/collections/snacks.nix
|
||||||
|
|
||||||
|
# Completion & AI Assistancee
|
||||||
./plugins/cmp/cmp.nix
|
./plugins/cmp/cmp.nix
|
||||||
./plugins/cmp/copilot.nix
|
./plugins/cmp/copilot.nix
|
||||||
|
./plugins/cmp/copilot-chat.nix
|
||||||
|
|
||||||
# Debug Adapter Protocol
|
# Debugging (DAP)
|
||||||
./plugins/dap/dap.nix
|
./plugins/dap/dap.nix
|
||||||
./plugins/dap/dap-ui.nix
|
./plugins/dap/dap-ui.nix
|
||||||
./plugins/dap/dap-virtual-text.nix
|
./plugins/dap/dap-virtual-text.nix
|
||||||
./plugins/dap/dap-python.nix
|
./plugins/dap/dap-python.nix
|
||||||
|
|
||||||
# Editor plugins and configurations
|
# Editor Enhancements
|
||||||
./plugins/editor/buffers.nix
|
|
||||||
./plugins/editor/commentary.nix
|
./plugins/editor/commentary.nix
|
||||||
./plugins/editor/harpoon.nix
|
./plugins/editor/harpoon.nix
|
||||||
./plugins/editor/mini.nix
|
|
||||||
./plugins/editor/sessions.nix
|
./plugins/editor/sessions.nix
|
||||||
./plugins/editor/smart-splits.nix
|
./plugins/editor/smart-splits.nix
|
||||||
./plugins/editor/surround.nix
|
./plugins/editor/surround.nix
|
||||||
./plugins/editor/treesitter.nix
|
./plugins/editor/treesitter.nix
|
||||||
|
|
||||||
# UI plugins
|
# User Interface Plugins
|
||||||
./plugins/ui/lualine.nix
|
./plugins/ui/lualine.nix
|
||||||
./plugins/ui/nvim-tree.nix
|
./plugins/ui/nvim-tree.nix
|
||||||
./plugins/ui/web-devicons.nix
|
./plugins/ui/web-devicons.nix
|
||||||
./plugins/ui/whichkey.nix
|
./plugins/ui/whichkey.nix
|
||||||
|
|
||||||
# LSP and formatting
|
# LSP and Formatting
|
||||||
./plugins/lsp/conform.nix
|
./plugins/lsp/conform.nix
|
||||||
./plugins/lsp/lsp.nix
|
./plugins/lsp/lsp.nix
|
||||||
|
|
||||||
# Git
|
# Git Integration
|
||||||
./plugins/git/fugitive.nix
|
./plugins/git/fugitive.nix
|
||||||
./plugins/git/gitsigns.nix
|
./plugins/git/gitsigns.nix
|
||||||
|
|
||||||
# Utils
|
# Markdown, Notes & Productivity
|
||||||
./plugins/utils/copilot-chat.nix
|
./plugins/notes/markdown-preview.nix
|
||||||
./plugins/utils/markdown-preview.nix
|
./plugins/notes/render-markdown.nix
|
||||||
./plugins/utils/render-markdown.nix
|
./plugins/notes/todo-comments.nix
|
||||||
|
|
||||||
|
# Utilities
|
||||||
./plugins/utils/oil.nix
|
./plugins/utils/oil.nix
|
||||||
./plugins/utils/telescope.nix
|
./plugins/utils/telescope.nix
|
||||||
./plugins/utils/todo-comments.nix
|
|
||||||
./plugins/utils/vimtex.nix
|
./plugins/utils/vimtex.nix
|
||||||
./plugins/utils/vimwiki.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
{ # prefix: find
|
{
|
||||||
mode = ["n"];
|
mode = ["n"];
|
||||||
key = "<leader>f";
|
key = "<leader>f";
|
||||||
action = "<NOP>";
|
action = "<NOP>";
|
||||||
|
@ -19,5 +19,32 @@
|
||||||
desc = "+find";
|
desc = "+find";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<PageUp>";
|
||||||
|
action = "<C-u>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<PageDown>";
|
||||||
|
action = "<C-d>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<Del>";
|
||||||
|
action = "zz";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
19
config/plugins/collections/mini.nix
Normal file
19
config/plugins/collections/mini.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{...}:{
|
||||||
|
plugins.mini = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Extend and create a/i textobjects.
|
||||||
|
modules.ai = {
|
||||||
|
# Number of lines within which textobject is searched
|
||||||
|
n_lines = 50;
|
||||||
|
|
||||||
|
# How to search for object
|
||||||
|
search_method = "cover_or_next";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Go forward/backward with square brackets.
|
||||||
|
modules.bracketed = { };
|
||||||
|
|
||||||
|
modules.align = { };
|
||||||
|
};
|
||||||
|
}
|
41
config/plugins/collections/snacks.nix
Normal file
41
config/plugins/collections/snacks.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{...}:{
|
||||||
|
plugins.snacks = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
bufdelete = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
scroll = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>q";
|
||||||
|
action = {
|
||||||
|
__raw = "function() require('snacks').bufdelete() end";
|
||||||
|
};
|
||||||
|
options = {
|
||||||
|
desc = "Close current buffer";
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>Q";
|
||||||
|
action = {
|
||||||
|
__raw = "function() require('snacks').bufdelete.other() end";
|
||||||
|
};
|
||||||
|
options = {
|
||||||
|
desc = "Close other buffers";
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,59 +0,0 @@
|
||||||
{...}: {
|
|
||||||
plugins.bufdelete = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
keymaps = [
|
|
||||||
{
|
|
||||||
# buffer prefix
|
|
||||||
mode = "n";
|
|
||||||
key = "<leader>b";
|
|
||||||
action = "<Nop>";
|
|
||||||
options = {
|
|
||||||
desc = "+buffer";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# goto next buffer
|
|
||||||
mode = ["n"];
|
|
||||||
key = "]b";
|
|
||||||
action = ":bnext<cr>";
|
|
||||||
options = {
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# goto previous buffer
|
|
||||||
mode = ["n"];
|
|
||||||
key = "[b";
|
|
||||||
action = ":bprevious<cr>";
|
|
||||||
options = {
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# delete buffer
|
|
||||||
mode = ["n"];
|
|
||||||
key = "<leader>bd";
|
|
||||||
action = ":Bdelete<cr>";
|
|
||||||
options = {
|
|
||||||
desc = "bdelete";
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# wipeout buffer
|
|
||||||
mode = ["n"];
|
|
||||||
key = "<leader>bw";
|
|
||||||
action = ":Bwipeout<cr>";
|
|
||||||
options = {
|
|
||||||
desc = "bwipeout";
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
{...}:{
|
|
||||||
plugins.mini = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Extend and create a/i textobjects.
|
|
||||||
modules.ai = {
|
|
||||||
# Module mappings.
|
|
||||||
mappings = {
|
|
||||||
# Main textobject prefixes
|
|
||||||
around = "a";
|
|
||||||
inside = "i";
|
|
||||||
|
|
||||||
# Next/last variants
|
|
||||||
around_next = "an";
|
|
||||||
inside_next = "in";
|
|
||||||
around_last = "al";
|
|
||||||
inside_last = "il";
|
|
||||||
|
|
||||||
# Move cursor to corresponding edge of `a` textobject
|
|
||||||
goto_left = "g[";
|
|
||||||
goto_right = "g]";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Number of lines within which textobject is searched
|
|
||||||
n_lines = 50;
|
|
||||||
|
|
||||||
# How to search for object
|
|
||||||
search_method = "cover_or_next";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -18,25 +18,4 @@
|
||||||
# Install all grammar packages.
|
# Install all grammar packages.
|
||||||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars;
|
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;
|
|
||||||
|
|
||||||
# Go to the next / previous usage.
|
|
||||||
keymaps = {
|
|
||||||
gotoNextUsage = "]u";
|
|
||||||
gotoPreviousUsage = "[u";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,6 @@
|
||||||
# Configure keymaps for our diagnostics.
|
# Configure keymaps for our diagnostics.
|
||||||
diagnostic = {
|
diagnostic = {
|
||||||
"<C-W>d" = "open_float"; # Show diagnostics in floating window.
|
"<C-W>d" = "open_float"; # Show diagnostics in floating window.
|
||||||
"[d" = "goto_prev"; # Jump to previous diagnostic.
|
|
||||||
"]d" = "goto_next"; # Jump to next diagnostic.
|
|
||||||
};
|
};
|
||||||
# Configure keymaps for our lspbuf.
|
# Configure keymaps for our lspbuf.
|
||||||
lspBuf = {
|
lspBuf = {
|
||||||
|
@ -65,7 +63,7 @@
|
||||||
# Renames all references to the symbol under the cursor.
|
# Renames all references to the symbol under the cursor.
|
||||||
"<leader>r" = {
|
"<leader>r" = {
|
||||||
action = "rename";
|
action = "rename";
|
||||||
desc = "Rename";
|
desc = "Rename reference";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
key = "<leader>n";
|
key = "<leader>n";
|
||||||
action = "<cmd>NvimTreeToggle<cr>";
|
action = "<cmd>NvimTreeToggle<cr>";
|
||||||
options = {
|
options = {
|
||||||
desc = "Toggle NvimTree";
|
desc = "Toggle file explorer";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
key = "<leader>e";
|
key = "<leader>e";
|
||||||
action = "<cmd>NvimTreeFocus<cr>";
|
action = "<cmd>NvimTreeFocus<cr>";
|
||||||
options = {
|
options = {
|
||||||
desc = "Focus NvimTree";
|
desc = "Focus file explorer";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
preset = "modern";
|
preset = "modern";
|
||||||
|
icons = {
|
||||||
|
mappings = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{...}: {
|
|
||||||
plugins.vimwiki = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue