在LINUX下对一个文本文件右键选择打开方式为“用GVIM TEXT EDITOR”打开,但却提示:
Error dectected while processing BufReadCmd Auto commands for "file://*":
E37: No write since last change (add ! to override)
而先打开VIM在用:e打开文件就没有这个错误了
原来文件地址是/home/linux/hello.c 现在变成 file:///home/linux/hello.c
该怎么解决?THS!
[问题]GVIM的一小问题
-
- 帖子: 18
- 注册时间: 2006-04-25 21:03
- Strange
- 帖子: 1824
- 注册时间: 2006-05-19 9:54
- 来自: Shanghai
-
- 帖子: 18
- 注册时间: 2006-04-25 21:03
可是我的.vimrc中只有这些阿?
[/code]
代码: 全选
" Configuration file for gvim
" Written for Debian GNU/Linux by W.Akkerman <wakkerma@debian.org>
" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty
" Switch syntax highlighting on, when the terminal has colors
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
"set vb t_vb=".
colorscheme evening
set fenc=utf-8 " default fileencoding
set fencs=utf-8,ucs-bom,euc-jp,gb18030,gbk,gb2312,cp936
" Also switch on highlighting the last used search pattern.
if has("syntax") && (&t_Co > 2 || has("gui_running"))
syntax on
set hlsearch
endif
" Extensions by i18n teams
if filereadable( "/etc/vim/langrc/" . $LANG . ".vim" )
exe "so " . "/etc/vim/langrc/" . $LANG . ".vim"
endif
" You can also specify a different font, overriding the default font and the
" one from the hooks above:
" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
if filereadable("/etc/vim/gvimrc.local")
source /etc/vim/gvimrc.local
endif
- Strange
- 帖子: 1824
- 注册时间: 2006-05-19 9:54
- 来自: Shanghai
-
- 帖子: 77
- 注册时间: 2006-11-22 9:21
是设置编码那几行引起的,我的vimrc这样写:
右键打开文件出错,现象与楼主描述的一致,同样的设置在windows没有问题。另外建一个右键菜单,自定义命令“gvim”,打开文件正常。于是猜想是参数传递出了问题,把GVim的启动器参数改成gvim -f %F就可以了。这个%F是试出来的,不知道具体含义-_-!
代码: 全选
set fileencodings=ucs-bom,utf-8,cp936
-
- 帖子: 44
- 注册时间: 2007-01-16 17:19
关于七楼的一点补充。
七楼说的十分正确,为了帮助一些新人,我也补充一点实际操作。
$: cd /usr/share$ cd applications/
$: sudo cp gvim.desktop gvim.desktop.bak
$: sudo gedit gvim.desktop
查找: Exec=gvim -f %U
改为 : Exec=gvim -f %F
OK!
$: cd /usr/share$ cd applications/
$: sudo cp gvim.desktop gvim.desktop.bak
$: sudo gedit gvim.desktop
查找: Exec=gvim -f %U
改为 : Exec=gvim -f %F
OK!