flake and neovim keybinds

This commit is contained in:
Aria Nolan 2024-04-06 16:05:34 -04:00
parent 6fd3f3c54c
commit 885a0c05f9
4 changed files with 100 additions and 49 deletions

View file

@ -8,11 +8,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1707830867, "lastModified": 1712079060,
"narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", "rev": "1381a759b205dff7a6818733118d02253340fd5e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -218,11 +218,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711625603, "lastModified": 1712317700,
"narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=", "narHash": "sha256-rnkQ6qMhlxfjpCECkTMlFXHU/88QvC5KpdJWq5H6F1E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2", "rev": "782eed8bb64b27acaeb7c17be4a095c85e65717f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -239,11 +239,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711604890, "lastModified": 1711625603,
"narHash": "sha256-vbI/gxRTq/gHW1Q8z6D/7JG/qGNl3JTimUDX+MwnC3A=", "narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "3142bdcc470e1e291e1fbe942fd69e06bd00c5df", "rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -260,11 +260,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711591334, "lastModified": 1711763326,
"narHash": "sha256-9d5ilxxq4CXw44eFw8VFrRneAKex7D8xjn95mwZjgf4=", "narHash": "sha256-sXcesZWKXFlEQ8oyGHnfk4xc9f2Ip0X/+YZOq3sKviI=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "f0dd0838c3558b59dc3b726d8ab89f5b5e35c297", "rev": "36524adc31566655f2f4d55ad6b875fb5c1a4083",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -281,11 +281,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711724506, "lastModified": 1712242906,
"narHash": "sha256-c+Rieg88Wmr1eh0TxkD9u82VOEe71VBFLmwyKYmhHWI=", "narHash": "sha256-LT4sYqxVV+fAn4Zbw4W4x2fAwXtwVriJcyuImsS7tF8=",
"owner": "doronbehar", "owner": "doronbehar",
"repo": "nix-matlab", "repo": "nix-matlab",
"rev": "38da0ef06fa5edee1ced5fb3c22f86ef1ecb4146", "rev": "8b57f25741707b87f13cf6145dae8792a93c697c",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -328,11 +328,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1711523803, "lastModified": 1712163089,
"narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=", "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2726f127c15a4cc9810843b96cad73c7eb39e443", "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -355,11 +355,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1711630555, "lastModified": 1712299511,
"narHash": "sha256-jslStwDlRwVZLwcFkExWegOGYv/Dn9q7yoocUX7AsIg=", "narHash": "sha256-yrBK6Jq0UuJjP+nc01OFNoKRRJgPNkbmwPpE4mD2Bis=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "acb917fbf2bc9ce9c556516d8a1f257709b3cf1e", "rev": "f285a958c089ccbca9c5710d4a075683fa1af654",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -370,11 +370,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1711743910, "lastModified": 1712320566,
"narHash": "sha256-XEBT1xEfTalw1OUKEHMN+LyIyZZrtu4WvzcLu34eFy0=", "narHash": "sha256-F/NR0Xf/AU21Nbtrni+6i+7C4dBKg9MNg7qrOmPRy6M=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nur", "repo": "nur",
"rev": "7e6f9ce704b7362eb5b0f8a8e72b25b750170289", "rev": "9ac97db2225dd90fc37c91fb6c91f2a10d331783",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -398,11 +398,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711519547, "lastModified": 1711760932,
"narHash": "sha256-Q7YmSCUJmDl71fJv/zD9lrOCJ1/SE/okZ2DsrmRjzhY=", "narHash": "sha256-DqUTQ2iAAqSDwMhKBqvi24v0Oc7pD3LCK/0FCG//TdA=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "7d47a32e5cd1ea481fab33c516356ce27c8cef4a", "rev": "c11e43aed6f17336c25cd120eac886b96c455731",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,13 +1,6 @@
{...}: { {...}: {
programs.nixvim.plugins.cmp = { programs.nixvim.plugins.cmp = {
enable = true; enable = true;
# filetype = {
# tex = {
# sources = [
# {name = "latex_symbols";}
# ];
# };
# };
settings = { settings = {
sources = [ sources = [
{ {
@ -26,10 +19,6 @@
name = "path"; name = "path";
priority = 0; priority = 0;
} }
{
name = "buffer";
priority = 0;
}
]; ];
snippet.expand = "luasnip"; snippet.expand = "luasnip";
completion = { completion = {

View file

@ -6,15 +6,7 @@
]; ];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
colorschemes.ayu = { colorschemes.kanagawa.enable = true;
enable = true;
settings = {
mirage = true;
overrides = {
LineNr = {fg = "#707A8C";};
};
};
};
clipboard = { clipboard = {
providers.wl-copy.enable = true; providers.wl-copy.enable = true;
register = "unnamedplus"; register = "unnamedplus";
@ -24,7 +16,7 @@
texliveMedium texliveMedium
zathura zathura
]; ];
options = { opts = {
number = true; number = true;
relativenumber = true; relativenumber = true;
tabstop = 2; tabstop = 2;
@ -38,6 +30,13 @@
cursorline = true; cursorline = true;
showmode = false; showmode = false;
}; };
extraConfigLuaPre = ''
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
'';
files = { files = {
"ftplugin/nix.lua" = { "ftplugin/nix.lua" = {
options = { options = {
@ -67,7 +66,57 @@
{ {
action = "<cmd>nohl<CR>"; action = "<cmd>nohl<CR>";
key = "<C-q>"; key = "<C-q>";
options.silent = true; mode = [ "n" ];
options = {
desc = "Remove search highlighting";
silent = true;
};
}
{
action = "function() require(\"luasnip\").expand() end";
key = "<C-L>";
mode = [ "i" ];
lua = true;
options = {
desc = "Luasnip expand";
silent = true;
};
}
{
action = "function() require(\"luasnip\").jump(1) end";
key = "<C-J>";
mode = [ "i" "s" ];
lua = true;
options = {
desc = "Luasnip jump to next";
silent = true;
};
}
{
action = "function() require(\"luasnip\").jump(-1) end";
key = "<C-K>";
mode = [ "i" "s" ];
lua = true;
options = {
desc = "Luasnip jump to previous";
silent = true;
};
}
{
action = ''
function()
if require("luasnip").choice_active() then
require("luasnip").change_choice(1)
end
end
'';
key = "<C-E>";
mode = [ "i" "s" ];
lua = true;
options = {
desc = "Luasnip change choice";
silent = true;
};
} }
]; ];
}; };

View file

@ -2,6 +2,16 @@
programs.nixvim.plugins = { programs.nixvim.plugins = {
telescope = { telescope = {
enable = true; enable = true;
keymaps = {
"<leader>g" = {
action = "git_files";
desc = "Telescope git files";
};
"<leader>d" = {
action = "diagnostics";
desc = "Telescope diagnostics";
};
};
}; };
comment = { comment = {
enable = true; enable = true;
@ -33,5 +43,8 @@
nixvimInjections = true; nixvimInjections = true;
indent = true; indent = true;
}; };
which-key = {
enable = true;
};
}; };
} }