58
votes
Fully disable mouse in console vim
You should add the following two lines at the end of /etc/vim/vimrc :
set mouse=
set ttymouse=
9
votes
Accepted
How can I disable all mouse functions in MacVim?
To disable all mouse functions, you can simply put this in your vimrc file:
set mouse=
For more, see :help 'mouse'.
7
votes
Accepted
Console vim(x): Can I map the scroll wheel to undo--redo?
it works for me:
set mouse=a
map <ScrollWheelUp> u
map <ScrollWheelDown> <C-R>
But i hope this is just for fun. Must be horrible =)
7
votes
Accepted
Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?
I'm not aware of any Vim feature or even plugin that does that; in fact, up until recently it would be rather hard to display it like that, but with Vim 8.2's popup windows it wouldn't be too hard; ...
6
votes
Accepted
Can I scroll in vim with my touch screen?
Note: I have not tested this with gvim, only with normal vim
This piece of code allows me to scroll instead of selecting text when I drag using my mouse.
function! MouseScroll()
"mark b is the ...
6
votes
Accepted
disable previously enabled mouse with Vim script
You don't need anything that complex
set mouse=a
" and
set mouse=
are enough.
You can even define your command to be
:command! ToggleMouse exe 'set mouse='.(empty(&mouse)?'a':'')
" Here I use ...
6
votes
How to disable moving the cursor with the mouse
From Vim Tips Wiki:
When you are using another application and select go back to Vim by
clicking inside Vim's text area, it not only switches application
focus to Vim, but it also moves the ...
5
votes
Accepted
Can I use the mouse scroll wheel to browse the auto-completion popup menu?
Your examples work fine for me on Vim 7.4.1689 and Neovim.
The following didn't work at first:
set mouse=a
Then I read the following in :h 'mouse'
Enable the use of the mouse. Only works for ...
5
votes
Accepted
Visual scrolling/visual <C-e> and <C-y> across wrapped lines?
I've released a vim plugin that pretty closely matches this behavior.
Instead of scrolling by exactly N lines, this maps <C-u>, <C-d> (half window) and <C-j>, <C-k> (quarter ...
5
votes
Accepted
Visual block selection using mouse in Neovim
Assuming you have set mousemodel=extend it's simply <RightMouse>.
5
votes
Accepted
How can we get the third mouse option with cut, copy paste in neovim?
First, you must enable mouse support with :set mouse=a.
In GVim you also need to :set mousemodel=popup to activate builtin popup menu.
In Neovim it all depends on GUI frontend, as Neovim itself has no ...
4
votes
How can I use my trackpad for horizontal scrolling?
I figured out a way to do that with Hammerspoon
and clever usage of mapping.
The first part is configuring Shift + ScrollUp and
Shift + ScrollDown to scroll horizontally. In
order to do that, you ...
4
votes
Accepted
Mapping Ctrl + mouse click
You are looking for this which I found at the bottom of :h keycodes:
nnoremap <C-LeftMouse> :echom 'Foo'<CR>
And according to :h <LeftMouse> you also need to check that set mouse ...
4
votes
Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?
You are looking for Choosewin, sadly it's not being actively developed anymore, but for the simplest use cases it works great.
4
votes
Focus follow mouse
In GVim there are set mousefocus and set scrollfocus (only Windows GVim 8.1.2257 or later).
mousefocus automatically activates window so it gets both mouse and keyboard input; scrollfocus only ...
4
votes
How to scroll down the output of coc help without using the mouse?
coc#util#float_scroll has been replaced by coc#float#scroll()
The example keymapping has been given in the documentation.
if has('nvim-0.4.3') || has('patch-8.2.0750')
nnoremap <nowait>...
4
votes
How to disable mouse in Neovim?
For those googling, the option name in neovim is just mouse:
set mouse=
3
votes
Accepted
How to keep Vim from exiting Visual Mode due to mouse clicks while mouse=a?
You could do this:
:xnoremap <LeftMouse> m`<LeftMouse>v``
This allows you to click on where you want to extend the visual selection to, rather than drag. It works best if you also
:set ...
3
votes
Scroll the screen, not the cursor, when using scrollwheel
I know this is a few years late, but you can use
nmap <Down> <C-e>
nmap <Up> <C-y>
This worked for me.
3
votes
Accepted
How to disable moving the cursor with the mouse
Here's a heavy solution:
nnoremap <LeftMouse> ma<LeftMouse>`a
It will let the click go through (thus changing the focus), but make sure the cursor always goes back to where it was before ...
3
votes
Accepted
How can I use mouse=a for local and remote work?
It works for me. I have ForwardX11 yes in my ~/.ssh/config file, which should have the same effect as running ssh with -X, and I started vim on the remote machine as vim -N -u NONE -i NONE to make ...
3
votes
Accepted
Cancel mouse highlight on mac
You can use fn to bypass Mouse Reporting for programs like vim. (i.e. do fn+left-mouse button to clear the selection.)
Source: https://superuser.com/questions/125102/mac-os-x-terminal-mouse-support/...
3
votes
Accepted
How to use "FocusGained" to stop my cursor from moving
I guess mouse clicks don't update the jump list. (:help jump-motions seems to confirm this is the case.)
Try this, for the async solution:
augroup MouseHack
autocmd!
autocmd FocusLost * set mouse=
...
3
votes
Fully disable mouse in console vim
This might work if you put it at the end of your .vimrc
set mouse=c
It's probaly not Vim that takes the mouse input, but rather your Terminal-emulator. To disable mouse support on your terminal this ...
3
votes
Why has vim started launching the ilist on FocusGained?
This appears to be a genuine bug in vim, which was fixed by the patch 8.2.2428. Both the Arch and Debian packages have now been updated to include this patch, so pacman -Syu or apt-get upgrade (...
Community wiki
3
votes
Mouse not working inside Alacritty
There are several ways Vim can recognize mouse events in the Terminal, this is why the --version has a whole bunch of flags starting with mouse: mouse_dec, mouse_xterm, mouse_urxvt, etc. There are all ...
2
votes
How to disable moving the cursor with the mouse
You can set mouse= to disable mouse entirely, use set mouse=a to restore mouse behaviour. You can automatically enable/disable mouse only in terminal vim but not in GUI vim by checking for if has("gui"...
2
votes
How to disable moving the cursor with the mouse
:nnoremap <Down> <Nop>
:nnoremap <Up> <Nop>
does the trick (in conjunction with :set mouse=). Of course, you can't use the arrow keys any more, but if you're using vim, you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mouse × 63scrolling × 12
vimrc × 11
neovim × 10
terminal × 9
cut-copy-paste × 7
gvim × 6
os-clipboard × 6
vimscript × 5
key-bindings × 5
visual-mode × 5
vim-windows × 4
cursor × 4
autocmd × 2
microsoft-windows × 2
command-line × 1
autocompletion × 1
normal-mode × 1
insert-mode × 1
external-command × 1
folding × 1
netrw × 1
split × 1
macvim × 1
linux × 1