What is set mouse = a for in nvim? - vim

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

: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.

Related

VIM: Backspace deletes in normal mode, but does nothing in insert mode.

Preliminary Info:
Issue is in terminal Vim, not gVim
I used CMDER (based on conemu) as my terminal emulator
I am on Windows 10
Detailed Description:
When I'm in Insert mode, I can type text as normal, but backspace does nothing. While in normal mode, the backspace key deletes text. This is exactly opposite the behavior I had just earlier today. I have read numerous other posts online describing Vim's unorthodox backspace behavior, but the suggested config settings (namely bs=2 or bs=indent,eol,start) had done nothing.
More unusual is that gVim behaves "normally" that is: Backspace move the cursor to the left in normal mode, and deletes text in insert mode.
What I would like is for backspace to delete text in insert mode (just like most other programs) and to be navigation/disabled in normal mode. How can I regain this behavior?
Below is a copy of my _vimrc: (I would put this on github but my git is messed up at the moment and I've yet to fix it.) Additionally there was a function that was inside of the _vimrc by default. I have no idea what it does but omitted it to save space. If you want to see if I can post it in a reply.
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
" Pathogen - Plugin manager
execute pathogen#infect()
set nocompatible " Turns off Vi compatability gubbinz
" Color Theme
if !has("gui_running") " Allows some 256 color themes to work in Terminal
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
colorscheme gruvbox
endif
let g:gruvbox_dark_contrast = 'hard' " Both of these are just visual gruvbox tweaks
let g:gruvbox_light_contrast = 'hard'
set guifont=Consolas:h10:cANSI:qDRAFT " Changes font
set bs=indent,eol,start " Makes backspace be normal
set filetype=ON " Has vim check for filetype
set showcmd " Displays incomplete commands
set ruler " Shows position of cursor in document
set syntax=ON " Turns on syntax highlighting
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set incsearch " Searches for strings incrementally
set autoindent " Auto-indent new lines
set shiftwidth=4 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
set go=egrLTm " Changes flags that specify how the GUI loads
Most likely, your insert-mode backspace is mapped to do nothing (i.e. <nop>). Verify this by typing :verbose imap <bs>. This will show if backspace key is mapped and where the map was set.
What I would like is for backspace to delete text in insert mode (just like most other programs) and to be navigation/disabled in normal mode. How can I regain this behavior?
You can do:
iunmap <bs>
nnoremap <bs> <nop>
The first line unmaps <bs> in insert mode, thus <bs> will recover its default functionality. The second line maps <bs> in normal mode to do nothing.

Colorscheme in Vim not working on initial boot up

Let me preface by saying that I am entirely new to Vim and MacVim. I am trying to get my preferred colorscheme to work, and I have been partially successful. As it currently stands, the colorscheme will work if, once I edit into a file I type:
:syntax enable
However, on the intial load up, it does not work. I thought by putting syntax enable in my .vimrc file, that would activate it at load up, but this apparently is not working. So far, my .vimrc files looks like:
set nocompatible "We want the latest Vim settings/options
so ~/.vim/plugins.vim
filetype plugin indent on
syntax on
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "The default leader is \, but a comma is much better.
set number "Activates line numbering.
"-----------Visuals------------"
colorscheme atom-dark "Sets colorscheme.
set t_CO=256 "Use 256 colors. This is useful for terminal Vim.
set guifont=Fira_Code:h13 "Sets font and font height.
set linespace=15 "Macvim-specific line height.
set guioptions-=l "Removes left hand scroll bar.
set guioptions-=L "Removes left hand scroll bar on vertically split screens.
set guioptions-=r "Removes right hand scroll bar.
set guioptions-=R "Removes right hand scroll bar on vertically split screens.
There is some more to it, but I don't believe it's relevant. Also, I have the colorscheme saved in my ~/.vim/colors folder, if that matters. And, finally, I am using MacVim for the most part.
What am I missing to get the colorscheme to work on the initial load? Or is it just required that I always manually enable syntax each time?
Thanks for the help in advance!
EDIT
My .gvimrc file:
set nocompatible " be iMproved, required
filetype off " required
set modelines=0 " sets modeline to 0 for security
" Turn on line numbers
set number
You should remove filetype off from your .gvimrc. First, see :help gvimrc:
The gvimrc file is where GUI-specific startup commands should be placed. It is always sourced after the vimrc file. If you have one then the $MYGVIMRC environment variable has its name.
Your .vimrc file sets filetype plugin indent on. But .gvimrc will be sourced after the .vimrc file, and it sets filetype off again. So any filetype detection will not be performed within your MacVim.
Also I recommend you to make .gvimrc contain GUI-specific configurations only. This means you can remove
set compatible
filetype off
set number
from your .gvimrc. Also you can move set modelines=0 to .vimrc, but I don't think it's necessary, so you may remove it also.
Additionally, you have options which will only work with GUI enabled Vim such as guifont, linespace and guioptions in your .vimrc. To make your .vimrc work on terminal Vim too, wrap that options with if has('gui_running'). So the .vimrc would be:
set nocompatible "We want the latest Vim settings/options
so ~/.vim/plugins.vim
filetype plugin indent on
syntax on
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "The default leader is \, but a comma is much better.
set number "Activates line numbering.
"-----------Visuals------------"
colorscheme atom-dark "Sets colorscheme.
set t_Co=256 "Use 256 colors. This is useful for terminal Vim.
if has('gui_running')
set guifont=Fira_Code:h13 "Sets font and font height.
set linespace=15 "Macvim-specific line height.
set guioptions-=l "Removes left hand scroll bar.
set guioptions-=L "Removes left hand scroll bar on vertically split screens.
set guioptions-=r "Removes right hand scroll bar.
set guioptions-=R "Removes right hand scroll bar on vertically split screens.
endif
First, you mistyped t_CO; it's t_Co.
Second, that line is completely useless. Remove it and configure your terminal emulator correctly instead.
Third, colorscheme atom-dark will only work in the MacVim GUI. If you want atom-dark to work in Vim you'll need to use the atom-dark-256 variant. Note that atom-dark-256 is machine-generated so there will probably be many differences between Vim and MacVim.
Four, use the project's issue tracker.

gVim 7.4 for Windows, Windows 7: Windowing issues and mouse weirdness

Out of nowhere, I started having weird issues with gVim. Here's a short list:
When I try to move the window with my mouse, clicking the title bar puts vim into Insert mode, and the window won't move.
Sometimes, if I click again, vim goes back into Command mode. Sometimes it doesn't.
Sometimes, the window moves. Sometimes, it doesn't.
Sometimes, clicking the title bar and dragging highlights text.
Sometimes, when I try to switch back to Insert mode and insert text wherever my cursor is, the cursor jumps to the beginning of the line.
What's killing me is that I haven't made any changes to my vimrc or gvimrc. This happened out of nowhere.
I reinstalled gVim, and nothing changed.
Here's my gvimrc, which lives on disk at C:\Users\jpavlick\_gvimrc:
colors desert
set guifont=Consolas
set guioptions=m
set guioptions=t
set listchars=tab:>-,nbsp:-
set list
Here's my vimrc, which lives on disk at C:\Users\jpavlick\_vimrc:
set nu
set tabstop=4
set shiftwidth=4
set backspace=indent,eol,start
syntax on
set autoindent
au BufReadPost *.cshtml set syntax=html
au BufReadPost *.edi set syntax=edifile
au BufReadPost *.sql set syntax=tsql
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 expandtab

Vim ignores window splitting settings in netrw

I would prefer if vim opens new windows on the right old window (when using vsplit) and under old window (when using split).
I read that I should set splitright and set splitbelow to my .vimrc. I added also g:netrw_altv=1 and g:netrw_alto=1. This settings doesn't work in netrw browser when I hit v button or type :vsplit file.txt.
My .vimrc:
syntax enable
set splitright
set splitbelow
let g:netrw_altv=1
let g:netrw_alto=1
set background=dar
colorscheme solarized
let g:solarized_termtrans=1
set t_Co=256
set expandtab
set tabstop=4
set shiftwidth=4
set smartindent
set smarttab
set gfn=Inconsolata\ Medium\ 11
set hls
set showmatch
set smartcase
set wildmenu
map <F2> :retab <CR> :wq! <CR>
In my case it was a bug in netrw. Updating it solved it.
http://www.vim.org/scripts/script.php?script_id=1075
Strange, as :vsp opens a new split on the right, and :sp on the bottom even without the options in my machine. You might want to take a look at this thread: http://tech.groups.yahoo.com/group/vim/message/51334

My gVim sometimes acts twice when pressing Tab, Arrow Keys, Enter and Backspace in Insert Mode

I am using gVim installed by yum of CentOS on my Thinkpad T410 laptop. The version of gVim is 7.2.411-1.8.el6(i686). When editing files in insert mode, something weird happens. When I press Tab or Enter, gVim inserts two tabs or two linefeeds. When pressing arrow keys or backspace, gVim moves two characters or deletes two characters. I don't know why it acts like this. Here is my .vimrc file, which is very simple:
syntax on
set nocompatible
set fileencodings=utf8,gb18030
set fileformats=unix,dos
set nobackup
set autoindent
set tabstop=4
set backspace=indent,eol,start
set guifont=Monaco\ 12
set hlsearch
set showmatch
colorscheme slate
Can anybody tell me what cause the problem and how I correct it? Thanks in advance.

Resources