Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. local map = vim.api.nvim_set_keymap
  2. local opts = { noremap = true, silent = true }
  3. -- Move to previous/next
  4. map('n', '<leader>,', '<Cmd>BufferPrevious<CR>', opts)
  5. map('n', '<leader>.', '<Cmd>BufferNext<CR>', opts)
  6. -- Re-order to previous/next
  7. map('n', '<leader><', '<Cmd>BufferMovePrevious<CR>', opts)
  8. map('n', '<leader>>', '<Cmd>BufferMoveNext<CR>', opts)
  9. -- Goto buffer in position...
  10. map('n', '<leader>1', '<Cmd>BufferGoto 1<CR>', opts)
  11. map('n', '<leader>2', '<Cmd>BufferGoto 2<CR>', opts)
  12. map('n', '<leader>3', '<Cmd>BufferGoto 3<CR>', opts)
  13. map('n', '<leader>4', '<Cmd>BufferGoto 4<CR>', opts)
  14. map('n', '<leader>5', '<Cmd>BufferGoto 5<CR>', opts)
  15. map('n', '<leader>6', '<Cmd>BufferGoto 6<CR>', opts)
  16. map('n', '<leader>7', '<Cmd>BufferGoto 7<CR>', opts)
  17. map('n', '<leader>8', '<Cmd>BufferGoto 8<CR>', opts)
  18. map('n', '<leader>9', '<Cmd>BufferGoto 9<CR>', opts)
  19. map('n', '<leader>0', '<Cmd>BufferLast<CR>', opts)
  20. -- Pin/unpin buffer
  21. map('n', '<leader>p', '<Cmd>BufferPin<CR>', opts)
  22. map('n', '<leader>i', '<Cmd>BufferPick<CR>', opts)
  23. -- Close buffer
  24. map('n', '<leader>c', '<Cmd>w|BufferClose<CR>', opts)
  25. map('n', '<leader>q', '<Cmd>BufferClose!<CR>', opts)
  26. -- Wipeout buffer
  27. -- :BufferWipeout
  28. -- Close commands
  29. -- :BufferCloseAllButCurrent
  30. -- :BufferCloseAllButPinned
  31. -- :BufferCloseAllButCurrentOrPinned
  32. -- :BufferCloseBuffersLeft
  33. -- :BufferCloseBuffersRight
  34. -- Magic buffer-picking mode
  35. -- Sort automatically by...
  36. map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
  37. map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
  38. map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
  39. map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
  40. require('bufferline').setup {
  41. animation = false,
  42. icons = { pinned = { buttton = '' } }
  43. }