Add smart-splits

This commit is contained in:
Tyler Hallada 2023-12-01 15:28:11 -05:00
parent 2e781ef1db
commit 06140480ad
4 changed files with 147 additions and 6 deletions

View File

@ -85,6 +85,7 @@
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" },
"sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" },
"ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
"telescope-emoji.nvim": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },

View File

@ -0,0 +1,134 @@
return {
"mrjones2014/smart-splits.nvim",
keys = {
{
"<A-h>",
function()
require("smart-splits").resize_left()
end,
desc = "Resize left",
mode = { "n", "t" },
},
{
"<A-j>",
function()
require("smart-splits").resize_down()
end,
desc = "Resize down",
mode = { "n", "t" },
},
{
"<A-k>",
function()
require("smart-splits").resize_up()
end,
desc = "Resize up",
mode = { "n", "t" },
},
{
"<A-l>",
function()
require("smart-splits").resize_right()
end,
desc = "Resize right",
mode = { "n", "t" },
},
-- because ShareMouse isn't mapping Alt to Option correctly...
{
"˙",
function()
require("smart-splits").resize_left()
end,
desc = "Resize left",
mode = { "n", "t" },
},
{
"",
function()
require("smart-splits").resize_down()
end,
desc = "Resize down",
mode = { "n", "t" },
},
{
"˚",
function()
require("smart-splits").resize_up()
end,
desc = "Resize up",
mode = { "n", "t" },
},
{
"¬",
function()
require("smart-splits").resize_right()
end,
desc = "Resize right",
mode = { "n", "t" },
},
{
"<C-h>",
function()
require("smart-splits").move_cursor_left()
end,
desc = "Move cursor left",
mode = { "n", "t" },
},
{
"<C-j>",
function()
require("smart-splits").move_cursor_down()
end,
desc = "Move cursor down",
mode = { "n", "t" },
},
{
"<C-k>",
function()
require("smart-splits").move_cursor_up()
end,
desc = "Move cursor up",
mode = { "n", "t" },
},
{
"<C-l>",
function()
require("smart-splits").move_cursor_right()
end,
desc = "Move cursor right",
mode = { "n", "t" },
},
{
"<C-A-h>",
function()
require("smart-splits").swap_buf_left()
end,
desc = "Swap buffer left",
mode = { "n", "t" },
},
{
"<C-A-j>",
function()
require("smart-splits").swap_buf_down()
end,
desc = "Swap buffer down",
mode = { "n", "t" },
},
{
"<C-A-k>",
function()
require("smart-splits").swap_buf_up()
end,
desc = "Swap buffer up",
mode = { "n", "t" },
},
{
"<C-A-l>",
function()
require("smart-splits").swap_buf_right()
end,
desc = "Swap buffer right",
mode = { "n", "t" },
},
},
}

View File

@ -29,10 +29,11 @@ return {
-- vim.keymap.set('n', [[<C-a>z]], [[<Cmd>ToggleTermToggleAll<CR>]])
-- vim.keymap.set('t', [[<C-a>z]], [[<Cmd>tab split<CR>]])
{ "<Esc>", [[<C-\><C-n>]], mode = "t", desc = "Escape terminal mode" },
{ "<C-j>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus down one window" },
{ "<C-h>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus left one window" },
{ "<C-k>", [[<Cmd>wincmd k<CR>]], mode = "t", desc = "Move focus up one window" },
{ "<C-l>", [[<Cmd>wincmd l<CR>]], mode = "t", desc = "Move focus right one window" },
-- These were replaced by smart-splits
-- { "<C-j>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus down one window" },
-- { "<C-h>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus left one window" },
-- { "<C-k>", [[<Cmd>wincmd k<CR>]], mode = "t", desc = "Move focus up one window" },
-- { "<C-l>", [[<Cmd>wincmd l<CR>]], mode = "t", desc = "Move focus right one window" },
{ [[<C-\>]], [[<Cmd>ToggleTerm<CR>]] },
{ "<F12>", [[<Cmd>ToggleTerm<CR>]] },
{ "<F12>", [[<Cmd>ToggleTerm<CR>]], mode = "t" },

View File

@ -7,8 +7,13 @@ return {
{ "<leader>zf", [[<Cmd>:TZFocus<CR>]], desc = "[Z]oom [N]arrow current buffer in new tab" },
{ "<leader>zm", [[<Cmd>:TZMinimalist<CR>]], desc = "[Z] Toggle minimalist nvim UI mode" },
{ "<leader>za", [[<Cmd>:TZAtaraxis<CR>]], desc = "[Z]oom [A]taraxis current buffer minimalist mode" },
{
"<C-w>z",
[[<Cmd>:TZFocus<CR>]],
mode = { "n", "t" },
desc = "Toggle [Z]oom current buffer in new tab",
},
-- tmux memory for fullscreening nvim window
{ [[<C-a>z]], [[<Cmd>:TZFocus<CR>]], desc = "Toggle [Z]oom current buffer in new tab" },
{ [[<C-a>z]], [[<Cmd>:TZFocus<CR>]], mode = "t", desc = "Toggle [Z]oom current terminal buffer in new tab" },
{ "<C-a>z", [[<Cmd>:TZFocus<CR>]], mode = { "n", "t" }, desc = "Toggle [Z]oom current buffer in new tab" },
},
}