2023-04-27_22-20-31.mp4
configurable window separtor
Currently in Neovim, we can not make the active window distinguishable via the window separator. This plugin will color the border of active window, like what tmux does for its different panes.
- Neovim 0.8.3+
- Nerd Fonts
Using vim-plug:
Plug 'nvim-zh/colorful-winsep.nvim'
Using Packer.nvim:
use {
"nvim-zh/colorful-winsep.nvim",
config = function ()
require('colorful-winsep').setup()
end
}
Using lazy.nvim
{
"nvim-zh/colorful-winsep.nvim",
config = true,
event = { "WinNew" },
}
require("colorful-winsep").setup({
-- highlight for Window separator
highlight = {
bg = "#16161E",
fg = "#1F3442",
},
-- timer refresh rate
interval = 30,
-- This plugin will not be activated for filetype in the following table.
no_exec_files = { "packer", "TelescopePrompt", "mason", "CompetiTest", "NvimTree" },
-- Symbols for separator lines, the order: horizontal, vertical, top left, top right, bottom left, bottom right.
symbols = { "━", "┃", "┏", "┓", "┗", "┛" },
close_event = function()
-- Executed after closing the window separator
end,
create_event = function()
-- Executed after creating the window separator
end,
})
NvimSeparatorDel
: close active window separtors.NvimSeparatorShow
: show active window separtors (cannot be used on already activated windows)
How to disable this plugin for nvim-tree #8
create_event = function()
local win_n = require("colorful-winsep.utils").calculate_number_windows()
if win_n == 2 then
local win_id = vim.fn.win_getid(vim.fn.winnr('h'))
local filetype = api.nvim_buf_get_option(vim.api.nvim_win_get_buf(win_id), 'filetype')
if filetype == "NvimTree" then
colorful_winsep.NvimSeparatorDel()
end
end
end
- Refactor more delicate logic for creating floating windows
-
will provide enable and disable apicreate_event
andclose_event
This plugin is released under the MIT License.