Displaying "Ctrl + O" in vim does not work

I just installed Ubuntu 16.04 and then installed vim. Soon I realized that Ctrl + Owhich I regularly use in vim to go to the last place does not work! After some searching, I got the following commands:

:nnoremap <M-Left> <C-O>

and

:nnoremap <X1Mouse> <C-O>

I tried to put both of these in mine .vimrc, but they do not give me the desired effect. This annoys me a lot, as it is one of the most used things that I use. What am I missing?

Edit : I reinstalled vim from scratch, also deleted the file ~/.vimrc. After deleting the file, I checked /usr/share/vim/vimrc; it was there. Then I installed vim and tested it on Ctrl+o; It works until I close the file. However, after I open it, he forgot the whole story.

+4
source share
1 answer

Well, the actual answer mentioned in the comments is that your vim configuration files do not have proper rights to them. In addition to this, the key mappings that you used in your question are not allowed according to the docs:

:help X1Mouse

The X1 and X2 buttons refer to the extra buttons found on mice.
The 'Microsoft Explorer' mouse has these buttons available to the right thumb.
Currently X1 and X2 only work on Win32 environments.

and

:h M-Left
Alt-Left        Move cursor to the beginning of the previous word

M = alt.

Put this in your vimrc. Turn on the mouse first:

set mouse=a
map <LeftMouse> <c-o>

Despite the fact that Vim uses inefficient gluing of movements together, if you want to get to any place on the screen, which the mouse solves well and much faster than Vim :)

+1
source

Source: https://habr.com/ru/post/1686040/


All Articles