Questions tagged [mouse]

Questions about the use of a mouse with Vi or Vim.

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

Automatically add a newline when dragging text from browser into Neovim

One of my workflows is drag lines with the mouse from the browser to Neovim (Gnome Terminal) in insert mode. What I'm trying to accomplish is putting a new line after dragging every line, without ...
Javier Ortega's user avatar
1 vote
1 answer
124 views

Vim's keyboard/mouse input handling

How does Vim/Neovim get input from the user? I am trying to make my input parser but cannot find a way to detect meta keys (Ctrl/Shift/Alt) with mouse input nor can I detect mouse movement - only ...
JosefLitos's user avatar
0 votes
0 answers
45 views

Issue: Vim scrolls when cursor is moved

I'm not exactly sure what triggers this behavior, but my vim randomly starts scrolling in response to cursor movement (mouse and touchpad). It always scrolls down. Restarting the terminal restores the ...
Surya's user avatar
  • 21
1 vote
2 answers
178 views

LeftMouse focus window without moving cursor

Is there a way for clicking on a Vim window to focus that window if inactive (without moving the cursor), then move the cursor if the window is already active? Here's what I've got so far: function ...
thirstyice's user avatar
0 votes
0 answers
41 views

What's controlling Vim paste behaviour?

What's controlling Vim paste behaviour via Vim over ssh using putty with right-click paste set to Linux host? To start we have: VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 27 2023 00:00:00) ...
chipfall's user avatar
  • 103
0 votes
1 answer
287 views

Focus-follows-mouse in Neovim?

Is it possible to get focus-follows-mouse behavior in terminal Neovim? Please note this is different from this question about how to focus a window by clicking the mouse. This question is about how to ...
Alex Burka's user avatar
0 votes
1 answer
85 views

somehow paste to random location ... tell vim to always ignore any roller actions from mouse middle roller button

I have been using vi or vim for many years however recently ( past year or two ) when I paste some highlighted text vim seems to paste highlighted text ( more often than not ) to random location in ...
Scott Stensland's user avatar
1 vote
1 answer
219 views

How to make vim position the cursor with custom mapping for <C-LeftMouse>?

I am using vim 8.2 in terminal with mouse support (mouse=a) and trying to define a custom mapping for <C-LeftMouse>. The mapping itself works but the problem is that vim stops setting cursor ...
Maxim V.'s user avatar
1 vote
1 answer
828 views

Copying from Windows clipboard

On my Windows 10 box, when using git bash, I am able to righ-click on git bash window and choose paste to flush the contents of the Windows clipboard to my vi text buffer. Now, when I ssh into a ...
Gergely's user avatar
  • 293
4 votes
1 answer
987 views

How can we get the third mouse option with cut, copy paste in neovim?

I am new to Neovim and using the default terminal in Ubuntu for Neovim. With the default terminal, we can click the right mouse and get the options for cut, copy and paste. How can I get this type of ...
Eka's user avatar
  • 143
0 votes
0 answers
181 views

how to copy text with mouse when nu and mouse=x is set in neovim

The only time the mouse does not select the numbers when mouse is set is if mouse is set to v. But you cant copy the text with right click or menu key.
Drek's user avatar
  • 11
1 vote
1 answer
3k views

How does "set mouse=a" actually work?

Could somebody explain, what is the reason to use set mouse=a? People say that thus I will be able, for example, to resize split windows (:sp, :vsp) by dragging separators, but I already can do it if ...
user90726's user avatar
  • 123
3 votes
2 answers
4k views

Mouse not working inside Alacritty

I am facing an issue with my vim. The mouse isn't working. I have set set mouse=a in my vimrc. I have checked it inside vim that the mouse value is set to "a". But it's still not working. ...
Merajul Arefin Pial's user avatar
7 votes
1 answer
7k views

How to disable mouse in Neovim?

I'm on Arch Linux with alacritty, zsh and neovim nightly (NVIM v0.5.0-dev+1069-g02a966386). I've read several posts on disabling the mouse in vim including 13566 and have put the following in my init....
ChocolateOverflow's user avatar
0 votes
1 answer
57 views

Why does the cursor end up on the wrong line when <Esc><Esc> is mapped to something?

In vim --clean, I insert these lines: One Two Three Four Five Six Then I do: :set mouse=a :nnoremap <Esc><Esc> <Nop> (From my observations, the mapping could be to anything. :...
Flux's user avatar
  • 1,021
0 votes
1 answer
655 views

How to make mouse click ALSO enter Insert mode?

I've enabled mouse and clipboard and ... something else: set mouse=a set clipboard+=autoselect guioptions+=a That's almost perfect, but I want it so that when I left click it moves the cursor and ...
coolaj86's user avatar
  • 135
1 vote
0 answers
1k views

How can I stop vim from automatically entering visual mode when I click into the PuTTY window with my mouse?

I suspect this is the same in vim as well, but fwiw I'm actually using nvim. For a long time I've used set mouse=a so I can choose to navigate my file with the mouse, if I so wish. What I've never ...
Codemonkey's user avatar
2 votes
1 answer
354 views

How do I enable mouse in netrw only (terminal vim)?

I would like to be able to use my mouse to scroll and click on directories to expand them in netrw. I don't want the mouse to be on for any other filetype/buffertype, so that I can still highlight/...
wxz's user avatar
  • 151
0 votes
1 answer
30 views

how to make the scrollwheel work in the window created by `vert term`?

OS version: uname -a Linux mydebian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux vim verson: vim --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15) ...
showkey's user avatar
  • 1,120
0 votes
1 answer
443 views

How to enable right click mouse in gvim?

I can use right click mouse in vim. It can't be used in my gvim. How to enable right click mouse in gvim?
showkey's user avatar
  • 1,120
3 votes
1 answer
399 views

Why has vim started launching the ilist on FocusGained?

Recently, on Debian Sid (accessed via SSH from an ArchLinux machine using Terminator), something has started triggering the [I / :ilist function whenever vim gains focus. If I start vim without ...
Dan's user avatar
  • 131
2 votes
1 answer
352 views

clicking on a line with concealed characters

Let's say I have a latex file with a line $\nabla_Y Z = \nabla_X Y$ If I set conceallevel=2 this becomes ∇_Y Z = ∇_X Y which is nice. If I have my cursor on another line and want to change the Z I ...
0x539's user avatar
  • 197
4 votes
1 answer
2k views

Visual block selection using mouse in Neovim

Is it possible? I set mouse=a, go to VISUAL BLOCK mode but when I click and move pointer, neovim falls into VISUAL and mouse selects character-wise.
vatosarmat's user avatar
0 votes
0 answers
469 views

vim: is possible to use mouse to move lines around

Question: Is possible to use mouse to move lines around? Requirements & Clarification I do know keyboard solutions. normal mode ddp d2j'}p dapggp alike. cmdline commands, :co. '<,'>m'a etc....
qeatzy's user avatar
  • 960
3 votes
2 answers
3k views

How to scroll down the output of coc help without using the mouse?

When coc prompts with information about what a class / function does there's help to the right, but if I want to scroll down within this help I have to use the mouse. I'm wondering if there's a nicer ...
baxx's user avatar
  • 1,025
3 votes
1 answer
493 views

Focus follow mouse

I use mouse wheel scroll on two panes. In order to focus one pane, I must first click to focus it, then scroll. Is there a way to focus upon mouse moving? This is also known as Focus follow mouse in ...
bilabila's user avatar
  • 131
3 votes
0 answers
135 views

How to disable mouse scroll wheel when in normal mode?

I want to completely disable the mouse but mouse scrolling in normal mode is not disabled. I have disabled other mouse function but scrolling in normal mode is still on. To disable the mouse I have ...
user avatar
7 votes
6 answers
2k views

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

Does Vim have functionality similar to tmux's display-panes command for selecting (goto) a specific window by number? Sometimes when I've many windows open, it can be a pain to navigate them by C-w ...
Shuzheng's user avatar
  • 1,215
3 votes
1 answer
1k views

copy-paste selection locally when editing files on remote headless server

When connected to a remote headless Linux server via SSH, I want to be able to do 3 things: select text using the mouse and copy the selection into my local X clipboard paste from local X clipboard ...
J-S's user avatar
  • 33
5 votes
0 answers
90 views

gvim: Make the mouse follow CTRL-W_j and CTRL-W_k

I run a Linux/GNOME laptop where the focus follows the mouse, and I have vim's mousefocus feature turned on, so the selected viewport follows the mouse, too. But when I try to switch viewports using ...
Michael Scheper's user avatar
2 votes
0 answers
34 views

Allow pasting into all modes, not just insert [duplicate]

I use command-line vim in xterms (actually TERM=rxvt-unicode) and have long been used to allowing X to manage all mouse interactions, with vim remaining blissfully unaware of the difference between ...
Dave Sherohman's user avatar
1 vote
0 answers
203 views

Using mouse to navigate to type using YouCompleteMe plugin

I'm trying to map ctrl+click event to generic navigation for java types using YouCompleteMe plugin. There's plugin command to do that: :YcmCompleter GoTo it navigates to "most sensible" place for type ...
g4s8's user avatar
  • 213
3 votes
2 answers
4k views

Mapping Ctrl + mouse click

I want to map Ctrl + mouse click to a command: nnoremap <C-???> :YcmCompleter GoTo<CR> Is it possible to do that using nnoremap? What symbol should I use for that?
g4s8's user avatar
  • 213
2 votes
4 answers
1k views

Don't use scrolloff=5 for mouse clicks

I use (Neo)Vim with mouse=a and scrolloff=5. Clicking on one of the top or bottom five lines with the mouse causes the screen to jump (so that the new cursor position is more centered), which ...
0x539's user avatar
  • 197
1 vote
1 answer
4k views

How to disable default mouse wheel behavior in iTerm?

I have: nnoremap <ScrollWheelUp> k nnoremap <S-ScrollWheelUp> k nnoremap <C-ScrollWheelUp> k nnoremap <ScrollWheelDown> j nnoremap <S-ScrollWheelDown> j nnoremap <C-...
tga's user avatar
  • 419
1 vote
1 answer
902 views

Split resizing with mouse not working after upgrade from ubuntu 16.04 to 18

I use to be able to resize my vim splits using the mouse in the terminal by clicking on the borders and dragging. Now I can't. How can I make it work again? edit: still works in gvim but doesn't work ...
ivan's user avatar
  • 263
0 votes
1 answer
622 views

Scroll wheel inserts seemingly-random characters in cygwin vim, depending on where on the screen the mouse cursor is

I have the following options set to non-default values, as reported by :redir @+ | :set | @redir end: --- Options --- autochdir cscopetag foldcolumn=7 hlsearch lazyredraw relativenumber sidescroll=1 ...
PrincessRTFM's user avatar
2 votes
2 answers
1k views

hide the WinBar (TermDebug)

Vim 8.1 add a new :Termdebug command with a really good gdb integration. If the mouse option is set, there is also a visual bar appearing on vim. Here is an extract of the man: If 'mouse' is set the ...
Charles Gueunet's user avatar
3 votes
1 answer
491 views

How to use "FocusGained" to stop my cursor from moving

I tend to use GVim a lot. Very frequently, I'll click on some other window and then when I click on vim to regain focus, my cursor will end up in some random location depending on where I clicked. I ...
DJMcMayhem's user avatar
  • 17.5k
0 votes
1 answer
229 views

Is it possible to do not expand the Visual-mode selection with ScrollWheelUp/Down?

When I select some text in Visual mode (either with keyboard or mouse), and I scroll the mouse wheel up/down, the visual mode expands the selection in up/down direction according to the mouse ...
xyx's user avatar
  • 422
0 votes
1 answer
626 views

How to setup the default browser to follow hyperlinks [closed]

On a text file with a hyperlink (http://url/) if I hover the mouse over the hyperlink and click on it, it is opened on chrome. How can I change the browser that vim decides to use when following ...
capstain's user avatar
38 votes
4 answers
54k views

Fully disable mouse in console vim

I saw completely disable mouse in console vim on Stack Overflow. It sounded like exactly what I wanted, but there the problem was related to Cygwin, so the title was a misnomer. I want to know how ...
James M. Lay's user avatar
8 votes
4 answers
4k views

How to disable moving the cursor with the mouse

I've been using Vim for decades (and Vi before it since around 1984.) I use it now on Linux. Somewhere along the line one behavior crept in that I'd like to disable: when I click in a window to move ...
4dummies's user avatar
  • 233
3 votes
1 answer
440 views

Console vim(x): Can I map the scroll wheel to undo--redo?

It's sort-of a follow to a recent XKCD. I want to know whether it's possible to map the scroll wheel to undo and redo, possibly n undos/redos per scroll? I'm using mate-terminal in MATE 1.6.x, bash, ...
yo''s user avatar
  • 1,141
3 votes
1 answer
2k views

How can I use mouse=a for local and remote work?

I do use the same vimrc on my local machine and on a remote machine to which I connect through SSH. I keep the vimrc synced between the machines for commodity. My issue starts when I set mouse=a, I ...
grochmal's user avatar
  • 1,656
3 votes
1 answer
875 views

Can I use the mouse scroll wheel to browse the auto-completion popup menu?

Is is possible to use <ScrollWheelUp> and <ScrollWheelDown> while the auto-complete popup is open? I tried using the map inoremap <expr> <ScrollWheelUp> pumvisible() ? "<Up&...
Luke Davis's user avatar
  • 1,397
10 votes
2 answers
2k views

Visual scrolling/visual <C-e> and <C-y> across wrapped lines?

This has been asked on stackoverflow before, but it seems it still has no solution. Perhaps that has changed with Vim 8.0. I'd like to be able to scroll (i.e. scroll-wheel, or <C-y>/<C-e> ...
Luke Davis's user avatar
  • 1,397
1 vote
1 answer
2k views

Cancel mouse highlight on mac

Whenever I use vim, sometimes I make a single-touch touchpad on vim screen and it makes a highlight like the picture below. The problem is this I cannot cancel this highlight. right click doesn't ...
zcahfg2's user avatar
  • 113
5 votes
2 answers
941 views

Can I scroll in vim with my touch screen?

I frequently use gvim on a windows 7 computer with a touch screen. If I flick up or down with the touch screen, it creates a selection (in S mode, not V mode). I'm not really a fan of this default ...
DJMcMayhem's user avatar
  • 17.5k
1 vote
2 answers
3k views

disable previously enabled mouse with Vim script

I've added this script to my vimrc file command! EnableMouse :call EnableMouseFunction() function! EnableMouseFunction() let command = ":set mouse=a" exe command endfunction So, ... what is ...
sensorario's user avatar