remove line number when open terminal

This commit is contained in:
xfy
2024-11-06 09:18:42 +08:00
parent 945ae19ceb
commit 72e8fbd9a2
2 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,14 @@ autocmd({ "BufNewFile", "BufRead" }, {
end,
})
-- remove relative line number when open terminal
autocmd({ "TermOpen" }, {
callback = function()
vim.api.nvim_buf_set_option(0, "relativenumber", false)
vim.api.nvim_buf_set_option(0, "number", false)
end,
})
-- Automatically update changed file in Vim
-- Triger `autoread` when files changes on disk
-- https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044
@ -113,6 +121,7 @@ local function update_winbar()
local buffer_count = get_buffer_count()
local ft = vim.bo.filetype
if ft == "NvimTree" then
vim.opt.winbar = ""
return
else
vim.opt.winbar = "%#WinBar1#%m "

View File

@ -19,7 +19,6 @@ map("i", "<A-k>", "<Esc>:m .-2<CR>==gi")
map("v", "<A-j>", ":m '>+1<CR>gv=gv")
map("v", "<A-k>", ":m '<-2<CR>gv=gv")
-- map("n", "<C-a>", "gg<S-v>G")
map("n", "$", "g_")
map("v", "$", "g_")
map("v", ">", ">gv")