Browse Source

leader for barbar keybinds

imac
Juni Kim 2 years ago
parent
commit
a8994b0b1d
  1. 65
      after/plugin/barbar.lua
  2. 1
      lua/junikim/options.lua

65
after/plugin/barbar.lua

@ -1,57 +1,29 @@
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
local function macos()
-- Move to previous/next
map('n', '', '<Cmd>BufferPrevious<CR>', opts)
map('n', '', '<Cmd>BufferNext<CR>', opts)
map('n', '<leader>,', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<leader>.', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '¯', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '˘', '<Cmd>BufferMoveNext<CR>', opts)
map('n', '<leader><', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<leader>>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '¡', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '£', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '¢', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '§', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '', '<Cmd>BufferGoto 8<CR>', opts)
map('n', 'ª', '<Cmd>BufferGoto 9<CR>', opts)
map('n', 'º', '<Cmd>BufferLast<CR>', opts)
map('n', '<leader>1', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<leader>2', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<leader>3', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<leader>4', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<leader>5', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<leader>6', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<leader>7', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<leader>8', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<leader>9', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<leader>0', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', 'π', '<Cmd>BufferPin<CR>', opts)
map('n', '<leader>p', '<Cmd>BufferPin<CR>', opts)
map('n', '<leader>i', '<Cmd>BufferPick<CR>', opts)
-- Close buffer
map('n', 'ç', '<Cmd>BufferClose<CR>', opts)
end
vim.api.nvim_create_user_command("MacOS", macos, {})
if vim.loop.os_uname().sysname == "Darwin" then
macos()
else
-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
-- Close buffer
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
end
map('n', '<leader>c', '<Cmd>w|BufferClose<CR>', opts)
map('n', '<leader>q', '<Cmd>BufferClose!<CR>', opts)
-- Wipeout buffer
-- :BufferWipeout
@ -62,7 +34,6 @@ end
-- :BufferCloseBuffersLeft
-- :BufferCloseBuffersRight
-- Magic buffer-picking mode
-- map('n', '<C-P>', '<Cmd>BufferPick<CR>', opts)
-- Sort automatically by...
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)

1
lua/junikim/options.lua

@ -26,6 +26,7 @@ vim.g.airline_powerline_fonts = 1
vim.opt.nu = true
vim.opt.rnu = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 7

Loading…
Cancel
Save