30 lines
996 B
Lua
30 lines
996 B
Lua
-- maps.lua
|
|
local function map(mode, lhs, rhs, opts)
|
|
local options = {noremap = true}
|
|
if opts then options = vim.tbl_extend('force', options, opts) end
|
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
|
end
|
|
|
|
vim.g.mapleader = ","
|
|
-- Toggle Goyo
|
|
map('n', '<C-g>', ':Goyo<Enter>', {noremap = false})
|
|
-- Open and move to resized terminal
|
|
map('n', '<leader>t', '<C-w>s<C-w>j :terminal<CR>:res 5<CR>i', {noremap = false})
|
|
-- Enter normal mode in terminal
|
|
map('t', '¿<C-N>', '<C-\\><C-N>')
|
|
-- Clear highlight
|
|
map('n', '<C-l>', '<cmd>noh<CR>')
|
|
-- Move to window in any mode
|
|
-- map('t', 'ª', '<C-\\><C-N><C-w>h')
|
|
-- map('t', 'º', '<C-\\><C-N><C-w>j')
|
|
-- map('t', '∆', '<C-\\><C-N><C-w>k')
|
|
-- map('t', '@', '<C-\\><C-N><C-w>l')
|
|
-- map('i', 'ª', '<C-\\><C-N><C-w>h')
|
|
-- map('i', 'º', '<C-\\><C-N><C-w>j')
|
|
-- map('i', '∆', '<C-\\><C-N><C-w>k')
|
|
-- map('i', '@', '<C-\\><C-N><C-w>l')
|
|
-- map('n', 'ª', '<C-w>h')
|
|
-- map('n', 'º', '<C-w>j')
|
|
-- map('n', '∆', '<C-w>k')
|
|
-- map('n', '@', '<C-w>l')
|