mg979 / vim-visual-multi

Multiple cursors plugin for vim/neovim
MIT License
4.25k stars 83 forks source link

<C-down> doesn't work in vim master (commit 6938e27) #120

Closed wimstefan closed 4 years ago

wimstefan commented 4 years ago

Describe the issue: When I try to create a cursor with <C-Down> in vim the vertical cursor is not created and the cursor is jumping two lines up instead. Other cursor creating motions as <S-{Left,Right}> do work as intended. Same if I first mark some lines with v3j for example and create the cursor column afterwards with \\c

Steps to reproduce

  1. place your cursor at the beginning of a word
  2. press <C-Down>
  3. the cursor jumps up two lines and visual multi is not activated

That happens both with this minimal vimrc and the when invoking with the tutorialrc as described in the README.

None of this happens with nvim and the same configuration.


mg979 commented 4 years ago

In vim 8.1 (debian buster) it works. It could be some bug of recent vim versions, if you map something else to <C-Down> does it work? Does <C-Up> work?

mg979 commented 4 years ago

Btw I built vim from source (8.2.0934) and I can't reproduce it.

wimstefan commented 4 years ago

In vim 8.1 (debian buster) it works. It could be some bug of recent vim versions, if you map something else to <C-Down> does it work? Does <C-Up> work?

Nope. <C-Up> goes in Insert-mode at the end of the line. Strange that you can't reproduce that with a self compiled version ... it might be interesting to compare vim --version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun  8 2020 09:23:22)
Included patches: 1-931
Modified by Gentoo-9999
Compiled by swimmer@localhost
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
+clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
-cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       +X11
-dnd               +mouse             -sound             +xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        +xsmp_interact
+ex_extra          -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H     -march=native -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: x86_64-pc-linux-gnu-gcc   -Wl,-E  -Wl,-O1 -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf   -lacl -lattr -ldl   -Wl,-E -Wl,-O1 -Wl,--as-needed  -L/usr/lib64/perl5/5.30.3/x86_64-linux/CORE -lperl -ldl -lm -lcrypt -lutil -lc  -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm      
wimstefan commented 4 years ago

Well that's interesting!!! I've compiled it also by hand (not with the live-ebuild from Gentoo) with minimal configuration options ./configure --enable-python3interp=yes --enable-perlinterp=yes --prefix=/usr/local and I get exactly the same misbehaviour when running src/vim -Nu ~/.vim/pack/packager/start/vim-visual-multi/tutorialrc :scriptnames is really minimal as well:

  1: ~/.vim/pack/packager/start/vim-visual-multi/tutorialrc
  2: ~/.vim/pack/packager/start/vim-visual-multi/plugin/visual-multi.vim
  3: ~/.vim/pack/packager/start/vim-visual-multi/autoload/vm/plugs.vim
  4: ~/.vim/pack/packager/start/vim-visual-multi/autoload/vm/maps.vim
  5: ~/.vim/pack/packager/start/vim-visual-multi/autoload/vm/maps/all.vim

What else do you need from me to tackle that issue?

mg979 commented 4 years ago

In vim (not neovim) if I do

nmap <esc> <esc>

I get strange behaviours for arrow keys. You sure you don't have anything mapped? Try

mapclear
mapclear <buffer>

And see if it keeps happening. Anyway I think it's a problem of escape keys (maybe terminal related, can you try another terminal emulator), not a problem with this plugin. I use xfce4-terminal.

Anyway make sure you use the same exact minimal vimrc as described in issue creation:

set runtimepath=$VIMRUNTIME
set packpath=
set nocompatible
set noloadplugins

" set the correct path to the plugin!
set runtimepath^=path/to/vim-visual-multi

runtime plugin/visual-multi.vim

then run with

vim -u this_vimrc -U NONE some_file
wimstefan commented 4 years ago

That was it! It is a terminal thing :) It works (also without the minimal vimrc) in uxterm and kitty and it doesn't work with alacritty (my terminal of choice) and urxvt.

How to proceed now? Contact the developers of alacritty?

mg979 commented 4 years ago

How to proceed now? Contact the developers of alacritty?

If you like. I'm closing this since it's not a plugin issue.

wimstefan commented 4 years ago

After talking to the developers of alacritty it seems that this is a known issue of vim when using it with another terminfo than xterm-* ... they don't have a solution for that and recommend to configure term in the vim configuration. Done with set term="xterm-256color" and problem solved.

mg979 commented 4 years ago

Thanks maybe I'll add it to the documentation.