keybind.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. local map = vim.api.nvim_set_keymap
  2. local opts = { silent = true, noremap = true }
  3. map("n", "<C-h>", "<C-w>h", opts)
  4. map("n", "<C-j>", "<C-w>j", opts)
  5. map("n", "<C-k>", "<C-w>k", opts)
  6. map("n", "<C-l>", "<C-w>l", opts)
  7. -- Telescope
  8. map("n", "<C-g>", ":Telescope live_grep <CR>", opts)
  9. map("n", "<C-w>", ":Telescope find_files <CR>", opts)
  10. -- Nvim-Tree
  11. map("n", "<C-b>", ":NvimTreeFocus <CR>", opts)
  12. map("n", "<C-c>", ":NvimTreeClose <CR>", opts)
  13. map("n", "<C-t>", ":NvimTreeToggle <CR>", opts)
  14. -- Change Buffer
  15. map("n", "<C-1>", ":BufferLineGoToBuffer 1 <CR>", opts)
  16. map("n", "<C-2>", ":BufferLineGoToBuffer 2 <CR>", opts)
  17. map("n", "<C-3>", ":BufferLineGoToBuffer 3 <CR>", opts)
  18. map("n", "<C-4>", ":BufferLineGoToBuffer 4 <CR>", opts)
  19. map("n", "<C-5>", ":BufferLineGoToBuffer 5 <CR>", opts)
  20. -- Resizing panes
  21. map("n", "<Left>", ":vertical resize +1<CR>", opts)
  22. map("n", "<Right>", ":vertical resize -1<CR>", opts)
  23. map("n", "<Up>", ":resize -1<CR>", opts)
  24. map("n", "<Down>", ":resize +1<CR>", opts)
  25. -- Comment Toggle
  26. require("Comment").setup()
  27. map("n", "j", "gj", opts)
  28. map("n", "k", "gk", opts)
  29. map("n", ";", ":", { noremap = true })