diff options
author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
tree | 35fe43e01755e0f312650667004487a44d6b7941 /runtime/doc/vim_diff.txt | |
parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'runtime/doc/vim_diff.txt')
-rw-r--r-- | runtime/doc/vim_diff.txt | 117 |
1 files changed, 104 insertions, 13 deletions
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 4fcaf15717..a74149d050 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -17,25 +17,27 @@ centralized reference of the differences. - Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for your |config|. - Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files. -- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent +- Use `$XDG_STATE_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent session information. |shada| ============================================================================== 2. Defaults *nvim-defaults* -- Syntax highlighting is enabled by default -- ":filetype plugin indent on" is enabled by default +- Filetype detection is enabled by default. This can be disabled by adding + ":filetype off" to |init.vim|. +- Syntax highlighting is enabled by default. This can be disabled by adding + ":syntax off" to |init.vim|. - 'autoindent' is enabled - 'autoread' is enabled - 'background' defaults to "dark" (unless set automatically by the terminal/UI) - 'backspace' defaults to "indent,eol,start" -- 'backupdir' defaults to .,~/.local/share/nvim/backup// (|xdg|), auto-created +- 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created - 'belloff' defaults to "all" - 'compatible' is always disabled - 'complete' excludes "i" - 'cscopeverbose' is enabled -- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created +- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created - 'display' defaults to "lastline,msgsep" - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding) - 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│" @@ -50,6 +52,8 @@ centralized reference of the differences. - 'langremap' is disabled - 'laststatus' defaults to 2 (statusline is always shown) - 'listchars' defaults to "tab:> ,trail:-,nbsp:+" +- 'mouse' defaults to "nvi" +- 'mousemodel' defaults to "popup_setpos" - 'nrformats' defaults to "bin,hex" - 'ruler' is enabled - 'sessionoptions' includes "unix,slash", excludes "options" @@ -63,7 +67,7 @@ centralized reference of the differences. - 'tags' defaults to "./tags;,tags" - 'ttimeoutlen' defaults to 50 - 'ttyfast' is always set -- 'undodir' defaults to ~/.local/share/nvim/undo// (|xdg|), auto-created +- 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created - 'viewoptions' includes "unix,slash", excludes "options" - 'viminfo' includes "!" - 'wildmenu' is enabled @@ -76,15 +80,42 @@ centralized reference of the differences. - |g:vimsyn_embed| defaults to "l" to enable Lua highlighting +Default Mouse ~ + *default-mouse* *disable-mouse* +By default the mouse is enabled. The right button click opens |popup-menu| +with standard actions, such as "Cut", "Copy" and "Paste". + +If you don't like this you can add to your |config| any of the following: + +- ignore mouse completely > + set mouse= +< +- no |popup-menu| but the right button extends selection > + set mousemodel=extend +> +- pressing ALT+LeftMouse releases mouse until main cursor moves > + nnoremap <M-LeftMouse> <Cmd> + \ set mouse=<Bar> + \ echo 'mouse OFF until next cursor-move'<Bar> + \ autocmd CursorMoved * ++once set mouse&<Bar> + \ echo 'mouse ON'<CR> +< +Also, mouse is not in use in |command-mode| or at |more-prompt|. So if you +need to copy/paste with your terminal then just pressing ':' makes Nvim to +release the mouse cursor temporarily. + Default Mappings ~ *default-mappings* Nvim creates the following default mappings at |startup|. You can disable any of these in your config by simply removing the mapping, e.g. ":unmap Y". > nnoremap Y y$ - nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<CR><C-L> + nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR> inoremap <C-U> <C-G>u<C-U> inoremap <C-W> <C-G>u<C-W> + xnoremap * y/\V<C-R>"<CR> + xnoremap # y?\V<C-R>"<CR> + nnoremap & :&&<CR> < Default Autocommands ~ *default-autocmds* @@ -178,6 +209,8 @@ Commands: |:Man| is available by default, with many improvements such as completion |:sign-define| accepts a `numhl` argument, to highlight the line number |:match| can be invoked before highlight group is defined + |:source| works with Lua and anonymous (no file) scripts + User commands can support |:command-preview| to show results as you type Events: |RecordingEnter| @@ -209,6 +242,7 @@ Highlight groups: |hl-Substitute| |hl-TermCursor| |hl-TermCursorNC| + |hl-WinSeparator| highlights window separators |hl-Whitespace| highlights 'listchars' whitespace Input/Mappings: @@ -225,9 +259,13 @@ Options: 'cpoptions' flags: |cpo-_| 'display' flags: "msgsep" minimizes scrolling when showing messages 'guicursor' works in the terminal - 'fillchars' flags: "msgsep" (see 'display') + 'fillchars' flags: "msgsep" (see 'display'), "horiz", "horizup", + "horizdown", "vertleft", "vertright", "verthoriz" 'foldcolumn' supports up to 9 dynamic/fixed columns 'inccommand' shows interactive results for |:substitute|-like commands + and |:command-preview| commands + 'laststatus' global statusline support + 'mousescroll' amount to scroll by when scrolling with a mouse 'pumblend' pseudo-transparent popupmenu 'scrollback' 'signcolumn' supports up to 9 dynamic/fixed columns @@ -320,6 +358,8 @@ coerced to strings. See |id()| for more details, currently it uses |c_CTRL-R| pasting a non-special register into |cmdline| omits the last <CR>. +|CursorMoved| always triggers when moving between windows. + Lua interface (|lua.txt|): - `:lua print("a\0b")` will print `a^@b`, like with `:echomsg "a\nb"` . In Vim @@ -337,13 +377,17 @@ Commands: Functions: |input()| and |inputdialog()| support for each other’s features (return on cancel and completion respectively) via dictionary argument (replaces all - other arguments if used). + other arguments if used), and "cancelreturn" can have any type if passed in + a dictionary. |input()| and |inputdialog()| support user-defined cmdline highlighting. Highlight groups: |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other groups + |hl-CurSearch| highlights match under cursor instead of last match found + using |n| or |N| |hl-CursorLine| is low-priority unless foreground color is set + |hl-VertSplit| superseded by |hl-WinSeparator| Macro/|recording| behavior Replay of a macro recorded during :lmap produces the same actions as when it @@ -354,6 +398,10 @@ Macro/|recording| behavior macros and 'keymap' at the same time. This also means you can use |:imap| on the results of keys from 'keymap'. +Mappings: + Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an + existing mapping for its simplified form (e.g. <Tab>). + Motion: The |jumplist| avoids useless/phantom jumps. @@ -364,6 +412,9 @@ Normal commands: Options: 'ttimeout', 'ttimeoutlen' behavior was simplified |jumpoptions| "stack" behavior + |jumpoptions| "view" tries to restore the |mark-view| when moving through + the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|. + 'shortmess' the "F" flag does not affect output from autocommands Shell: Shell output (|:!|, |:make|, …) is always routed through the UI, so it @@ -429,7 +480,8 @@ Vimscript compatibility: `this_session` does not alias to |v:this_session| Working directory (Vim implemented some of these later than Nvim): -- |DirChanged| can be triggered when switching to another window. +- |DirChanged| and |DirChangedPre| can be triggered when switching to another + window or tab. - |getcwd()| and |haslocaldir()| may throw errors if the tab page or window cannot be found. *E5000* *E5001* *E5002* - |haslocaldir()| checks for tab-local directory if and only if -1 is passed as @@ -481,7 +533,6 @@ Commands: :tearoff Compile-time features: - EBCDIC Emacs tags support X11 integration (see |x11-selection|) @@ -490,6 +541,9 @@ Eval: *js_encode()* *js_decode()* *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead. + *v:sizeofint* + *v:sizeoflong* + *v:sizeofpointer* Events: *SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead. @@ -507,6 +561,9 @@ Highlight groups: Options: 'antialias' + *'balloondelay'* *'bdlay'* + *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'* + *'balloonexpr'* *'bexpr'* 'bioskey' (MS-DOS) 'conskey' (MS-DOS) *'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".) @@ -522,25 +579,58 @@ Options: *'imactivatefunc'* *'imaf'* *'imactivatekey'* *'imak'* *'imstatusfunc'* *'imsf'* + *'insertmode'* *'im'* Use the following script to emulate 'insertmode': +> + autocmd BufWinEnter * startinsert + inoremap <Esc> <C-X><C-Z><C-]> + inoremap <C-C> <C-X><C-Z> + inoremap <C-L> <C-X><C-Z><C-]><Esc> + inoremap <C-Z> <C-X><C-Z><Cmd>suspend<CR> + noremap <C-C> <Esc> + snoremap <C-C> <Esc> + noremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR> + cnoremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR> + inoremap <C-\><C-G> <C-X><C-Z> + autocmd CmdWinEnter * noremap <buffer> <C-C> <C-C> + autocmd CmdWinEnter * inoremap <buffer> <C-C> <C-C> + + lua << EOF + vim.on_key(function(c) + if c == '\27' then + local mode = vim.api.nvim_get_mode().mode + if mode:find('^[nvV\22sS\19]') and vim.fn.getcmdtype() == '' then + vim.schedule(function() + vim.cmd('startinsert') + end) + end + end + end) + EOF +< *'macatsui'* + *'maxcombine'* *'mco'* + Nvim always displays up to 6 combining characters. You can still edit + text with more than 6 combining characters, you just can't see them. + Use |g8| or |ga|. See |mbyte-combining|. 'maxmem' Nvim delegates memory-management to the OS. 'maxmemtot' Nvim delegates memory-management to the OS. - 'maxcombine' (6 is always used) *'prompt'* *'noprompt'* + *'remap'* *'noremap'* *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* 'shelltype' *'shortname'* *'sn'* *'noshortname'* *'nosn'* *'swapsync'* *'sws'* *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows) + *'terse'* *'noterse'* (Add "s" to 'shortmess' instead) 'textauto' 'textmode' *'toolbar'* *'tb'* *'toolbariconsize'* *'tbis'* *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* + *'ttyfast'* *'tf'* *'nottyfast'* *'notf'* *'ttymouse'* *'ttym'* *'ttyscroll'* *'tsl'* *'ttytype'* *'tty'* - 'ttyfast' 'weirdinvert' Startup: @@ -572,6 +662,7 @@ Test functions: test_scrollbar() test_setmouse() test_settime() + test_srand_seed() TUI: *t_xx* *termcap-options* *t_AB* *t_Sb* *t_vb* *t_SI* |