split navigation even with terminals

This commit is contained in:
secretspecter 2023-08-04 12:18:59 -06:00
parent b2adb7cfcb
commit 20be1e9ca2

View file

@ -1,6 +1,7 @@
(let [cmp (require :cmp)
luasnip (require :luasnip)]
{:options (fn []
(set vim.g.mapleader " ")
(set vim.o.termguicolors true)
(set vim.o.clipboard :unnamedplus)
(set vim.o.wrap false)
@ -8,18 +9,32 @@
(vim.cmd.colorscheme :everforest)
;; http://neovim.io/doc/user/change.html#fo-table
(set vim.o.formatoptions :tncro)
(set vim.o.conceallevel 2))
(set vim.o.conceallevel 2)
(set vim.o.splitbelow true)
(set vim.o.splitright true))
: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)]
(nmap :<Tab> ":bnext<CR>" "Next Buffer")
(nmap :<S-Tab> ":bprevious<CR>" "Previous Buffer")
(nmap :<C-P> ":Telescope find_files<CR>" "Telescope find_files")
(nmap :<leader>x ":write|bdelete<CR>" "Save and delete buffer")
(nmap :<leader>dt
#(vim.cmd (.. "split ~/gemwiki/diary/"
(nmap :<C-p> ":Telescope find_files<CR>" "Telescope find_files")
(nmap :<C-b> ":Telescope buffers<CR>" "Telescope find_files")
(nmap :<C-x> ":bn|bd!#<CR>" "Delete a buffer without removing the split")
(nmap :<leader>tt ":new term://bash|resize 8<CR>|i")
;; unified window navigation via C-hjkl
(tmap :<C-h> :<C-\><C-N><C-w>h)
(tmap :<C-j> :<C-\><C-N><C-w>j)
(tmap :<C-k> :<C-\><C-N><C-w>k)
(tmap :<C-l> :<C-\><C-N><C-w>l)
(nmap :<C-h> :<C-W>h)
(nmap :<C-j> :<C-W>j)
(nmap :<C-k> :<C-W>k)
(nmap :<C-l> :<C-W>l)
(nmap :<leader>dd
#(vim.cmd (.. "split ~/gemwiki/diary/"
(os.date "%Y%m%d")
".gmi"
"| resize 8 | $")
"|resize 8|$")
"Open today's diary"))
(let [duck (require :duck)]
(nmap :<leader>dd #(duck.hatch) "hatch a duck")