summaryrefslogtreecommitdiff
path: root/config/keymaps.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-18 01:28:42 -0500
committerseth <[email protected]>2023-12-18 02:18:35 -0500
commit8faa242f21648e52a6bbdfa803fd4ea1b0e347e0 (patch)
treeeff6694cefb2f821bf19b0d8cb3d97bf48cb15b9 /config/keymaps.nix
parent9fe8afd0c5f2b439176728d8863570bf22614dbd (diff)
port to nixvim
Diffstat (limited to 'config/keymaps.nix')
-rw-r--r--config/keymaps.nix82
1 files changed, 82 insertions, 0 deletions
diff --git a/config/keymaps.nix b/config/keymaps.nix
new file mode 100644
index 0000000..231da71
--- /dev/null
+++ b/config/keymaps.nix
@@ -0,0 +1,82 @@
+{lib, ...}: let
+ setBind = lib.recursiveUpdate {
+ mode = "n";
+ lua = true;
+ options = {
+ noremap = true;
+ silent = true;
+ };
+ };
+in {
+ keymaps = map setBind (
+ [
+ {
+ key = "<leader>t";
+ action = ''
+ function()
+ require("neo-tree.command").execute({
+ toggle = true,
+ dir = vim.loop.cwd()
+ })
+ end
+ '';
+ }
+
+ {
+ mode = ["n" "o" "x"];
+ key = "s";
+ action = ''
+ function()
+ require("flash").jump()
+ end
+ '';
+ }
+
+ {
+ key = "<leader>q";
+ action = ''
+ function()
+ vim.cmd("BufferLinePickClose")
+ end
+ '';
+ }
+
+ {
+ key = "<leader>f";
+ action = ''
+ function()
+ vim.cmd("Telescope")
+ end
+ '';
+ }
+
+ {
+ key = "<leader>p";
+ action = ''
+ function()
+ vim.cmd("TroubleToggle")
+ end
+ '';
+ }
+
+ {
+ key = "<leader>z";
+ action = ''
+ function()
+ vim.cmd("FormatToggle")
+ end
+ '';
+ }
+ ]
+ ++ (
+ map (n: {
+ key = "<leader>${toString n}";
+ action = ''
+ function()
+ vim.cmd("BufferLineGoToBuffer ${toString n}")
+ end
+ '';
+ }) (lib.range 1 9)
+ )
+ );
+}