nvim-config/after/plugin/keymap/init.lua

59 lines
1.4 KiB
Lua
Raw Permalink Normal View History

2022-11-01 18:09:46 +01:00
local Remap = require("serxoz.keymap")
local nnoremap = Remap.nnoremap
local vnoremap = Remap.vnoremap
local inoremap = Remap.inoremap
local xnoremap = Remap.xnoremap
local nmap = Remap.nmap
nnoremap("<leader>pv", ":Ex<CR>")
nnoremap("<leader>u", ":UndotreeShow<CR>")
vnoremap("J", ":m '>+1<CR>gv=gv")
vnoremap("K", ":m '<-2<CR>gv=gv")
vnoremap("<", "<gv")
vnoremap(">", ">gv")
2022-11-01 18:09:46 +01:00
nnoremap("Y", "yg$")
nnoremap("n", "nzzzv")
nnoremap("N", "Nzzzv")
nnoremap("J", "mzJ`z")
nnoremap("<C-d>", "<C-d>zz")
nnoremap("<C-u>", "<C-u>zz")
nnoremap("<leader>vwm", function()
require("vim-with-me").StartVimWithMe()
end)
nnoremap("<leader>svwm", function()
require("vim-with-me").StopVimWithMe()
end)
-- greatest remap ever
xnoremap("<leader>p", "\"_dP")
-- next greatest remap ever : asbjornHaland
nnoremap("<leader>y", "\"+y")
vnoremap("<leader>y", "\"+y")
nmap("<leader>Y", "\"+Y")
nnoremap("<leader>d", "\"_d")
vnoremap("<leader>d", "\"_d")
vnoremap("<leader>d", "\"_d")
-- This is going to get me cancelled
inoremap("<C-c>", "<Esc>")
nnoremap("Q", "<nop>")
nnoremap("<C-k>", "<cmd>cnext<CR>zz")
nnoremap("<C-j>", "<cmd>cprev<CR>zz")
nnoremap("<leader>k", "<cmd>lnext<CR>zz")
nnoremap("<leader>j", "<cmd>lprev<CR>zz")
nnoremap("<leader>s", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>")
-- Buffers
nnoremap("<TAB>", ":bnext<CR>")
nnoremap("<S-Tab>", ":bprevious<CR>")
nnoremap("<leader>x", ":bdelete<CR>")