[问题]GVIM的一小问题

Vim、Emacs配置和使用
回复
apopen
帖子: 18
注册时间: 2006-04-25 21:03

[问题]GVIM的一小问题

#1

帖子 apopen » 2006-06-03 9:56

在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!
头像
Strange
帖子: 1824
注册时间: 2006-05-19 9:54
来自: Shanghai

#2

帖子 Strange » 2006-06-03 10:16

检查一下vim插件,一个一个去掉,看看还有没有问题
其实就是检查一下,哪个插件,或者配置文件设置了BufReadCmd,然后检查相关内容
apopen
帖子: 18
注册时间: 2006-04-25 21:03

#3

帖子 apopen » 2006-06-03 10:37

可是我的.vimrc中只有这些阿?

代码: 全选

" 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

[/code]
头像
Strange
帖子: 1824
注册时间: 2006-05-19 9:54
来自: Shanghai

#4

帖子 Strange » 2006-06-03 17:17

首先vimrc里面source了/etc/vim/gvimrc.local 这个文件,就等于也要看那个文件里面的内容了
然后检查一下插件目录,是runtime目录下面的plugin目录,可能是插件的问题
apopen
帖子: 18
注册时间: 2006-04-25 21:03

#5

帖子 apopen » 2006-06-03 19:46

THS 我试试
头像
rhfcaesar
帖子: 2996
注册时间: 2005-11-17 15:45
来自: 湖北

我也有这个问题

#6

帖子 rhfcaesar » 2006-06-08 12:38

我也有这个问题。楼上的说是插件问题,但我只有latex-suite一个插件,删除这个插件后问题仍然存在。搂住的问题解决了吗?能不能具体讲一下怎么解决的?谢谢
sgt.pepper
帖子: 77
注册时间: 2006-11-22 9:21

#7

帖子 sgt.pepper » 2007-06-10 15:26

是设置编码那几行引起的,我的vimrc这样写:

代码: 全选

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

关于七楼的一点补充。

#8

帖子 fanz_g » 2007-07-05 18:22

七楼说的十分正确,为了帮助一些新人,我也补充一点实际操作。
$: 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!
回复