diff options
84 files changed, 1136 insertions, 152 deletions
diff --git a/runtime/colors/blue.vim b/runtime/colors/blue.vim index 9ee878e103..7a17fc38b7 100644 --- a/runtime/colors/blue.vim +++ b/runtime/colors/blue.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan <steven@vertigan.wattle.id.au> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -82,6 +82,7 @@ hi Type guifg=#ffa500 guibg=NONE gui=bold cterm=NONE hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline hi Label guifg=#ffd700 guibg=NONE gui=NONE cterm=NONE hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -194,6 +195,7 @@ if s:t_Co >= 256 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=220 ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -309,6 +311,7 @@ if s:t_Co >= 16 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -423,6 +426,7 @@ if s:t_Co >= 8 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg diff --git a/runtime/colors/darkblue.vim b/runtime/colors/darkblue.vim index 9451e397e5..90dc304791 100644 --- a/runtime/colors/darkblue.vim +++ b/runtime/colors/darkblue.vim @@ -4,7 +4,7 @@ " Maintainer: Original author Bohdan Vlasyuk <bohdan@vstu.edu.ua> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -24,6 +24,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') endfor endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText @@ -134,6 +135,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText diff --git a/runtime/colors/delek.vim b/runtime/colors/delek.vim index 35d4934f5c..d29980d685 100644 --- a/runtime/colors/delek.vim +++ b/runtime/colors/delek.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Schweikert <david@schweikert.ch> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -24,6 +24,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') endfor endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -100,6 +101,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/desert.vim b/runtime/colors/desert.vim index 07ef937ab6..b5f404a14e 100644 --- a/runtime/colors/desert.vim +++ b/runtime/colors/desert.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Hans Fugal <hans@fugal.net> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -32,6 +32,7 @@ hi! link CursorLineSign CursorLine hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#333333 gui=NONE cterm=NONE hi StatusLine guifg=#333333 guibg=#c2bfa5 gui=NONE cterm=NONE hi StatusLineNC guifg=#7f7f8c guibg=#c2bfa5 gui=NONE cterm=NONE @@ -108,6 +109,7 @@ if s:t_Co >= 256 hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=236 cterm=NONE hi StatusLine ctermfg=236 ctermbg=144 cterm=NONE hi StatusLineNC ctermfg=242 ctermbg=144 cterm=NONE diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim index d5e081337a..2f6859ad10 100644 --- a/runtime/colors/evening.vim +++ b/runtime/colors/evening.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan <steven@vertigan.wattle.id.au> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -24,6 +24,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') endfor endif hi! link VertSplit StatusLineNC +hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -134,6 +135,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -247,6 +249,7 @@ endif if s:t_Co >= 16 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine diff --git a/runtime/colors/habamax.vim b/runtime/colors/habamax.vim index 4b4c95e050..e4113d80bb 100644 --- a/runtime/colors/habamax.vim +++ b/runtime/colors/habamax.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim <habamax@gmail.com> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -27,6 +27,7 @@ hi! link Terminal Normal hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu +hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement @@ -122,6 +123,7 @@ if s:t_Co >= 256 hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu + hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement diff --git a/runtime/colors/industry.vim b/runtime/colors/industry.vim index 6e66a4a791..edb86188a8 100644 --- a/runtime/colors/industry.vim +++ b/runtime/colors/industry.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Shian Lee. " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -86,6 +86,7 @@ hi Conceal guifg=#6c6c6c guibg=NONE gui=NONE cterm=NONE hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE hi Title guifg=#ff00ff guibg=NONE gui=bold cterm=bold hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -162,6 +163,7 @@ if s:t_Co >= 256 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=201 ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -241,6 +243,7 @@ if s:t_Co >= 16 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=magenta ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/lunaperche.vim b/runtime/colors/lunaperche.vim index 75d25e2a23..464b7af00e 100644 --- a/runtime/colors/lunaperche.vim +++ b/runtime/colors/lunaperche.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim <habamax@gmail.com> " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -93,6 +93,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#af5f5f', '#5faf5f', '#af875f', '#5f87af', '#d787d7', '#5fafaf', '#c6c6c6', '#767676', '#ff5f5f', '#5fd75f', '#ffd787', '#5fafff', '#ff87ff', '#5fd7d7', '#ffffff'] @@ -369,6 +370,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel if &background ==# 'dark' hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Statusline ctermfg=251 ctermbg=16 cterm=bold,reverse diff --git a/runtime/colors/morning.vim b/runtime/colors/morning.vim index 82a3d6d97d..463d009e88 100644 --- a/runtime/colors/morning.vim +++ b/runtime/colors/morning.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Bram Moolenaar <Bram@vim.org> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -33,6 +33,7 @@ hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#e4e4e4 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#cccccc gui=bold cterm=bold hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE @@ -107,6 +108,7 @@ if s:t_Co >= 256 hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=254 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=252 cterm=bold hi Folded ctermfg=18 ctermbg=252 cterm=NONE diff --git a/runtime/colors/murphy.vim b/runtime/colors/murphy.vim index f38c8259dd..f00bdbd608 100644 --- a/runtime/colors/murphy.vim +++ b/runtime/colors/murphy.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron <ron@ronware.org>. " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -33,6 +33,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal guifg=#87ff87 guibg=#000000 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#000000 gui=NONE cterm=NONE @@ -108,6 +109,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal ctermfg=120 ctermbg=16 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=16 cterm=NONE diff --git a/runtime/colors/pablo.vim b/runtime/colors/pablo.vim index de585adfe2..202f505136 100644 --- a/runtime/colors/pablo.vim +++ b/runtime/colors/pablo.vim @@ -3,7 +3,7 @@ " Maintainer: Original maintainerRon Aaron <ron@ronware.org> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -30,6 +30,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#808080 guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#00ffff guibg=NONE gui=NONE cterm=NONE @@ -105,6 +106,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=16 cterm=NONE hi Comment ctermfg=244 ctermbg=NONE cterm=NONE hi Constant ctermfg=51 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/peachpuff.vim b/runtime/colors/peachpuff.vim index 91c98119b3..508346a7ce 100644 --- a/runtime/colors/peachpuff.vim +++ b/runtime/colors/peachpuff.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Ne\v{c}as (Yeti) <yeti@physics.muni.cz> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -31,6 +31,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffdab9 gui=NONE cterm=NONE hi Folded guifg=#000000 guibg=#e3c1a5 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#f5c195 gui=NONE cterm=NONE @@ -105,6 +106,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=223 cterm=NONE hi Folded ctermfg=16 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=180 cterm=NONE diff --git a/runtime/colors/quiet.vim b/runtime/colors/quiet.vim index bcf2eced16..38349d76e8 100644 --- a/runtime/colors/quiet.vim +++ b/runtime/colors/quiet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans <neutaaaaan@gmail.com> " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -22,6 +22,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/retrobox.vim b/runtime/colors/retrobox.vim index a89bf0557e..f34fc99dc5 100644 --- a/runtime/colors/retrobox.vim +++ b/runtime/colors/retrobox.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim <habamax@gmail.com>, ported from gruvbox8 of Lifepillar <lifepillar@lifepillar.me> " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -22,6 +22,7 @@ hi! link Tag Special hi! link lCursor Cursor hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch hi! link Terminal Normal diff --git a/runtime/colors/shine.vim b/runtime/colors/shine.vim index f3697c9ad6..39e6dae956 100644 --- a/runtime/colors/shine.vim +++ b/runtime/colors/shine.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer is Yasuhiro Matsumoto <mattn@mail.goo.ne.jp> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -35,6 +35,7 @@ hi! link Tag Special hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#dadada gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#dadada gui=NONE cterm=NONE @@ -115,6 +116,7 @@ if s:t_Co >= 256 hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=253 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=253 cterm=NONE diff --git a/runtime/colors/slate.vim b/runtime/colors/slate.vim index c9ce78946b..319ab9e0aa 100644 --- a/runtime/colors/slate.vim +++ b/runtime/colors/slate.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ralph Amissah <ralph@amissah.com> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -31,6 +31,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#262626 gui=NONE cterm=NONE hi EndOfBuffer guifg=#5f87d7 guibg=NONE gui=NONE cterm=NONE hi StatusLine guifg=#000000 guibg=#afaf87 gui=NONE cterm=NONE @@ -110,6 +111,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=235 cterm=NONE hi EndOfBuffer ctermfg=68 ctermbg=NONE cterm=NONE hi StatusLine ctermfg=16 ctermbg=144 cterm=NONE diff --git a/runtime/colors/sorbet.vim b/runtime/colors/sorbet.vim index bd4fb7baf7..25c27bf635 100644 --- a/runtime/colors/sorbet.vim +++ b/runtime/colors/sorbet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans <neutaaaaan@gmail.com> " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/torte.vim b/runtime/colors/torte.vim index 7271188f0d..0709263f7c 100644 --- a/runtime/colors/torte.vim +++ b/runtime/colors/torte.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Thorsten Maerz <info@netztorte.de> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -33,6 +33,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#cccccc guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#80a0ff guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#ffa0a0 guibg=NONE gui=NONE cterm=NONE @@ -108,6 +109,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Comment ctermfg=111 ctermbg=NONE cterm=NONE hi Constant ctermfg=217 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/unokai.vim b/runtime/colors/unokai.vim new file mode 100644 index 0000000000..168eda1483 --- /dev/null +++ b/runtime/colors/unokai.vim @@ -0,0 +1,522 @@ +" Name: unokai +" Description: Color scheme similar to Monokai originally created by Wimer Hazenberg for TextMate +" Author: k-37 <60838818+k-37@users.noreply.github.com> +" Maintainer: k-37 <60838818+k-37@users.noreply.github.com> +" Website: https://github.com/vim/colorschemes +" License: Vim License (see `:help license`) +" Last Change: 2024 Dec 15 + +" Generated by Colortemplate v2.2.3 + +set background=dark + +" hi clear +source $VIMRUNTIME/colors/vim.lua " Nvim: revert to Vim default color scheme +let g:colors_name = 'unokai' + +let s:t_Co = &t_Co + +if (has('termguicolors') && &termguicolors) || has('gui_running') + let g:terminal_ansi_colors = ['#282923', '#c61e5c', '#81af24', '#fd971f', '#51aebe', '#ae81ff', '#80beb5', '#bababa', '#74705d', '#f92672', '#a6e22e', '#e6db74', '#66d9ef', '#fd5ff0', '#a1efe4', '#f8f8f2'] + " Nvim uses g:terminal_color_{0-15} instead + for i in range(g:terminal_ansi_colors->len()) + let g:terminal_color_{i} = g:terminal_ansi_colors[i] + endfor +endif +hi! link CursorLineFold FoldColumn +hi! link CursorLineSign SignColumn +hi! link MessageWindow Pmenu +hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel +hi! link StatusLineTerm StatusLine +hi! link StatusLineTermNC StatusLineNC +hi! link Terminal Normal +hi! link Delimiter PreProc +hi! link Operator PreProc +hi! link StorageClass PreProc +hi! link Structure PreProc +hi! link Define Identifier +hi! link Label String +hi! link markdownCode Comment +hi! link markdownCodeBlock markdownCode +hi! link markdownCodeDelimiter markdownCode +hi Normal guifg=#f8f8f2 guibg=#282923 gui=NONE cterm=NONE +hi StatusLine guifg=#282923 guibg=#bababa gui=NONE cterm=NONE +hi StatusLineNC guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi VertSplit guifg=#74705d guibg=#74705d gui=NONE cterm=NONE +hi TabLine guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineFill guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineSel guifg=#282923 guibg=#bababa gui=bold cterm=bold +hi ToolbarLine guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi ToolbarButton guifg=#74705d guibg=#f8f8f2 gui=bold,reverse cterm=bold,reverse +hi QuickFixLine guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi CursorLineNr guifg=#dadada guibg=NONE gui=bold cterm=bold +hi LineNr guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrAbove guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrBelow guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi NonText guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi EndOfBuffer guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi SpecialKey guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi FoldColumn guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi Visual guifg=#a1efe4 guibg=#282923 gui=reverse cterm=reverse +hi VisualNOS guifg=#282923 guibg=#80beb5 gui=NONE cterm=NONE +hi Pmenu guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi PmenuThumb guifg=NONE guibg=#74705d gui=NONE cterm=NONE +hi PmenuSbar guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi PmenuSel guifg=NONE guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuKind guifg=#80beb5 guibg=#585858 gui=NONE cterm=NONE +hi PmenuKindSel guifg=#80beb5 guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuExtra guifg=#bababa guibg=#585858 gui=NONE cterm=NONE +hi PmenuExtraSel guifg=#bababa guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuMatch guifg=#ffaf5f guibg=#585858 gui=NONE cterm=NONE +hi PmenuMatchSel guifg=#ffaf5f guibg=#8a8a8a gui=NONE cterm=NONE +hi SignColumn guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Error guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ErrorMsg guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ModeMsg guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi MoreMsg guifg=#81af24 guibg=NONE gui=NONE cterm=NONE +hi Question guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi WarningMsg guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Todo guifg=#dadada guibg=NONE gui=bold cterm=bold +hi MatchParen guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Search guifg=#66d9ef guibg=#282923 gui=reverse cterm=reverse +hi IncSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi CurSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi WildMenu guifg=#282923 guibg=#e6db74 gui=bold cterm=bold +hi debugPC guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi debugBreakpoint guifg=#282923 guibg=#f92672 gui=NONE cterm=NONE +hi Cursor guifg=#000000 guibg=#dadada gui=NONE cterm=NONE +hi lCursor guifg=#282923 guibg=#5fff00 gui=NONE cterm=NONE +hi CursorLine guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi CursorColumn guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi Folded guifg=#bababa guibg=#414141 gui=NONE cterm=NONE +hi ColorColumn guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi SpellBad guifg=NONE guibg=NONE guisp=#d75f5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellCap guifg=NONE guibg=NONE guisp=#ffaf5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellLocal guifg=NONE guibg=NONE guisp=#5fd75f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellRare guifg=NONE guibg=NONE guisp=#fd5ff0 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi Constant guifg=#ae81ff guibg=NONE gui=NONE cterm=NONE +hi Type guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Character guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Comment guifg=#74705d guibg=NONE gui=NONE cterm=NONE +hi String guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi Function guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Identifier guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi PreProc guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Special guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Statement guifg=#f92672 guibg=NONE gui=bold cterm=bold +hi Underlined guifg=#66d9ef guibg=NONE gui=underline cterm=underline +hi Title guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi Debug guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Directory guifg=#a1efe4 guibg=NONE gui=bold cterm=bold +hi Conceal guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi DiffAdd guifg=#5faf5f guibg=NONE gui=reverse cterm=reverse +hi DiffChange guifg=#5f87af guibg=NONE gui=reverse cterm=reverse +hi DiffText guifg=#af87af guibg=NONE gui=reverse cterm=reverse +hi DiffDelete guifg=#af5f5f guibg=NONE gui=reverse cterm=reverse +hi Added guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE +hi Changed guifg=#ffaf5f guibg=NONE gui=NONE cterm=NONE +hi Removed guifg=#d75f5f guibg=NONE gui=NONE cterm=NONE +hi htmlBold guifg=#f8f8f2 guibg=NONE gui=bold cterm=bold +hi htmlItalic guifg=#f8f8f2 guibg=NONE gui=italic cterm=italic +hi markdownHeadingDelimiter guifg=#f8f8f2 guibg=NONE gui=NONE cterm=NONE +hi markdownH1Delimiter guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi markdownH2Delimiter guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi markdownH4Delimiter guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi markdownH6Delimiter guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi markdownH3Delimiter guifg=#fd971f guibg=NONE gui=NONE cterm=NONE +hi markdownH5Delimiter guifg=#51aebe guibg=NONE gui=NONE cterm=NONE + +if s:t_Co >= 256 + hi! link CursorLineFold FoldColumn + hi! link CursorLineSign SignColumn + hi! link MessageWindow Pmenu + hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel + hi! link StatusLineTerm StatusLine + hi! link StatusLineTermNC StatusLineNC + hi! link Terminal Normal + hi! link Delimiter PreProc + hi! link Operator PreProc + hi! link StorageClass PreProc + hi! link Structure PreProc + hi! link Define Identifier + hi! link Label String + hi! link markdownCode Comment + hi! link markdownCodeBlock markdownCode + hi! link markdownCodeDelimiter markdownCode + hi Normal ctermfg=255 ctermbg=235 cterm=NONE + hi StatusLine ctermfg=235 ctermbg=250 cterm=NONE + hi StatusLineNC ctermfg=235 ctermbg=244 cterm=NONE + hi VertSplit ctermfg=244 ctermbg=244 cterm=NONE + hi TabLine ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineFill ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineSel ctermfg=235 ctermbg=250 cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=244 ctermbg=255 cterm=bold,reverse + hi QuickFixLine ctermfg=235 ctermbg=141 cterm=NONE + hi CursorLineNr ctermfg=253 ctermbg=NONE cterm=bold + hi LineNr ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=245 ctermbg=NONE cterm=NONE + hi NonText ctermfg=245 ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=245 ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=245 ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=245 ctermbg=NONE cterm=NONE + hi Visual ctermfg=116 ctermbg=235 cterm=reverse + hi VisualNOS ctermfg=235 ctermbg=73 cterm=NONE + hi Pmenu ctermfg=NONE ctermbg=240 cterm=NONE + hi PmenuThumb ctermfg=NONE ctermbg=244 cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=NONE cterm=NONE + hi PmenuSel ctermfg=NONE ctermbg=245 cterm=NONE + hi PmenuKind ctermfg=73 ctermbg=240 cterm=NONE + hi PmenuKindSel ctermfg=73 ctermbg=245 cterm=NONE + hi PmenuExtra ctermfg=250 ctermbg=240 cterm=NONE + hi PmenuExtraSel ctermfg=250 ctermbg=245 cterm=NONE + hi PmenuMatch ctermfg=215 ctermbg=240 cterm=NONE + hi PmenuMatchSel ctermfg=215 ctermbg=245 cterm=NONE + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=197 ctermbg=16 cterm=reverse + hi ErrorMsg ctermfg=197 ctermbg=16 cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=106 ctermbg=NONE cterm=NONE + hi Question ctermfg=185 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=197 ctermbg=NONE cterm=NONE + hi Todo ctermfg=253 ctermbg=NONE cterm=bold + hi MatchParen ctermfg=208 ctermbg=NONE cterm=bold + hi Search ctermfg=81 ctermbg=235 cterm=reverse + hi IncSearch ctermfg=215 ctermbg=235 cterm=reverse + hi CurSearch ctermfg=215 ctermbg=235 cterm=reverse + hi WildMenu ctermfg=235 ctermbg=185 cterm=bold + hi debugPC ctermfg=235 ctermbg=73 cterm=NONE + hi debugBreakpoint ctermfg=235 ctermbg=197 cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE + hi Folded ctermfg=250 ctermbg=238 cterm=NONE + hi ColorColumn ctermfg=NONE ctermbg=240 cterm=NONE + hi SpellBad ctermfg=167 ctermbg=NONE cterm=underline + hi SpellCap ctermfg=215 ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=77 ctermbg=NONE cterm=underline + hi SpellRare ctermfg=207 ctermbg=NONE cterm=underline + hi Constant ctermfg=141 ctermbg=NONE cterm=NONE + hi Type ctermfg=208 ctermbg=NONE cterm=bold + hi Character ctermfg=112 ctermbg=NONE cterm=NONE + hi Comment ctermfg=244 ctermbg=NONE cterm=NONE + hi String ctermfg=185 ctermbg=NONE cterm=NONE + hi Function ctermfg=112 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=81 ctermbg=NONE cterm=NONE + hi PreProc ctermfg=197 ctermbg=NONE cterm=NONE + hi Special ctermfg=73 ctermbg=NONE cterm=NONE + hi Statement ctermfg=197 ctermbg=NONE cterm=bold + hi Underlined ctermfg=81 ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=73 ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=116 ctermbg=NONE cterm=bold + hi Conceal ctermfg=245 ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=71 ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=67 ctermbg=NONE cterm=reverse + hi DiffText ctermfg=139 ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=131 ctermbg=NONE cterm=reverse + hi Added ctermfg=77 ctermbg=NONE cterm=NONE + hi Changed ctermfg=215 ctermbg=NONE cterm=NONE + hi Removed ctermfg=167 ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=255 ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=255 ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=255 ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=197 ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=185 ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=81 ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=112 ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=208 ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=73 ctermbg=NONE cterm=NONE + unlet s:t_Co + finish +endif + +if s:t_Co >= 16 + hi Normal ctermfg=white ctermbg=black cterm=NONE + hi StatusLine ctermfg=black ctermbg=gray cterm=NONE + hi StatusLineNC ctermfg=black ctermbg=darkgray cterm=NONE + hi VertSplit ctermfg=darkgray ctermbg=darkgray cterm=NONE + hi TabLine ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineFill ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=darkgray ctermbg=white cterm=bold,reverse + hi QuickFixLine ctermfg=black ctermbg=darkmagenta cterm=NONE + hi CursorLineNr ctermfg=white ctermbg=NONE cterm=bold + hi LineNr ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi NonText ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi Visual ctermfg=cyan ctermbg=black cterm=reverse + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=darkgray ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=red ctermbg=black cterm=reverse + hi ErrorMsg ctermfg=red ctermbg=black cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=yellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=red ctermbg=NONE cterm=NONE + hi Todo ctermfg=white ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=blue ctermbg=black cterm=reverse + hi IncSearch ctermfg=red ctermbg=black cterm=reverse + hi CurSearch ctermfg=red ctermbg=black cterm=reverse + hi WildMenu ctermfg=black ctermbg=yellow cterm=bold + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=red cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=NONE cterm=underline + hi SpellCap ctermfg=darkyellow ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=darkgreen ctermbg=NONE cterm=underline + hi SpellRare ctermfg=magenta ctermbg=NONE cterm=underline + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=green ctermbg=NONE cterm=NONE + hi Comment ctermfg=darkgray ctermbg=NONE cterm=NONE + hi String ctermfg=yellow ctermbg=NONE cterm=NONE + hi Function ctermfg=green ctermbg=NONE cterm=NONE + hi Identifier ctermfg=blue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=red ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Statement ctermfg=red ctermbg=NONE cterm=bold + hi Underlined ctermfg=blue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=cyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=white ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=white ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=white ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=red ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=yellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=blue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=green ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co + finish +endif + +if s:t_Co >= 8 + hi Normal ctermfg=gray ctermbg=black cterm=NONE + hi StatusLine ctermfg=gray ctermbg=black cterm=bold,reverse + hi StatusLineNC ctermfg=gray ctermbg=black cterm=reverse + hi VertSplit ctermfg=gray ctermbg=gray cterm=NONE + hi TabLine ctermfg=black ctermbg=gray cterm=NONE + hi TabLineFill ctermfg=gray ctermbg=gray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=gray ctermbg=black cterm=reverse + hi QuickFixLine ctermfg=black ctermbg=darkyellow cterm=NONE + hi CursorLineNr ctermfg=darkyellow ctermbg=NONE cterm=bold + hi LineNr ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrAbove ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrBelow ctermfg=gray ctermbg=NONE cterm=bold + hi NonText ctermfg=gray ctermbg=NONE cterm=bold + hi EndOfBuffer ctermfg=gray ctermbg=NONE cterm=bold + hi SpecialKey ctermfg=gray ctermbg=NONE cterm=bold + hi FoldColumn ctermfg=gray ctermbg=NONE cterm=bold + hi Visual ctermfg=black ctermbg=darkcyan cterm=NONE + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=black ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ErrorMsg ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=darkred ctermbg=NONE cterm=NONE + hi Todo ctermfg=gray ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=black ctermbg=darkblue cterm=NONE + hi IncSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi CurSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi WildMenu ctermfg=black ctermbg=darkyellow cterm=NONE + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=darkcyan cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=gray cterm=reverse + hi SpellCap ctermfg=darkblue ctermbg=gray cterm=reverse + hi SpellLocal ctermfg=darkgreen ctermbg=black cterm=reverse + hi SpellRare ctermfg=darkmagenta ctermbg=gray cterm=reverse + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Comment ctermfg=gray ctermbg=NONE cterm=bold + hi String ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Function ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Identifier ctermfg=darkblue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=darkred ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Statement ctermfg=darkred ctermbg=NONE cterm=bold + hi Underlined ctermfg=darkblue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=gray ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=gray ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=gray ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=gray ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=darkred ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co + finish +endif + +if s:t_Co >= 0 + hi Normal term=NONE + hi ColorColumn term=reverse + hi Conceal term=NONE + hi Cursor term=reverse + hi CursorColumn term=NONE + hi CursorLine term=underline + hi CursorLineNr term=bold + hi DiffAdd term=reverse + hi DiffChange term=NONE + hi DiffDelete term=reverse + hi DiffText term=reverse + hi Directory term=NONE + hi EndOfBuffer term=NONE + hi ErrorMsg term=bold,reverse + hi FoldColumn term=NONE + hi Folded term=NONE + hi IncSearch term=bold,reverse,underline + hi LineNr term=NONE + hi MatchParen term=bold,underline + hi ModeMsg term=bold + hi MoreMsg term=NONE + hi NonText term=NONE + hi Pmenu term=reverse + hi PmenuSbar term=reverse + hi PmenuSel term=bold + hi PmenuThumb term=NONE + hi Question term=standout + hi Search term=reverse + hi SignColumn term=reverse + hi SpecialKey term=bold + hi SpellBad term=underline + hi SpellCap term=underline + hi SpellLocal term=underline + hi SpellRare term=underline + hi StatusLine term=bold,reverse + hi StatusLineNC term=bold,underline + hi TabLine term=bold,underline + hi TabLineFill term=NONE + hi Terminal term=NONE + hi TabLineSel term=bold,reverse + hi Title term=NONE + hi VertSplit term=NONE + hi Visual term=reverse + hi VisualNOS term=NONE + hi WarningMsg term=standout + hi WildMenu term=bold + hi CursorIM term=NONE + hi ToolbarLine term=reverse + hi ToolbarButton term=bold,reverse + hi CurSearch term=reverse + hi CursorLineFold term=underline + hi CursorLineSign term=underline + hi Comment term=bold + hi Constant term=NONE + hi Error term=bold,reverse + hi Identifier term=NONE + hi Ignore term=NONE + hi PreProc term=NONE + hi Special term=NONE + hi Statement term=NONE + hi Todo term=bold,reverse + hi Type term=NONE + hi Underlined term=underline + unlet s:t_Co + finish +endif + +" Background: dark +" Color: color00 #282923 235 black +" Color: color08 #74705d 244 darkgray +" Color: color01 #c61e5c 125 darkred +" Color: color09 #f92672 197 red +" Color: color02 #81af24 106 darkgreen +" Color: color10 #a6e22e 112 green +" Color: color03 #fd971f 208 darkyellow +" Color: color11 #e6db74 185 yellow +" Color: color04 #51aebe 73 darkblue +" Color: color12 #66d9ef 81 blue +" Color: color05 #ae81ff 141 darkmagenta +" Color: color13 #fd5ff0 207 magenta +" Color: color06 #80beb5 73 darkcyan +" Color: color14 #a1efe4 116 cyan +" Color: color07 #bababa 250 gray +" Color: color15 #f8f8f2 255 white +" Color: colorLine #3a392f 237 darkgrey +" Color: colorB #585858 240 darkgrey +" Color: colorF #414141 238 darkgrey +" Color: colorNonT #8a8a8a 245 darkgrey +" Color: colorC #ffaf5f 215 red +" Color: colorlC #5fff00 82 green +" Color: colorV #1f3f5f 109 cyan +" Color: colorMP #fd971f 208 darkyellow +" Color: diffAdd #5faf5f 71 darkgreen +" Color: diffDelete #af5f5f 131 darkred +" Color: diffChange #5f87af 67 darkblue +" Color: diffText #af87af 139 darkmagenta +" Color: black #000000 16 black +" Color: white #dadada 253 white +" Color: Added #5fd75f 77 darkgreen +" Color: Changed #ffaf5f 215 darkyellow +" Color: Removed #d75f5f 167 darkred +" Term colors: color00 color01 color02 color03 color04 color05 color06 color07 +" Term colors: color08 color09 color10 color11 color12 color13 color14 color15 +" vim: et ts=8 sw=2 sts=2 diff --git a/runtime/colors/wildcharm.vim b/runtime/colors/wildcharm.vim index 47ca5a1408..00ebc16529 100644 --- a/runtime/colors/wildcharm.vim +++ b/runtime/colors/wildcharm.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim <habamax@gmail.com> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') @@ -194,6 +195,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' hi Normal ctermfg=252 ctermbg=16 cterm=NONE diff --git a/runtime/colors/zaibatsu.vim b/runtime/colors/zaibatsu.vim index 90c6104afe..49047617c4 100644 --- a/runtime/colors/zaibatsu.vim +++ b/runtime/colors/zaibatsu.vim @@ -4,7 +4,7 @@ " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -96,6 +96,7 @@ hi! link TabLineFill StatusLineNC hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -201,6 +202,7 @@ if s:t_Co >= 256 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -309,6 +311,7 @@ if s:t_Co >= 16 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -417,6 +420,7 @@ if s:t_Co >= 8 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/zellner.vim b/runtime/colors/zellner.vim index 7781ca9ab8..298ec0f700 100644 --- a/runtime/colors/zellner.vim +++ b/runtime/colors/zellner.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron <ron@ronware.org> " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -31,6 +31,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#e5e5e5 gui=NONE cterm=NONE @@ -106,6 +107,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=254 cterm=NONE diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 572e5e4267..5a6361d45f 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3150,11 +3150,13 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()* • {config} Map defining the window configuration. Keys: • relative: Sets the window layout to "floating", placed at (row,col) coordinates relative to: - • "editor" The global editor grid + • "cursor" Cursor position in current window. + • "editor" The global editor grid. + • "laststatus" 'laststatus' if present, or last row. + • "mouse" Mouse position. + • "tabline" Tabline if present, or first row. • "win" Window given by the `win` field, or current window. - • "cursor" Cursor position in current window. - • "mouse" Mouse position • win: |window-ID| window to split, or relative window when creating a float (relative="win"). • anchor: Decides which corner of the float to place at diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index da64475465..1e4889747d 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -508,6 +508,15 @@ be a parameter (typically manifest as mutually-exclusive buf/win/… flags like - Example: `nvim_buf_del_mark` acts on a `Buffer` object (the first parameter) and uses the "del" {verb}. + *dev-namespace-name* +Use namespace names like `nvim.foo.bar`: > + vim.api.nvim_create_namespace('nvim.lsp.codelens') +< + + *dev-augroup-name* +Use autocommand group names like `nvim.foo.bar`: > + vim.api.nvim_create_augroup('nvim.treesitter.dev') +< INTERFACE PATTERNS *dev-api-patterns* diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 44cbf238cf..6e5a77ff7a 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2983,6 +2983,7 @@ vim.fs.dir({path}, {opts}) *vim.fs.dir()* • skip: (fun(dir_name: string): boolean)|nil Predicate to control traversal. Return false to stop searching the current directory. Only useful when depth > 1 + • follow: boolean|nil Follow symbolic links. (default: true) Return: ~ (`Iterator`) over items in {path}. Each iteration yields two values: @@ -3024,7 +3025,7 @@ vim.fs.find({names}, {opts}) *vim.fs.find()* -- get all files ending with .cpp or .hpp inside lib/ local cpp_hpp = vim.fs.find(function(name, path) - return name:match('.*%.[ch]pp$') and path:match('[/\\\\]lib$') + return name:match('.*%.[ch]pp$') and path:match('[/\\]lib$') end, {limit = math.huge, type = 'file'}) < @@ -3038,8 +3039,10 @@ vim.fs.find({names}, {opts}) *vim.fs.find()* If {names} is a function, it is called for each traversed item with args: • name: base name of the current item - • path: full path of the current item The function should - return `true` if the given item is considered a match. + • path: full path of the current item + + The function should return `true` if the given item is + considered a match. • {opts} (`table`) Optional keyword arguments: • {path}? (`string`) Path to begin searching from. If omitted, the |current-directory| is used. @@ -3053,6 +3056,8 @@ vim.fs.find({names}, {opts}) *vim.fs.find()* • {limit}? (`number`, default: `1`) Stop the search after finding this many matches. Use `math.huge` to place no limit on the number of matches. + • {follow}? (`boolean`, default: `true`) Follow symbolic + links. Return: ~ (`string[]`) Normalized paths |vim.fs.normalize()| of all matching diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index e12c307b5f..8c4130b3f2 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -187,6 +187,7 @@ API • |nvim__ns_set()| can set properties for a namespace • |nvim_echo()| `err` field to print error messages and `chunks` accepts highlight group IDs. +• |nvim_open_win()| `relative` field can be set to "laststatus" and "tabline". DEFAULTS @@ -285,6 +286,8 @@ LUA • |vim.json.encode()| has an option to enable forward slash escaping • |vim.fs.abspath()| converts paths to absolute paths. • |vim.fs.relpath()| gets relative path compared to base path. +• |vim.fs.dir()| and |vim.fs.find()| now follow symbolic links by default, + the behavior can be turn off using the new `follow` option. OPTIONS @@ -336,6 +339,8 @@ TERMINAL unfocused terminal window will have no cursor at all (so there is nothing to highlight). • |jobstart()| gained the "term" flag. +• The |terminal| will send theme update notifications when 'background' is + changed and DEC mode 2031 is enabled. TREESITTER diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index a59312208a..59c1c4b21c 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -122,7 +122,7 @@ fully disable the mouse or popup-menu, do any of the following: < To remove the default popup-menu without disabling mouse: >vim aunmenu PopUp - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu To remove only the "How-to disable mouse" menu item (and its separator): >vim aunmenu PopUp.How-to\ disable\ mouse diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 689a4db408..ed8f93c71c 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -46,7 +46,7 @@ local query = vim.treesitter.query.parse( (#set! @code lang @_lang)) ]] ) -local run_message_ns = vim.api.nvim_create_namespace('vimdoc/run_message') +local run_message_ns = vim.api.nvim_create_namespace('nvim.vimdoc.run_message') vim.api.nvim_buf_clear_namespace(0, run_message_ns, 0, -1) for _, match, metadata in query:iter_matches(tree:root(), 0, 0, -1) do diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 711ee35775..aa5cac2f07 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -21,7 +21,7 @@ local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' } if not vim.b.disable_query_linter and #query_lint_on > 0 then vim.api.nvim_create_autocmd(query_lint_on, { - group = vim.api.nvim_create_augroup('querylint', { clear = false }), + group = vim.api.nvim_create_augroup('nvim.querylint', { clear = false }), buffer = buf, callback = function() vim.treesitter.query.lint(buf) diff --git a/runtime/lua/_vim9script.lua b/runtime/lua/_vim9script.lua index 23c078cb87..29bafc53b2 100644 --- a/runtime/lua/_vim9script.lua +++ b/runtime/lua/_vim9script.lua @@ -145,7 +145,7 @@ local vim9 = (function() -- work well for calling ":source X" from within a vimscript/vim9script -- function M.make_source_cmd = function() - local group = vim.api.nvim_create_augroup('vim9script-source', {}) + local group = vim.api.nvim_create_augroup('nvim.vim9script_source', {}) vim.api.nvim_create_autocmd('SourceCmd', { pattern = '*.vim', group = group, diff --git a/runtime/lua/editorconfig.lua b/runtime/lua/editorconfig.lua index e65d267a70..2093c4eb5c 100644 --- a/runtime/lua/editorconfig.lua +++ b/runtime/lua/editorconfig.lua @@ -151,7 +151,7 @@ function properties.trim_trailing_whitespace(bufnr, val) ) if val == 'true' then vim.api.nvim_create_autocmd('BufWritePre', { - group = 'editorconfig', + group = 'nvim.editorconfig', buffer = bufnr, callback = function() local view = vim.fn.winsaveview() @@ -163,7 +163,7 @@ function properties.trim_trailing_whitespace(bufnr, val) else vim.api.nvim_clear_autocmds({ event = 'BufWritePre', - group = 'editorconfig', + group = 'nvim.editorconfig', buffer = bufnr, }) end @@ -180,7 +180,7 @@ function properties.insert_final_newline(bufnr, val) local endofline = val == 'true' if vim.bo[bufnr].endofline ~= endofline then vim.api.nvim_create_autocmd('BufWritePre', { - group = 'editorconfig', + group = 'nvim.editorconfig', buffer = bufnr, once = true, callback = function() diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index d71116117e..28f1542f64 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -412,7 +412,7 @@ do end end - local nvim_popupmenu_augroup = vim.api.nvim_create_augroup('nvim_popupmenu', {}) + local nvim_popupmenu_augroup = vim.api.nvim_create_augroup('nvim.popupmenu', {}) vim.api.nvim_create_autocmd('MenuPopup', { pattern = '*', group = nvim_popupmenu_augroup, @@ -429,7 +429,7 @@ end --- Default autocommands. See |default-autocmds| do - local nvim_terminal_augroup = vim.api.nvim_create_augroup('nvim_terminal', {}) + local nvim_terminal_augroup = vim.api.nvim_create_augroup('nvim.terminal', {}) vim.api.nvim_create_autocmd('BufReadCmd', { pattern = 'term://*', group = nvim_terminal_augroup, @@ -509,14 +509,14 @@ do vim.api.nvim_create_autocmd('CmdwinEnter', { pattern = '[:>]', desc = 'Limit syntax sync to maxlines=1 in the command window', - group = vim.api.nvim_create_augroup('nvim_cmdwin', {}), + group = vim.api.nvim_create_augroup('nvim.cmdwin', {}), command = 'syntax sync minlines=1 maxlines=1', }) vim.api.nvim_create_autocmd('SwapExists', { pattern = '*', desc = 'Skip the swapfile prompt when the swapfile is owned by a running Nvim process', - group = vim.api.nvim_create_augroup('nvim_swapfile', {}), + group = vim.api.nvim_create_augroup('nvim.swapfile', {}), callback = function() local info = vim.fn.swapinfo(vim.v.swapname) local user = vim.uv.os_get_passwd().username @@ -543,7 +543,7 @@ do end if tty then - local group = vim.api.nvim_create_augroup('nvim_tty', {}) + local group = vim.api.nvim_create_augroup('nvim.tty', {}) --- Set an option after startup (so that OptionSet is fired), but only if not --- already set by the user. diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 8930f131f6..670e867c1e 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1754,10 +1754,12 @@ function vim.api.nvim_open_term(buffer, opts) end --- @param config vim.api.keyset.win_config Map defining the window configuration. Keys: --- - relative: Sets the window layout to "floating", placed at (row,col) --- coordinates relative to: ---- - "editor" The global editor grid ---- - "win" Window given by the `win` field, or current window. ---- - "cursor" Cursor position in current window. ---- - "mouse" Mouse position +--- - "cursor" Cursor position in current window. +--- - "editor" The global editor grid. +--- - "laststatus" 'laststatus' if present, or last row. +--- - "mouse" Mouse position. +--- - "tabline" Tabline if present, or first row. +--- - "win" Window given by the `win` field, or current window. --- - win: `window-ID` window to split, or relative window when creating a --- float (relative="win"). --- - anchor: Decides which corner of the float to place at (row,col): diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 6466c7d6e8..0939ff591e 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -356,7 +356,7 @@ local bufnr_and_namespace_cacher_mt = { -- bufnr -> ns -> Diagnostic[] local diagnostic_cache = {} --- @type table<integer,table<integer,vim.Diagnostic[]>> do - local group = api.nvim_create_augroup('DiagnosticBufWipeout', {}) + local group = api.nvim_create_augroup('nvim.diagnostic.buf_wipeout', {}) setmetatable(diagnostic_cache, { --- @param t table<integer,vim.Diagnostic[]> --- @param bufnr integer @@ -1402,7 +1402,7 @@ M.handlers.signs = { local ns = M.get_namespace(namespace) if not ns.user_data.sign_ns then ns.user_data.sign_ns = - api.nvim_create_namespace(string.format('%s/diagnostic/signs', ns.name)) + api.nvim_create_namespace(string.format('nvim.%s.diagnostic.signs', ns.name)) end -- Handle legacy diagnostic sign definitions @@ -1500,7 +1500,7 @@ M.handlers.underline = { local ns = M.get_namespace(namespace) if not ns.user_data.underline_ns then ns.user_data.underline_ns = - api.nvim_create_namespace(string.format('%s/diagnostic/underline', ns.name)) + api.nvim_create_namespace(string.format('nvim.%s.diagnostic.underline', ns.name)) end local underline_ns = ns.user_data.underline_ns @@ -1572,7 +1572,7 @@ M.handlers.virtual_text = { local ns = M.get_namespace(namespace) if not ns.user_data.virt_text_ns then ns.user_data.virt_text_ns = - api.nvim_create_namespace(string.format('%s/diagnostic/virtual_text', ns.name)) + api.nvim_create_namespace(string.format('nvim.%s.diagnostic.virtual_text', ns.name)) end local virt_text_ns = ns.user_data.virt_text_ns diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index bc866db399..1960bca52b 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2374,6 +2374,8 @@ local pattern = { ['%.html%.m4$'] = 'htmlm4', ['^JAM.*%.'] = starsetf('jam'), ['^Prl.*%.'] = starsetf('jam'), + ['^${HOME}/.*/Code/User/.*%.json$'] = 'jsonc', + ['^${HOME}/.*/VSCodium/User/.*%.json$'] = 'jsonc', ['%.properties_..$'] = 'jproperties', ['%.properties_.._..$'] = 'jproperties', ['%.properties_.._.._'] = starsetf('jproperties'), diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index 91e06688b3..5940fa4386 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -136,6 +136,7 @@ end --- - skip: (fun(dir_name: string): boolean)|nil Predicate --- to control traversal. Return false to stop searching the current directory. --- Only useful when depth > 1 +--- - follow: boolean|nil Follow symbolic links. (default: true) --- ---@return Iterator over items in {path}. Each iteration yields two values: "name" and "type". --- "name" is the basename of the item relative to {path}. @@ -147,6 +148,7 @@ function M.dir(path, opts) vim.validate('path', path, 'string') vim.validate('depth', opts.depth, 'number', true) vim.validate('skip', opts.skip, 'function', true) + vim.validate('follow', opts.follow, 'boolean', true) path = M.normalize(path) if not opts.depth or opts.depth == 1 then @@ -177,7 +179,9 @@ function M.dir(path, opts) if opts.depth and level < opts.depth - and t == 'directory' + and (t == 'directory' or (t == 'link' and opts.follow ~= false and (vim.uv.fs_stat( + M.joinpath(path, f) + ) or {}).type == 'directory')) and (not opts.skip or opts.skip(f) ~= false) then dirs[#dirs + 1] = { f, level + 1 } @@ -211,6 +215,10 @@ end --- Use `math.huge` to place no limit on the number of matches. --- (default: `1`) --- @field limit? number +--- +--- Follow symbolic links. +--- (default: `true`) +--- @field follow? boolean --- Find files or directories (or other items as specified by `opts.type`) in the given path. --- @@ -234,7 +242,7 @@ end --- --- -- get all files ending with .cpp or .hpp inside lib/ --- local cpp_hpp = vim.fs.find(function(name, path) ---- return name:match('.*%.[ch]pp$') and path:match('[/\\\\]lib$') +--- return name:match('.*%.[ch]pp$') and path:match('[/\\]lib$') --- end, {limit = math.huge, type = 'file'}) --- ``` --- @@ -244,6 +252,7 @@ end --- If {names} is a function, it is called for each traversed item with args: --- - name: base name of the current item --- - path: full path of the current item +--- --- The function should return `true` if the given item is considered a match. --- ---@param opts vim.fs.find.Opts Optional keyword arguments: @@ -256,6 +265,7 @@ function M.find(names, opts) vim.validate('stop', opts.stop, 'string', true) vim.validate('type', opts.type, 'string', true) vim.validate('limit', opts.limit, 'number', true) + vim.validate('follow', opts.follow, 'boolean', true) if type(names) == 'string' then names = { names } @@ -345,7 +355,14 @@ function M.find(names, opts) end end - if type_ == 'directory' then + if + type_ == 'directory' + or ( + type_ == 'link' + and opts.follow ~= false + and (vim.uv.fs_stat(f) or {}).type == 'directory' + ) + then dirs[#dirs + 1] = f end end diff --git a/runtime/lua/vim/hl.lua b/runtime/lua/vim/hl.lua index 099efa3c61..f5ace7fdc5 100644 --- a/runtime/lua/vim/hl.lua +++ b/runtime/lua/vim/hl.lua @@ -115,7 +115,7 @@ function M.range(bufnr, ns, higroup, start, finish, opts) end end -local yank_ns = api.nvim_create_namespace('hlyank') +local yank_ns = api.nvim_create_namespace('nvim.hlyank') local yank_timer --- @type uv.uv_timer_t? local yank_cancel --- @type fun()? diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 23f4e104d0..5226c8ae37 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -513,7 +513,9 @@ local function lsp_enable_callback(bufnr) ---@param root_dir string config.root_dir(function(root_dir) config.root_dir = root_dir - start(config) + vim.schedule(function() + start(config) + end) end) else start(config) @@ -544,7 +546,7 @@ function lsp.enable(name, enable) if nm == '*' then error('Invalid name') end - lsp._enabled_configs[nm] = enable == false and nil or {} + lsp._enabled_configs[nm] = enable ~= false and {} or nil end if not next(lsp._enabled_configs) then @@ -841,7 +843,7 @@ local function buf_attach(bufnr) attached_buffers[bufnr] = true local uri = vim.uri_from_bufnr(bufnr) - local augroup = ('lsp_b_%d_save'):format(bufnr) + local augroup = ('nvim.lsp.b_%d_save'):format(bufnr) local group = api.nvim_create_augroup(augroup, { clear = true }) api.nvim_create_autocmd('BufWritePre', { group = group, diff --git a/runtime/lua/vim/lsp/_folding_range.lua b/runtime/lua/vim/lsp/_folding_range.lua index 2f1767aaf5..66eb81db6e 100644 --- a/runtime/lua/vim/lsp/_folding_range.lua +++ b/runtime/lua/vim/lsp/_folding_range.lua @@ -171,7 +171,7 @@ end -- 1. Implement clearing `bufstate` and event hooks -- when no clients in the buffer support the corresponding method. -- 2. Then generalize this state management to other LSP modules. -local augroup_setup = api.nvim_create_augroup('vim_lsp_folding_range/setup', {}) +local augroup_setup = api.nvim_create_augroup('nvim.lsp.folding_range.setup', {}) --- Initialize `bufstate` and event hooks, then request folding ranges. --- Manage their lifecycle within this function. diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 69407bc6f8..0acbc50003 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -20,7 +20,7 @@ local function client_positional_params(params) end end -local hover_ns = api.nvim_create_namespace('vim_lsp_hover_range') +local hover_ns = api.nvim_create_namespace('nvim.lsp.hover_range') --- @class vim.lsp.buf.hover.Opts : vim.lsp.util.open_floating_preview.Opts --- @field silent? boolean @@ -324,7 +324,7 @@ local function process_signature_help_results(results) return signatures end -local sig_help_ns = api.nvim_create_namespace('vim_lsp_signature_help') +local sig_help_ns = api.nvim_create_namespace('nvim.lsp.signature_help') --- @class vim.lsp.buf.signature_help.Opts : vim.lsp.util.open_floating_preview.Opts --- @field silent? boolean diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index 3ccd165d0b..e36d8fee27 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -21,7 +21,7 @@ local lens_cache_by_buf = setmetatable({}, { ---client_id -> namespace local namespaces = setmetatable({}, { __index = function(t, key) - local value = api.nvim_create_namespace('vim_lsp_codelens:' .. key) + local value = api.nvim_create_namespace('nvim.lsp.codelens:' .. key) rawset(t, key, value) return value end, @@ -30,7 +30,7 @@ local namespaces = setmetatable({}, { ---@private M.__namespaces = namespaces -local augroup = api.nvim_create_augroup('vim_lsp_codelens', {}) +local augroup = api.nvim_create_augroup('nvim.lsp.codelens', {}) api.nvim_create_autocmd('LspDetach', { group = augroup, diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index dbf0a62eeb..edbc329939 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -630,7 +630,7 @@ local function enable_completions(client_id, bufnr, opts) -- Set up autocommands. local group = - api.nvim_create_augroup(string.format('vim/lsp/completion-%d', bufnr), { clear = true }) + api.nvim_create_augroup(string.format('nvim.lsp.completion_%d', bufnr), { clear = true }) api.nvim_create_autocmd('CompleteDone', { group = group, buffer = bufnr, diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 8c1f3f10d4..cf39338cc1 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -5,7 +5,7 @@ local api = vim.api local M = {} -local augroup = api.nvim_create_augroup('vim_lsp_diagnostic', {}) +local augroup = api.nvim_create_augroup('nvim.lsp.diagnostic', {}) local DEFAULT_CLIENT_ID = -1 diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 3779c342e8..425e3206aa 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -382,7 +382,7 @@ end --- @diagnostic disable-next-line: deprecated RCS[ms.textDocument_hover] = M.hover -local sig_help_ns = api.nvim_create_namespace('vim_lsp_signature_help') +local sig_help_ns = api.nvim_create_namespace('nvim.lsp.signature_help') --- @deprecated remove in 0.13 --- |lsp-handler| for the method "textDocument/signatureHelp". diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua index 50cf9f5f29..37e1202d1d 100644 --- a/runtime/lua/vim/lsp/inlay_hint.lua +++ b/runtime/lua/vim/lsp/inlay_hint.lua @@ -29,8 +29,8 @@ local bufstates = vim.defaulttable(function(_) }) end) -local namespace = api.nvim_create_namespace('vim_lsp_inlayhint') -local augroup = api.nvim_create_augroup('vim_lsp_inlayhint', {}) +local namespace = api.nvim_create_namespace('nvim.lsp.inlayhint') +local augroup = api.nvim_create_augroup('nvim.lsp.inlayhint', {}) --- |lsp-handler| for the method `textDocument/inlayHint` --- Store hints for a specific buffer and client diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index 7cc3f95aed..a31202553b 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -166,7 +166,7 @@ function STHighlighter.new(bufnr) local self = setmetatable({}, { __index = STHighlighter }) self.bufnr = bufnr - self.augroup = api.nvim_create_augroup('vim_lsp_semantic_tokens:' .. bufnr, { clear = true }) + self.augroup = api.nvim_create_augroup('nvim.lsp.semantic_tokens:' .. bufnr, { clear = true }) self.client_state = {} STHighlighter.active[bufnr] = self @@ -225,7 +225,7 @@ function STHighlighter:attach(client_id) local state = self.client_state[client_id] if not state then state = { - namespace = api.nvim_create_namespace('vim_lsp_semantic_tokens:' .. client_id), + namespace = api.nvim_create_namespace('nvim.lsp.semantic_tokens:' .. client_id), active_request = {}, current_result = {}, } @@ -805,7 +805,7 @@ function M._refresh(err, _, ctx) return vim.NIL end -local namespace = api.nvim_create_namespace('vim_lsp_semantic_tokens') +local namespace = api.nvim_create_namespace('nvim.lsp.semantic_tokens') api.nvim_set_decoration_provider(namespace, { on_win = function(_, _, bufnr, topline, botline) local highlighter = STHighlighter.active[bufnr] diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 14633adf0c..4e0adf3366 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1357,7 +1357,7 @@ end ---@param bufnrs table list of buffers where the preview window will remain visible ---@see autocmd-events local function close_preview_autocmd(events, winnr, bufnrs) - local augroup = api.nvim_create_augroup('preview_window_' .. winnr, { + local augroup = api.nvim_create_augroup('nvim.preview_window_' .. winnr, { clear = true, }) @@ -1619,7 +1619,7 @@ function M.open_floating_preview(contents, syntax, opts) api.nvim_buf_set_var(bufnr, 'lsp_floating_preview', floating_winnr) end - local augroup_name = ('closing_floating_preview_%d'):format(floating_winnr) + local augroup_name = ('nvim.closing_floating_preview_%d'):format(floating_winnr) local ok = pcall(api.nvim_get_autocmds, { group = augroup_name, pattern = tostring(floating_winnr) }) if not ok then @@ -1650,7 +1650,7 @@ function M.open_floating_preview(contents, syntax, opts) end do --[[ References ]] - local reference_ns = api.nvim_create_namespace('vim_lsp_references') + local reference_ns = api.nvim_create_namespace('nvim.lsp.references') --- Removes document highlights from a buffer. --- diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua index af7e3c6d33..bfd439181e 100644 --- a/runtime/lua/vim/snippet.lua +++ b/runtime/lua/vim/snippet.lua @@ -1,6 +1,6 @@ local G = vim.lsp._snippet_grammar -local snippet_group = vim.api.nvim_create_augroup('vim/snippet', {}) -local snippet_ns = vim.api.nvim_create_namespace('vim/snippet') +local snippet_group = vim.api.nvim_create_augroup('nvim.snippet', {}) +local snippet_ns = vim.api.nvim_create_namespace('nvim.snippet') local hl_group = 'SnippetTabstop' local jump_forward_key = '<tab>' local jump_backward_key = '<s-tab>' diff --git a/runtime/lua/vim/treesitter/_fold.lua b/runtime/lua/vim/treesitter/_fold.lua index 2777241e9f..4a571bbaf7 100644 --- a/runtime/lua/vim/treesitter/_fold.lua +++ b/runtime/lua/vim/treesitter/_fold.lua @@ -192,7 +192,7 @@ local M = {} ---@type table<integer,TS.FoldInfo> local foldinfos = {} -local group = api.nvim_create_augroup('treesitter/fold', {}) +local group = api.nvim_create_augroup('nvim.treesitter.fold', {}) --- Update the folds in the windows that contain the buffer and use expr foldmethod (assuming that --- the user doesn't use different foldexpr for the same buffer). diff --git a/runtime/lua/vim/treesitter/_query_linter.lua b/runtime/lua/vim/treesitter/_query_linter.lua index a825505378..f6645beb28 100644 --- a/runtime/lua/vim/treesitter/_query_linter.lua +++ b/runtime/lua/vim/treesitter/_query_linter.lua @@ -1,6 +1,6 @@ local api = vim.api -local namespace = api.nvim_create_namespace('vim.treesitter.query_linter') +local namespace = api.nvim_create_namespace('nvim.treesitter.query_linter') local M = {} diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 26817cdba5..42c25dbdad 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -119,7 +119,7 @@ function TSTreeView:new(bufnr, lang) end local t = { - ns = api.nvim_create_namespace('treesitter/dev-inspect'), + ns = api.nvim_create_namespace('nvim.treesitter.dev_inspect'), nodes = nodes, named = named, ---@type vim.treesitter.dev.TSTreeViewOpts @@ -135,7 +135,7 @@ function TSTreeView:new(bufnr, lang) return t end -local decor_ns = api.nvim_create_namespace('ts.dev') +local decor_ns = api.nvim_create_namespace('nvim.treesitter.dev') ---@param range Range4 ---@return string @@ -442,7 +442,7 @@ function M.inspect_tree(opts) end, }) - local group = api.nvim_create_augroup('treesitter/dev', {}) + local group = api.nvim_create_augroup('nvim.treesitter.dev', {}) api.nvim_create_autocmd('CursorMoved', { group = group, @@ -547,7 +547,7 @@ function M.inspect_tree(opts) }) end -local edit_ns = api.nvim_create_namespace('treesitter/dev-edit') +local edit_ns = api.nvim_create_namespace('nvim.treesitter.dev_edit') ---@param query_win integer ---@param base_win integer @@ -633,7 +633,7 @@ function M.edit_query(lang) -- can infer the language later. api.nvim_buf_set_name(query_buf, string.format('%s/query_editor.scm', lang)) - local group = api.nvim_create_augroup('treesitter/dev-edit', {}) + local group = api.nvim_create_augroup('nvim.treesitter.dev_edit', {}) api.nvim_create_autocmd({ 'TextChanged', 'InsertLeave' }, { group = group, buffer = query_buf, diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua index be138885d5..c11fa1999d 100644 --- a/runtime/lua/vim/treesitter/highlighter.lua +++ b/runtime/lua/vim/treesitter/highlighter.lua @@ -2,7 +2,7 @@ local api = vim.api local query = vim.treesitter.query local Range = require('vim.treesitter._range') -local ns = api.nvim_create_namespace('treesitter/highlighter') +local ns = api.nvim_create_namespace('nvim.treesitter.highlighter') ---@alias vim.treesitter.highlighter.Iter fun(end_line: integer|nil): integer, TSNode, vim.treesitter.query.TSMetadata, TSQueryMatch diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 66ab0d52f0..ad648f36cc 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -289,7 +289,7 @@ end, false) api.nvim_create_autocmd('OptionSet', { pattern = { 'runtimepath' }, - group = api.nvim_create_augroup('ts_query_cache_reset', { clear = true }), + group = api.nvim_create_augroup('nvim.treesitter.query_cache_reset', { clear = true }), callback = function() M.get:clear() end, diff --git a/runtime/lua/vim/vimhelp.lua b/runtime/lua/vim/vimhelp.lua index 5579cc0174..a494d311b1 100644 --- a/runtime/lua/vim/vimhelp.lua +++ b/runtime/lua/vim/vimhelp.lua @@ -7,7 +7,7 @@ local M = {} --- Note: {patterns} is assumed to be sorted by occurrence in the file. --- @param patterns {start:string,stop:string,match:string}[] function M.highlight_groups(patterns) - local ns = vim.api.nvim_create_namespace('vimhelp') + local ns = vim.api.nvim_create_namespace('nvim.vimhelp') vim.api.nvim_buf_clear_namespace(0, ns, 0, -1) local save_cursor = vim.fn.getcurpos() diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index a96919e1fe..357146cabd 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -1,4 +1,4 @@ -local group = vim.api.nvim_create_augroup('editorconfig', {}) +local group = vim.api.nvim_create_augroup('nvim.editorconfig', {}) vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, { group = group, callback = function(args) diff --git a/runtime/plugin/man.lua b/runtime/plugin/man.lua index d6d90208a2..e707b68859 100644 --- a/runtime/plugin/man.lua +++ b/runtime/plugin/man.lua @@ -24,7 +24,7 @@ end, { end, }) -local augroup = vim.api.nvim_create_augroup('man', {}) +local augroup = vim.api.nvim_create_augroup('nvim.man', {}) vim.api.nvim_create_autocmd('BufReadCmd', { group = augroup, diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim index fd127988f2..48a5b1171c 100644 --- a/runtime/syntax/lyrics.vim +++ b/runtime/syntax/lyrics.vim @@ -2,7 +2,7 @@ " Language: LyRiCs " Maintainer: ObserverOfTime <chronobserver@disroot.org> " Filenames: *.lrc -" Last Change: 2024 Sep 20 +" Last Change: 2025 Jan 13 if exists('b:current_syntax') finish @@ -23,7 +23,7 @@ syn match lrcTagName contained nextgroup=lrcTagValue syn match lrcTagValue /:\zs.\+\ze\]/ contained " Lyrics -syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\]\)\+/ +syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\d\?\]\)\+/ \ contains=lrcNumber nextgroup=lrcLyricLine syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index 45c9e3f56c..225189a3f9 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -101,10 +101,12 @@ /// @param config Map defining the window configuration. Keys: /// - relative: Sets the window layout to "floating", placed at (row,col) /// coordinates relative to: -/// - "editor" The global editor grid -/// - "win" Window given by the `win` field, or current window. -/// - "cursor" Cursor position in current window. -/// - "mouse" Mouse position +/// - "cursor" Cursor position in current window. +/// - "editor" The global editor grid. +/// - "laststatus" 'laststatus' if present, or last row. +/// - "mouse" Mouse position. +/// - "tabline" Tabline if present, or first row. +/// - "win" Window given by the `win` field, or current window. /// - win: |window-ID| window to split, or relative window when creating a /// float (relative="win"). /// - anchor: Decides which corner of the float to place at (row,col): @@ -699,7 +701,9 @@ Dict(win_config) nvim_win_get_config(Window window, Arena *arena, Error *err) FUNC_API_SINCE(6) { /// Keep in sync with FloatRelative in buffer_defs.h - static const char *const float_relative_str[] = { "editor", "win", "cursor", "mouse" }; + static const char *const float_relative_str[] = { + "editor", "win", "cursor", "mouse", "tabline", "laststatus" + }; /// Keep in sync with WinSplit in buffer_defs.h static const char *const win_split_str[] = { "left", "right", "above", "below" }; @@ -805,6 +809,10 @@ static bool parse_float_relative(String relative, FloatRelative *out) *out = kFloatRelativeCursor; } else if (striequal(str, "mouse")) { *out = kFloatRelativeMouse; + } else if (striequal(str, "tabline")) { + *out = kFloatRelativeTabline; + } else if (striequal(str, "laststatus")) { + *out = kFloatRelativeLaststatus; } else { return false; } diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 3fe44beab9..bffb29578f 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -900,6 +900,8 @@ typedef enum { kFloatRelativeWindow = 1, kFloatRelativeCursor = 2, kFloatRelativeMouse = 3, + kFloatRelativeTabline = 4, + kFloatRelativeLaststatus = 5, } FloatRelative; /// Keep in sync with win_split_str[] in nvim_win_get_config() (api/win_config.c) diff --git a/src/nvim/fold.c b/src/nvim/fold.c index c9699cb161..b59933d600 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1658,7 +1658,7 @@ static void foldDelMarker(buf_T *buf, linenr_T lnum, char *marker, size_t marker if (*cms != NUL) { // Also delete 'commentstring' if it matches. char *cms2 = strstr(cms, "%s"); - if (p - line >= cms2 - cms + if (cms2 != NULL && p - line >= cms2 - cms && strncmp(p - (cms2 - cms), cms, (size_t)(cms2 - cms)) == 0 && strncmp(p + len, cms2 + 2, strlen(cms2 + 2)) == 0) { p -= cms2 - cms; diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 60aa1055c3..6cf4556a9f 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1518,9 +1518,11 @@ int merge_modifiers(int c_arg, int *modifiers) if (*modifiers & MOD_MASK_CTRL) { if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) { - c &= 0x1f; - if (c == NUL) { - c = K_ZERO; + if (!(State & MODE_TERMINAL) || !(c == 'I' || c == 'J' || c == 'M' || c == '[')) { + c &= 0x1f; + if (c == NUL) { + c = K_ZERO; + } } } else if (c == '6') { // CTRL-6 is equivalent to CTRL-^ diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index eac9ea02e0..93871905db 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -44,6 +44,7 @@ #include "nvim/spellfile.h" #include "nvim/spellsuggest.h" #include "nvim/strings.h" +#include "nvim/terminal.h" #include "nvim/types_defs.h" #include "nvim/vim_defs.h" #include "nvim/window.h" @@ -532,6 +533,15 @@ const char *did_set_background(optset_T *args) check_string_option(&p_bg); init_highlight(false, false); } + + // Notify all terminal buffers that the background color changed so they can + // send a theme update notification + FOR_ALL_BUFFERS(buf) { + if (buf->terminal) { + terminal_notify_theme(buf->terminal, dark); + } + } + return NULL; } diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index d7ed709906..2ad5ac49ca 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -179,6 +179,8 @@ struct terminal { StringBuilder *send; ///< When there is a pending TermRequest autocommand, block and store input. } pending; + bool theme_updates; ///< Send a theme update notification when 'bg' changes + bool color_set[16]; char *selection_buffer; /// libvterm selection buffer @@ -193,6 +195,7 @@ static VTermScreenCallbacks vterm_screen_callbacks = { .movecursor = term_movecursor, .settermprop = term_settermprop, .bell = term_bell, + .theme = term_theme, .sb_pushline = term_sb_push, // Called before a line goes offscreen. .sb_popline = term_sb_pop, }; @@ -1011,7 +1014,7 @@ static void terminal_send_key(Terminal *term, int c) c = Ctrl_AT; } - VTermKey key = convert_key(c, &mod); + VTermKey key = convert_key(&c, &mod); if (key) { vterm_keyboard_key(term->vt, key, mod); @@ -1141,6 +1144,20 @@ bool terminal_running(const Terminal *term) return !term->closed; } +void terminal_notify_theme(Terminal *term, bool dark) + FUNC_ATTR_NONNULL_ALL +{ + if (!term->theme_updates) { + return; + } + + char buf[10]; + ssize_t ret = snprintf(buf, sizeof(buf), "\x1b[997;%cn", dark ? '1' : '2'); + assert(ret > 0); + assert((size_t)ret <= sizeof(buf)); + terminal_send(term, buf, (size_t)ret); +} + static void terminal_focus(const Terminal *term, bool focus) FUNC_ATTR_NONNULL_ALL { @@ -1259,6 +1276,10 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *data) invalidate_terminal(term, -1, -1); break; + case VTERM_PROP_THEMEUPDATES: + term->theme_updates = val->boolean; + break; + default: return 0; } @@ -1273,6 +1294,14 @@ static int term_bell(void *data) return 1; } +/// Called when the terminal wants to query the system theme. +static int term_theme(bool *dark, void *data) + FUNC_ATTR_NONNULL_ALL +{ + *dark = (*p_bg == 'd'); + return 1; +} + /// Scrollback push handler: called just before a line goes offscreen (and libvterm will forget it), /// giving us a chance to store it. /// @@ -1415,19 +1444,23 @@ static int term_selection_set(VTermSelectionMask mask, VTermStringFragment frag, // }}} // input handling {{{ -static void convert_modifiers(int key, VTermModifier *statep) +static void convert_modifiers(int *key, VTermModifier *statep) { if (mod_mask & MOD_MASK_SHIFT) { *statep |= VTERM_MOD_SHIFT; } if (mod_mask & MOD_MASK_CTRL) { *statep |= VTERM_MOD_CTRL; + if (!(mod_mask & MOD_MASK_SHIFT) && *key >= 'A' && *key <= 'Z') { + // vterm interprets CTRL+A as SHIFT+CTRL, change to CTRL+a + *key += ('a' - 'A'); + } } if (mod_mask & MOD_MASK_ALT) { *statep |= VTERM_MOD_ALT; } - switch (key) { + switch (*key) { case K_S_TAB: case K_S_UP: case K_S_DOWN: @@ -1459,11 +1492,11 @@ static void convert_modifiers(int key, VTermModifier *statep) } } -static VTermKey convert_key(int key, VTermModifier *statep) +static VTermKey convert_key(int *key, VTermModifier *statep) { convert_modifiers(key, statep); - switch (key) { + switch (*key) { case K_BS: return VTERM_KEY_BACKSPACE; case K_S_TAB: @@ -1791,7 +1824,7 @@ static bool send_mouse_event(Terminal *term, int c) } VTermModifier mod = VTERM_MOD_NONE; - convert_modifiers(c, &mod); + convert_modifiers(&c, &mod); mouse_action(term, button, row, col - offset, pressed, mod); return false; } diff --git a/src/nvim/vterm/screen.c b/src/nvim/vterm/screen.c index c91c6fb84f..45bd5e2a27 100644 --- a/src/nvim/vterm/screen.c +++ b/src/nvim/vterm/screen.c @@ -784,6 +784,17 @@ static int resize(int new_rows, int new_cols, VTermStateFields *fields, void *us return 1; } +static int theme(bool *dark, void *user) +{ + VTermScreen *screen = user; + + if (screen->callbacks && screen->callbacks->theme) { + return (*screen->callbacks->theme)(dark, screen->cbdata); + } + + return 1; +} + static int setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user) { @@ -838,6 +849,7 @@ static VTermStateCallbacks state_cbs = { .settermprop = &settermprop, .bell = &bell, .resize = &resize, + .theme = &theme, .setlineinfo = &setlineinfo, .sb_clear = &sb_clear, }; diff --git a/src/nvim/vterm/state.c b/src/nvim/vterm/state.c index 9e787acd9b..4ad07377de 100644 --- a/src/nvim/vterm/state.c +++ b/src/nvim/vterm/state.c @@ -819,6 +819,10 @@ static void set_dec_mode(VTermState *state, int num, int val) state->mode.bracketpaste = (unsigned)val; break; + case 2031: + settermprop_bool(state, VTERM_PROP_THEMEUPDATES, val); + break; + default: DEBUG_LOG("libvterm: Unknown DEC mode %d\n", num); return; @@ -894,6 +898,10 @@ static void request_dec_mode(VTermState *state, int num) reply = state->mode.bracketpaste; break; + case 2031: + reply = state->mode.theme_updates; + break; + default: vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?%d;%d$y", num, 0); return; @@ -1387,6 +1395,7 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha { char *qmark = (leader_byte == '?') ? "?" : ""; + bool dark = false; switch (val) { case 0: @@ -1403,6 +1412,13 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "%s%d;%dR", qmark, state->pos.row + 1, state->pos.col + 1); break; + case 996: + if (state->callbacks && state->callbacks->theme) { + if (state->callbacks->theme(&dark, state->cbdata)) { + vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?997;%cn", dark ? '1' : '2'); + } + } + break; } } break; @@ -2268,6 +2284,9 @@ int vterm_state_set_termprop(VTermState *state, VTermProp prop, VTermValue *val) case VTERM_PROP_FOCUSREPORT: state->mode.report_focus = (unsigned)val->boolean; return 1; + case VTERM_PROP_THEMEUPDATES: + state->mode.theme_updates = (unsigned)val->boolean; + return 1; case VTERM_N_PROPS: return 0; diff --git a/src/nvim/vterm/vterm_defs.h b/src/nvim/vterm/vterm_defs.h index d0a8ba8814..9aa933bef0 100644 --- a/src/nvim/vterm/vterm_defs.h +++ b/src/nvim/vterm/vterm_defs.h @@ -86,6 +86,7 @@ typedef enum { VTERM_PROP_CURSORSHAPE, // number VTERM_PROP_MOUSE, // number VTERM_PROP_FOCUSREPORT, // bool + VTERM_PROP_THEMEUPDATES, // bool VTERM_N_PROPS, } VTermProp; @@ -111,6 +112,7 @@ typedef struct { int (*settermprop)(VTermProp prop, VTermValue *val, void *user); int (*bell)(void *user); int (*resize)(int rows, int cols, void *user); + int (*theme)(bool *dark, void *user); int (*sb_pushline)(int cols, const VTermScreenCell *cells, void *user); int (*sb_popline)(int cols, VTermScreenCell *cells, void *user); int (*sb_clear)(void *user); @@ -263,6 +265,7 @@ typedef struct { int (*settermprop)(VTermProp prop, VTermValue *val, void *user); int (*bell)(void *user); int (*resize)(int rows, int cols, VTermStateFields *fields, void *user); + int (*theme)(bool *dark, void *user); int (*setlineinfo)(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user); int (*sb_clear)(void *user); diff --git a/src/nvim/vterm/vterm_internal_defs.h b/src/nvim/vterm/vterm_internal_defs.h index 770f862ce3..d4d59867bf 100644 --- a/src/nvim/vterm/vterm_internal_defs.h +++ b/src/nvim/vterm/vterm_internal_defs.h @@ -119,6 +119,7 @@ struct VTermState { unsigned leftrightmargin:1; unsigned bracketpaste:1; unsigned report_focus:1; + unsigned theme_updates:1; } mode; VTermEncodingInstance encoding[4], encoding_utf8; diff --git a/src/nvim/window.c b/src/nvim/window.c index 68f45ec5ba..1c0d8c1027 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -835,6 +835,10 @@ void ui_ext_win_position(win_T *wp, bool validate) col += tcol - 1; } } + } else if (c.relative == kFloatRelativeLaststatus) { + row += Rows - (int)p_ch - last_stl_height(false); + } else if (c.relative == kFloatRelativeTabline) { + row += tabline_height(); } bool resort = wp->w_grid_alloc.comp_index != 0 @@ -1066,6 +1070,7 @@ win_T *win_split_ins(int size, int flags, win_T *new_wp, int dir, frame_T *to_fl return NULL; } need_status = STATUS_HEIGHT; + win_float_anchor_laststatus(); } bool do_equal = false; @@ -6803,6 +6808,7 @@ void last_status(bool morewin) { // Don't make a difference between horizontal or vertical split. last_status_rec(topframe, last_stl_height(morewin) > 0, global_stl_height() > 0); + win_float_anchor_laststatus(); } // Remove status line from window, replacing it with a horizontal separator if needed. diff --git a/src/nvim/winfloat.c b/src/nvim/winfloat.c index 3e791e2beb..d11b965dfc 100644 --- a/src/nvim/winfloat.c +++ b/src/nvim/winfloat.c @@ -307,6 +307,15 @@ void win_check_anchored_floats(win_T *win) } } +void win_float_anchor_laststatus(void) +{ + FOR_ALL_WINDOWS_IN_TAB(win, curtab) { + if (win->w_config.relative == kFloatRelativeLaststatus) { + win->w_pos_changed = true; + } + } +} + void win_reconfig_floats(void) { for (win_T *wp = lastwin; wp && wp->w_floating; wp = wp->w_prev) { diff --git a/test/functional/editor/defaults_spec.lua b/test/functional/editor/defaults_spec.lua index b62c5afcfc..ee6bfa1be9 100644 --- a/test/functional/editor/defaults_spec.lua +++ b/test/functional/editor/defaults_spec.lua @@ -32,7 +32,7 @@ describe('default', function() describe('popupmenu', function() it('can be disabled by user', function() n.clear { - args = { '+autocmd! nvim_popupmenu', '+aunmenu PopUp' }, + args = { '+autocmd! nvim.popupmenu', '+aunmenu PopUp' }, } local screen = Screen.new(40, 8) n.insert([[ diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index d1f598a9d8..f84fc140d2 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -173,7 +173,7 @@ describe('swapfile detection', function() local screen2 = Screen.new(256, 40) screen2._default_attr_ids = nil exec(init) - command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog). + command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog). -- With shortmess+=F command('set shortmess+=F') @@ -277,7 +277,7 @@ describe('swapfile detection', function() set_session(nvim1) screen:attach() exec(init) - command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog). + command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog). feed(':split Xfile1\n') -- The default SwapExists handler does _not_ skip this prompt. screen:expect({ @@ -296,7 +296,7 @@ describe('swapfile detection', function() set_session(nvim2) screen:attach() exec(init) - command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog). + command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog). command('set more') command('au bufadd * let foo_w = wincol()') feed(':e Xfile1<CR>') @@ -327,7 +327,7 @@ describe('swapfile detection', function() exec(init) if not swapexists then - command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog). + command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog). end command('set nohidden') diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index 0ba0948eee..33af25f629 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -17,6 +17,8 @@ local mkdir = t.mkdir local nvim_prog_basename = is_os('win') and 'nvim.exe' or 'nvim' +local link_limit = is_os('win') and 64 or (is_os('mac') or is_os('bsd')) and 33 or 41 + local test_basename_dirname_eq = { '~/foo/', '~/foo', @@ -152,7 +154,7 @@ describe('vim.fs', function() ) end) - it('works with opts.depth and opts.skip', function() + it('works with opts.depth, opts.skip and opts.follow', function() io.open('testd/a1', 'w'):close() io.open('testd/b1', 'w'):close() io.open('testd/c1', 'w'):close() @@ -166,8 +168,8 @@ describe('vim.fs', function() io.open('testd/a/b/c/b4', 'w'):close() io.open('testd/a/b/c/c4', 'w'):close() - local function run(dir, depth, skip) - return exec_lua(function() + local function run(dir, depth, skip, follow) + return exec_lua(function(follow_) local r = {} --- @type table<string, string> local skip_f --- @type function if skip then @@ -177,11 +179,11 @@ describe('vim.fs', function() end end end - for name, type_ in vim.fs.dir(dir, { depth = depth, skip = skip_f }) do + for name, type_ in vim.fs.dir(dir, { depth = depth, skip = skip_f, follow = follow_ }) do r[name] = type_ end return r - end) + end, follow) end local exp = {} @@ -197,6 +199,7 @@ describe('vim.fs', function() exp['a/b2'] = 'file' exp['a/c2'] = 'file' exp['a/b'] = 'directory' + local lexp = vim.deepcopy(exp) eq(exp, run('testd', 2)) @@ -213,6 +216,29 @@ describe('vim.fs', function() exp['a/b/c/c4'] = 'file' eq(exp, run('testd', 999)) + + vim.uv.fs_symlink(vim.uv.fs_realpath('testd/a'), 'testd/l', { junction = true, dir = true }) + lexp['l'] = 'link' + eq(lexp, run('testd', 2, nil, false)) + + lexp['l/a2'] = 'file' + lexp['l/b2'] = 'file' + lexp['l/c2'] = 'file' + lexp['l/b'] = 'directory' + eq(lexp, run('testd', 2, nil, true)) + end) + + it('follow=true handles symlink loop', function() + local cwd = 'testd/a/b/c' + local symlink = cwd .. '/link_loop' ---@type string + vim.uv.fs_symlink(vim.uv.fs_realpath(cwd), symlink, { junction = true, dir = true }) + + eq( + link_limit, + exec_lua(function() + return #vim.iter(vim.fs.dir(cwd, { depth = math.huge, follow = true })):totable() + end) + ) end) end) @@ -228,6 +254,53 @@ describe('vim.fs', function() eq({ nvim_dir }, vim.fs.find(name, { path = parent, upward = true, type = 'directory' })) end) + it('follows symlinks', function() + local build_dir = test_source_path .. '/build' ---@type string + local symlink = test_source_path .. '/build_link' ---@type string + vim.uv.fs_symlink(build_dir, symlink, { junction = true, dir = true }) + + finally(function() + vim.uv.fs_unlink(symlink) + end) + + eq( + { nvim_prog, symlink .. '/bin/' .. nvim_prog_basename }, + vim.fs.find(nvim_prog_basename, { + path = test_source_path, + type = 'file', + limit = 2, + follow = true, + }) + ) + + eq( + { nvim_prog }, + vim.fs.find(nvim_prog_basename, { + path = test_source_path, + type = 'file', + limit = 2, + follow = false, + }) + ) + end) + + it('follow=true handles symlink loop', function() + local cwd = test_source_path ---@type string + local symlink = test_source_path .. '/loop_link' ---@type string + vim.uv.fs_symlink(cwd, symlink, { junction = true, dir = true }) + + finally(function() + vim.uv.fs_unlink(symlink) + end) + + eq(link_limit, #vim.fs.find(nvim_prog_basename, { + path = test_source_path, + type = 'file', + limit = math.huge, + follow = true, + })) + end) + it('accepts predicate as names', function() local opts = { path = nvim_dir, upward = true, type = 'directory' } eq( diff --git a/test/functional/lua/hl_spec.lua b/test/functional/lua/hl_spec.lua index 89881973bf..3f903d43a9 100644 --- a/test/functional/lua/hl_spec.lua +++ b/test/functional/lua/hl_spec.lua @@ -144,7 +144,7 @@ describe('vim.hl.on_yank', function() vim.api.nvim_buf_set_mark(0, ']', 1, 1, {}) vim.hl.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } }) end) - local ns = api.nvim_create_namespace('hlyank') + local ns = api.nvim_create_namespace('nvim.hlyank') local win = api.nvim_get_current_win() eq({ win }, api.nvim__ns_get(ns).wins) command('wincmd w') @@ -158,7 +158,7 @@ describe('vim.hl.on_yank', function() vim.api.nvim_buf_set_mark(0, ']', 1, 1, {}) vim.hl.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } }) end) - local ns = api.nvim_create_namespace('hlyank') + local ns = api.nvim_create_namespace('nvim.hlyank') eq(api.nvim_get_current_win(), api.nvim__ns_get(ns).wins[1]) command('wincmd w') exec_lua(function() diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 5e9766c784..db3ab8ed98 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -6259,37 +6259,42 @@ describe('LSP', function() ) end) - it('supports a function for root_dir', function() + it('supports async function for root_dir', function() exec_lua(create_server_definition) local tmp1 = t.tmpname(true) + exec_lua(function() + local server = _G._create_server({ + handlers = { + initialize = function(_, _, callback) + callback(nil, { capabilities = {} }) + end, + }, + }) - eq( - 'some_dir', - exec_lua(function() - local server = _G._create_server({ - handlers = { - initialize = function(_, _, callback) - callback(nil, { capabilities = {} }) - end, - }, - }) - - vim.lsp.config('foo', { - cmd = server.cmd, - filetypes = { 'foo' }, - root_dir = function(cb) + vim.lsp.config('foo', { + cmd = server.cmd, + filetypes = { 'foo' }, + root_dir = function(cb) + vim.system({ 'sleep', '0' }, {}, function() cb('some_dir') - end, - }) - vim.lsp.enable('foo') + end) + end, + }) + vim.lsp.enable('foo') - vim.cmd.edit(assert(tmp1)) - vim.bo.filetype = 'foo' + vim.cmd.edit(assert(tmp1)) + vim.bo.filetype = 'foo' + end) - return vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() })[1].root_dir - end) - ) + retry(nil, 1000, function() + eq( + 'some_dir', + exec_lua(function() + return vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() })[1].root_dir + end) + ) + end) end) end) end) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index cc807ba555..66b75a4ea2 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -351,7 +351,7 @@ describe(':terminal buffer', function() end) it('TermRequest synchronization #27572', function() - command('autocmd! nvim_terminal TermRequest') + command('autocmd! nvim.terminal TermRequest') local term = exec_lua([[ _G.input = {} local term = vim.api.nvim_open_term(0, { @@ -625,6 +625,74 @@ describe('terminal input', function() ]]):format(key)) end end) + + -- TODO(bfredl): getcharstr() erases the distinction between <C-I> and <Tab>. + -- If it was enhanced or replaced this could get folded into the test above. + it('can send TAB/C-I and ESC/C-[ separately', function() + clear() + local screen = tt.setup_child_nvim({ + '-u', + 'NONE', + '-i', + 'NONE', + '--cmd', + 'colorscheme vim', + '--cmd', + 'set notermguicolors', + '--cmd', + 'noremap <Tab> <cmd>echo "Tab!"<cr>', + '--cmd', + 'noremap <C-i> <cmd>echo "Ctrl-I!"<cr>', + '--cmd', + 'noremap <Esc> <cmd>echo "Esc!"<cr>', + '--cmd', + 'noremap <C-[> <cmd>echo "Ctrl-[!"<cr>', + }) + + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + | + {3:-- TERMINAL --} | + ]]) + + feed('<tab>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Tab! | + {3:-- TERMINAL --} | + ]]) + + feed('<c-i>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Ctrl-I! | + {3:-- TERMINAL --} | + ]]) + + feed('<Esc>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Esc! | + {3:-- TERMINAL --} | + ]]) + + feed('<c-[>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Ctrl-[! | + {3:-- TERMINAL --} | + ]]) + end) end) if is_os('win') then diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 5224d322d3..c29a1e9cd4 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -176,7 +176,7 @@ local function test_terminal_with_fake_shell(backslash) end) it('with no argument, acts like jobstart(…,{term=true})', function() - command('autocmd! nvim_terminal TermClose') + command('autocmd! nvim.terminal TermClose') feed_command('terminal') screen:expect([[ ^ready $ | @@ -246,7 +246,7 @@ local function test_terminal_with_fake_shell(backslash) end) it('ignores writes if the backing stream closes', function() - command('autocmd! nvim_terminal TermClose') + command('autocmd! nvim.terminal TermClose') feed_command('terminal') feed('iiXXXXXXX') poke_eventloop() @@ -258,14 +258,14 @@ local function test_terminal_with_fake_shell(backslash) end) it('works with findfile()', function() - command('autocmd! nvim_terminal TermClose') + command('autocmd! nvim.terminal TermClose') feed_command('terminal') eq('term://', string.match(eval('bufname("%")'), '^term://')) eq('scripts/shadacat.py', eval('findfile("scripts/shadacat.py", ".")')) end) it('works with :find', function() - command('autocmd! nvim_terminal TermClose') + command('autocmd! nvim.terminal TermClose') feed_command('terminal') screen:expect([[ ^ready $ | diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 3624a7bc2b..a2dc3c500f 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -644,7 +644,7 @@ describe('TUI', function() aunmenu PopUp " Delete the default MenuPopup event handler. - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu menu PopUp.foo :let g:menustr = 'foo'<CR> menu PopUp.bar :let g:menustr = 'bar'<CR> menu PopUp.baz :let g:menustr = 'baz'<CR> @@ -3309,6 +3309,32 @@ describe('TUI bg color', function() {3:-- TERMINAL --} | ]]) end) + + it('sends theme update notifications when background changes #31652', function() + command('set background=dark') -- set outer Nvim background + local child_server = new_pipename() + local screen = tt.setup_child_nvim({ + '--listen', + child_server, + '-u', + 'NONE', + '-i', + 'NONE', + '--cmd', + 'colorscheme vim', + '--cmd', + 'set noswapfile', + }) + screen:expect({ any = '%[No Name%]' }) + local child_session = n.connect(child_server) + retry(nil, nil, function() + eq({ true, 'dark' }, { child_session:request('nvim_eval', '&background') }) + end) + command('set background=light') -- set outer Nvim background + retry(nil, nil, function() + eq({ true, 'light' }, { child_session:request('nvim_eval', '&background') }) + end) + end) end) -- These tests require `tt` because --headless/--embed diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index be0a9b80cf..ca26c46fc5 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1012,6 +1012,97 @@ describe('float window', function() end) end) + it('placed relative to tabline and laststatus', function() + local screen = Screen.new(20, 10) + screen:add_extra_attr_ids({ [100] = { bold = true, foreground = Screen.colors.Magenta } }) + command('set showtabline=1 laststatus=1') + api.nvim_open_win(0, false, { + relative = 'laststatus', + border = 'single', + anchor = 'SE', + width = 5, + height = 1, + row = 0, + col = 1000, + }) + local tabwin = api.nvim_open_win(0, false, { + relative = 'tabline', + border = 'single', + width = 5, + height = 1, + row = 0, + col = 1000, + }) + screen:expect([[ + ^ {2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + {1:~ }|*3 + {1:~ }{2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + | + ]]) + command('tabnew | tabnext') + screen:expect([[ + {5: }{100:3}{5: Name] }{24: No Name]X}| + ^ {2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + {1:~ }|*2 + {1:~ }{2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + | + ]]) + command('vsplit') + screen:expect([[ + {5: }{100:4}{5: Name] }{24: No Name]X}| + ^ {2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + {1:~ }{2:│}{1:~}| + {1:~ }{2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + {3:[No Name] }{2:<}| + | + ]]) + command('quit') + api.nvim_win_set_config(tabwin, { + relative = 'tabline', + border = 'single', + width = 5, + height = 1, + row = 1, + col = 0, + }) + screen:expect([[ + {5: }{100:3}{5: Name] }{24: No Name]X}| + ^ | + {2:┌─────┐}{1: }| + {2:│}{4: }{2:│}{1: }| + {2:└─────┘}{1: }| + {1:~ }| + {1:~ }{2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + | + ]]) + command('tabonly') + screen:expect([[ + ^ | + {2:┌─────┐}{1: }| + {2:│}{4: }{2:│}{1: }| + {2:└─────┘}{1: }| + {1:~ }|*2 + {1:~ }{2:┌─────┐}| + {1:~ }{2:│}{4: }{2:│}| + {1:~ }{2:└─────┘}| + | + ]]) + end) + local function with_ext_multigrid(multigrid) local screen, attrs before_each(function() diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index 3afda0c4af..cac7174cb6 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -1094,7 +1094,7 @@ describe('ext_multigrid', function() end) it('supports mouse', function() - command('autocmd! nvim_popupmenu') -- Delete the default MenuPopup event handler. + command('autocmd! nvim.popupmenu') -- Delete the default MenuPopup event handler. insert('some text\nto be clicked') screen:expect{grid=[[ ## grid 1 diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 5e883d1a92..4c5b1d2bd2 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -841,7 +841,7 @@ describe('ui/ext_popupmenu', function() aunmenu PopUp " Delete the default MenuPopup event handler. - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu menu PopUp.foo :let g:menustr = 'foo'<CR> menu PopUp.bar :let g:menustr = 'bar'<CR> menu PopUp.baz :let g:menustr = 'baz'<CR> @@ -4089,7 +4089,7 @@ describe('builtin popupmenu', function() set mouse=a mousemodel=popup " Delete the default MenuPopup event handler. - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu aunmenu PopUp menu PopUp.foo :let g:menustr = 'foo'<CR> menu PopUp.bar :let g:menustr = 'bar'<CR> @@ -4946,7 +4946,7 @@ describe('builtin popupmenu', function() it(':popup command', function() exec([[ " Delete the default MenuPopup event handler. - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu func ChangeMenu() aunmenu PopUp.&Paste @@ -5106,7 +5106,7 @@ describe('builtin popupmenu', function() exec([[ set mousemodel=popup_setpos " Delete the default MenuPopup event handler. - autocmd! nvim_popupmenu + autocmd! nvim.popupmenu aunmenu * source $VIMRUNTIME/menu.vim call setline(1, join(range(20))) diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim index b104d733f0..61596fc83a 100644 --- a/test/old/testdir/setup.vim +++ b/test/old/testdir/setup.vim @@ -65,7 +65,7 @@ mapclear mapclear! aunmenu * tlunmenu * -autocmd! nvim_popupmenu +autocmd! nvim.popupmenu " Undo the 'grepprg' and 'grepformat' setting in _defaults.lua. set grepprg& grepformat& diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 5182ff5167..2c6b1bd0f4 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -395,7 +395,7 @@ func s:GetFilenameChecks() abort \ 'jq': ['file.jq'], \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock'], \ 'json5': ['file.json5'], - \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock'], + \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock', expand("$HOME/.config/VSCodium/User/settings.json")], \ 'jsonl': ['file.jsonl'], \ 'jsonnet': ['file.jsonnet', 'file.libsonnet'], \ 'jsp': ['file.jsp'], diff --git a/test/testutil.lua b/test/testutil.lua index 3226bfeb1e..e69dcae120 100644 --- a/test/testutil.lua +++ b/test/testutil.lua @@ -388,15 +388,18 @@ end local sysname = uv.os_uname().sysname:lower() ---- @param s 'win'|'mac'|'freebsd'|'openbsd'|'bsd' +--- @param s 'win'|'mac'|'linux'|'freebsd'|'openbsd'|'bsd' --- @return boolean function M.is_os(s) - if not (s == 'win' or s == 'mac' or s == 'freebsd' or s == 'openbsd' or s == 'bsd') then + if + not (s == 'win' or s == 'mac' or s == 'linux' or s == 'freebsd' or s == 'openbsd' or s == 'bsd') + then error('unknown platform: ' .. tostring(s)) end return not not ( (s == 'win' and (sysname:find('windows') or sysname:find('mingw'))) or (s == 'mac' and sysname == 'darwin') + or (s == 'linux' and sysname == 'linux') or (s == 'freebsd' and sysname == 'freebsd') or (s == 'openbsd' and sysname == 'openbsd') or (s == 'bsd' and sysname:find('bsd')) diff --git a/test/unit/fixtures/vterm_test.c b/test/unit/fixtures/vterm_test.c index 7522962a05..6744305960 100644 --- a/test/unit/fixtures/vterm_test.c +++ b/test/unit/fixtures/vterm_test.c @@ -345,6 +345,8 @@ static VTermValueType vterm_get_prop_type(VTermProp prop) return VTERM_VALUETYPE_INT; case VTERM_PROP_FOCUSREPORT: return VTERM_VALUETYPE_BOOL; + case VTERM_PROP_THEMEUPDATES: + return VTERM_VALUETYPE_BOOL; case VTERM_N_PROPS: return 0; |