Nvim :help
頁面,使用 產生器 從 原始碼 使用 tree-sitter-vimdoc 解析器產生。
vim-patch.sh
https://github.com/neovim/neovim/blob/master/scripts/vim-patch.sh 查看 Vim 修補程式的狀態./scripts/vim-patch.sh -l
git clone https://github.com/neovim/neovim.git
./scripts/vim-patch.sh -l
以查看遺失的 Vim 修補程式列表。8.0.0123
。./scripts/vim-patch.sh -p 8.0.0123
git log --grep
或 git log -G
來搜尋 Nvim/Vim 原始碼的歷史記錄(即使是已刪除的程式碼)。例如,要尋找 reset_option_was_set
git log -p -G reset_option_was_set
git log
選項(如 --grep
和 -G
)傳遞給 ./scripts/vim-patch.sh -L
來篩選未合併的 Vim 修補程式。例如,要尋找 +quickfix
修補程式./scripts/vim-patch.sh -L --grep quickfix -- src
vim-patch:8.x.xxxx
(無空格)vim-patch:8.0.0123
(無空格)runtime/
修補程式的提示 https://github.com/neovim/neovim/pull/1744#issuecomment-68202876version.c: update
PR,請以以下格式在提交訊息中包含 NA 修補程式vim-patch:<version-or-commit> vim-patch:<version-or-commit> ...
<version-or-commit>
是一個有效的 Vim 版本(如 8.0.0123
)或提交 ID(SHA)。每個修補程式都應位於單獨的行中。./scripts/vim-patch -p <na-patch> ./scripts/vim-patch -p <na-patch> ... ./scripts/vim-patch -P <patch> git rebase -i master
:scriptversion
相關的功能。(Nvim 僅支援 Vimscript 版本 1。)請注意,標記為 Vim9:
的修補程式可能仍然包含對程式碼庫其他部分適用的修正,因此這些修補程式需要單獨檢查。testdir/Makefile
的更新通常為 NA,因為 Makefile 會隱式尋找 https://github.com/neovim/neovim/commit/8a677f8a4bff6005fa39f090c14e970c3dfdbe6e#diff-b3c6ad6680a25a1b42095879e3a87104R52 所有 test_*.vim
檔案。*.proto
變更:Nvim 自動產生函式原型#ifdef
微調:例如,Vim 決定為所有平台啟用 FEAT_VISUAL
,但 Nvim 已經這樣做了。新增新的 FEAT_
保護也不與 Nvim 相關。src/Make_*
、src/testdir/Make__*
if_*.c
變更:if_python.c
等已移除。term.c
變更:Nvim TUI 使用 libtermkey
來讀取終端序列;Vim 的 term.c
已被移除。job
修補程式:API 和實作不相容src/channel_*
、src/job_*
、src/testdir/test_channel_*
、src/testdir/test_job_*
:terminal
修補程式:API 和實作不相容src/terminal_*
、src/testdir/test_terminal_*
defaults.vim
修補程式src/gui_*
、src/gvim_*
、src/GvimExt/*
、src/testdir/test_gui*
balloon
變更:Nvim 不支援 balloon 功能src/beval_*
、src/testdir/test_balloon_*
test_popupwin.vim
、test_popupwin_textprop.vim
的螢幕截圖測試:https://github.com/neovim/neovim/pull/12741#issuecomment-704677141src/json*
、src/testdir/test_json.vim
test_restricted.vim
受限模式在 https://github.com/neovim/neovim/pull/11996 中被移除test_prompt_buffer.vim
中的許多測試需要不相容的 Vim 功能,例如 channel
;它們仍應包含,但應跳過Filelist
、README
、INSTALL
src/nvim/version.c
中的 Vim 修補程式列表會根據 Nvim git 記錄中是否存在 vim-patch:xxx
token 自動更新 https://github.com/neovim/neovim/pull/7780。src/nvim/version.c
。scripts/vim-patch.sh -p
會故意省略 version.c
,以避免合併衝突並在移植修補程式時節省時間。scripts/vimpatch.lua
) 僅能識別 vim-patch:8.0.1206
等 token,而無法識別 vim-patch:<hash>
。memory.c
https://github.com/neovim/neovim/blob/master/src/nvim/memory.c 以取得更多資訊。----------------------------------------------------------------------- Deprecated or removed Replacement ----------------------------------------------------------------------- vim_free xfree VIM_CLEAR(&foo) XFREE_CLEAR(foo) malloc alloc lalloc lalloc_id ALLOC_ONE xmalloc calloc lalloc_clear xcalloc realloc vim_realloc xrealloc mch_memmove memmove vim_memset copy_chars copy_spaces memset vim_strbyte strchr vim_strncpy strncpy xstrlcpy/xmemcpyz vim_strcat strncat xstrlcat VIM_ISWHITE ascii_iswhite IS_WHITE_OR_NUL ascii_iswhite_or_nul vim_isalpha mb_isalpha vim_isNormalIDc ascii_isident vim_islower vim_isupper mb_islower mb_isupper vim_tolower vim_toupper mb_tolower mb_toupper mb_ptr2len utfc_ptr2len mb_ptr2len_len utfc_ptr2len_len mb_char2len utf_char2len mb_char2bytes utf_char2bytes mb_ptr2cells utf_ptr2cells mb_ptr2cells_len utf_ptr2cells_len mb_char2cells utf_char2cells mb_off2cells utf_off2cells mb_ptr2char utf_ptr2char mb_head_off utf_head_off mb_tail_off utf_cp_bounds mb_strnicmp2 utf_strnicmp MB_STRNICMP2 utf_strnicmp mb_lefthalve grid_lefthalve mb_fix_col grid_fix_col utf_off2cells grid_off2cells ml_get_curline get_cursor_line_ptr ml_get_cursor get_cursor_pos_ptr ml_get_curline_len get_cursor_line_len ml_get_cursor_len get_cursor_pos_len screen_char ui_line screen_line grid_put_linebuf screen_* (most functions) grid_* update_prepare, update_finish #9484 removed; use update_screen only ARRAY_LENGTH ARRAY_SIZE vim_strsave_escape_csi vim_strsave_escape_ks vim_unescape_csi vim_unescape_ks gettail path_tail mch_isFullName path_is_absolute script_do_profile profile_init -----------------------------------------------------------------------
mb_
函式時,請務必注意 utf_
和 utfc_
之間的差異。此外,間接呼叫語法 (*mb_ptr2len)(...)
應取代為一般函式呼叫 utfc_ptr2len(...)
。----------------------------------------------------------------------- Data type Format (Vim source) Portable format (Nvim source) ------------ ----------------------- ---------------------------------- long long "%lld" "%" PRId64 size_t "%ld" "%zu" linenr_T "%ld" "%" PRIdLINENR -----------------------------------------------------------------------
ga_init2
已重新命名為 ga_init
,而原始的 ga_init
已不存在。src/testdir/*.in
) 應轉換為 Lua 測試(請參閱 #1286 https://github.com/neovim/neovim/issues/1286 和 #1328 https://github.com/neovim/neovim/pull/1328)。請參閱遷移舊式測試的檢查清單 https://github.com/neovim/neovim/blob/master/test/README.md#checklist-for-migrating-legacy-tests。src/testdir/*.vim
) 轉換為 Lua。「新式」Vim 測試比舊式測試快,而且轉換它們會花費時間和精力,不如將這些時間花在其他地方。只需將它們複製到 test/old/testdir/*.vim
。enc_utf8
或 has_mbyte
的條件已過時(僅適用「true」的情況)。CSI
僅在具有 FEAT_GUI
的 Vim 中是必要的。CSI
在 Nvim 中的類型超前緩衝區中沒有特殊含義。(另請參閱 https://github.com/neovim/neovim/pull/16936)list_T
和 listitem_T
)已在 https://github.com/neovim/neovim/pull/7708/ 中變更。有一個針對「舊」用法的 lint,但以下是最重要的變更。list_T list
:一個列表listitem_T li
:list
的一個項目int val
:lv_copyID
的值-------------------------------------------------------------------------------------- Old New Comment ------------------------------- ------------------------------------------------------ list->lv_first tv_list_first(list) list->lv_last tv_list_last(list) li->li_next TV_LIST_ITEM_NEXT(list, li) To be avoided if possible, must use list which li belongs to. li->li_prev TV_LIST_ITEM_PREV(list, li) To be avoided if possible, must use list which li belongs to. Suggestion by @ZyX-l: Use TV_LIST_ITER or indexing instead of the previous two calls. list->lv_len tv_list_len(list) list->lv_lock tv_list_locked(list) &li->li_tv TV_LIST_ITEM_TV(li) list->lv_refcount++ tv_list_ref(list) val = list->lv_copyID val = tv_list_copyid(list) list->lv_copyID = val tv_list_set_copyid(list, val) for (li = list->lv_first; TV_LIST_ITER_CONST(list, li, Use TV_LIST_ITER(...) if you need to li != NULL && another_cond; { if (another_cond) {break;} code}) modify list items (note: assigning copyID is also modification and this happens li = li->li_next) code always when recursively traversing a list). --------------------------------------------------------------------------------------
typval.h
和 typval.c
。{僅在編譯時使用...}
:絕大多數功能都已設為非可選(請參閱 https://github.com/neovim/neovim/wiki/Introduction)$VIMRUNTIME/lua/vim/filetype.lua
)。邏輯編碼在三個表格中,依優先順序排列(傳回第一個符合的項目):1. filename
用於文字完整路徑或基本名稱查找;2. pattern
用於根據 lua-patterns 比對檔名或路徑,並針對快速查找進行最佳化;3. extension
用於文字副檔名查找。$VIMRUNTIME/lua/vim/filetype/detect.lua
中實作。"*[mM]akefile" regex -> "makefile", "Makefile" filenames "*.js\c" regex -> "js", "jS", "Js", "jS" extensions模式比對有幾個差異
"*/debian/changelog" -> "/debian/changelog$" "*/bind/db.*" -> "/bind/db%."
/
,則父模式沒有特殊的比對行為。"/etc/"
、"/log/"
);"/conf"
, "git/"
);"nginx"
)。".*/etc/a2ps/.*%.cfg"
"/etc/"
或 "%.cfg$"
"%.“
(速度快但不夠精確) 或 "/a2ps/.*%."
(精確但速度慢)