diff --git a/plugins/astrocore/autocmds.nix b/config/autocmds.nix similarity index 100% rename from plugins/astrocore/autocmds.nix rename to config/autocmds.nix diff --git a/config/keymaps.nix b/config/keymaps.nix deleted file mode 100644 index 02c27a6..0000000 --- a/config/keymaps.nix +++ /dev/null @@ -1,35 +0,0 @@ -let - forceWrite = { - action = "silent! update! | redraw"; - options.desc = "Force write"; - }; -in -{ - keymaps = [ - { - key = "n"; - action = "enew"; - options.desc = "New file"; - } - { - inherit (forceWrite) action options; - key = ""; - } - { - inherit (forceWrite) options; - mode = [ "i" "x" ]; - key = ""; - action = "${forceWrite.action}"; - } - { - key = "|"; - action = "vsplit"; - options.desc = "Split vertically"; - } - { - key = "\\"; - action = "split"; - options.desc = "Split horizontally"; - } - ]; -} diff --git a/config/keymaps/buffers.nix b/config/keymaps/buffers.nix new file mode 100644 index 0000000..c835db8 --- /dev/null +++ b/config/keymaps/buffers.nix @@ -0,0 +1,164 @@ +# Manage buffers +# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L56-L89 +[ + { + key = "c"; + options.desc = "Close buffer"; + + action.__raw = '' + function() + require("astrocore.buffer").close() + end + ''; + } + { + key = "C"; + options.desc = "Force close buffer"; + + action.__raw = '' + function() + require("astrocore.buffer").close(0, true) + end + ''; + } + { + key = "]b"; + options.desc = "Next buffer in tabline"; + + action.__raw = '' + function() + require("astrocore.buffer").nav(vim.v.count1) + end + ''; + } + { + key = "[b"; + options.desc = "Previous buffer in tabline"; + + action.__raw = '' + function() + require("astrocore.buffer").nav(-vim.v.count1) + end + ''; + } + { + key = ">b"; + options.desc = "Move buffer tab right"; + + action.__raw = '' + function() + require("astrocore.buffer").move(vim.v.count1) + end + ''; + } + { + key = " to load help for given