Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

+ and - work as expected only in the insert mode. When I try to yank a line in the visual mode using "+y combination, + causes cursor to move one line up and - one line down. The last pressed key field resets " and in it's place appears a number of lines to yank.

I couldn't find any tips in the help, regarding unbinding + from the Carriage Return, CtrlM motion. Very irritating.

With or without .vimrc, effect is exactly the same. Maybe problem with mappings. Here is output of several commands:

---------showkey       
key 12                    # pressing +

----------showkey -a    
+ 43 0053 0x2b             # pressing +

----------dumpkeys |grep plus 
keycode  12 = plus             question         backslash        Control_underscore


----------xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p' 

20 plus                    # pressing +

----------cat .vimrc 
set fileencodings=iso-2022-jp,euc-jp,cp932,utf8,default,latin1
"colorscheme distinguished
filetype on
filetype plugin on 
filetype indent on

set stl=%f\ %m\ %r\ [Fmt=%{&ff}][Typ=%Y]\ Line:%l/%L[%p%%]\ Col:%c\ Buf:%n\ [%b][0x%B]
set autowrite
set noswapfile
set hidden "no need to save buffer before

set nocompatible

set autoindent
set si
set wrap
set spell
set nobackup

set ruler
set showcmd
set number
set cursorline

set tabstop=4
set expandtab
set smarttab
set shiftwidth=4

set incsearch
set mouse=a
syntax on
set hlsearch

set hid "change buffer no save
set incsearch
set magic "for regex
set wildmenu
set ls=2
set cmdheight=1


----------vim --version

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul  2 2013 18:30:39)
Included patches: 1-1287
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    -netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    
+farsi           +mouse_netterm   +syntax          
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -D_FORTIFY_SOURCE=2 -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   -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        -lm -lncurses  -lacl -lattr -lgpm -ldl   -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       


share|improve this question
    
Apart from the fact that you have duplicate commands and that you should always use longform options (hidden vs hid) for clarity I see nothing wrong in your vimrc. What about $ vim --version? –  romainl Jul 16 '13 at 14:24
    
Done - added in the edited question above. –  Piotr Jul 16 '13 at 16:47
    
Thanks -romainl- your comment put me on the right tracks. –  Piotr Jul 16 '13 at 18:18
    
OK. Of course you can't use "+y if Vim is not built with clipboard support. So much time wasted for such a simple cause. –  romainl Jul 16 '13 at 18:57

3 Answers 3

up vote 1 down vote accepted

If anyone will came across problem like this here is a similar issue, with slightly different symptoms, and the same answer.

http://unix.stackexchange.com/questions/25965/vim-unnamed-register-or

share|improve this answer

"As expected"? But what do you expect?

In insert mode, + and - are supposed to insert a + and a -.

In normal mode, + and - are supposed to move the cursor one line up and down.

In visual mode, + and - are supposed to move the cursor one line up and down, expending/contracting the selection.

+ only means "clipboard register" when it is typed after a " (or in some contexts after a @).

If you are trying to yank to the "+ register you must first tell vim which register to use, then do the operation.

"+y

After you have typed the ", typing + won't move the cursor and Vim wil just wait patiently until you tell it what you want to do with that register (ydc).

share|improve this answer
    
in visual, after choosing a piece of text, "+y combination : " no problem, " appears on my status-bar + causes cursor to move one line up, and " on the status-bar gets replaced by a digit(number of highlighted lines). –  Piotr Jul 16 '13 at 6:02
    
Visually selecting and yanking anything shouldn't change anything to your statusline (if that's what you call "status-bar"). If you have set showcmd, you are supposed to get 1 on the right of the command line after you have pressed v, then the number increases while you extend the selection, then it is replaced by " when you press ", then it becomes "+ when you press +, then it becomes "+y when you press y and disappears. Pressing " puts you in a mode similar to operator-pending mode where Vim waits idly for your input. No cursor movement should happen between " and y. –  romainl Jul 16 '13 at 7:07
    
If that's not what happens, post your config. You should have done it right from the start, actually. –  romainl Jul 16 '13 at 7:08
    
Done - added in edited question. Just reinstalled vim, no difference. –  Piotr Jul 16 '13 at 13:32

If I understand your problem correctly, you'll want to press + just after choosing the register, not after y.

The correct way to yank to the " register is "+y.

share|improve this answer
    
I miss-typed my post, correction is applied. –  Piotr Jul 16 '13 at 5:42
    
I just shifted from Mint to Arh with Awesome. No matter if in X-windows or in the console, always same result, both "+" keys react in the same way. No mappings on this one. –  Piotr Jul 16 '13 at 5:50
    
Sorry, no idea then. –  Dean Jul 16 '13 at 6:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.