authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-27 19:12:01-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-27 19:12:01-07:00
log926f53011d593219726d6432324071a2d589df96
treea2f0fed87716443db0f49eb122fd04ab0f3a9af4
parent73902bf7006a8aef3954708d96a19c79764ef30c

fun neovim things


3 files changed, 95 insertions(+), 37 deletions(-)

modules/neovim/default.nix+38-18
...@@ -1,9 +1,5 @@...@@ -1,9 +1,5 @@
1{ config, lib, ... }:
1{2{
2 config,
3 lib,
4 host,
5 ...
6}: {
7 # based on default options from upstream:3 # based on default options from upstream:
8 # https://github.com/NotAShelf/nvf/blob/main/configuration.nix4 # https://github.com/NotAShelf/nvf/blob/main/configuration.nix
9 #5 #
...@@ -45,6 +41,10 @@...@@ -45,6 +41,10 @@
45 # https://github.com/onsails/lspkind.nvim41 # https://github.com/onsails/lspkind.nvim
46 lspkind.enable = config.vim.autocomplete.blink-cmp.enable;42 lspkind.enable = config.vim.autocomplete.blink-cmp.enable;
47 };43 };
44 treesitter = {
45 enable = true;
46 addDefaultGrammars = true;
47 };
48 debugger = {48 debugger = {
49 nvim-dap = {49 nvim-dap = {
50 enable = true;50 enable = true;
...@@ -57,17 +57,17 @@...@@ -57,17 +57,17 @@
57 enableExtraDiagnostics = true;57 enableExtraDiagnostics = true;
5858
59 # sort-lines: on59 # sort-lines: on
60 assembly.enable = true;
61 bash.enable = true;60 bash.enable = true;
62 clang.enable = true;61 clang.enable = true;
63 css.enable = true;62 css.enable = true;
64 html.enable = true;63 html.enable = true;
64 markdown.enable = true;
65 nix.enable = true;65 nix.enable = true;
66 python.enable = true;
66 rust.crates.enable = true;67 rust.crates.enable = true;
67 rust.enable = true;68 rust.enable = true;
68 ts.enable = true;69 ts.enable = true;
69 zig.enable = true;70 zig.enable = true;
70 markdown.enable = true;
71 # sort-lines: off71 # sort-lines: off
7272
73 nix.format.type = "nixfmt"; # looks so much nicer73 nix.format.type = "nixfmt"; # looks so much nicer
...@@ -107,19 +107,24 @@...@@ -107,19 +107,24 @@
107 bigfile.enable = true;107 bigfile.enable = true;
108 explorer.replace_netrw = true;108 explorer.replace_netrw = true;
109 dashboard = {109 dashboard = {
110 sections = [110 preset.keys = [
111 {section = "header";}
112 {111 {
113 icon = " ";112 icon = " ";
114 title = "Keymaps";113 key = "n";
115 section = "keys";114 desc = "New File";
116 indent = 2;115 action = ":ene | startinsert";
117 padding = 1;
118 }116 }
119 {117 {
120 icon = " ";118 icon = " ";
121 title = "Recent Files";119 key = "r";
122 section = "recent_files";120 desc = "Recent Files";
121 action = ":lua Snacks.dashboard.pick('oldfiles')";
122 }
123 ];
124 sections = [
125 { section = "header"; }
126 {
127 section = "keys";
123 indent = 2;128 indent = 2;
124 padding = 1;129 padding = 1;
125 }130 }
...@@ -130,6 +135,21 @@...@@ -130,6 +135,21 @@
130 indent = 2;135 indent = 2;
131 padding = 1;136 padding = 1;
132 }137 }
138 {
139 icon = " ";
140 title = "Git";
141 section = "terminal";
142 enabled = lib.options.literalExpression ''
143 function()
144 return Snacks.git.get_root() ~= nil
145 end
146 '';
147 cmd = "git status --short --branch --renames";
148 height = 10;
149 padding = 1;
150 ttl = 5 * 60;
151 indent = 3;
152 }
133 ];153 ];
134 };154 };
135 image.enable = true;155 image.enable = true;
...@@ -137,7 +157,7 @@...@@ -137,7 +157,7 @@
137 picker = {157 picker = {
138 enable = true;158 enable = true;
139 sources = {159 sources = {
140 explorer = {};160 explorer = { };
141 };161 };
142 };162 };
143 };163 };
users/chloe/configuration.nix+1-1
...@@ -3,8 +3,8 @@...@@ -3,8 +3,8 @@
3{3{
4 # packages for all machines4 # packages for all machines
5 environment.systemPackages = with pkgs; [5 environment.systemPackages = with pkgs; [
6 git
6 ];7 ];
7 # services for all machines
88
9 # configuration for shared modules.9 # configuration for shared modules.
10 # all custom options in 'shared' for clarity.10 # all custom options in 'shared' for clarity.
users/chloe/vim.nix+56-18
...@@ -1,20 +1,58 @@...@@ -1,20 +1,58 @@
1{ ... }:1_: {
2{2 vim = {
3 vim.theme.extraConfig = ''3 options = {
4 if vim.g.neovide then4 tabstop = 2;
5 vim.g.neovide_cursor_trail_size = 0.35 softtabstop = 2;
6 vim.g.neovide_scroll_animation_length = 0.1;6 shiftwidth = 2;
7 undofile = true;
8 swapfile = false;
9 showmode = false;
10 foldlevel = 99;
11 foldcolumn = "1";
12 foldlevelstart = 99;
13 foldenable = true;
14 linebreak = true;
15 };
716
8 vim.keymap.set('n', '<D-s>', ':w<CR>') -- Save17 binds = {
9 vim.keymap.set('v', '<D-c>', '"+y') -- Copy18 hardtime-nvim.setupOpts = {
10 vim.keymap.set('n', '<D-v>', '"+P') -- Paste normal mode19 restriction_mode = "block";
11 vim.keymap.set('v', '<D-v>', '"+P') -- Paste visual mode20 disable_mouse = false;
12 vim.keymap.set('c', '<D-v>', '<C-R>+') -- Paste command mode21 };
13 vim.keymap.set('i', '<D-v>', '<ESC>l"+Pli') -- Paste insert mode22 };
14 end23 git = {
15 vim.api.nvim_set_keymap("", '<D-v>', '+p<CR>', { noremap = true, silent = true})24 gitsigns.setupOpts = {
16 vim.api.nvim_set_keymap('!', '<D-v>', '<C-R>+', { noremap = true, silent = true})25 current_line_blame = true;
17 vim.api.nvim_set_keymap('t', '<D-v>', '<C-R>+', { noremap = true, silent = true})26 current_line_blame_opts = {
18 vim.api.nvim_set_keymap('v', '<D-v>', '<C-R>+', { noremap = true, silent = true})27 virt_text = true;
19 '';28 virt_text_pos = "right_align";
29 delay = 25;
30 ignore_whitespace = true;
31 virt_text_priority = 100;
32 use_focus = true;
33 };
34 };
35 };
36
37 keymaps =
38 let
39 mkKeymap = mode: key: action: desc: {
40 inherit mode;
41 inherit key action desc;
42 };
43 n = mkKeymap "n"; # normal mode
44 in
45 [
46 # UI
47 (n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
48 # Find Files
49 (n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
50 (n "<leader>f" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
51 # Lsp
52 (n "K" ":Lspsaga hover_doc<CR>" "Hover docs")
53 (n "lr" ":lua vim.lsp.buf.rename()<CR>" "Rename")
54 (n "gd" ":lua vim.lsp.buf.definition()<CR>" "Go to Definition")
55 (n "gD" ":lua vim.lsp.buf.declaration()<CR>" "Go to Declaration")
56 ];
57 };
20}58}