首页 > 解决方案 > nvim 中的 set mouse = a for 是什么?

问题描述

我不确定我可以问这个问题,但我找不到关于 mouse = a 的信息,我只是发现它不能再用“ctrl + c”和“ctrl + v”复制或粘贴,但是我设法像往常一样做,我想知道 set 的用途是什么"mouse=a",它是否对我有用,或者在哪种情况下对我有用,因为我发现的只是那个错误,我可以甚至在 vim 页面上都找不到它,如果你能给我一个页面,我可以知道下面显示的 init.vim 的每个部分,那就太好了,非常感谢你的理解。

我澄清说我刚刚在 Windows 10 上安装了 neovim,我完全是个菜鸟

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

标签: vimneovim

解决方案


:set mouse=a 'a' 表示所有 vim 模式:视觉正常插入命令行

这是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.

推荐阅读