tab page smoothing

This commit is contained in:
secretspecter 2024-03-09 14:33:39 -07:00
parent 6dc460cc80
commit cd352fa327

View file

@ -17,16 +17,16 @@
:keymap (fn [] :keymap (fn []
(let [nmap #(vim.keymap.set :n $1 $2 {:desc $3}) (let [nmap #(vim.keymap.set :n $1 $2 {:desc $3})
tmap #(vim.keymap.set :t $1 $2)] tmap #(vim.keymap.set :t $1 $2 {:desc (.. $3 " (from a terminal)")})]
(nmap :<C-h> :<C-W>h "Move to window left") (nmap :<C-h> :<C-W>h "Move to window left")
(tmap :<C-h> :<C-\><C-n><C-w>h "Move to window left")
(nmap :<C-j> :<C-W>j "Move to window down") (nmap :<C-j> :<C-W>j "Move to window down")
(tmap :<C-j> :<C-\><C-n><C-w>j "Move to window down")
(nmap :<C-k> :<C-W>k "Move to window up") (nmap :<C-k> :<C-W>k "Move to window up")
(tmap :<C-k> :<C-\><C-n><C-w>k "Move to window up")
(nmap :<C-l> :<C-W>l "Move to window right") (nmap :<C-l> :<C-W>l "Move to window right")
(tmap :<C-h> :<C-\><C-n><C-w>h "Move to window left (from a terminal)") (tmap :<C-l> :<C-\><C-n><C-w>l "Move to window right")
(tmap :<C-j> :<C-\><C-n><C-w>j "Move to window down (from a terminal)") (tmap :<C-w> "<C-\\><C-n>" "Escape to normal mode")
(tmap :<C-k> :<C-\><C-n><C-w>k "Move to window up (from a terminal)")
(tmap :<C-l> :<C-\><C-n><C-w>l "Move to window right (from a terminal)")
(tmap :<C-w> "<C-\\><C-n>" "Escape to normal mode from a terminal")
(vim.api.nvim_create_autocmd (vim.api.nvim_create_autocmd
[:BufWinEnter :WinEnter] [:BufWinEnter :WinEnter]
{:pattern "term://*" {:pattern "term://*"
@ -34,11 +34,14 @@
(nmap :<Tab> :<C-^> "Toggle alternate-file") (nmap :<Tab> :<C-^> "Toggle alternate-file")
(nmap :<C-x> ":bn|bd!#<cr>" "Delete a buffer without removing the split") (nmap :<C-x> ":bn|bd!#<cr>" "Delete a buffer without removing the split")
(nmap :<leader>tt ":term<cr>i" "Open a terminal in the current window")
(nmap :<leader>to ":new term://bash|resize 8<cr>" "Open an 8 line terminal below the current window") (nmap :<leader>to ":new term://bash|resize 8<cr>" "Open an 8 line terminal below the current window")
(nmap :<leader>w :80<C-W>| "Set the window width to 80 characters") (nmap :<leader>w :80<C-W>| "Set the window width to 80 characters")
(nmap :<leader>W :120<C-W>| "Set the window width to 120 characters") (nmap :<leader>W :120<C-W>| "Set the window width to 120 characters")
(nmap :<C-t> ":tabnew<cr>" "Create a new tab page") (nmap :<C-t> ":tabnew<cr>" "Create a new tab page")
(tmap :<C-t> "<C-\\><C-n>:tabnew<cr>" "Create a new tab page")
(nmap :<C-w><tab> :<C-w>gt "Go to next tab (cyclical)") (nmap :<C-w><tab> :<C-w>gt "Go to next tab (cyclical)")
(tmap :<C-w><tab> "<C-\\><C-n><C-w>gt" "Go to next tab (cyclical)")
(nmap :<leader>jt (nmap :<leader>jt
#(vim.cmd (.. "vsplit ~/TDC-Obsidian/Journal/" #(vim.cmd (.. "vsplit ~/TDC-Obsidian/Journal/"