分页: 1 / 1

[问题]GVIM的一小问题

发表于 : 2006-06-03 9:56
apopen
在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!

发表于 : 2006-06-03 10:16
Strange
检查一下vim插件,一个一个去掉,看看还有没有问题
其实就是检查一下,哪个插件,或者配置文件设置了BufReadCmd,然后检查相关内容

发表于 : 2006-06-03 10:37
apopen
可是我的.vimrc中只有这些阿?

代码: 全选

" Configuration file for gvim
" Written for Debian GNU/Linux by W.Akkerman <[email protected]>

" 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

[/code]

发表于 : 2006-06-03 17:17
Strange
首先vimrc里面source了/etc/vim/gvimrc.local 这个文件,就等于也要看那个文件里面的内容了
然后检查一下插件目录,是runtime目录下面的plugin目录,可能是插件的问题

发表于 : 2006-06-03 19:46
apopen
THS 我试试

我也有这个问题

发表于 : 2006-06-08 12:38
rhfcaesar
我也有这个问题。楼上的说是插件问题,但我只有latex-suite一个插件,删除这个插件后问题仍然存在。搂住的问题解决了吗?能不能具体讲一下怎么解决的?谢谢

发表于 : 2007-06-10 15:26
sgt.pepper
是设置编码那几行引起的,我的vimrc这样写:

代码: 全选

set fileencodings=ucs-bom,utf-8,cp936
右键打开文件出错,现象与楼主描述的一致,同样的设置在windows没有问题。另外建一个右键菜单,自定义命令“gvim”,打开文件正常。于是猜想是参数传递出了问题,把GVim的启动器参数改成gvim -f %F就可以了。这个%F是试出来的,不知道具体含义-_-!

关于七楼的一点补充。

发表于 : 2007-07-05 18:22
fanz_g
七楼说的十分正确,为了帮助一些新人,我也补充一点实际操作。
$: 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!