add mor remaps like identation fix, epic block moving, scrolling optimization etc.
This commit is contained in:
parent
7a339d35c7
commit
f9eda294ab
1 changed files with 10 additions and 5 deletions
|
|
@ -5,7 +5,6 @@ vim.g.mapleader = " "
|
|||
|
||||
vim.keymap.set("n", "<leader>r", vim.cmd.Ex, { noremap = true, desc = "netrw File Browser" }) -- netrw file explorer
|
||||
|
||||
-- Telescope
|
||||
vim.keymap.set("n", "<leader>e", ":Telescope file_browser hidden=true previewer=false display_stat=false<CR>", { noremap = true, desc = "Directory browser" })
|
||||
vim.keymap.set("n", "<leader>fo", ":Telescope oldfiles<CR>", { noremap = true, desc = "File history" })
|
||||
vim.keymap.set("n", "<leader>ff", ":Telescope find_files hidden=true no_ignore=false <CR>", { noremap = true, desc = "File search" })
|
||||
|
|
@ -21,10 +20,16 @@ vim.keymap.set("n", "w", "W") -- skip punctuation when moving to start of next w
|
|||
vim.keymap.set("n", "e", "E") -- skip punctuation when moving to end of next word
|
||||
vim.keymap.set("n", "b", "B") -- skip punctuation when moving to end of previous word
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz") -- more eye-friendly down scrolling
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz") -- more eye-friendly up scrolling
|
||||
|
||||
-- further inspiration: https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua
|
||||
|
||||
vim.keymap.set("n", "<leader>i", "gg=G``", { noremap = true, desc = "Re-indent whole file" }) -- '``' makes it stay at current line+column position
|
||||
|
||||
-- Thank you ThePrimeagen for those
|
||||
-- https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") -- move whole lines/blocks down in visual mode
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") -- move whole lines/blocks up in visual mode
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz") -- eye-friendly down scrolling
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz") -- eye-friendly up scrolling
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z") -- when merging lines, keep cursor at current position
|
||||
|
||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { noremap = true, desc = "Replace word below cursor" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue