Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is set mouse = a for in nvim?

Tags:

vim

neovim

I'm not sure I can ask this question, but I can't find information about what mouse = a is for, I just find that it can no longer be copied or pasted with "ctrl + c" and "ctrl + v", however I manage to do as I normally would, I want to know what is the use of set "mouse=a", If it works for me or not, or in which cases it would work for me, because all I find is that error, I could not even find it on the vim page, it would be very good if you could show me a page where I can know what each part of my init.vim shown below thank you very much for your understanding.

I clarify that I just installed neovim on Windows 10, I am completely a noob at this

set mouse=a
set numberwidth=1
set clipboard=unnamed
syntax enable
set showcmd
set ruler
set cursorline
set encoding=utf-8
set showmatch
set signcolumn=yes
set noexpandtab
set tabstop=4 shiftwidth=4

filetype plugin indent on

set list

set relativenumber
so ~/.vim/plugins.vim
so ~/.vim/plugin-config.vim
so ~/.vim/maps.vim

colorscheme gruvbox
let g:gruvbox_contrast_dark = "hard"
"highlight Normal ctermbg=NONE
set laststatus=2
set noshowmode

" Javascript
autocmd BufRead *.js set filetype=javascript.jsx
autocmd BufRead *.jsx set filetype=javascript.jsx
augroup filetype javascript syntax=javascript

"" Searching
set hlsearch                    " highlight matches
set incsearch                   " incremental searching
set ignorecase                  " searches are case insensitive...
set smartcase                   " ... unless they contain at least one capital letter
like image 244
KSIER45 Avatar asked Dec 23 '22 16:12

KSIER45


1 Answers

:set mouse=a the 'a' means all vim modes: visual, normal, insert, command line.

This is the help of vim:

'mouse'                 string  (default "", "a" for GUI, MS-DOS and Win32,
                                        set to "a" or "nvi" in defaults.vim)
                        global
        Enable the use of the mouse.  Works for most terminals (xterm, MS-DOS,
        Win32 win32-mouse, QNX pterm, *BSD console with sysmouse and Linux
        console with gpm).  For using the mouse in the GUI, see gui-mouse.
        The mouse can be enabled for different modes:
                n       Normal mode and Terminal modes
                v       Visual mode
                i       Insert mode
                c       Command-line mode
                h       all previous modes when editing a help file
                a       all previous modes
                r       for hit-enter and more-prompt prompt
        Normally you would enable the mouse in all five modes with:
                :set mouse=a
        If your terminal can't overrule the mouse events going to the
        application, use:
                :set mouse=nvi
        The you can press ":", select text for the system, and press Esc to go
        back to Vim using the mouse events.
        In defaults.vim "nvi" is used if the 'term' option is not matching
        "xterm".

        When the mouse is not enabled, the GUI will still use the mouse for
        modeless selection.  This doesn't move the text cursor.
like image 82
Lews Avatar answered Jan 25 '23 23:01

Lews