0

I am having issues with my vim setup. If I click, or if I scroll with the mouse inside vim, I get a strange behavior. Those actions sometimes change my mode to insert and copy or paste things from the register, or insert random characters.

I do not know when the problem started since I do not use my mouse too often inside vim. However, sometimes I click or scroll on my window, and these commands are messing up my document.

I am using arch with i3 and uxrvt. I would also share my .vimrc file, but I am new here, so I do not know if I should just copy and paste it.

I noticed that if I open vim with xterm instead of uxrvt, the mouse clicks and scrolls refresh the cursor and place it at the middle of the screen and to the left.

I have set the option set mouse=a in my .vimrc

Please help me :)

Juanch0p
  • 71
  • 8

1 Answers1

0

Ok, I figured it out what was the issue. At some point, I mapped this command: nnoremap <esc> :noh<return><esc> to disable the highlighted results of a search after pressing <esc>

When reading :h set ttymouse, I realized that the mouse clicks and scrolls return <esc> and some other characters to the editor. This, together with my remapping of <esc> was messing up the return values of my mouse.

I fixed it by removing my remapping of <esc>, but I would like to use that mapping without messing my mouse :(

Juanch0p
  • 71
  • 8
  • see if this helps: https://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting – Sundeep Oct 22 '16 at 08:58
  • Thanks, I initially got the idea of remapping `` from there. I am using now `` to achieve that purpose. Now I mapped `nnoremap :noh` – Juanch0p Oct 22 '16 at 11:54