From 89a83ecf06cfb24dbd302931344622f5b269afb7 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sat, 31 May 2025 17:54:51 +0800 Subject: [PATCH] =?UTF-8?q?feat=20nvim:=20=E5=9C=A8nvim=E5=85=A7=E7=9A=84T?= =?UTF-8?q?erminal=E7=94=A8=20`nvim=20Readme.md`=20=E9=96=8B=E5=95=9F?= =?UTF-8?q?=E6=AA=94=E6=A1=88=EF=BC=8C=E6=9C=83=E5=9C=A8=E7=95=B6=E5=89=8D?= =?UTF-8?q?nvim=E4=BB=A5=E6=96=B0Buffer=E9=96=8B=E5=95=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exact_components/terminal.lua | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_components/terminal.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_components/terminal.lua index f16356e..588f417 100644 --- a/dot_config/nvim/exact_lua/exact_plugins/exact_components/terminal.lua +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_components/terminal.lua @@ -15,7 +15,9 @@ return { end require("toggleterm").setup { - open_mapping = [[]], + open_mapping = [[]], -- 設定開關快速鍵 + + -- on_open時,以Neotree當Offset on_open = function(_) if is_neo_tree_open() then vim.defer_fn(function() @@ -26,6 +28,7 @@ return { end, 100) end end, + hide_numbers = true, shade_filetypes = {}, shade_terminals = true, @@ -48,4 +51,21 @@ return { vim.api.nvim_set_keymap('t', '', [[]], { noremap = true, silent = true }) end, }, + + -- 在nvim內的Terminal用 `nvim Readme.md` 開啟檔案,會在當前nvim以新Buffer開啟 + { + "willothy/flatten.nvim", + -- config = true, + -- or pass configuration with + opts = { + window = { + open = "alternate", + diff = "tab_vsplit", + focus = "first", + }, + }, + -- Ensure that it runs first to minimize delay when opening file from terminal + lazy = false, + priority = 1001, + }, }