diff --git a/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua b/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua index 0fefa3f..14cb675 100644 --- a/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua +++ b/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua @@ -1,5 +1,5 @@ -- 這個檔案是用來設定 Neovim 的鍵盤快捷鍵 -- Tab切換 -vim.api.nvim_set_keymap('n', '', 'tabnext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', 'tabprevious', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('n', '', 'tabnext', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('n', '', 'tabprevious', { noremap = true, silent = true }) diff --git a/dot_config/exact_nvim/exact_lua/exact_config/lazy.lua b/dot_config/exact_nvim/exact_lua/exact_config/lazy.lua index 0a0d0b8..0d76d1d 100644 --- a/dot_config/exact_nvim/exact_lua/exact_config/lazy.lua +++ b/dot_config/exact_nvim/exact_lua/exact_config/lazy.lua @@ -40,6 +40,7 @@ require("lazy").setup({ -- }, -- 自動載入 plugins 資料夾中的所有插件 { import = "plugins" }, + { import = "plugins.tab" }, -- 手動引入 o-plugins 資料夾中的插件 -- require("o-plugins.nvim-listchars"), diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/barbar.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/barbar.lua deleted file mode 100644 index 0a5a20b..0000000 --- a/dot_config/exact_nvim/exact_lua/exact_plugins/barbar.lua +++ /dev/null @@ -1,18 +0,0 @@ -if true then return {} end -- 因為會與tabby衝突,先停用 - -return { - {'romgrk/barbar.nvim', - dependencies = { - 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status - 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons - }, - init = function() vim.g.barbar_auto_setup = false end, - opts = { - -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: - -- animation = true, - -- insert_at_start = true, - -- …etc. - }, - version = '^1.0.0', -- optional: only update when a new 1.x version is released - }, -} diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/lualine.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/lualine.lua index e848756..0613f9f 100644 --- a/dot_config/exact_nvim/exact_lua/exact_plugins/lualine.lua +++ b/dot_config/exact_nvim/exact_lua/exact_plugins/lualine.lua @@ -45,7 +45,7 @@ return { tabline = {}, winbar = {}, inactive_winbar = {}, - extensions = {} + extensions = {'neo-tree', 'toggleterm'} } end, -- config = function(_, opts) diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/tab/barbar.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/barbar.lua new file mode 100644 index 0000000..77ddf91 --- /dev/null +++ b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/barbar.lua @@ -0,0 +1,32 @@ +-- if true then return {} end -- 停用 + +return { + {'romgrk/barbar.nvim', + version = '^1.0.0', -- optional: only update when a new 1.x version is released + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + -- opts = { + -- -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- -- animation = false, + -- -- insert_at_start = true, + -- -- …etc. + -- }, + config = function(_, opts) + require'bufferline'.setup { + -- animation = false, -- 禁用動畫效果 + sidebar_filetypes = { + ['neo-tree'] = {event = 'BufWipeout'}, + }, + } + + -- 設定快速鍵 + -- vim.api.nvim_set_keymap('t', '', [[]], { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', '', 'BufferNext', { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', '', 'BufferPrevious', { noremap = true, silent = true }) + + end, + }, +} diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/tab/bufferline.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/bufferline.lua new file mode 100644 index 0000000..b79f38c --- /dev/null +++ b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/bufferline.lua @@ -0,0 +1,55 @@ +if true then return {} end -- 停用 + +-- 查看說明: +-- nvim +"help bufferline" +only + +return { + { + 'akinsho/bufferline.nvim', + version = "*", + dependencies = 'nvim-tree/nvim-web-devicons', + config = function() + vim.opt.termguicolors = true + require("bufferline").setup{ + options = { + mode = "buffers", + custom_filter = function(buf_number) + local buf_ft = vim.bo[buf_number].filetype + if buf_ft == "toggleterm" then + return false + end + return true + end, + click_callback = function(buf_number) + local buf_ft = vim.bo[buf_number].filetype + if buf_ft == "toggleterm" then + -- 如果是 toggleterm 的 Buffer,阻止切換 + print("Cannot switch to terminal buffer!") + return + end + -- 否則切換到目標 Buffer + vim.api.nvim_set_current_buf(buf_number) + end, + -- custom_filter = function(buf_number) + -- -- 過濾掉 toggleterm 的終端 Buffer + -- local buf_name = vim.fn.bufname(buf_number) + -- if buf_name:match("term://") then + -- return false + -- end + -- return true + -- end, + -- offsets = { + -- { + -- filetype = "neo-tree", + -- text = function() + -- return vim.fn.getcwd() + -- end, + -- highlight = "Directory", + -- text_align = "left" + -- } + -- } + } + } + end, + } +} diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/tabby.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/tabby.lua similarity index 96% rename from dot_config/exact_nvim/exact_lua/exact_plugins/tabby.lua rename to dot_config/exact_nvim/exact_lua/exact_plugins/tab/tabby.lua index 4c72e8c..42acce0 100644 --- a/dot_config/exact_nvim/exact_lua/exact_plugins/tabby.lua +++ b/dot_config/exact_nvim/exact_lua/exact_plugins/tab/tabby.lua @@ -1,3 +1,5 @@ +if true then return {} end -- 因為barbar會與tabby衝突,停用 + return { { 'nanozuki/tabby.nvim', diff --git a/dot_config/exact_nvim/exact_lua/exact_plugins/terminal.lua b/dot_config/exact_nvim/exact_lua/exact_plugins/terminal.lua index b1bb43e..9a1f7ac 100644 --- a/dot_config/exact_nvim/exact_lua/exact_plugins/terminal.lua +++ b/dot_config/exact_nvim/exact_lua/exact_plugins/terminal.lua @@ -35,6 +35,7 @@ return { direction = 'horizontal', close_on_exit = true, shell = vim.o.shell, + } -- 添加第二個快捷鍵映射