remap.lua 772 B

1234567891011121314151617181920212223242526272829
  1. -- map leader to <space>
  2. vim.g.mapleader = " "
  3. -- show the vim builtin Explorer
  4. vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
  5. -- move whole blocks back and forth
  6. vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
  7. vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
  8. -- Keep the search results in the middle
  9. vim.keymap.set("n", "n", "nzzzv")
  10. vim.keymap.set("n", "N", "Nzzzv")
  11. -- Copy/Pasting with System Clipboard
  12. vim.keymap.set("n", "<leader>y", "\"+y")
  13. vim.keymap.set("v", "<leader>y", "\"+y")
  14. vim.keymap.set("n", "<leader>Y", "\"+Y")
  15. -- scrolling with C-e, C-y, scroll 5 lines at once
  16. vim.keymap.set("n", "<C-e>", "5<C-e>")
  17. vim.keymap.set("n","<C-y>", "5<C-y>")
  18. -- When selecting Text, keep the Block selected
  19. vim.keymap.set("v", "<", "<gv")
  20. vim.keymap.set("v", ">", ">gv")