From 696f3394a033ede8bd3d2d767ef9dc96f0eb2f17 Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Sat, 28 Jan 2023 20:12:44 -0500 Subject: [PATCH] ability to switch to macos --- after/plugin/barbar.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/after/plugin/barbar.lua b/after/plugin/barbar.lua index c300571..30e093a 100644 --- a/after/plugin/barbar.lua +++ b/after/plugin/barbar.lua @@ -1,7 +1,7 @@ local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -if vim.loop.os_uname().sysname == "Darwin" then +local function macos() -- Move to previous/next map('n', '≤', 'BufferPrevious', opts) map('n', '≥', 'BufferNext', opts) @@ -23,6 +23,12 @@ if vim.loop.os_uname().sysname == "Darwin" then map('n', 'π', 'BufferPin', opts) -- Close buffer map('n', 'ç', 'BufferClose', 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', '', 'BufferPrevious', opts)