有没有什么方法可以显式地请求vim发出哔哔声,最好是不需要运行外部命令?原因是我经常运行需要很长时间的命令(如:make),所以我开始做其他事情,但我需要提醒任务完成的事实。因此,没有错误会导致vim发出哔哔声,但我可以运行任意命令,所以我需要一些命令,使它发出哔哔声(好吧,运行外部程序是可行的,但我更喜欢更便携的方法)。
:make
ax6ht2ek1#
有:
:set novisualbell:set errorbells:exe "normal \<Esc>"
:set novisualbell
:set errorbells
:exe "normal \<Esc>"
字符串有关详细信息,请参阅:
:help 'errorbells'
:help :echoerr
mwg9r5ms2#
打印响铃字符(Ctrl-G)。在Windows echo ^G上会发出蜂鸣声。根据您的终端设置,它也可以在Linux上工作。
echo ^G
qfe3c7zg3#
下面是@johnsyweb-supports-our-mods的答案,其中还有一个边缘情况,并 Package 在一个可重用的命令中:
command -bar Bell call s:Bell()function s:Bell() const l:belloff = &g:belloff const l:visualbell = &g:visualbell try set belloff-=esc set novisualbell execute "normal! \<Esc>" finally let &g:belloff = l:belloff let &g:visualbell = l:visualbell endtryendfunction
command -bar Bell call s:Bell()
function s:Bell()
const l:belloff = &g:belloff
const l:visualbell = &g:visualbell
try
set belloff-=esc
set novisualbell
execute "normal! \<Esc>"
finally
let &g:belloff = l:belloff
let &g:visualbell = l:visualbell
endtry
endfunction
字符串
3条答案
按热度按时间ax6ht2ek1#
有:
字符串
有关详细信息,请参阅:
:help 'errorbells'
个:help :echoerr
个mwg9r5ms2#
打印响铃字符(Ctrl-G)。在Windows
echo ^G
上会发出蜂鸣声。根据您的终端设置,它也可以在Linux上工作。qfe3c7zg3#
下面是@johnsyweb-supports-our-mods的答案,其中还有一个边缘情况,并 Package 在一个可重用的命令中:
字符串