nvim: update smartsplit keybinding loading

This commit is contained in:
proctor committed 2026-04-13 17:19:11 -05:00
1 parent 3e9ae79508
commit bdc89102ae
2 files changed
+29 -24

No files matched your search

+25 -21
View File
@@ -1,23 +1,27 @@
(import-macros {: tx} :config.macros) (import-macros {: tx} :config.macros)
(tx :mrjones2014/smart-splits.nvim
(let [smart-splits (require :smart-splits)] {:lazy false
(when smart-splits :config (fn []
;; recommended mappings (let [smart-splits (require :smart-splits)]
;; resizing splits (when smart-splits
;; these keymaps will also accept a range, ;; recommended mappings
;; for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)` ;; resizing splits
(vim.keymap.set :n :<M-S-h> smart-splits.resize_left) ;; these keymaps will also accept a range,
(vim.keymap.set :n :<M-S-j> smart-splits.resize_down) ;; for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
(vim.keymap.set :n :<M-S-k> smart-splits.resize_up) (vim.keymap.set :n :<M-S-h> smart-splits.resize_left)
(vim.keymap.set :n :<M-S-l> smart-splits.resize_right) ; ; moving between splits (vim.keymap.set :n :<M-S-j> smart-splits.resize_down)
(vim.keymap.set :n :<M-h> smart-splits.move_cursor_left) (vim.keymap.set :n :<M-S-k> smart-splits.resize_up)
(vim.keymap.set :n :<M-j> smart-splits.move_cursor_down) (vim.keymap.set :n :<M-S-l> smart-splits.resize_right) ; ; moving between splits
(vim.keymap.set :n :<M-k> smart-splits.move_cursor_up) (vim.keymap.set :n :<M-h> smart-splits.move_cursor_left)
(vim.keymap.set :n :<M-l> smart-splits.move_cursor_right) ; ; swapping buffers between windows (vim.keymap.set :n :<M-j> smart-splits.move_cursor_down)
(vim.keymap.set :n :<leader><leader>h smart-splits.swap_buf_left) (vim.keymap.set :n :<M-k> smart-splits.move_cursor_up)
(vim.keymap.set :n :<leader><leader>j smart-splits.swap_buf_down) (vim.keymap.set :n :<M-l> smart-splits.move_cursor_right) ; ; swapping buffers between windows
(vim.keymap.set :n :<leader><leader>k smart-splits.swap_buf_up) (vim.keymap.set :n :<leader><leader>h
(vim.keymap.set :n :<leader><leader>l smart-splits.swap_buf_right))) smart-splits.swap_buf_left)
(vim.keymap.set :n :<leader><leader>j
(tx :mrjones2014/smart-splits.nvim {:lazy false}) smart-splits.swap_buf_down)
(vim.keymap.set :n :<leader><leader>k
smart-splits.swap_buf_up)
(vim.keymap.set :n :<leader><leader>l
smart-splits.swap_buf_right))))})
@@ -1,5 +1,5 @@
-- [nfnl] fnl/plugins/smartsplits.fnl -- [nfnl] fnl/plugins/smartsplits.fnl
do local function _1_()
local smart_splits = require("smart-splits") local smart_splits = require("smart-splits")
if smart_splits then if smart_splits then
vim.keymap.set("n", "<M-S-h>", smart_splits.resize_left) vim.keymap.set("n", "<M-S-h>", smart_splits.resize_left)
@@ -13,8 +13,9 @@ do
vim.keymap.set("n", "<leader><leader>h", smart_splits.swap_buf_left) vim.keymap.set("n", "<leader><leader>h", smart_splits.swap_buf_left)
vim.keymap.set("n", "<leader><leader>j", smart_splits.swap_buf_down) vim.keymap.set("n", "<leader><leader>j", smart_splits.swap_buf_down)
vim.keymap.set("n", "<leader><leader>k", smart_splits.swap_buf_up) vim.keymap.set("n", "<leader><leader>k", smart_splits.swap_buf_up)
vim.keymap.set("n", "<leader><leader>l", smart_splits.swap_buf_right) return vim.keymap.set("n", "<leader><leader>l", smart_splits.swap_buf_right)
else else
return nil
end end
end end
return {"mrjones2014/smart-splits.nvim", lazy = false} return {"mrjones2014/smart-splits.nvim", config = _1_, lazy = false}