nvim/lua/keymap.lua

50 lines
1.7 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- base
G.map({
{ 'n', '<leader>nh', ':nohlsearch<CR>' },
{ 'n', '<leader>rp', ':%s/' },
{ 'v', 'L', '$' },
{ 'v', 'H', '^' },
{ 'n', 'L', '$' },
{ 'n', 'H', '^' },
{ 'v', '>', '>gv' },
{ 'v', '<', '<gv' },
{ 'n', '>', '>>' },
{ 'n', '<', '<<' },
{ 'n', '?', ':set hlsearch<CR>?' },
{ 'n', '/', ':set hlsearch<CR>/' },
{ 'n', '<A-l>', ':tabn<CR>' },
{ 'n', '<A-h>', ':tabp<CR>' },
{ 'n', '<c-j>', '<c-w>j' },
{ 'n', '<c-h>', '<c-w>h' },
{ 'n', '<c-k>', '<c-w>k' },
{ 'n', '<c-l>', '<c-w>l' },
{ 'n', '<c-c>', ':q<CR>' },
{ 'n', '<c-S>', ':w !sudo tee %<CR>' },
{ 'n', '<c-q>', ':q!<CR>' },
{ 'v', '<cs-y>', '"+y' },
{ 'n', '<leader>y', 'ggyG' },
{ 'n', '<leader>p', 'ggpG' },
{ 'n', '<leader>v', 'ggVG' },
{ 'n', '<up>', ':res -5<CR>' },
{ 'n', '<down>', ':res +5<CR>' },
{ 'n', '<left>', ':vertical resize -5<CR>' },
{ 'n', '<right>', ':vertical resize +5<CR>' },
})
-- 终端 / Reasonix / lazygitQQdock.nvim持久化 + 自适应分屏)
-- TODO: 根分区恢复读写后改为 lazy spec 引用 git.qyhhh.top/newbie/QQdock.nvim删本地 lua/QQdock/
local Q = require('QQdock')
G.map({
{ 'n', '<c-t>', Q.shell, { noremap = true } },
{ 'i', '<c-t>', Q.shell, { noremap = true } },
{ 'n', '<C-i>', function() Q.open('reasonix') end, { noremap = true } },
{ 'n', '<leader>gg', function() Q.open('lazygit') end, { noremap = true } },
})