You are not logged in.

#1 2012-10-19 02:55:46

Goran
Member
Registered: 2012-01-24
Posts: 92

Vim - Multiple messages for a single :w operation.

You can see vim messages with the :messages command. If you do :echom "Hello World!", :messages should give you a single message, which is "Hello World!". However, when I save a file with (:w), :messages shows two messages:

"source/main.c" 173L, 3166C written
"source/main.c" 173L, 3166C written

Is this normal? I mean, I would expect a single message, for a single :w operation. The fact that it's happening twice per write would imply that vim is, for some reason, writing the same file twice.

Any guidance would be appreciated.

Offline

#2 2012-10-19 03:14:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Vim - Multiple messages for a single :w operation.

This made me curious, and it does this for me as well.  I guess this is normal behavior, but it does indeed seem rather odd.

Offline

#3 2012-10-19 12:52:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim - Multiple messages for a single :w operation.

I get a single "Hello world" and a single line when writing.

Post your .vimrc. What plugins are you using?

Offline

#4 2012-10-19 13:54:25

Goran
Member
Registered: 2012-01-24
Posts: 92

Re: Vim - Multiple messages for a single :w operation.

I'm just running with the default /etc/vimrc file.

Offline

#5 2012-10-19 14:00:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim - Multiple messages for a single :w operation.

Goran wrote:

I'm just running with the default /etc/vimrc file.

Switched my .vimrc to https://projects.archlinux.org/svntogit … ckages/vim and I still get one line.

Offline

#6 2012-10-19 20:04:42

Goran
Member
Registered: 2012-01-24
Posts: 92

Re: Vim - Multiple messages for a single :w operation.

Well, I'm happy it works for you, but I still have the previously described problem.

Maybe you have a different version of vim?

Here's what I get when I run vim --version:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 15 2012 03:54:20)
Included patches: 1-661
Compiled by ArchLinux
Big version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff 
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi 
+file_in_path +find_in_path +float +folding -footer +fork() +gettext 
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall 
+linebreak +lispindent +listcmds +localmap +lua +menu +mksession +modify_fname 
+mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm 
-mouse_sysmouse +mouse_xterm +mouse_urxvt +mouse_sgr +multi_byte +multi_lang 
-mzscheme +netbeans_intg +path_extra +perl +persistent_undo +postscript 
+printer -profile +python -python3 +quickfix +reltime +rightleft +ruby 
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop 
+syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
 +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual 
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup 
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save 
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15   -I/usr/local/include  -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -rdynamic -Wl,-export-dynamic  -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lnsl   -lacl -lattr -lgpm -ldl  -L/usr/lib -llua  -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -lrt -ldl -lcrypt -lm  -L/usr/lib   

Maybe this is only an issue with the "Big" version.

Offline

#7 2012-10-19 20:07:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim - Multiple messages for a single :w operation.

I'm using stock vim 7.3.661-1 from [extra].

My 'vim --version' says 'Big version without GUI.
You have some gvim config files listed

  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"

- aren't you using gVim?


Edit: I've installed gvim but I still cannot reproduce it.
I'm using a 32-bit Arch.

Last edited by karol (2012-10-19 20:14:19)

Offline

#8 2012-10-19 20:16:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,554
Website

Re: Vim - Multiple messages for a single :w operation.

I have Big version without GUI (7.3.661-1) and also get the double message from a ":w"

Mine is a 32-bit system.  I don't know if/why that'd be relevant, but it is one potential difference.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2012-10-19 20:48:29

Goran
Member
Registered: 2012-01-24
Posts: 92

Re: Vim - Multiple messages for a single :w operation.

karol wrote:

- aren't you using gVim?

No. I'm running vim in xterm.

Trilby wrote:

Mine is a 32-bit system.  I don't know if/why that'd be relevant, but it is one potential difference.

Same here.

Offline

#10 2012-10-19 20:52:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim - Multiple messages for a single :w operation.

Maybe it's some plugin?

$ pacman -Qqs ^vim
vim
vim-runtime
vim-spell-pl

Offline

#11 2012-10-19 20:56:51

Goran
Member
Registered: 2012-01-24
Posts: 92

Re: Vim - Multiple messages for a single :w operation.

I don't know, but here's what I get:

$ pacman -Qqs ^vim
gvim
vim-runtime

Offline

#12 2012-10-19 21:59:08

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Vim - Multiple messages for a single :w operation.

I don't get a repeated message with th ":w" command with vim run in an xterm or urxvt or using gvim.  Could the difference be a result of the 'shortmess' settings?

From the documentation, /usr/share/vim/vim73/doc/message.txt:

The ":messages" command can be used to view previously given messages.  This is especially useful when messages have been overwritten or truncated.  This depends on the 'shortmess' option.

The number of remembered messages is fixed at 20 for the tiny version and 200 for other versions.

My shortmess options are:

:se shm
  shortmess=filnxtToOI

The only shortmess option I have deliberately set in my '.vimrc' is to stop the intro  or welcome splash:

set shortmess+=I

Offline

#13 2012-10-19 22:01:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim - Multiple messages for a single :w operation.

OP said he's using the stock /etc/vimrc https://bbs.archlinux.org/viewtopic.php … 0#p1178300

Offline

Board footer

Powered by FluxBB