You are not logged in.
I just spent some time struggling with a frustrating vim 7.1 problem. Using the mouse to cut and paste within a vim session stopped working when upgraded from 7.0. I don't use gvim, btw, nor do I have it loaded.
After downgrading to 7.0 and doing some detective work with ":set" I found that :set mouse= or :set mouse=v will give me the behavior I wanted. For 7.1 the setting defaults to mouse=a. With that setting I was being put in "(insert) visual" mode where the mouse was basically useless. Since I also use vim for command line editing it really pissed me off!
Here is my .vimrc entry:
" Ref: http://vimdoc.sourceforge.net/htmldoc/options.html#'mouse'
" Ref: http://vimdoc.sourceforge.net/htmldoc/t … ouse-using
set mouse=v
I thought I'd share this in case anyone else had the same problem.
I saw a post in the forum from quite a while back that seemed to indicate having gvim installed may have something to do with maintaining the behaviour I wanted. As I said, tho, I don't use it nor want it.
Hope this helps someone! And any comments by those more in the know about Arch and vim compilation would be helpful and educational to me. I'm not new to Linux (a Slacker), but am fairly new to Arch.
Snork
I don't want to be the Go-To Guy. I want to be the Go-Past Guy. He's
the guy you rush past on your way to bother the first guy.
Me, 08/05
Offline
Hope this helps someone!
Oh yes
thank you, you saved my day
Offline
I encountered the same problem with copy/paste from the clipboard and the vim upgrade to 7.1
After searching in the vim tips pages, I found http://www.vim.org/tips/tip.php?tip_id=1065 which gives me the answer.
Now I have in the /etc/vimrc file :
" In many terminal emulators the mouse works just fine, thus enable it.
"set mouse=a
set nopaste
if has("gui_running")
"mouse visual block (ala MS Word)
nmap <A-LeftMouse> ms<LeftMouse><C-v>`so
imap <A-LeftMouse> <Esc><C-v>`^ms<Esc>gi<LeftMouse><C-o><C-v>`so
vmap <A-LeftDrag> <LeftDrag>
vmap <A-LeftMouse> <C-v><LeftMouse>msgv`s
vmap <S-LeftMouse> v<LeftMouse>msgv`s
set mouse=ra
else
"paste toggle
nmap <F7> :set paste! paste?<CR>
imap <F7> <C-o>:set paste!<CR>
vmap <F7> <Esc>:set paste!<CR>gv
"xterm mouse with middleclick paste
nnoremap <MiddleMouse> i<MiddleMouse>
vnoremap <MiddleMouse> s<MiddleMouse>
set pastetoggle=<F7> mouse=rnv
endif
This works for me.
Last edited by berbae (2007-06-28 09:45:09)
Offline
Thanks Snork:) Have to say my temporary solution realy starded at my nerves...:P
cat >> tempfile
paste everything and exit cat
back to vim and :read tempfile
Offline
You guys are welcome! I figured if I was cussin' up a blue streak about this, many others also were. Just sharin' the wealth.
I don't want to be the Go-To Guy. I want to be the Go-Past Guy. He's
the guy you rush past on your way to bother the first guy.
Me, 08/05
Offline
I just found the same after few days of making tricks with the mouse. Isn't a bug? Should it work this way in default mode?
Offline
I agree this is not a bug, but this is a very bad default configuration !
Thanks for the info I was really annoyed too
Last edited by LiFo2 (2007-06-29 14:07:14)
Offline
Yes, thank you for this invaluable piece of advice! You also saved my day
Offline
fyi. holding shift down and then clicking the mouse button you want works too.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
thanks
Offline
Hello,
Seems that problem is back again.
I also changed my virc to 'set mouse = v' to be able to use the copy/paste stuff.
So thanks for the tip. They also told that on the bug-reports :
http://bugs.archlinux.org/task/12051
and
http://bugs.archlinux.org/task/7534
But does anybody knows why is the default to 'set mouse = a' ?
Offline
thank you very much for sharing this tip!
Offline
Saved the day. I was so thankful I registered just to say, "Thanks!"
Offline
From my experience it all depends on what terminal I use. With konsole, no problems pasting in 'mouse=ni' mode, in stjerm, pasting isn't allowed. I've mapped to F7 and F8:
map <F7> <Esc>:set mouse=<CR>
map <F8> <Esc>:set mouse=ni<CR> " Mouse navigation
The first allows me to paste from the x clipboard in insert mode. Or if xclip is installed I use F9 and F10 (pasting only works when not in insert mode):
vmap <F9> :!xclip -f -sel clip<CR> " Copy to X clipboard
map <F10> mz:-1r !xclip -o -sel clip<CR>`z " Paste X clipboard
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline