gvim 启动太慢

升级到Ubuntu12.04后,在console下启动gvim,长时间内无法输入,发现是由于ibus导致的。

使用-f参数可以实现快速启动。

1
2
3
4
5
6
-f          Foreground.   For  the  GUI  version, Vim will not fork and
            detach from the shell it was started in.  On the Amiga, Vim
            is  not restarted to open a new window.  This option should
            be used when Vim is executed by a program  that  will  wait
            for  the  edit session to finish (e.g. mail).  On the Amiga
            the ":sh" and ":!" commands will not work.

因此在console下启动

1
gvim -f

由于每次输入-f参数,可能显得比较繁琐,可在~/.bashrc中加入如下代码。

1
alias gvim="gvim -f 2>/dev/null

2>表示标准错误输出STDERR,意即抛弃标准错误输出;0>表示标准输入,1>表示标准输出。

这样在console下,输入gvim,即可实现快速启动。

1
$gvim

 

原文地址:https://www.cnblogs.com/JimMoriarty/p/3414022.html