diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/colors/default.vim | 12 | ||||
-rw-r--r-- | runtime/colors/vim.vim | 269 | ||||
-rw-r--r-- | runtime/doc/api.txt | 18 | ||||
-rw-r--r-- | runtime/doc/dev_theme.txt | 103 | ||||
-rw-r--r-- | runtime/doc/news.txt | 4 | ||||
-rw-r--r-- | runtime/doc/treesitter.txt | 2 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 | ||||
-rw-r--r-- | runtime/ftplugin/help.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api.lua | 20 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api_keysets.lua | 22 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 1 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter.lua | 3 | ||||
-rw-r--r-- | runtime/syntax/pacmanlog.vim | 41 |
13 files changed, 474 insertions, 27 deletions
diff --git a/runtime/colors/default.vim b/runtime/colors/default.vim index d2960fa78b..fac120ccf5 100644 --- a/runtime/colors/default.vim +++ b/runtime/colors/default.vim @@ -1,12 +1,10 @@ -" Vim color file -" Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 -" Former Maintainer: Bram Moolenaar <Bram@vim.org> +" Neovim color file +" Maintainer: The Neovim Project <https://github.com/neovim/neovim> +" Last Change: 2023 Dec 01 -" This is the default color scheme. It doesn't define the Normal -" highlighting, it uses whatever the colors used to be. +" This is the default color scheme. -" Set 'background' back to the default. The value can't always be estimated +" Set 'background' back to the default. The value can't always be estimated " and is then guessed. hi clear Normal set bg& diff --git a/runtime/colors/vim.vim b/runtime/colors/vim.vim new file mode 100644 index 0000000000..3418abe424 --- /dev/null +++ b/runtime/colors/vim.vim @@ -0,0 +1,269 @@ +" Name: vim +" Description: Vim's default color scheme +" Author: Bram Moolenaar <Bram@vim.org> +" Maintainer: The Vim Project <https://github.com/vim/vim> +" Website: https://github.com/vim/vim +" License: Same as Vim +" Last Updated: 2023 Aug 10 + +" This is Vim's default color scheme. It doesn't define the Normal +" highlighting, it uses whatever the colors used to be. + +hi clear +let g:colors_name = 'vim' + +" General +hi Conceal guifg=LightGrey guibg=DarkGrey guisp=NONE gui=NONE ctermfg=LightGrey ctermbg=DarkGrey cterm=NONE +hi Cursor guifg=bg guibg=fg guisp=NONE gui=NONE ctermfg=bg ctermbg=fg cterm=NONE +hi lCursor guifg=bg guibg=fg guisp=NONE gui=NONE ctermfg=bg ctermbg=fg cterm=NONE +hi DiffText guifg=NONE guibg=Red guisp=NONE gui=bold ctermfg=NONE ctermbg=Red cterm=bold +hi ErrorMsg guifg=White guibg=Red guisp=NONE gui=NONE ctermfg=White ctermbg=DarkRed cterm=NONE +hi IncSearch guifg=NONE guibg=NONE guisp=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse +hi ModeMsg guifg=NONE guibg=NONE guisp=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi NonText guifg=Blue guibg=NONE guisp=NONE gui=bold ctermfg=Blue ctermbg=NONE cterm=NONE +hi Normal guifg=NONE guibg=NONE guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi PmenuSbar guifg=NONE guibg=Grey guisp=NONE gui=NONE ctermfg=NONE ctermbg=Grey cterm=NONE +hi StatusLine guifg=NONE guibg=NONE guisp=NONE gui=reverse,bold ctermfg=NONE ctermbg=NONE cterm=reverse,bold +hi StatusLineNC guifg=NONE guibg=NONE guisp=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse +hi TabLineFill guifg=NONE guibg=NONE guisp=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse +hi TabLineSel guifg=NONE guibg=NONE guisp=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi TermCursor guifg=NONE guibg=NONE guisp=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse +hi WinBar guifg=NONE guibg=NONE guisp=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi WildMenu guifg=Black guibg=Yellow guisp=NONE gui=NONE ctermfg=Black ctermbg=Yellow cterm=NONE +hi! link VertSplit Normal +hi! link WinSeparator VertSplit +hi! link WinBarNC WinBar +hi! link EndOfBuffer NonText +hi! link LineNrAbove LineNr +hi! link LineNrBelow LineNr +hi! link QuickFixLine Search +hi! link CursorLineSign SignColumn +hi! link CursorLineFold FoldColumn +hi! link CurSearch Search +hi! link PmenuKind Pmenu +hi! link PmenuKindSel PmenuSel +hi! link PmenuExtra Pmenu +hi! link PmenuExtraSel PmenuSel +hi! link Substitute Search +hi! link Whitespace NonText +hi! link MsgSeparator StatusLine +hi! link NormalFloat Pmenu +hi! link FloatBorder WinSeparator +hi! link FloatTitle Title +hi! link FloatFooter Title +hi FloatShadow guifg=NONE guibg=Black guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE blend=80 +hi FloatShadowThrough guifg=NONE guibg=Black guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE blend=100 +hi RedrawDebugNormal guifg=NONE guibg=NONE guisp=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse +hi RedrawDebugClear guifg=NONE guibg=Yellow guisp=NONE gui=NONE ctermfg=NONE ctermbg=Yellow cterm=NONE +hi RedrawDebugComposed guifg=NONE guibg=Green guisp=NONE gui=NONE ctermfg=NONE ctermbg=Green cterm=NONE +hi RedrawDebugRecompose guifg=NONE guibg=Red guisp=NONE gui=NONE ctermfg=NONE ctermbg=Red cterm=NONE +hi Error guifg=White guibg=Red guisp=NONE gui=NONE ctermfg=White ctermbg=Red cterm=NONE term=reverse +hi Todo guifg=Blue guibg=Yellow guisp=NONE gui=NONE ctermfg=Black ctermbg=Yellow cterm=NONE term=standout +hi! link String Constant +hi! link Character Constant +hi! link Number Constant +hi! link Boolean Constant +hi! link Float Number +hi! link Function Identifier +hi! link Conditional Statement +hi! link Repeat Statement +hi! link Label Statement +hi! link Operator Statement +hi! link Keyword Statement +hi! link Exception Statement +hi! link Include PreProc +hi! link Define PreProc +hi! link Macro PreProc +hi! link PreCondit PreProc +hi! link StorageClass Type +hi! link Structure Type +hi! link Typedef Type +hi! link Tag Special +hi! link SpecialChar Special +hi! link Delimiter Special +hi! link SpecialComment Special +hi! link Debug Special +hi DiagnosticError guifg=Red guibg=NONE guisp=NONE gui=NONE ctermfg=1 ctermbg=NONE cterm=NONE +hi DiagnosticWarn guifg=Orange guibg=NONE guisp=NONE gui=NONE ctermfg=3 ctermbg=NONE cterm=NONE +hi DiagnosticInfo guifg=LightBlue guibg=NONE guisp=NONE gui=NONE ctermfg=4 ctermbg=NONE cterm=NONE +hi DiagnosticHint guifg=LightGrey guibg=NONE guisp=NONE gui=NONE ctermfg=7 ctermbg=NONE cterm=NONE +hi DiagnosticOk guifg=LightGreen guibg=NONE guisp=NONE gui=NONE ctermfg=10 ctermbg=NONE cterm=NONE +hi DiagnosticUnderlineError guifg=NONE guibg=NONE guisp=Red gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +hi DiagnosticUnderlineWarn guifg=NONE guibg=NONE guisp=Orange gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +hi DiagnosticUnderlineInfo guifg=NONE guibg=NONE guisp=LightBlue gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +hi DiagnosticUnderlineHint guifg=NONE guibg=NONE guisp=LightGrey gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +hi DiagnosticUnderlineOk guifg=NONE guibg=NONE guisp=LightGreen gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +hi! link DiagnosticVirtualTextError DiagnosticError +hi! link DiagnosticVirtualTextWarn DiagnosticWarn +hi! link DiagnosticVirtualTextInfo DiagnosticInfo +hi! link DiagnosticVirtualTextHint DiagnosticHint +hi! link DiagnosticVirtualTextOk DiagnosticOk +hi! link DiagnosticFloatingError DiagnosticError +hi! link DiagnosticFloatingWarn DiagnosticWarn +hi! link DiagnosticFloatingInfo DiagnosticInfo +hi! link DiagnosticFloatingHint DiagnosticHint +hi! link DiagnosticFloatingOk DiagnosticOk +hi! link DiagnosticSignError DiagnosticError +hi! link DiagnosticSignWarn DiagnosticWarn +hi! link DiagnosticSignInfo DiagnosticInfo +hi! link DiagnosticSignHint DiagnosticHint +hi! link DiagnosticSignOk DiagnosticOk +hi DiagnosticDeprecated guifg=NONE guibg=NONE guisp=Red gui=strikethrough ctermfg=NONE ctermbg=NONE cterm=strikethrough +hi! link DiagnosticUnnecessary Comment +hi! link LspInlayHint NonText +hi! link SnippetTabstop Visual + +" Text +hi! link @text.literal Comment +hi! link @text.reference Identifier +hi! link @text.title Title +hi! link @text.uri Underlined +hi! link @text.underline Underlined +hi! link @text.todo Todo + +" Miscs +hi! link @comment Comment +hi! link @punctuation Delimiter + +" Constants +hi! link @constant Constant +hi! link @constant.builtin Special +hi! link @constant.macro Define +hi! link @define Define +hi! link @macro Macro +hi! link @string String +hi! link @string.escape SpecialChar +hi! link @string.special SpecialChar +hi! link @character Character +hi! link @character.special SpecialChar +hi! link @number Number +hi! link @boolean Boolean +hi! link @float Float + +" Functions +hi! link @function Function +hi! link @function.builtin Special +hi! link @function.macro Macro +hi! link @parameter Identifier +hi! link @method Function +hi! link @field Identifier +hi! link @property Identifier +hi! link @constructor Special + +" Keywords +hi! link @conditional Conditional +hi! link @repeat Repeat +hi! link @label Label +hi! link @operator Operator +hi! link @keyword Keyword +hi! link @exception Exception + +hi! link @variable Identifier +hi! link @type Type +hi! link @type.definition Typedef +hi! link @storageclass StorageClass +hi! link @namespace Identifier +hi! link @include Include +hi! link @preproc PreProc +hi! link @debug Debug +hi! link @tag Tag + +" LSP semantic tokens +hi! link @lsp.type.class Structure +hi! link @lsp.type.comment Comment +hi! link @lsp.type.decorator Function +hi! link @lsp.type.enum Structure +hi! link @lsp.type.enumMember Constant +hi! link @lsp.type.function Function +hi! link @lsp.type.interface Structure +hi! link @lsp.type.macro Macro +hi! link @lsp.type.method Function +hi! link @lsp.type.namespace Structure +hi! link @lsp.type.parameter Identifier +hi! link @lsp.type.property Identifier +hi! link @lsp.type.struct Structure +hi! link @lsp.type.type Type +hi! link @lsp.type.typeParameter TypeDef +hi! link @lsp.type.variable Identifier + +if &background ==# 'light' + " Default colors only used with a light background. + hi ColorColumn guifg=NONE guibg=LightRed guisp=NONE gui=NONE ctermfg=NONE ctermbg=LightRed cterm=NONE + hi CursorColumn guifg=NONE guibg=Grey90 guisp=NONE gui=NONE ctermfg=NONE ctermbg=LightGrey cterm=NONE + hi CursorLine guifg=NONE guibg=Grey90 guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorLineNr guifg=Brown guibg=NONE guisp=NONE gui=bold ctermfg=Brown ctermbg=NONE cterm=underline + hi DiffAdd guifg=NONE guibg=LightBlue guisp=NONE gui=NONE ctermfg=NONE ctermbg=LightBlue cterm=NONE + hi DiffChange guifg=NONE guibg=LightMagenta guisp=NONE gui=NONE ctermfg=NONE ctermbg=LightMagenta cterm=NONE + hi DiffDelete guifg=Blue guibg=LightCyan guisp=NONE gui=bold ctermfg=Blue ctermbg=LightCyan cterm=NONE + hi Directory guifg=Blue guibg=NONE guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=NONE cterm=NONE + hi FoldColumn guifg=DarkBlue guibg=Grey guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=Grey cterm=NONE + hi Folded guifg=DarkBlue guibg=LightGrey guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=Grey cterm=NONE + hi LineNr guifg=Brown guibg=NONE guisp=NONE gui=NONE ctermfg=Brown ctermbg=NONE cterm=NONE + hi MatchParen guifg=NONE guibg=Cyan guisp=NONE gui=NONE ctermfg=NONE ctermbg=Cyan cterm=NONE + hi MoreMsg guifg=SeaGreen guibg=NONE guisp=NONE gui=bold ctermfg=DarkGreen ctermbg=NONE cterm=NONE + hi Pmenu guifg=NONE guibg=LightMagenta guisp=NONE gui=NONE ctermfg=Black ctermbg=LightMagenta cterm=NONE + hi PmenuSel guifg=NONE guibg=Grey guisp=NONE gui=NONE ctermfg=Black ctermbg=LightGrey cterm=NONE blend=NONE + hi PmenuThumb guifg=NONE guibg=Black guisp=NONE gui=NONE ctermfg=NONE ctermbg=Black cterm=NONE + hi Question guifg=SeaGreen guibg=NONE guisp=NONE gui=bold ctermfg=DarkGreen ctermbg=NONE cterm=NONE + hi Search guifg=NONE guibg=Yellow guisp=NONE gui=NONE ctermfg=NONE ctermbg=Yellow cterm=NONE + hi SignColumn guifg=DarkBlue guibg=Grey guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=Grey cterm=NONE + hi SpecialKey guifg=Blue guibg=NONE guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=NONE cterm=NONE + hi SpellBad guifg=NONE guibg=NONE guisp=Red gui=undercurl ctermfg=NONE ctermbg=LightRed cterm=NONE + hi SpellCap guifg=NONE guibg=NONE guisp=Blue gui=undercurl ctermfg=NONE ctermbg=LightBlue cterm=NONE + hi SpellLocal guifg=NONE guibg=NONE guisp=DarkCyan gui=undercurl ctermfg=NONE ctermbg=Cyan cterm=NONE + hi SpellRare guifg=NONE guibg=NONE guisp=Magenta gui=undercurl ctermfg=NONE ctermbg=LightMagenta cterm=NONE + hi TabLine guifg=NONE guibg=LightGrey guisp=NONE gui=underline ctermfg=black ctermbg=LightGrey cterm=underline + hi Title guifg=Magenta guibg=NONE guisp=NONE gui=bold ctermfg=DarkMagenta ctermbg=NONE cterm=NONE + hi Visual guifg=NONE guibg=LightGrey guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi WarningMsg guifg=Red guibg=NONE guisp=NONE gui=NONE ctermfg=DarkRed ctermbg=NONE cterm=NONE + hi Comment guifg=Blue guibg=NONE guisp=NONE gui=NONE ctermfg=DarkBlue ctermbg=NONE cterm=NONE term=bold + hi Constant guifg=Magenta guibg=NONE guisp=NONE gui=NONE ctermfg=DarkRed ctermbg=NONE cterm=NONE term=underline + hi Special guifg=#6a5acd guibg=NONE guisp=NONE gui=NONE ctermfg=DarkMagenta ctermbg=NONE cterm=NONE term=bold + hi Identifier guifg=DarkCyan guibg=NONE guisp=NONE gui=NONE ctermfg=DarkCyan ctermbg=NONE cterm=NONE term=underline + hi Statement guifg=Brown guibg=NONE guisp=NONE gui=bold ctermfg=Brown ctermbg=NONE cterm=NONE term=bold + hi PreProc guifg=#6a0dad guibg=NONE guisp=NONE gui=NONE ctermfg=DarkMagenta ctermbg=NONE cterm=NONE term=underline + hi Type guifg=SeaGreen guibg=NONE guisp=NONE gui=bold ctermfg=DarkGreen ctermbg=NONE cterm=NONE term=underline + hi Underlined guifg=SlateBlue guibg=NONE guisp=NONE gui=underline ctermfg=DarkMagenta ctermbg=NONE cterm=underline term=underline + hi Ignore guifg=bg guibg=NONE guisp=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE term=NONE +else + " Default colors only used with a dark background. + hi ColorColumn guifg=NONE guibg=DarkRed guisp=NONE gui=NONE ctermfg=NONE ctermbg=DarkRed cterm=NONE + hi CursorColumn guifg=NONE guibg=Grey40 guisp=NONE gui=NONE ctermfg=NONE ctermbg=DarkGrey cterm=NONE + hi CursorLine guifg=NONE guibg=Grey40 guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorLineNr guifg=Yellow guibg=NONE guisp=NONE gui=bold ctermfg=Yellow ctermbg=NONE cterm=underline + hi DiffAdd guifg=NONE guibg=DarkBlue guisp=NONE gui=NONE ctermfg=NONE ctermbg=DarkBlue cterm=NONE + hi DiffChange guifg=NONE guibg=DarkMagenta guisp=NONE gui=NONE ctermfg=NONE ctermbg=DarkMagenta cterm=NONE + hi DiffDelete guifg=Blue guibg=DarkCyan guisp=NONE gui=bold ctermfg=Blue ctermbg=DarkCyan cterm=NONE + hi Directory guifg=Cyan guibg=NONE guisp=NONE gui=NONE ctermfg=LightCyan ctermbg=NONE cterm=NONE + hi FoldColumn guifg=Cyan guibg=Grey guisp=NONE gui=NONE ctermfg=Cyan ctermbg=DarkGrey cterm=NONE + hi Folded guifg=Cyan guibg=DarkGrey guisp=NONE gui=NONE ctermfg=Cyan ctermbg=DarkGrey cterm=NONE + hi LineNr guifg=Yellow guibg=NONE guisp=NONE gui=NONE ctermfg=Yellow ctermbg=NONE cterm=NONE + hi MatchParen guifg=NONE guibg=DarkCyan guisp=NONE gui=NONE ctermfg=NONE ctermbg=DarkCyan cterm=NONE + hi MoreMsg guifg=SeaGreen guibg=NONE guisp=NONE gui=bold ctermfg=LightGreen ctermbg=NONE cterm=NONE + hi Pmenu guifg=NONE guibg=Magenta guisp=NONE gui=NONE ctermfg=Black ctermbg=Magenta cterm=NONE + hi PmenuSel guifg=NONE guibg=DarkGrey guisp=NONE gui=NONE ctermfg=DarkGrey ctermbg=Black cterm=NONE blend=NONE + hi PmenuThumb guifg=NONE guibg=White guisp=NONE gui=NONE ctermfg=NONE ctermbg=White cterm=NONE + hi Question guifg=Green guibg=NONE guisp=NONE gui=bold ctermfg=LightGreen ctermbg=NONE cterm=NONE + hi Search guifg=Black guibg=Yellow guisp=NONE gui=NONE ctermfg=Black ctermbg=Yellow cterm=NONE + hi SignColumn guifg=Cyan guibg=Grey guisp=NONE gui=NONE ctermfg=Cyan ctermbg=DarkGrey cterm=NONE + hi SpecialKey guifg=Cyan guibg=NONE guisp=NONE gui=NONE ctermfg=LightBlue ctermbg=NONE cterm=NONE + hi SpellBad guifg=NONE guibg=NONE guisp=Red gui=undercurl ctermfg=NONE ctermbg=Red cterm=NONE + hi SpellCap guifg=NONE guibg=NONE guisp=Blue gui=undercurl ctermfg=NONE ctermbg=Blue cterm=NONE + hi SpellLocal guifg=NONE guibg=NONE guisp=Cyan gui=undercurl ctermfg=NONE ctermbg=Cyan cterm=NONE + hi SpellRare guifg=NONE guibg=NONE guisp=Magenta gui=undercurl ctermfg=NONE ctermbg=Magenta cterm=NONE + hi TabLine guifg=NONE guibg=DarkGrey guisp=NONE gui=underline ctermfg=white ctermbg=DarkGrey cterm=underline + hi Title guifg=Magenta guibg=NONE guisp=NONE gui=bold ctermfg=LightMagenta ctermbg=NONE cterm=NONE + hi Visual guifg=NONE guibg=DarkGrey guisp=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi WarningMsg guifg=Red guibg=NONE guisp=NONE gui=NONE ctermfg=LightRed ctermbg=NONE cterm=NONE + hi Comment guifg=#80a0ff guibg=NONE guisp=NONE gui=NONE ctermfg=Cyan ctermbg=NONE cterm=NONE term=bold + hi Constant guifg=#ffa0a0 guibg=NONE guisp=NONE gui=NONE ctermfg=Magenta ctermbg=NONE cterm=NONE term=underline + hi Special guifg=Orange guibg=NONE guisp=NONE gui=NONE ctermfg=LightRed ctermbg=NONE cterm=NONE term=bold + hi Identifier guifg=#40ffff guibg=NONE guisp=NONE gui=NONE ctermfg=Cyan ctermbg=NONE cterm=bold term=underline + hi Statement guifg=#ffff60 guibg=NONE guisp=NONE gui=bold ctermfg=Yellow ctermbg=NONE cterm=NONE term=bold + hi PreProc guifg=#ff80ff guibg=NONE guisp=NONE gui=NONE ctermfg=LightBlue ctermbg=NONE cterm=NONE term=underline + hi Type guifg=#60ff60 guibg=NONE guisp=NONE gui=bold ctermfg=LightGreen ctermbg=NONE cterm=NONE term=underline + hi Underlined guifg=#80a0ff guibg=NONE guisp=NONE gui=underline ctermfg=LightBlue ctermbg=NONE cterm=underline term=underline + hi Ignore guifg=bg guibg=NONE guisp=NONE gui=NONE ctermfg=black ctermbg=NONE cterm=NONE term=NONE +endif + +" vim: sw=2 diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ba3b7c0915..4aba1f8141 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1006,7 +1006,7 @@ nvim_get_keymap({mode}) *nvim_get_keymap()* Array of |maparg()|-like dictionaries describing mappings. The "buffer" key is always zero. -nvim_get_mark({name}, {opts}) *nvim_get_mark()* +nvim_get_mark({name}, {*opts}) *nvim_get_mark()* Returns a `(row, col, buffer, buffername)` tuple representing the position of the uppercase/file named mark. "End of line" column position is returned as |v:maxcol| (big number). See |mark-motions|. @@ -1204,7 +1204,7 @@ nvim_notify({msg}, {log_level}, {opts}) *nvim_notify()* • {log_level} The log level • {opts} Reserved for future use. -nvim_open_term({buffer}, {opts}) *nvim_open_term()* +nvim_open_term({buffer}, {*opts}) *nvim_open_term()* Open a terminal instance in a buffer By default (and currently the only option) the terminal will not be @@ -1305,7 +1305,7 @@ nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) • cpoptions *nvim_select_popupmenu_item()* -nvim_select_popupmenu_item({item}, {insert}, {finish}, {opts}) +nvim_select_popupmenu_item({item}, {insert}, {finish}, {*opts}) Selects an item in the completion popup menu. If neither |ins-completion| nor |cmdline-completion| popup menu is active @@ -1878,7 +1878,7 @@ nvim_get_commands({*opts}) *nvim_get_commands()* See also: ~ • |nvim_get_all_options_info()| -nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* +nvim_parse_cmd({str}, {*opts}) *nvim_parse_cmd()* Parse command line. Doesn't check the validity of command arguments. @@ -2057,7 +2057,7 @@ affected. You can use |nvim_buf_is_loaded()| or |nvim_buf_line_count()| to check whether a buffer is loaded. -nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* +nvim_buf_attach({buffer}, {send_buffer}, {*opts}) *nvim_buf_attach()* Activates buffer-update events on a channel, or as Lua callbacks. Example (Lua): capture buffer updates in a global `events` variable (use @@ -2193,7 +2193,7 @@ nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()* • {buffer} Buffer handle, or 0 for current buffer • {name} Variable name -nvim_buf_delete({buffer}, {opts}) *nvim_buf_delete()* +nvim_buf_delete({buffer}, {*opts}) *nvim_buf_delete()* Deletes the buffer. See |:bwipeout| Attributes: ~ @@ -2310,7 +2310,7 @@ nvim_buf_get_offset({buffer}, {index}) *nvim_buf_get_offset()* *nvim_buf_get_text()* nvim_buf_get_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col}, - {opts}) + {*opts}) Gets a range from the buffer. This differs from |nvim_buf_get_lines()| in that it allows retrieving only @@ -2412,7 +2412,7 @@ nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, {replacement}) • |nvim_buf_set_text()| *nvim_buf_set_mark()* -nvim_buf_set_mark({buffer}, {name}, {line}, {col}, {opts}) +nvim_buf_set_mark({buffer}, {name}, {line}, {col}, {*opts}) Sets a named mark in the given buffer, all marks are allowed file/uppercase, visual, last change, etc. See |mark-motions|. @@ -2553,7 +2553,7 @@ nvim_buf_del_extmark({buffer}, {ns_id}, {id}) *nvim_buf_del_extmark()* true if the extmark was found, else false *nvim_buf_get_extmark_by_id()* -nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts}) +nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {*opts}) Gets the position (0-indexed) of an |extmark|. Parameters: ~ diff --git a/runtime/doc/dev_theme.txt b/runtime/doc/dev_theme.txt new file mode 100644 index 0000000000..04ec3f293c --- /dev/null +++ b/runtime/doc/dev_theme.txt @@ -0,0 +1,103 @@ +*dev_theme.txt* Nvim + + + NVIM REFERENCE MANUAL + + +Nvim theme style guide *dev-theme* + +This is style guide for developers working on Nvim's default color scheme. + +License: CC-By 3.0 https://creativecommons.org/licenses/by/3.0/ + + Type |gO| to see the table of contents. + +============================================================================== +Design + +- Be "Neovim branded", i.e. have mostly "green-blue" feel plus one or two + colors reserved for very occasional user attention. + +- Be extra minimal for 'notermguicolors' (256 colors) while allowing a bit + more shades when 'termguicolors' is set (true colors). + +- Be accessible, i.e. have high enough contrast ratio (as defined in + https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef). + This means to have value at least 7 for |hl-Normal| and 4.5 for some common + cases (|hl-Visual|, `Comment` with set 'cursorline', colored syntax, `Diff*`, + |hl-Search|). + +- Be suitable for dark and light backgrounds via exchange of dark and light + palettes. + +- Be usable, i.e. provide enough visual feedback for common objects. + + +============================================================================== +Palettes + +- There are two separate palettes: dark and light. They all contain the same + set of colors exported as `NvimDark*` and `NvimLight*` colors respectively. + +- The dark palette is used for background in the dark color scheme and for + foreground in the light color scheme; and vice versa. This introduces + recognizable visual system without too standing out. + +- Actual computation of palettes should be done in a perceptually uniform + color space. Oklch is a good choice. + +- Each palette has the following colors (descriptions are for dark background; + reverse for light one): + + - Four shades of "colored" greys for general UI. In 256 colors they are + exact greys; in true colors they are shades of "cold" grey. + + - Dark ones (from darkest to lightest) are reserved as background for + |hl-NormalFloat| (considered as "black"), |hl-Normal| (background), + |hl-CursorLine|, |hl-Visual|. + + - Light ones (also from darkest to lightest) are reserved for + `Comment`, |hl-StatusLine|/|hl-TabLine|, |hl-Normal| (foreground), + and color considered as "white". + +- Six colors to provide enough terminal colors: red, yellow, green, cyan, + blue, magenta. + They should have (reasonably) similar lightness and chroma to make them + visually coherent. Lightness should be as equal to the palette's basic grey + (which is used for |hl-Normal|) as possible. They should have (reasonably) + different hues to make them visually separable. + +- Each palette color should have a 256 colors variant with closest color + computed based on the perceptually uniform distance measure. + + +============================================================================== +Highlight groups + +Use: + +- Grey shades for general UI according to their design. + +- Bold text for keywords (`Statement` highlight group). This is an important + choice to increase accessibility for people with color deficiencies, as it + doesn't rely on actual color. + +- Green for strings, |hl-DiffAdd| (as background), |hl-DiagnosticOk|, and some + minor text UI elements. + +- Cyan as main syntax color, i.e. for function usage (`Function` highlight + group), |hl-DiffText|, |hl-DiagnosticInfo|, and some minor text UI elements. + +- Red to generally mean high user attention, i.e. errors; in particular for + |hl-ErrorMsg|, |hl-DiffDelete|, |hl-DiagnosticError|. + +- Yellow very sparingly only with true colors to mean mild user attention, + i.e. warnings. That is, |hl-DiagnosticWarn| and |hl-WarningMsg|. + +- Blue very sparingly only with true colors as |hl-DiagnosticHint| and some + additional important syntax group (like `Identifier`). + +- Magenta very carefully (if at all). + + + vim:tw=78:ts=8:et:ft=help:norl: diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 825e5ba41f..e38707fa76 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -95,6 +95,9 @@ The following changes may require adaptations in user config or plugins. • Legacy and extmark signs are displayed and listed with the same priority: line number -> priority -> sign id -> recently placed +• Default color scheme has been updated to be "Neovim branded" and accessible. + Use `:colorscheme vim` to revert to the old legacy color scheme. + ============================================================================== BREAKING CHANGES IN HEAD *news-breaking-dev* @@ -266,6 +269,7 @@ The following changes to existing APIs or features add new behavior. vim.g.query_lint_on = {} < • Enabled treesitter highlighting for treesitter query files. + • Enabled treesitter highlighting for help files. • The `workspace/didChangeWatchedFiles` LSP client capability is now enabled by default. diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 9bdc6b8d24..e3836a357b 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -616,6 +616,8 @@ get_node({opts}) *vim.treesitter.get_node()* • pos table|nil 0-indexed (row, col) tuple. Defaults to cursor position in the current window. Required if {bufnr} is not the current buffer + • lang string|nil Parser language. (default: from buffer + filetype) • ignore_injections boolean Ignore injected languages (default true) diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index cf9b3cf0e5..f6dfe3b14a 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -30,6 +30,8 @@ Defaults *nvim-defaults* ":filetype off" to |init.vim|. - Syntax highlighting is enabled by default. This can be disabled by adding ":syntax off" to |init.vim|. +- Default color scheme has been updated. This can be reversed by adding + ":colorscheme vim" to |init.vim|. - 'autoindent' is enabled - 'autoread' is enabled (works in all UIs, including terminal) diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 4cc3386167..bf3408c2d9 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -1,3 +1,7 @@ +-- use treesitter over syntax (for highlighted code blocks) +vim.treesitter.start() + +-- add custom highlights for list in `:h highlight-groups` if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then require('vim.vimhelp').highlight_groups() end diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 49269ba631..4ad0a2e791 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -151,7 +151,7 @@ function vim.api.nvim_buf_add_highlight(buffer, ns_id, hl_group, line, col_start --- `nvim_buf_lines_event`. Else the first notification --- will be `nvim_buf_changedtick_event`. Not for Lua --- callbacks. ---- @param opts table<string,function> Optional parameters. +--- @param opts vim.api.keyset.buf_attach Optional parameters. --- • on_lines: Lua callback invoked on change. Return `true` to detach. Args: --- • the string "lines" --- • buffer handle @@ -284,7 +284,7 @@ function vim.api.nvim_buf_del_var(buffer, name) end --- Deletes the buffer. See `:bwipeout` --- --- @param buffer integer Buffer handle, or 0 for current buffer ---- @param opts table<string,any> Optional parameters. Keys: +--- @param opts vim.api.keyset.buf_delete Optional parameters. Keys: --- • force: Force deletion and ignore unsaved changes. --- • unload: Unloaded only, do not delete. See `:bunload` function vim.api.nvim_buf_delete(buffer, opts) end @@ -307,7 +307,7 @@ function vim.api.nvim_buf_get_commands(buffer, opts) end --- @param buffer integer Buffer handle, or 0 for current buffer --- @param ns_id integer Namespace id from `nvim_create_namespace()` --- @param id integer Extmark id ---- @param opts table<string,any> Optional parameters. Keys: +--- @param opts vim.api.keyset.get_extmark Optional parameters. Keys: --- • details: Whether to include the details dict --- • hl_name: Whether to include highlight group name instead --- of id, true if omitted @@ -440,7 +440,7 @@ function vim.api.nvim_buf_get_option(buffer, name) end --- @param start_col integer Starting column (byte offset) on first line --- @param end_row integer Last line index, inclusive --- @param end_col integer Ending column (byte offset) on last line, exclusive ---- @param opts table<string,any> Optional parameters. Currently unused. +--- @param opts vim.api.keyset.empty Optional parameters. Currently unused. --- @return string[] function vim.api.nvim_buf_get_text(buffer, start_row, start_col, end_row, end_col, opts) end @@ -626,7 +626,7 @@ function vim.api.nvim_buf_set_lines(buffer, start, end_, strict_indexing, replac --- @param name string Mark name --- @param line integer Line number --- @param col integer Column/row number ---- @param opts table<string,any> Optional parameters. Reserved for future use. +--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use. --- @return boolean function vim.api.nvim_buf_set_mark(buffer, name, line, col, opts) end @@ -675,7 +675,7 @@ function vim.api.nvim_buf_set_var(buffer, name, value) end --- @param src_id integer --- @param line integer --- @param chunks any[] ---- @param opts table<string,any> +--- @param opts vim.api.keyset.empty --- @return integer function vim.api.nvim_buf_set_virtual_text(buffer, src_id, line, chunks, opts) end @@ -1241,7 +1241,7 @@ function vim.api.nvim_get_keymap(mode) end --- Marks are (1,0)-indexed. `api-indexing` --- --- @param name string Mark name ---- @param opts table<string,any> Optional parameters. Reserved for future use. +--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use. --- @return any[] function vim.api.nvim_get_mark(name, opts) end @@ -1439,7 +1439,7 @@ function vim.api.nvim_notify(msg, log_level, opts) end --- virtual terminal having the intended size. --- --- @param buffer integer the buffer to use (expected to be empty) ---- @param opts table<string,function> Optional parameters. +--- @param opts vim.api.keyset.open_term Optional parameters. --- • on_input: Lua callback for input sent, i e keypresses in --- terminal mode. Note: keypresses are sent raw as they would --- be to the pty master end. For instance, a carriage return @@ -1602,7 +1602,7 @@ function vim.api.nvim_out_write(str) end --- Doesn't check the validity of command arguments. --- --- @param str string Command line string to parse. Cannot contain "\n". ---- @param opts table<string,any> Optional parameters. Reserved for future use. +--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use. --- @return table<string,any> function vim.api.nvim_parse_cmd(str, opts) end @@ -1685,7 +1685,7 @@ function vim.api.nvim_replace_termcodes(str, from_part, do_lt, special) end --- inserted in the buffer. Ignored for `cmdline-completion`. --- @param finish boolean Finish the completion and dismiss the popup menu. Implies --- {insert}. ---- @param opts table<string,any> Optional parameters. Reserved for future use. +--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use. function vim.api.nvim_select_popupmenu_item(item, insert, finish, opts) end --- Sets the current buffer. diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua index f69e5a92c7..6a3e574455 100644 --- a/runtime/lua/vim/_meta/api_keysets.lua +++ b/runtime/lua/vim/_meta/api_keysets.lua @@ -3,6 +3,19 @@ -- DO NOT EDIT error('Cannot require a meta file') +--- @class vim.api.keyset.buf_attach +--- @field on_lines? function +--- @field on_bytes? function +--- @field on_changedtick? function +--- @field on_detach? function +--- @field on_reload? function +--- @field utf_sizes? boolean +--- @field preview? boolean + +--- @class vim.api.keyset.buf_delete +--- @field force? boolean +--- @field unload? boolean + --- @class vim.api.keyset.clear_autocmds --- @field buffer? integer --- @field event? any @@ -74,6 +87,8 @@ error('Cannot require a meta file') --- @class vim.api.keyset.echo_opts --- @field verbose? boolean +--- @class vim.api.keyset.empty + --- @class vim.api.keyset.eval_statusline --- @field winid? integer --- @field maxwidth? integer @@ -124,6 +139,10 @@ error('Cannot require a meta file') --- @class vim.api.keyset.get_commands --- @field builtin? boolean +--- @class vim.api.keyset.get_extmark +--- @field details? boolean +--- @field hl_name? boolean + --- @class vim.api.keyset.get_extmarks --- @field limit? integer --- @field details? boolean @@ -196,6 +215,9 @@ error('Cannot require a meta file') --- @field desc? string --- @field replace_keycodes? boolean +--- @class vim.api.keyset.open_term +--- @field on_input? function + --- @class vim.api.keyset.option --- @field scope? string --- @field win? integer diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 60882d4432..e64923ab54 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1394,6 +1394,7 @@ local filename = { octaverc = 'octave', ['octave.conf'] = 'octave', opam = 'opam', + ['pacman.log'] = 'pacmanlog', ['/etc/pam.conf'] = 'pamconf', ['pam_env.conf'] = 'pamenv', ['.pam_environment'] = 'pamenv', diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index e7a66c00b2..7b795380fe 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -362,6 +362,7 @@ end --- - bufnr integer|nil Buffer number (nil or 0 for current buffer) --- - pos table|nil 0-indexed (row, col) tuple. Defaults to cursor position in the --- current window. Required if {bufnr} is not the current buffer +--- - lang string|nil Parser language. (default: from buffer filetype) --- - ignore_injections boolean Ignore injected languages (default true) --- ---@return TSNode | nil Node at the given position @@ -392,7 +393,7 @@ function M.get_node(opts) local ts_range = { row, col, row, col } - local root_lang_tree = M.get_parser(bufnr) + local root_lang_tree = M.get_parser(bufnr, opts.lang) if not root_lang_tree then return end diff --git a/runtime/syntax/pacmanlog.vim b/runtime/syntax/pacmanlog.vim new file mode 100644 index 0000000000..98abd58685 --- /dev/null +++ b/runtime/syntax/pacmanlog.vim @@ -0,0 +1,41 @@ +" Vim syntax file +" Language: pacman.log +" Maintainer: Ronan Pigott <ronan@rjp.ie> +" Last Change: 2023 Dec 04 + +if exists("b:current_syntax") + finish +endif + +syn sync maxlines=1 +syn region pacmanlogMsg start='\S' end='$' keepend contains=pacmanlogTransaction,pacmanlogALPMMsg +syn region pacmanlogTag start='\['hs=s+1 end='\]'he=e-1 keepend nextgroup=pacmanlogMsg +syn region pacmanlogTime start='^\['hs=s+1 end='\]'he=e-1 keepend nextgroup=pacmanlogTag + +syn match pacmanlogPackageName '\v[a-z0-9@_+.-]+' contained skipwhite nextgroup=pacmanlogPackageVersion +syn match pacmanlogPackageVersion '(.*)' contained + +syn match pacmanlogTransaction 'transaction \v(started|completed)$' contained +syn match pacmanlogInstalled '\v(re)?installed' contained nextgroup=pacmanlogPackageName +syn match pacmanlogUpgraded 'upgraded' contained nextgroup=pacmanlogPackageName +syn match pacmanlogDowngraded 'downgraded' contained nextgroup=pacmanlogPackageName +syn match pacmanlogRemoved 'removed' contained nextgroup=pacmanlogPackageName +syn match pacmanlogWarning 'warning:.*$' contained + +syn region pacmanlogALPMMsg start='\v(\[ALPM\] )@<=(transaction|(re)?installed|upgraded|downgraded|removed|warning)>' end='$' contained + \ contains=pacmanlogTransaction,pacmanlogInstalled,pacmanlogUpgraded,pacmanlogDowngraded,pacmanlogRemoved,pacmanlogWarning,pacmanlogPackageName,pacmanlogPackgeVersion + +hi def link pacmanlogTime String +hi def link pacmanlogTag Type + +hi def link pacmanlogTransaction Special +hi def link pacmanlogInstalled Identifier +hi def link pacmanlogRemoved Repeat +hi def link pacmanlogUpgraded pacmanlogInstalled +hi def link pacmanlogDowngraded pacmanlogRemoved +hi def link pacmanlogWarning WarningMsg + +hi def link pacmanlogPackageName Normal +hi def link pacmanlogPackageVersion Comment + +let b:current_syntax = "pacmanlog" |