gpt4 book ai didi

vim - 当焦点在vim中的其他窗口时如何隐藏光标线

转载 作者:行者123 更新时间:2023-12-03 15:31:16 24 4
gpt4 key购买 nike

在我的 vimrc 文件中,我有这个选项 set cursorline .如果那个窗口不是焦点,我想隐藏这一行。 vim 中是否有选项可以做到这一点?
看到这个 screenshot

最佳答案

本质上,它只是以下 autocmds:

augroup CursorLine
au!
au VimEnter * setlocal cursorline
au WinEnter * setlocal cursorline
au BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END

但有时,您可能希望为某些窗口定义异常(exception)(即永久打开或关闭)。那就是我的 CursorLineCurrentWindow plugin可能会有所帮助。

关于vim - 当焦点在vim中的其他窗口时如何隐藏光标线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14068751/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com