2401vim, a complete list of important changes and updates to vim

original

2023

better UTF-16support

Add strutf16len()and utf16idx(), and add flags in byteidx(),byteidxcomp()and , in the document.charidx()utf16内置.txt

Add to'crypymethod' xchacha20v2

Basically xchacha20the same as, but more resistant libsodiumto change.

2022

Add to"smoothscroll"

Use the mouse to scroll 换行the screen rows instead 文本行.

Add to "statusline"and"tabline"'showcmdloc',%S

controlled "showcmd", 显示位置or added to 状态行或标签行.

Support kitty-keyboard-protocolkeyboard protocol, add'keyprotocol'

To KiTTYthe terminal; better handling 修改键.

Add WinResizedevent

Event窗口 fired when the size is changed .

WinScrolledFits inactive windows, more information available

Previously, it only fit 当前窗口, and was not 更改内容informative, scrolling .

Add options to col()andcharcol()winid

另一个Get 光标列, col , char from window .

readblob()Add the offsetand parameters in sizeto allow reading character devices

Before, it was always read 整个文件, read block .

Add to'lispoptions'

Settings lispoptions=indentexpr:1, 'lisp'allow use when enabled 'indentexpr'.

Add toTextChangedT

Fires after text in a 终端window更改 .

"shortmess"add in"C"

Suppress messages during 补全(ins-completion)process

The sound feature macOSworks on

sound_playevent()It fits here now macOS.

Add to:echowindow

Show message in 弹窗; Also add popup_findecho()here.here

"fillchars"Add the last line in

Sets the character when 'display'containing fillcharsor .truncate使用

Add to"splitkeep"

When controlling 打开,关闭或调整the level .分割滚动行为

matchaddpos()Many matches can be added

Previously the limit was 8, here .

dummy text

Allow adding dummy text to the buffer.

Give up support for WindowsXPpeaceVista

Add tokeytrans()

Convert 转义序列to string, here .

Add to:defer

函数Run code on exit , here .

Add flags to writefile()andmkdir()'D'

On exit 函数, delete 文件或目录, 1 , 2 .

窗口Set cursor shape in terminal

termcap-cursor-shapeSuitable 窗口, here .

Add togetscriptinfo()

:scriptnames, but more convenient for scripts, here , 1 .

Add tosetcmdline()

From 脚本Settings 命令行内容和光标位置, here .

Add toindexof()

Use 回调函数, to find a value in a list, here .

Support 双,点和虚线underline

The underline attribute can :highlightbe used in 双,点和虚.

Add tovirtcol2col()

虚列Take it from 字节索引, here .

Add <<ampersand >>_

按位移位symbol.

Add toautocmd_add(),autocmd_get(),autocmd_delete()

autocmdFunctions for operations , add , take , delete .

'formatoptions'Add / in

When used on rows with 内联注释(only ) , do not insert .'cindent'o\\

addgetcmdcompltype(),getcmdscreenpos()

Get 当前命令行the complement of 类型和位置1 , 2 .

Add string interpolation

$When used as a string 前缀, {...}internal ; such as

$"Hello, {$USER} at {strftime('%c', localtime())}"

add column to"breakindentopt"

In 指定列the 缩进flexible packaging industry.

restore mapping

mapset()Accepts returned from maparg()or allowing for easy mapping. 1 , 2 , 3maplist()字典保存和恢复

Add toisabsolutepath()

Check 路径if it is 绝对路径, 1 .

Add tomaplist()

Get all映射 lists.here

Add tohl-CurSearch

高亮Current.here 搜索匹配项_ _

Allowed to heredocbe used in

If added eval, expressions for heredocmiddle presses are allowed =expr:

let lines =<< trim eval END
    See the file `=$HOME`/.vimrc
END

Support channelLSP

通道Supported in 语言-服务器-协议(LSP).

Add to--log

启动Start recording when .

WinScrolledevent

滚动Fired after window content.

Add :profilestop and dump

(previously only on exit Vim), allows 停止analysis and 配置文件dumping 文件into. here

UnixOpen channel on domain socket

ch_open("unix:/tmp/socket")

Add "fuzzy"to "wildoptions"_

Command line "模糊"completion.

DirChangedPreevent

Triggered before directory 更改.

Add and "errorformat"_%e%k

尾行和列.

will "pum:"be added to'wildoptions'

Yes 命令行补全, show 弹出菜单.

add "timeout"to"spellsuggest"

Limit 搜索spell suggestion time; previously it was always 5000milliseconds.

P in visual mode

( ) text in 可视mode without copying the text into."放"粘贴已删除未命名寄存器

win_move_separator(),win_move_statusline()

移动and resize the window. 1 , 2

2021

内置.txt

eval.txtsplit into内置.txt

*exprAllow local script functions in options

Now available as setdiffexpr=s:MyDiffExpr().

Add to:argdedeupe

参数列表Duplicate items from 删除.

reduce(),filter()and map()works on strings

Assign a value λto an option with a function

'operatorfunc','tagfunc','completefunc','omnifunc'and 'imactivatefunc'now acceptable λ.

Add tohl-CursorLineSign,hl-CursorLineFold

Adjust " 'cursorline'" 符号高亮.

Add tohlget(),hlset()

Programming operations 高亮. 1 , 2

Add WinClosedevent

关闭Triggered when the window is opened.

Add tov:colornames

Maps 颜色名to hexadecimal code.

Add to"guiligatures"

Supported for GTKGUIuse in 连字.

Add to'thesaurusfunc'

同义Completion function.

ModeChangedevent

模式Triggered on change.here

Add multiple spaces to"listchars"

No matter where it is, 两个或多个spaces are displayed.

Add todigraph_get(),digraph_getlist(),digraph_set(),digraph_setlist()

列举并定义Dichotomy of functions. 1
2
3
4

add list to"breakindentopt"

Extra indent (with "formatlistpat"settings) 编号列表或项目符号lines matching the list .添加

Add \%.l,\%<.land \%>.lpattern

Matches 光标the current line; see /\%lhere .

Add to'cryptmethod'=xchaha20

libsodiumof 更安全加密.

Add tozp,zP,zy

zpWithout 尾随空格block mode 粘贴, zywithout 尾随空格copying.

Add to{% "Status Line"

{%expr%}According to "statusline"format string 重新计算.

:vimgrepAdd f flag in

"模糊"Matching :vimgrepresults.Here _

Add to"autoshelldir"

终端Automatically change the directory in the window Vim.

Add tostrcharlen()

Separate combination symbols, take 串计数的长度here .

Traverse string

The loop string is 'for char in "str"'; loops use combinators 按代码点.

Expand"fillchars"

New values: rows represented by "eob"changes , and change flags. Can be set on a per-window basis (previously always ). Also allowed for use in and .(~)不存在"foldopen","foldclose""foldsep""foldcolumn"
"fillchars"全局"fillchars""statusline"多字节符

add followwrapto"diffopt"

Yes 差异窗口, don't reset "换行".

Add tofullcommand()

缩写Take from 完整命令名(eg :s->:substitute), here

lead: "ListChars"in

When set "list", 高亮leading spaces.

Detect focus events in terminal

FocusGainand FocusLostautocommands can work 终端within . See xterm-focus-event.

:sleep!

休息并隐藏cursor.

Add tocharcol(),getcharpos(),setcharpos(),getcursorcharpos(),setcursorcharpos()

col(),getpos(),setpos(),getcurpos(),cursor()related 多字节versions.

2020

addcharidx()

Convert 字节索引to 符索引.

add VimSuspendandVimResume

暂停/恢复Triggers when; only on <C-z>, not SIGSTP/SIGCONTsignals. 1 , 2

Add to<Cmd>

Do not use this更改 so that there is no need to use or , always in the mode . For example,键映射模式<C-u><C-o>插入或可视映射有效noremap<C-q><Cmd>:normal!K<CR>

:sortand sort()can be sorted locally relevantly

:sortlor sort(...,'l').

matchfuzzy(),matchfuzzypos()

"模糊"match.

Add toInsertLeavePre

离开Trigger here before insert mode .

??symbol

echo value ??

If the value is empty, use the above.

Add togettext()

Available for翻译 plugins.Here

Add tosetcellwidths(),charclass()

宽度歧义符Coverage is allowed 显示宽度.

Add g<Tab>;support :tabnext#, :tabclose#etc.

g<Tab>Returns 上次访问的选项卡the reference :tab*in the command .#上次访问的选项卡

expand('<SID>')

Useful for *funcand settings, such as*expr

let &includexpr = expand('<SID>') .. 'fun()'

to uses:fun()

Add to"quickfixtextfunc"

Customized ; can also be passed here快修窗口 according to parameters文本内容setqflist()

Sort for readir(),readirex()adding

Add to readdir()and to sort. here and herereaddirex()可选参数控制

Add toterminalprops()

List 此终端supported functions .

Add to'spelloptions'

唯一The accepted values ​​are words 驼峰(camel)to spell check CamelCase.

Add toSigUSR1autocmd

Events to SIG_USR1detect .

Add toflatten()

flatten list

Add togetreginfo()

Returns register information details; can be passed setreg()here恢复 .

Add tosearchcount()

Get 当前搜索relevant details .

Allow setting underline color in terminal

Can be set :highlightusing , available if enabled .ctermul下划线颜色'termguicolors'guisp

Add toreduce()

化简List as single value here .

Add toreadirex()

Similar to readdir(), but returns 带属性a dictionary (i.e. Unixabove stat()).

Add togetmarklist()

Similar :marks, take 标记列表here

add unsignedto"nrformats"

数字Ignore the preceding -and always treat it <C-a>as <C-x>the positive of the sum so 1985-06-18that 正常it works as above.

Add tomapset()

Map from script 设置, and 恢复mappable, here .

LuaCall Vimfunction from

vim.call("fun_name", "arg")
vim.fn.fun_name("arg")

LuaCall the function from Vim.

IPv6Support in channels

IPv6Support in channels

Add toechoraw()

No processing required, output to terminal; can be used to send 转义码, here .

Add optional error code to:cquit

Use 指定代码exit instead of always use 1. Added v:exitingin 8.2.2070.

2019

rand()andsrand()

Generate 随机数. 1 , 2

interrupt()

Aborted运行 script.

strptime()

解析Time string here

:terminal ++shell

shellRun the:terminal command in.here

v:argv

Vimused when calling 命令行参数.

Add togM

Move 行的中间here .

hl-LineNrAbove,hl-LineNrBelow

Highlighted "relativenumber"when setting .光标上下方行号

Add to'cursorlineopt'

更多控制How to display "光标".

Borders and alignment'completepopup'

Control 补全弹出menu 更多选项.

"completeopt"Pop-ups in

(Alternative to press 预览窗口) 弹窗Show 额外completion information in .

:spellrare

Mark words by rarity in spell files .

->symbol

expr->fun(args)is fun(expr, args)a quick way to improve readability:

[1, 2]->map({
    
    _, v -> v + 1})

see method

Pop-ups

弹窗Similar 补全窗口, but can be controlled to VimScripta moderate 更大degree. See popup "previewpopup". This is still an experimental feature.

"Complete slash"

Override 'shellslash'to complete.

#{}dictionary annotation

The notation is the same as a normal dictionary except that it 键值is not required :引号#{}{}表示法

#{
    
    foo: "bar"}

sound function

Playable sound; see sound_playevent().

v:option_command,v:option_oldlocal,v:option_oldglobal

Improved OptionSetevents.

:constant

Constant , equivalent to the following

:let v = 1 | :lockvar v

win_execute()

in the context of the specified windowexecute() .

"wincolor"(warm color)

Yes 此窗口, use it 高亮组instead of hl-Normal.

g:actual_curwin,g:statusline_winid

When running in " 状态行"( %{expr}) .表达式临时设置

:let=<<

HeredocAssignment, here :

let text =<< trim END
    text
END

text attribute

Assigned 元数据to , as an alternative to syntax highlighting. See . This is still the 缓冲case .文本Vimtextprop实验性功能

listener_add()

A callback缓冲 called when a change is added .

Default values ​​for function parameters

Such as function Fun(value=10). See optional-function-argument.

:xrestore

重启重新连接Arrive later X服务器.

environ(),getenv()andsetenv()

处理environment variables, 1 2 3 .

chdir()

Use the 域和恢复capability 更改catalog.

:cbefore,:cafter

Browse 光标before and after 错误.

Show matching locations when searching

When n is used "S"and is not in "shortmess"the middle tense, it is displayed "3/44".

:cabove,:cbelow,:labove,:lbelow

Browse 光标related errors.

Control 窗口font weight on

"guifont"Used in to "W"control 窗口font weight on. See gui-font.

Tab-localTable of contents

See.similar directory :tcdwith .:lcdwindow-local

v:Prefix is ​​required

In the past, counting was also possible. :scriptversion>=3At that time , v:a prefix was required.

winnr()Add more parameters to

Find the neighbor window .

CompleteChangedevent

After every change " 插入模式" 补全menu, here .

str2list()andlist2str()

按字节列表Conversion , and vice versa.

readdir()

Get 目录content here .

:scriptversion

Specify VimScriptcompatible versions.

..symbol

Concatenation symbols, since one .is ambiguous, "a"..'b'and 'a'."b"are the same. Also added ..=.

:autocmdParameters ++once_

Only run once 自动命令, such as:

au CursorMoved * ++once :echom 'ONCE'

Add window IDparameters tomatchdelete(),clearmatches(),getmatches(),setmatches()

complete_info()

Get information about the current completion .

rubyeval()

Calculation Rubyformula.

CTRL-W_gtkey combination, CTRL-W_gTkey combination

Like gtand gTswitch tabs. Mainly used to 终端窗口switch from.

*=,/=,%=

like,let var*=2

a:variables are immutable

Previously, variables could sometimes be changed a:.

[:ident:], [:keyword:], [:fname:]

The third character allowed "listchars"in"tab:"

set listchars=tab:(_)

As above, 按制表符set 最后符the settings 第三个符and press to (______)display tabs.

Blobtype

BlobStores text starting with, as in 二进制数据. See here .Blob0z0zDEADBEEFblob

"FormatOptions""p"logo in

Not in the 句点back .单个空格换行

:redrawtabline

"tabline"Redraw after changes tabline(for plug-ins).

sign_place(),sign_unplace()wait

定义和保存Flag functions 1 , 2 .

Allow functions and commands to redefine themselves

In the past, functions always had to be added !to 函数. Now it is smarter, and it allows overwriting . That is, in or , there is no need or addition anymore.覆盖相同名字Vim函数自身vimrc插件自动加载!

:filterSupport more commands

here

:tlmenu

终端of 弹出菜单.

include xdifflibraries

Include difflibraries without dependencies 外部工具to improve diffquality. Many new "diffopt"settings like:

set diffopt+=internal,algorithm:patience

It's a very good setup.

"\

继续行注释;See line-continuation-comment:

au FileType git
            "\ Go to commit.
            \  nnoremap <Leader>g :exe printf(":!cd ~/src/vim && git diff %s^\!", split(getline("."), ' ')[1])<CR>
            "\ Delete commit.
            \| nnoremap <Leader>d :call search('^commit ', 'bc') \| :exe 'd' . (search('^commit ', 'n') - line("."))<CR>

cfilterplug-in

filter快修/位置列表

'vartabstop','varsofttabstop'

Variable 制表位宽度, such as set vartabstop=4,8making the first one 制表符a 4个space and the rest as 8个spaces.

OptionSetautocmd

Fires whenever 设置an option is selected.

prompt buffering

Mainly used to 作业provide 用户输入.

Allowed :unlet_$ENV

取消It couldn't really be set before 环境变量(just set to 空串).

CTRL-R CTRL-L

In 命令行, 缓冲insert rows from

job_info()List all jobs without parameters

mkdir('p')Does not fail if directory already exists

Add terminal API.

See terminal-apihere .

trim()

clear 空格; must be used before substitute(), here .

will "!"be added to"guioptions"

For !shellcommands, use Vima terminal window.

terminal menu

Make :popupand right click and 终端work in.

窗口24Bit color in console

See "termguicolors".

‘pumwidth’

补全of the menu 最小宽度.

DirChangedevent

(Use :cd,:lcdetc. 目录when changed, [here] 9https://vimhelp.org/autocmd.txt.html#DirChanged)

CmdlineChangedevent

In 命令行, 更改after text, here .

2017

TextYankPostevent

复制或删除After the text, here .

win_screenpos().

Get 窗口location here .

CmdlineEnter,CmdlineLeave

进入和离开When using the command line. 1 , 2

:terminal

Terminal buffering .

--clean,'viminfofile'

No plug-ins are needed, 默认just start using settings Vim.

"cinoptions"E mark in

Indent externblocks 设置.

'pyxversion',:pythonx

Make it easier to run code in Python2and out of available code.3Python

Guess you like

Origin blog.csdn.net/fqbqrr/article/details/135411393