Compare commits

...

19 commits

Author SHA1 Message Date
570fddee2d
feat(keys): avoid conflict between document symbol keybinds for
telescope
2024-09-18 03:05:43 -07:00
8e3bb627ba
feat: add back <C-d> and <C-u> auto-centering 2024-09-18 02:45:39 -07:00
6db1a249a6
feat(keys): reverts automatic centering on scroll 2024-09-18 02:30:32 -07:00
2543f97755
feat: add vimg wrapper script for quick git view 2024-09-18 01:31:22 -07:00
914cd10148
feat: add persistent undofile 2024-09-18 01:26:14 -07:00
b123800156
feat: add undotree 2024-09-18 01:23:24 -07:00
6f76853957
fix: correctly map scrolling and revert neogit keymaps 2024-09-18 01:21:02 -07:00
b7ec14467a
feat: increase fold level 2024-09-18 01:18:35 -07:00
82a9a5af6b
squash! feat: use floating neogit style 2024-09-18 01:14:39 -07:00
cd670638d1
feat: add settings to avoid life being ruined 2024-09-18 01:04:10 -07:00
c074ca3615
feat: enable some integrations for neogit 2024-09-18 01:00:47 -07:00
e935980efe
fix: use correct attribute for neogit popup 2024-09-18 00:58:05 -07:00
c90437651c
keys: add a ton of QoL keymappings 2024-09-18 00:55:54 -07:00
4a098743d2
fix: use treesitter folding correctly 2024-09-18 00:55:19 -07:00
ea8999a96c
keys: add a ton of telescope keymaps 2024-09-18 00:51:35 -07:00
63fa67dd6f
feat: use floating neogit style 2024-09-18 00:33:58 -07:00
266e176103
squash! chore: add funny comment xdxddxdxdxd 2024-09-18 00:33:32 -07:00
4b6e2de27a
feat: add cellular automaton plugin 2024-09-18 00:33:03 -07:00
3e1649bc6a
chore: add funny comment xdxddxdxdxd 2024-09-18 00:30:17 -07:00
7 changed files with 259 additions and 10 deletions

View file

@ -5,7 +5,9 @@ This is the Neovim configuration for all my NixOS and Nix enabled systems
blingful features like sidebars or fancy UI enhancements in favor of native
(neo)Vim, while still having everything useful you'd expect, like LSPs, file
explorer (`oil.nvim`), completions, advanced language tools, and QoL
enhancements.
enhancements. Additionally, a small wrapper script called `vimg` is provided in
`packages.${system}.vimg` which simply opens Neovim inside the `Neogit` UI.
This allows it to be used as a quick git TUI from the shell.
The central design goal is to prefer Vim whenever possible. The Vim text editor
is already incredibly powerful, and many plugins designed to emulate features

View file

@ -3,8 +3,17 @@
colorschemes.rose-pine.enable = true;
opts = {
# Global status/cmdline
laststatus = 3;
relativenumber = true;
number = true;
# sane defaults for tab/space
shiftwidth = 2;
tabstop = 4;
# Crank up fold level so tree-sitter doesn't fold everything
foldlevel = 15;
# Persistent undos across sessions
undofile = true;
};
}

View file

@ -23,6 +23,128 @@
desc = "Zen mode";
};
}
{
mode = "n";
action = ":%%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>";
key = "<leader>fs";
options = {
silent = true;
noremap = true;
desc = "Search and replace the word under the cursor globally and case-insensitively";
};
}
# center the screen when scrolling
{
mode = "n";
action = ":CellularAutomaton make_it_rain<CR>";
key = "<leader>kys";
options = {
silent = true;
noremap = true;
desc = "A mysterious surprise!";
};
}
{
mode = "n";
action = "nzzzv";
key = "n";
options = {
silent = true;
noremap = true;
desc = "Search next and center screen, reopening folds";
};
}
{
mode = "n";
action = "Nzzzv";
key = "N";
options = {
silent = true;
noremap = true;
desc = "Search previous and center screen, reopening folds";
};
}
# The greatest remap of all time -- the primeagen
{
mode = [
"n"
"v"
];
action = "\"_d";
key = "<leader>d";
options = {
silent = true;
noremap = true;
desc = "Delete without copying to register";
};
}
{
mode = [
"n"
"v"
];
action = "\"+y";
key = "<leader>y";
options = {
silent = true;
noremap = true;
desc = "Yank to system clipboard";
};
}
{
mode = "n";
action = "\"+Y";
key = "<leader>Y";
options = {
silent = true;
noremap = true;
desc = "Yank whole line to system clipboard";
};
}
{
mode = [
"n"
"v"
];
action = "\"+p";
key = "<leader>p";
options = {
silent = true;
noremap = true;
desc = "Put from system clipboard";
};
}
{
mode = [
"n"
"v"
];
action = "\"+P";
key = "<leader>P";
options = {
silent = true;
noremap = true;
desc = "Put from system clipboard";
};
}
{
mode = "n";
key = "<C-u>";
action = "<C-u>zz";
options = {
silent = true;
noremap = true;
};
}
{
mode = "n";
key = "<C-d>";
action = "<C-d>zz";
options = {
silent = true;
noremap = true;
};
}
{
action = "<cmd>Telescope find_files<CR>";
key = "<Leader>ff";
@ -65,7 +187,70 @@
options = {
silent = true;
noremap = true;
desc = "Go to definition";
desc = "Go to definition, or search through them (if multiple)";
};
}
{
action = "<cmd>lua require'telescope.builtin'.lsp_implementations{}<CR>";
key = "gr";
options = {
silent = true;
noremap = true;
desc = "Go to implementation";
};
}
{
action = "<cmd>lua require'telescope.builtin'.lsp_document_symbols{}<CR>";
key = "<leader>a";
options = {
silent = true;
noremap = true;
desc = "List and search through document symbols";
};
}
{
action = "<cmd>lua require'telescope.builtin'.lsp_workspace_symbols{}<CR>";
key = "<leader>fcs";
options = {
silent = true;
noremap = true;
desc = "List and search through workplace symbols";
};
}
{
action = "<cmd>lua require'telescope.builtin'.lsp_type_definitions{}<CR>";
key = "<leader>fct";
options = {
silent = true;
noremap = true;
desc = "List and search through type definitions";
};
}
{
action = "<cmd>lua require'telescope.builtin'.lsp_references{}<CR>";
key = "<leader>fcr";
options = {
silent = true;
noremap = true;
desc = "List and search through references";
};
}
{
action = "<cmd>lua require'telescope.builtin'.diagnostics{}<CR>";
key = "<leader>fcd";
options = {
silent = true;
noremap = true;
desc = "List and search through diagnostics";
};
}
{
action = "<cmd>lua require'telescope.builtin'.keymaps{}<CR>";
key = "<leader>fcd";
options = {
silent = true;
noremap = true;
desc = "Search through keymaps";
};
}
{
@ -169,12 +354,12 @@
};
}
{
action = ":Neogit commit<CR>";
action = ":Neogit kind=floating commit<CR>";
key = "<Leader>gc";
options = {
silent = true;
noremap = true;
desc = "Open commit menu";
desc = "Quickly open Neogit commit menu";
};
}
{
@ -431,9 +616,12 @@
}
{
action = ":Telescope yank_history<CR>";
key = "<Leader>p";
mode = "n";
options.desc = "Look through yank history with telescope.";
key = "<Leader>fp";
mode = [
"n"
"v"
];
options.desc = "Search through yank history with telescope.";
}
{
action = '':Oil<CR>'';
@ -553,5 +741,13 @@
desc = "Toggle autoformat in buffer";
};
}
{
action = ":UndotreeToggle<CR>";
key = "<Leader>u";
options = {
noremap = true;
desc = "Open undotree";
};
}
];
}

View file

@ -25,6 +25,7 @@
};
trouble.enable = true;
barbecue.enable = true;
undotree.enable = true;
lualine = {
enable = true;
settings = {
@ -80,10 +81,22 @@
};
neogit = {
enable = true;
settings.graph_style = "unicode";
settings = {
graph_style = "unicode";
integrations = {
diffview = true;
telescope = true;
};
};
};
# Language specific tools
diffview.enable = true;
# The greatest QoL plugin of all time. Renders codeblocks, formatting, etc
# in LSP popup buffers too. GUI users will never flex on you with their
# typesetting again!
markdown-preview.enable = true;
# Language specific tools
ts-autotag.enable = true;
};
extraPlugins = [
@ -99,5 +112,9 @@
name = "lsp-progress.nvim";
src = inputs.lsp-progress;
})
(pkgs.vimUtils.buildVimPlugin {
name = "cellular-automaton.nvim";
src = inputs.cellular-automaton;
})
];
}

View file

@ -2,10 +2,10 @@
plugins = {
treesitter = {
enable = true;
folding = true;
settings = {
highlight.enable = true;
indent.enable = true;
folding.enable = true;
};
};
treesitter-context.enable = true;

View file

@ -1,5 +1,21 @@
{
"nodes": {
"cellular-automaton": {
"flake": false,
"locked": {
"lastModified": 1719777869,
"narHash": "sha256-nIv7ISRk0+yWd1lGEwAV6u1U7EFQj/T9F8pU6O0Wf0s=",
"owner": "Eandrju",
"repo": "cellular-automaton.nvim",
"rev": "11aea08aa084f9d523b0142c2cd9441b8ede09ed",
"type": "github"
},
"original": {
"owner": "Eandrju",
"repo": "cellular-automaton.nvim",
"type": "github"
}
},
"devshell": {
"inputs": {
"nixpkgs": [
@ -314,6 +330,7 @@
},
"root": {
"inputs": {
"cellular-automaton": "cellular-automaton",
"flake-parts": "flake-parts",
"haskell-tools": "haskell-tools",
"lsp-progress": "lsp-progress",

View file

@ -26,6 +26,10 @@
url = "github:linrongbin16/lsp-progress.nvim";
flake = false;
};
cellular-automaton = {
url = "github:Eandrju/cellular-automaton.nvim";
flake = false;
};
};
outputs =
@ -69,6 +73,10 @@
packages = {
default = nvim;
vimg = pkgs.writeScriptBin "vimg" ''
#!/bin/sh
${nvim}/bin/nvim +Neogit
'';
};
};
};