You are not logged in.

#1 2010-03-06 13:16:55

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Vim @= behaviour

Origin: http://forum.colemak.com/viewtopic.php?pid=6246#p6246 (post #80)

See this piece of remappings (from colemak.vim):

nnoremap n h
nnoremap u k
nnoremap e j
nnoremap i l
" Turbo navigation!
nnoremap <silent> N @='5n'<CR>
nnoremap <silent> U @='5u'<CR>
nnoremap <silent> E @='5e'<CR>
nnoremap <silent> I @='5i'<CR>

Now, we tested this with a person who uses the same version of Vim as me (7.2; see :version outputs below) and we get different behaviour.
For this person, it works as expected; N makes the cursor go left 5 characters, U five lines up, etc..
For me, in contrast, N goes to the fifth next search result, U undoes five times, etc., and to get the actually desired function, i need to use 5h, 5k, etc. instead of 5n, 5e, etc., inside the @=''.

(BTW it appears to be my Vim that behaves non-standard.)

We actually got different behaviour sourcing the same :mksession output.
Why the hell is this?

Here's mine and this person's :version output, respectively (i just use Arch's normal [g]vim packages BTW):

:version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 22 2010 16:08:53)
Included patches: 1-368
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 +cryptv +cscope +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 +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang
-mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer -profile +python +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  -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/pango-1.0 -I/usr/include/glib-2.0 -I/u
sr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14     -march=i686 -mtune=generic -O2 -pipe -D_FORTIFY_SOURCE=1    -D_REENTRANT -D_GNU_SOURCE  -fstack-protector -I/u
sr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl5/core_perl/CORE  -I/usr/include/python2.6 -pthread
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,--hash-style=gnu -Wl,--as-needed -L/usr/local/lib -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpa
ngocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lXt -lncurses -lacl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -fstack-protector -L/usr/local/lib  -L/usr/
lib/perl5/core_perl/CORE -lperl -lutil -lc -L/usr/lib/python2.6/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic


:version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jun 17 2009 19:45:57)
Included patches: 1-22
Compiled by _www@b68.apple.com
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +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 +menu +mksession +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm 
-mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind -signs +smartindent -sniff +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 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H     -arch i386 -arch ppc -g -Os -pipe -mdynamic-no-pic -arch i386 -arch ppc -pipe        
Linking: gcc   -arch i386 -arch ppc             -o vim       -lm -lncurses  -liconv

Perhaps i should post this somewhere more concentrated on Vim, but it'd be helpful if i at least get some feedback on how it works on you people's Vims. As i said, i have the normal vim and gvim packages of Arch installed.

Thanks in advance.

Last edited by TaylanUB (2010-03-09 17:31:05)


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

#2 2010-03-09 17:29:33

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: Vim @= behaviour

Sorry but *bump*.

It would be really helpful if at least you could simply tell me what behaviour you get after entering the following commands to Vim, so i can know if it's related to Arch's Vim build, or entirely my issue (since i get different results than multiple other people) :

nnoremap n h|nnoremap <silent> N @='n'<CR>

After that, does pressing 'N' go five characters to the left, or does it [attempt to] go to the fifth next search result?


(note: Edited the opening post; i had forgot appending <CR> to the remaps with '@='.)

Last edited by TaylanUB (2010-03-09 17:31:26)


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

Board footer

Powered by FluxBB