Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d950984489 | ||
|
|
b1e32ac0c9 | ||
|
|
938ae280c7 | ||
|
|
6b066c6d8f | ||
|
|
b444ee761a | ||
|
|
e1121b1394 | ||
|
|
af93691b53 | ||
|
|
997b8a015c | ||
|
|
5b9f57262f | ||
|
|
ea62cee85e | ||
|
|
a572b936ce | ||
|
|
f53e065bce | ||
|
|
441a7a9448 | ||
|
|
3e1ac1443a | ||
|
|
2c1c803c7e | ||
|
|
d114975b9b | ||
|
|
0917e86763 | ||
|
|
9de960ace0 | ||
|
|
f2017f255d | ||
|
|
552bdca781 | ||
|
|
eea0a00811 | ||
|
|
c3a26c6bff | ||
|
|
1d87e11a1e | ||
|
|
ce3189d56e | ||
|
|
bc3dc298b3 | ||
|
|
339e114d70 | ||
|
|
fdbd14e892 | ||
|
|
1d6539cf36 | ||
|
|
1a6476428f | ||
|
|
32ff96ef01 | ||
|
|
5ceb8157bc | ||
|
|
55a27d8ea7 | ||
|
|
234c3fab28 | ||
|
|
094b8473ed | ||
|
|
aab2ead008 | ||
|
|
9d9a20ee87 | ||
|
|
3ec78f973f | ||
|
|
412e0e4ed9 | ||
|
|
c4b7dec382 | ||
|
|
962d916435 | ||
|
|
094cf9f4d5 | ||
|
|
6c41bedeed | ||
|
|
80b817b749 | ||
|
|
0caaf1e465 | ||
|
|
313e4724c3 | ||
|
|
6642982bea | ||
|
|
af9e28a5b8 | ||
|
|
43e234e8b4 | ||
|
|
91deac4539 | ||
|
|
0261e3978e | ||
|
|
546933f497 | ||
|
|
a9a6b0323e | ||
|
|
40b4872966 | ||
|
|
c72078b631 | ||
|
|
c8ef30bc2e | ||
|
|
cb626a4692 | ||
|
|
7a1bdaecf2 | ||
|
|
61fdbfa1e3 | ||
|
|
4ad8ae8465 | ||
|
|
49f0524fb5 | ||
|
|
4be18e77ff | ||
|
|
78012f55fa | ||
|
|
be4e01637e | ||
|
|
685bf83b73 | ||
|
|
8f531662e2 | ||
|
|
e8d4ae0d11 | ||
|
|
1b438a8228 | ||
|
|
a7d36b7320 | ||
|
|
b40c1de384 | ||
|
|
9c51798a1f | ||
|
|
d6e4c75af2 | ||
|
|
ce93d162da | ||
|
|
b8bebd0cd7 | ||
|
|
eb45ad25ab | ||
|
|
907349a743 | ||
|
|
f2e30d0c44 | ||
|
|
2a99fe6c41 | ||
|
|
836137d89a | ||
|
|
492324e588 | ||
|
|
755bf2b3d2 | ||
|
|
94722c5107 | ||
|
|
04e4f1d985 | ||
|
|
8fe5b9c8c1 | ||
|
|
d0200c8631 | ||
|
|
192e24d974 | ||
|
|
f75a2cb3c7 | ||
|
|
fadc02a2a5 | ||
|
|
8dbab1d8ce | ||
|
|
657aea7fc4 | ||
|
|
53f54e49b7 | ||
|
|
870219c58c | ||
|
|
142ed77898 | ||
|
|
032713f829 | ||
|
|
0f843ef091 | ||
|
|
01d4efe2e8 | ||
|
|
b0d45ec67f | ||
|
|
b582010350 | ||
|
|
62a6923470 | ||
|
|
b149d22796 | ||
|
|
5c8771bc5a |
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@@ -96,22 +96,21 @@ jobs:
|
||||
- name: Install gcc-11
|
||||
if: matrix.compiler == 'gcc'
|
||||
run: |
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt install -y gcc-11
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
|
||||
sudo update-alternatives --set gcc /usr/bin/gcc-11
|
||||
|
||||
- name: Install clang-15
|
||||
- name: Install clang-16
|
||||
if: matrix.compiler == 'clang'
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
. /etc/lsb-release
|
||||
sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-15 main"
|
||||
sudo apt install -y clang-15 llvm-15
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
|
||||
sudo update-alternatives --set clang /usr/bin/clang-15
|
||||
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-15 100
|
||||
sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-15 100
|
||||
sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-16 main"
|
||||
sudo apt install -y clang-16 llvm-16
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
|
||||
sudo update-alternatives --set clang /usr/bin/clang-16
|
||||
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-16 100
|
||||
sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-16 100
|
||||
|
||||
- name: Set up environment
|
||||
run: |
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
|
||||
# What is Vim9?
|
||||
|
||||
This is an experimental side of [Vim](https://github.com/vim/vim).
|
||||
It explores ways of making Vim script faster and better.
|
||||
This is a new syntax for Vim script that was introduced with Vim 9.0.
|
||||
It intends making Vim script faster and better.
|
||||
|
||||
WARNING: The Vim9 script features are still under development, anything can
|
||||
break!
|
||||
|
||||
# Why Vim9?
|
||||
|
||||
## 1. FASTER VIM SCRIPT
|
||||
|
||||
The third item on the poll results of 2018, after popup windows and text
|
||||
properties, is faster Vim script. So how do we do that?
|
||||
properties, both of which have been implemented, is faster Vim script.
|
||||
So how do we do that?
|
||||
|
||||
I have been throwing some ideas around, and soon came to the conclusion
|
||||
that the current way functions are called and executed, with
|
||||
@@ -53,7 +52,7 @@ we can gain, and also that Vim script can be faster than builtin
|
||||
interfaces.
|
||||
|
||||
LuaJit is much faster at Lua-only instructions. In practice the script would
|
||||
not do something useless as counting but change the text. For example,
|
||||
not do something useless counting, but change the text. For example,
|
||||
reindent all the lines:
|
||||
|
||||
``` vim
|
||||
|
||||
@@ -228,6 +228,28 @@ FunctionEnd
|
||||
!insertmacro GetParent ""
|
||||
!insertmacro GetParent "un."
|
||||
|
||||
# Get home directory
|
||||
!macro GetHomeDir un
|
||||
Function ${un}GetHomeDir
|
||||
Push $0
|
||||
Push $1
|
||||
ReadEnvStr $0 "HOME"
|
||||
${If} $0 == ""
|
||||
ReadEnvStr $0 "HOMEDRIVE"
|
||||
ReadEnvStr $1 "HOMEPATH"
|
||||
StrCpy $0 "$0$1"
|
||||
${If} $0 == ""
|
||||
ReadEnvStr $0 "USERPROFILE"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
Pop $1
|
||||
Exch $0 # put $0 on top of stack, restore $0 to original value
|
||||
FunctionEnd
|
||||
!macroend
|
||||
|
||||
!insertmacro GetHomeDir ""
|
||||
!insertmacro GetHomeDir "un."
|
||||
|
||||
# Check if Vim is already installed.
|
||||
# return: Installed directory. If not found, it will be empty.
|
||||
Function CheckOldVim
|
||||
@@ -520,7 +542,8 @@ SectionGroup $(str_group_plugin) id_group_plugin
|
||||
Section "$(str_section_plugin_home)" id_section_pluginhome
|
||||
SectionIn 1 3
|
||||
|
||||
StrCpy $1 "$1 -create-directories home"
|
||||
# use ShellExecAsUser below instead
|
||||
# StrCpy $1 "$1 -create-directories home"
|
||||
SectionEnd
|
||||
|
||||
Section "$(str_section_plugin_vim)" id_section_pluginvim
|
||||
@@ -594,6 +617,13 @@ Section -call_install_exe
|
||||
DetailPrint "$(str_msg_registering)"
|
||||
nsExec::Exec "$0\install.exe $1"
|
||||
Pop $3
|
||||
|
||||
${If} ${SectionIsSelected} ${id_section_pluginhome}
|
||||
ReadEnvStr $3 "COMSPEC"
|
||||
Call GetHomeDir
|
||||
Pop $4
|
||||
ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles & cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent keymap plugin syntax"' SW_HIDE
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
##########################################################
|
||||
@@ -1042,15 +1072,8 @@ SectionEnd
|
||||
SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin
|
||||
Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home
|
||||
# get the home dir
|
||||
ReadEnvStr $0 "HOME"
|
||||
${If} $0 == ""
|
||||
ReadEnvStr $0 "HOMEDRIVE"
|
||||
ReadEnvStr $1 "HOMEPATH"
|
||||
StrCpy $0 "$0$1"
|
||||
${If} $0 == ""
|
||||
ReadEnvStr $0 "USERPROFILE"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
Call un.GetHomeDir
|
||||
Pop $0
|
||||
|
||||
${If} $0 != ""
|
||||
!insertmacro RemoveVimfiles $0
|
||||
|
||||
314
runtime/autoload/dist/vimindent.vim
vendored
314
runtime/autoload/dist/vimindent.vim
vendored
@@ -2,12 +2,12 @@ vim9script
|
||||
|
||||
# Language: Vim script
|
||||
# Maintainer: github user lacygoill
|
||||
# Last Change: 2023 Jan 03
|
||||
# Last Change: 2023 Feb 01
|
||||
|
||||
# NOTE: Whenever you change the code, make sure the tests are still passing:
|
||||
#
|
||||
# $ cd runtime/indent/
|
||||
# $ make clean; make test || vimdiff testdir/vim.{fail,ok}
|
||||
# $ make clean; make test || vimdiff testdir/vim.{ok,fail}
|
||||
|
||||
# Config {{{1
|
||||
|
||||
@@ -112,6 +112,10 @@ const DICT_KEY: string = '^\s*\%('
|
||||
.. '\)'
|
||||
.. ':\%(\s\|$\)'
|
||||
|
||||
# NOT_A_DICT_KEY {{{3
|
||||
|
||||
const NOT_A_DICT_KEY: string = ':\@!'
|
||||
|
||||
# END_OF_COMMAND {{{3
|
||||
|
||||
const END_OF_COMMAND: string = $'\s*\%($\|||\@!\|{INLINE_COMMENT}\)'
|
||||
@@ -144,19 +148,43 @@ const HEREDOC_OPERATOR: string = '\s=<<\s\@=\%(\s\+\%(trim\|eval\)\)\{,2}'
|
||||
#
|
||||
# But sometimes, it can be too costly and cause `E363` to be given.
|
||||
const PATTERN_DELIMITER: string = '[-+*/%]\%(=\s\)\@!'
|
||||
|
||||
# QUOTE {{{3
|
||||
|
||||
const QUOTE: string = '["'']'
|
||||
# }}}2
|
||||
# Syntaxes {{{2
|
||||
# ASSIGNS_HEREDOC {{{3
|
||||
# BLOCKS {{{3
|
||||
|
||||
const ASSIGNS_HEREDOC: string = $'^\%({COMMENT}\)\@!.*\%({HEREDOC_OPERATOR}\)\s\+\zs[A-Z]\+{END_OF_LINE}'
|
||||
const BLOCKS: list<list<string>> = [
|
||||
['if', 'el\%[se]', 'elseif\=', 'en\%[dif]'],
|
||||
['for', 'endfor\='],
|
||||
['wh\%[ile]', 'endw\%[hile]'],
|
||||
['try', 'cat\%[ch]', 'fina\|finally\=', 'endt\%[ry]'],
|
||||
['def', 'enddef'],
|
||||
['fu\%[nction](\@!', 'endf\%[unction]'],
|
||||
['class', 'endclass'],
|
||||
['interface', 'endinterface'],
|
||||
['enum', 'endenum'],
|
||||
['aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+', 'aug\%[roup]\s\+[eE][nN][dD]'],
|
||||
]
|
||||
|
||||
# CD_COMMAND {{{3
|
||||
# MODIFIERS {{{3
|
||||
|
||||
const CD_COMMAND: string = $'\<[lt]\=cd!\=\s\+-{END_OF_COMMAND}'
|
||||
# some keywords can be prefixed by modifiers (e.g. `def` can be prefixed by `export`)
|
||||
const MODIFIERS: dict<string> = {
|
||||
def: ['export', 'static'],
|
||||
class: ['export', 'abstract', 'export abstract'],
|
||||
interface: ['export'],
|
||||
}
|
||||
# ...
|
||||
# class: ['export', 'abstract', 'export abstract'],
|
||||
# ...
|
||||
# →
|
||||
# ...
|
||||
# class: '\%(export\|abstract\|export\s\+abstract\)\s\+',
|
||||
# ...
|
||||
->map((_, mods: list<string>): string =>
|
||||
'\%(' .. mods
|
||||
->join('\|')
|
||||
->substitute('\s\+', '\\s\\+', 'g')
|
||||
.. '\)' .. '\s\+')
|
||||
|
||||
# HIGHER_ORDER_COMMAND {{{3
|
||||
|
||||
@@ -174,58 +202,102 @@ patterns =<< trim eval END
|
||||
g\%[lobal]!\={PATTERN_DELIMITER}.*
|
||||
v\%[global]!\={PATTERN_DELIMITER}.*
|
||||
END
|
||||
const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%(' .. patterns->join('\|') .. '\):\@!'
|
||||
|
||||
# MAPPING_COMMAND {{{3
|
||||
const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%({patterns->join('\|')}\){NOT_A_DICT_KEY}'
|
||||
|
||||
const MAPPING_COMMAND: string = '\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)map!\=\s'
|
||||
# START_MIDDLE_END {{{3
|
||||
|
||||
# NORMAL_COMMAND {{{3
|
||||
# Let's derive this constant from `BLOCKS`:
|
||||
#
|
||||
# [['if', 'el\%[se]', 'elseif\=', 'en\%[dif]'],
|
||||
# ['for', 'endfor\='],
|
||||
# ...,
|
||||
# [...]]
|
||||
# →
|
||||
# {
|
||||
# 'for': ['for', '', 'endfor\='],
|
||||
# 'endfor': ['for', '', 'endfor\='],
|
||||
# 'if': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
# 'else': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
# 'elseif': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
# 'endif': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
# ...
|
||||
# }
|
||||
var START_MIDDLE_END: dict<list<string>>
|
||||
|
||||
const NORMAL_COMMAND: string = '\<norm\%[al]!\=\s*\S\+$'
|
||||
def Unshorten(kwd: string): string
|
||||
return BlockStartKeyword(kwd)
|
||||
enddef
|
||||
|
||||
# PLUS_MINUS_COMMAND {{{3
|
||||
def BlockStartKeyword(line: string): string
|
||||
var kwd: string = line->matchstr('\l\+')
|
||||
return fullcommand(kwd, false)
|
||||
enddef
|
||||
|
||||
# In legacy, the `:+` and `:-` commands are not required to be preceded by a colon.
|
||||
# As a result, when `+` or `-` is alone on a line, there is ambiguity.
|
||||
# It might be an operator or a command.
|
||||
# To not break the indentation in legacy scripts, we might need to consider such
|
||||
# lines as commands.
|
||||
const PLUS_MINUS_COMMAND: string = '^\s*[+-]\s*$'
|
||||
{
|
||||
for kwds: list<string> in BLOCKS
|
||||
var [start: string, middle: string, end: string] = [kwds[0], '', kwds[-1]]
|
||||
if MODIFIERS->has_key(start->Unshorten())
|
||||
start = $'\%({MODIFIERS[start]}\)\={start}'
|
||||
endif
|
||||
if kwds->len() > 2
|
||||
middle = kwds[1 : -2]->join('\|')
|
||||
endif
|
||||
for kwd: string in kwds
|
||||
START_MIDDLE_END->extend({[kwd->Unshorten()]: [start, middle, end]})
|
||||
endfor
|
||||
endfor
|
||||
}
|
||||
|
||||
START_MIDDLE_END = START_MIDDLE_END
|
||||
->map((_, kwds: list<string>) =>
|
||||
kwds->map((_, kwd: string) => kwd == ''
|
||||
? ''
|
||||
: $'\%(^\|{BAR_SEPARATION}\|\<sil\%[ent]\|{HIGHER_ORDER_COMMAND}\)\s*'
|
||||
.. $'\<\%({kwd}\)\>\%(\s*{OPERATOR}\)\@!'))
|
||||
|
||||
lockvar! START_MIDDLE_END
|
||||
|
||||
# ENDS_BLOCK {{{3
|
||||
|
||||
const ENDS_BLOCK: string = '^\s*\%('
|
||||
.. 'en\%[dif]'
|
||||
.. '\|' .. 'endfor\='
|
||||
.. '\|' .. 'endw\%[hile]'
|
||||
.. '\|' .. 'endt\%[ry]'
|
||||
.. '\|' .. 'enddef'
|
||||
.. '\|' .. 'endclass'
|
||||
.. '\|' .. 'endf\%[unction]'
|
||||
.. '\|' .. 'aug\%[roup]\s\+[eE][nN][dD]'
|
||||
.. BLOCKS
|
||||
->copy()
|
||||
->map((_, kwds: list<string>): string => kwds[-1])
|
||||
->join('\|')
|
||||
.. '\|' .. CLOSING_BRACKET
|
||||
.. $'\){END_OF_COMMAND}'
|
||||
|
||||
# ENDS_BLOCK_OR_CLAUSE {{{3
|
||||
|
||||
patterns =<< trim END
|
||||
en\%[dif]
|
||||
el\%[se]
|
||||
endfor\=
|
||||
endclass
|
||||
endw\%[hile]
|
||||
endt\%[ry]
|
||||
fina\|finally\=
|
||||
enddef
|
||||
endf\%[unction]
|
||||
aug\%[roup]\s\+[eE][nN][dD]
|
||||
END
|
||||
patterns = BLOCKS
|
||||
->copy()
|
||||
->map((_, kwds: list<string>) => kwds[1 :])
|
||||
->flattennew()
|
||||
# `catch` and `elseif` need to be handled as special cases
|
||||
->filter((_, pat: string): bool => pat->Unshorten() !~ '^\%(catch\|elseif\)\>')
|
||||
|
||||
const ENDS_BLOCK_OR_CLAUSE: string = '^\s*\%(' .. patterns->join('\|') .. $'\){END_OF_COMMAND}'
|
||||
.. $'\|^\s*cat\%[ch]\%(\s\+\({PATTERN_DELIMITER}\).*\1\)\={END_OF_COMMAND}'
|
||||
.. $'\|^\s*elseif\=\>\%({OPERATOR}\)\@!'
|
||||
|
||||
# STARTS_NAMED_BLOCK {{{3
|
||||
|
||||
patterns = []
|
||||
{
|
||||
for kwds: list<string> in BLOCKS
|
||||
for kwd: string in kwds[0 : -2]
|
||||
if MODIFIERS->has_key(kwd->Unshorten())
|
||||
patterns += [$'\%({MODIFIERS[kwd]}\)\={kwd}']
|
||||
else
|
||||
patterns += [kwd]
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
}
|
||||
|
||||
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>{NOT_A_DICT_KEY}'
|
||||
|
||||
# STARTS_CURLY_BLOCK {{{3
|
||||
|
||||
# TODO: `{` alone on a line is not necessarily the start of a block.
|
||||
@@ -238,73 +310,57 @@ const STARTS_CURLY_BLOCK: string = '\%('
|
||||
.. '\|' .. $'^\%(\s*\|.*{BAR_SEPARATION}\s*\)\%(com\%[mand]\|au\%[tocmd]\).*\zs\s{{'
|
||||
.. '\)' .. END_OF_COMMAND
|
||||
|
||||
# STARTS_NAMED_BLOCK {{{3
|
||||
|
||||
# All of these will be used at the start of a line (or after a bar).
|
||||
# NOTE: Don't replace `\%x28` with `(`.{{{
|
||||
#
|
||||
# Otherwise, the paren would be unbalanced which might cause syntax highlighting
|
||||
# issues much later in the code of the current script (sometimes, the syntax
|
||||
# highlighting plugin fails to correctly recognize a heredoc which is far away
|
||||
# and/or not displayed because inside a fold).
|
||||
# }}}
|
||||
patterns =<< trim END
|
||||
if
|
||||
el\%[se]
|
||||
elseif\=
|
||||
for
|
||||
class
|
||||
wh\%[ile]
|
||||
try
|
||||
cat\%[ch]
|
||||
fina\|finally\=
|
||||
fu\%[nction]\%x28\@!
|
||||
\%(export\s\+\)\=def
|
||||
aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+
|
||||
END
|
||||
const STARTS_NAMED_BLOCK: string = '^\s*\%(sil\%[ent]\s\+\)\=\%(' .. patterns->join('\|') .. '\)\>:\@!'
|
||||
|
||||
# STARTS_FUNCTION {{{3
|
||||
|
||||
const STARTS_FUNCTION: string = '^\s*\%(export\s\+\)\=def\>:\@!'
|
||||
const STARTS_FUNCTION: string = $'^\s*\%({MODIFIERS.def}\)\=def\>{NOT_A_DICT_KEY}'
|
||||
|
||||
# ENDS_FUNCTION {{{3
|
||||
|
||||
const ENDS_FUNCTION: string = $'^\s*enddef\>:\@!{END_OF_COMMAND}'
|
||||
const ENDS_FUNCTION: string = $'^\s*enddef\>{END_OF_COMMAND}'
|
||||
|
||||
# START_MIDDLE_END {{{3
|
||||
# ASSIGNS_HEREDOC {{{3
|
||||
|
||||
const START_MIDDLE_END: dict<list<string>> = {
|
||||
if: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
else: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
elseif: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
endif: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
|
||||
for: ['for', '', 'endfor\='],
|
||||
endfor: ['for', '', 'endfor\='],
|
||||
class: ['class', '', 'endclass'],
|
||||
endclass: ['class', '', 'endclass'],
|
||||
while: ['wh\%[ile]', '', 'endw\%[hile]'],
|
||||
endwhile: ['wh\%[ile]', '', 'endw\%[hile]'],
|
||||
try: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
|
||||
catch: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
|
||||
finally: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
|
||||
endtry: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
|
||||
def: ['\%(export\s\+\)\=def', '', 'enddef'],
|
||||
enddef: ['\%(export\s\+\)\=def', '', 'enddef'],
|
||||
function: ['fu\%[nction]', '', 'endf\%[unction]'],
|
||||
endfunction: ['fu\%[nction]', '', 'endf\%[unction]'],
|
||||
augroup: ['aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+', '', 'aug\%[roup]\s\+[eE][nN][dD]'],
|
||||
}->map((_, kwds: list<string>) =>
|
||||
kwds->map((_, kwd: string) => kwd == ''
|
||||
? ''
|
||||
: $'\%(^\|{BAR_SEPARATION}\|\<sil\%[ent]\|{HIGHER_ORDER_COMMAND}\)\s*'
|
||||
.. $'\%({printf('\C\<\%%(%s\)\>:\@!\%%(\s*%s\)\@!', kwd, OPERATOR)}\)'))
|
||||
const ASSIGNS_HEREDOC: string = $'^\%({COMMENT}\)\@!.*\%({HEREDOC_OPERATOR}\)\s\+\zs[A-Z]\+{END_OF_LINE}'
|
||||
|
||||
# PLUS_MINUS_COMMAND {{{3
|
||||
|
||||
# In legacy, the `:+` and `:-` commands are not required to be preceded by a colon.
|
||||
# As a result, when `+` or `-` is alone on a line, there is ambiguity.
|
||||
# It might be an operator or a command.
|
||||
# To not break the indentation in legacy scripts, we might need to consider such
|
||||
# lines as commands.
|
||||
const PLUS_MINUS_COMMAND: string = '^\s*[+-]\s*$'
|
||||
|
||||
# TRICKY_COMMANDS {{{3
|
||||
|
||||
# Some commands are tricky because they accept an argument which can be
|
||||
# conflated with an operator. Examples:
|
||||
#
|
||||
# argdelete *
|
||||
# cd -
|
||||
# normal! ==
|
||||
# nunmap <buffer> (
|
||||
#
|
||||
# TODO: Other commands might accept operators as argument. Handle them too.
|
||||
patterns =<< trim eval END
|
||||
{'\'}<argd\%[elete]\s\+\*\s*$
|
||||
\<[lt]\=cd!\=\s\+-\s*$
|
||||
\<norm\%[al]!\=\s*\S\+$
|
||||
\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)map!\=\s
|
||||
{PLUS_MINUS_COMMAND}
|
||||
END
|
||||
|
||||
const TRICKY_COMMANDS: string = patterns->join('\|')
|
||||
# }}}2
|
||||
# EOL {{{2
|
||||
# OPENING_BRACKET_AT_EOL {{{3
|
||||
|
||||
const OPENING_BRACKET_AT_EOL: string = OPENING_BRACKET .. END_OF_VIM9_LINE
|
||||
|
||||
# CLOSING_BRACKET_AT_EOL {{{3
|
||||
|
||||
const CLOSING_BRACKET_AT_EOL: string = CLOSING_BRACKET .. END_OF_VIM9_LINE
|
||||
|
||||
# COMMA_AT_EOL {{{3
|
||||
|
||||
const COMMA_AT_EOL: string = $',{END_OF_VIM9_LINE}'
|
||||
@@ -392,6 +448,7 @@ export def Expr(lnum = v:lnum): number # {{{2
|
||||
endif
|
||||
|
||||
if line_A->AtStartOf('FuncHeader')
|
||||
&& !IsInInterface()
|
||||
line_A.lnum->CacheFuncHeader()
|
||||
elseif line_A.lnum->IsInside('FuncHeader')
|
||||
return b:vimindent.startindent + 2 * shiftwidth()
|
||||
@@ -430,6 +487,7 @@ export def Expr(lnum = v:lnum): number # {{{2
|
||||
if line_A.text->ContinuesBelowBracketBlock(line_B, past_bracket_block)
|
||||
&& line_A.text !~ CLOSING_BRACKET_AT_SOL
|
||||
return past_bracket_block.startindent
|
||||
+ (past_bracket_block.startline =~ STARTS_NAMED_BLOCK ? 2 * shiftwidth() : 0)
|
||||
endif
|
||||
|
||||
# Problem: If we press `==` on the line right below the start of a multiline
|
||||
@@ -438,6 +496,18 @@ export def Expr(lnum = v:lnum): number # {{{2
|
||||
if line_B->EndsWithLambdaArrow()
|
||||
return Indent(line_B.lnum) + shiftwidth() + IndentMoreInBracketBlock()
|
||||
endif
|
||||
# FIXME: Similar issue here:
|
||||
#
|
||||
# var x = []
|
||||
# ->filter((_, _) =>
|
||||
# true)
|
||||
# ->items()
|
||||
#
|
||||
# Press `==` on last line.
|
||||
# Expected: The `->items()` line is indented like `->filter(...)`.
|
||||
# Actual: It's indented like `true)`.
|
||||
# Is it worth fixing? `=ip` gives the correct indentation, because then the
|
||||
# cache is used.
|
||||
|
||||
# Don't move this block before the heredoc one.{{{
|
||||
#
|
||||
@@ -536,8 +606,13 @@ def Offset( # {{{2
|
||||
line_B: dict<any>,
|
||||
): number
|
||||
|
||||
if line_B->AtStartOf('FuncHeader')
|
||||
&& IsInInterface()
|
||||
return 0
|
||||
|
||||
# increase indentation inside a block
|
||||
if line_B.text =~ STARTS_NAMED_BLOCK || line_B->EndsWithCurlyBlock()
|
||||
elseif line_B.text =~ STARTS_NAMED_BLOCK
|
||||
|| line_B->EndsWithCurlyBlock()
|
||||
# But don't indent if the line starting the block also closes it.
|
||||
if line_B->AlsoClosesBlock()
|
||||
return 0
|
||||
@@ -807,11 +882,6 @@ def Indent(lnum: number): number # {{{3
|
||||
return indent(lnum)
|
||||
enddef
|
||||
|
||||
def BlockStartKeyword(line: string): string # {{{3
|
||||
var kwd: string = line->matchstr('\l\+')
|
||||
return fullcommand(kwd, false)
|
||||
enddef
|
||||
|
||||
def MatchingOpenBracket(line: dict<any>): number # {{{3
|
||||
var end: string = line.text->matchstr(CLOSING_BRACKET)
|
||||
var start: string = {']': '[', '}': '{', ')': '('}[end]
|
||||
@@ -908,7 +978,8 @@ def SearchPair( # {{{3
|
||||
if end == '[' || end == ']'
|
||||
e = e->escape('[]')
|
||||
endif
|
||||
return searchpair(s, middle, e, flags, (): bool => InCommentOrString(), stopline, TIMEOUT)
|
||||
return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e,
|
||||
flags, (): bool => InCommentOrString(), stopline, TIMEOUT)
|
||||
enddef
|
||||
|
||||
def SearchPairStart( # {{{3
|
||||
@@ -1016,6 +1087,10 @@ def IsInThisBlock(line_A: dict<any>, lnum: number): bool # {{{3
|
||||
return line_A.lnum <= end
|
||||
enddef
|
||||
|
||||
def IsInInterface(): bool # {{{3
|
||||
return SearchPair('interface', '', 'endinterface', 'nW') > 0
|
||||
enddef
|
||||
|
||||
def IsFirstLineOfCommand(line_1: dict<any>, line_2: dict<any>): bool # {{{3
|
||||
if line_1.text->Is_IN_KeywordForLoop(line_2.text)
|
||||
return false
|
||||
@@ -1096,6 +1171,10 @@ def EndsWithOpeningBracket(line: dict<any>): bool # {{{3
|
||||
return NonCommentedMatch(line, OPENING_BRACKET_AT_EOL)
|
||||
enddef
|
||||
|
||||
def EndsWithClosingBracket(line: dict<any>): bool # {{{3
|
||||
return NonCommentedMatch(line, CLOSING_BRACKET_AT_EOL)
|
||||
enddef
|
||||
|
||||
def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
|
||||
# Could happen if there is no code above us, and we're not on the 1st line.
|
||||
# In that case, `PrevCodeLine()` returns `{lnum: 0, line: ''}`.
|
||||
@@ -1103,16 +1182,6 @@ def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
|
||||
return false
|
||||
endif
|
||||
|
||||
if line.text =~ PLUS_MINUS_COMMAND
|
||||
return false
|
||||
endif
|
||||
|
||||
# In `argdelete *`, `*` is not a multiplication operator.
|
||||
# TODO: Other commands can accept `*` as an argument. Handle them too.
|
||||
if line.text =~ '\<argd\%[elete]\s\+\*\s*$'
|
||||
return false
|
||||
endif
|
||||
|
||||
# Technically, that's wrong. A line might start with a range and end with a
|
||||
# line continuation symbol. But it's unlikely. And it's useful to assume the
|
||||
# opposite because it prevents us from conflating a mark with an operator or
|
||||
@@ -1179,24 +1248,7 @@ def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
|
||||
return false
|
||||
endif
|
||||
|
||||
# `:help cd-`
|
||||
if line.text =~ CD_COMMAND
|
||||
return false
|
||||
endif
|
||||
|
||||
# At the end of a mapping, any character might appear; e.g. a paren:
|
||||
#
|
||||
# nunmap <buffer> (
|
||||
#
|
||||
# Don't conflate this with a line continuation symbol.
|
||||
if line.text =~ MAPPING_COMMAND
|
||||
return false
|
||||
endif
|
||||
|
||||
# not a comparison operator
|
||||
# vv
|
||||
# normal! ==
|
||||
if line.text =~ NORMAL_COMMAND
|
||||
if line.text =~ TRICKY_COMMANDS
|
||||
return false
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim autoload file for the tohtml plugin.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2019 Aug 16
|
||||
" Last Change: 2023 Jan 01
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
@@ -351,63 +351,65 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
|
||||
let s:old_magic = &magic
|
||||
set magic
|
||||
|
||||
if s:settings.use_xhtml
|
||||
if s:settings.encoding != ""
|
||||
let xml_line = "<?xml version=\"1.0\" encoding=\"" . s:settings.encoding . "\"?>"
|
||||
else
|
||||
let xml_line = "<?xml version=\"1.0\"?>"
|
||||
endif
|
||||
let tag_close = ' />'
|
||||
endif
|
||||
|
||||
let style = [s:settings.use_xhtml ? "" : '-->']
|
||||
let body_line = ''
|
||||
|
||||
let html = []
|
||||
let s:html5 = 0
|
||||
if s:settings.use_xhtml
|
||||
call add(html, xml_line)
|
||||
endif
|
||||
if s:settings.use_xhtml
|
||||
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
|
||||
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">')
|
||||
elseif s:settings.use_css && !s:settings.no_pre
|
||||
call add(html, "<!DOCTYPE html>")
|
||||
call add(html, '<html>')
|
||||
let s:html5 = 1
|
||||
else
|
||||
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
|
||||
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
|
||||
call add(html, '<html>')
|
||||
endif
|
||||
call add(html, '<head>')
|
||||
|
||||
" include encoding as close to the top as possible, but only if not already
|
||||
" contained in XML information
|
||||
if s:settings.encoding != "" && !s:settings.use_xhtml
|
||||
if s:html5
|
||||
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
|
||||
else
|
||||
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
|
||||
if !s:settings.no_doc
|
||||
if s:settings.use_xhtml
|
||||
if s:settings.encoding != ""
|
||||
let xml_line = "<?xml version=\"1.0\" encoding=\"" . s:settings.encoding . "\"?>"
|
||||
else
|
||||
let xml_line = "<?xml version=\"1.0\"?>"
|
||||
endif
|
||||
let tag_close = ' />'
|
||||
endif
|
||||
|
||||
let style = [s:settings.use_xhtml ? "" : '-->']
|
||||
let body_line = ''
|
||||
|
||||
let s:html5 = 0
|
||||
if s:settings.use_xhtml
|
||||
call add(html, xml_line)
|
||||
endif
|
||||
if s:settings.use_xhtml
|
||||
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
|
||||
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">')
|
||||
elseif s:settings.use_css && !s:settings.no_pre
|
||||
call add(html, "<!DOCTYPE html>")
|
||||
call add(html, '<html>')
|
||||
let s:html5 = 1
|
||||
else
|
||||
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
|
||||
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
|
||||
call add(html, '<html>')
|
||||
endif
|
||||
call add(html, '<head>')
|
||||
|
||||
" include encoding as close to the top as possible, but only if not already
|
||||
" contained in XML information
|
||||
if s:settings.encoding != "" && !s:settings.use_xhtml
|
||||
if s:html5
|
||||
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
|
||||
else
|
||||
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
|
||||
endif
|
||||
endif
|
||||
|
||||
call add(html, '<title>diff</title>')
|
||||
call add(html, '<meta name="Generator" content="Vim/'.v:version/100.'.'.v:version%100.'"'.tag_close)
|
||||
call add(html, '<meta name="plugin-version" content="'.g:loaded_2html_plugin.'"'.tag_close)
|
||||
call add(html, '<meta name="settings" content="'.
|
||||
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
|
||||
\ ',prevent_copy='.s:settings.prevent_copy.
|
||||
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
|
||||
\ '"'.tag_close)
|
||||
call add(html, '<meta name="colorscheme" content="'.
|
||||
\ (exists('g:colors_name')
|
||||
\ ? g:colors_name
|
||||
\ : 'none'). '"'.tag_close)
|
||||
|
||||
call add(html, '</head>')
|
||||
let body_line_num = len(html)
|
||||
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
|
||||
endif
|
||||
|
||||
call add(html, '<title>diff</title>')
|
||||
call add(html, '<meta name="Generator" content="Vim/'.v:version/100.'.'.v:version%100.'"'.tag_close)
|
||||
call add(html, '<meta name="plugin-version" content="'.g:loaded_2html_plugin.'"'.tag_close)
|
||||
call add(html, '<meta name="settings" content="'.
|
||||
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
|
||||
\ ',prevent_copy='.s:settings.prevent_copy.
|
||||
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
|
||||
\ '"'.tag_close)
|
||||
call add(html, '<meta name="colorscheme" content="'.
|
||||
\ (exists('g:colors_name')
|
||||
\ ? g:colors_name
|
||||
\ : 'none'). '"'.tag_close)
|
||||
|
||||
call add(html, '</head>')
|
||||
let body_line_num = len(html)
|
||||
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
|
||||
call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>")
|
||||
|
||||
call add(html, '<tr>')
|
||||
@@ -430,47 +432,53 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
|
||||
" When not using CSS or when using xhtml, the <body> line can be important.
|
||||
" Assume it will be the same for all buffers and grab it from the first
|
||||
" buffer. Similarly, need to grab the body end line as well.
|
||||
if body_line == ''
|
||||
if !s:settings.no_doc
|
||||
if body_line == ''
|
||||
1
|
||||
call search('<body')
|
||||
let body_line = getline('.')
|
||||
$
|
||||
call search('</body>', 'b')
|
||||
let s:body_end_line = getline('.')
|
||||
endif
|
||||
|
||||
" Grab the style information. Some of this will be duplicated so only insert
|
||||
" it if it's not already there. {{{
|
||||
1
|
||||
call search('<body')
|
||||
let body_line = getline('.')
|
||||
$
|
||||
call search('</body>', 'b')
|
||||
let s:body_end_line = getline('.')
|
||||
endif
|
||||
|
||||
" Grab the style information. Some of this will be duplicated so only insert
|
||||
" it if it's not already there. {{{
|
||||
1
|
||||
let style_start = search('^<style\( type="text/css"\)\?>')
|
||||
1
|
||||
let style_end = search('^</style>')
|
||||
if style_start > 0 && style_end > 0
|
||||
let buf_styles = getline(style_start + 1, style_end - 1)
|
||||
for a_style in buf_styles
|
||||
if index(style, a_style) == -1
|
||||
if diff_style_start == 0
|
||||
if a_style =~ '\<Diff\(Change\|Text\|Add\|Delete\)'
|
||||
let diff_style_start = len(style)-1
|
||||
let style_start = search('^<style\( type="text/css"\)\?>')
|
||||
1
|
||||
let style_end = search('^</style>')
|
||||
if style_start > 0 && style_end > 0
|
||||
let buf_styles = getline(style_start + 1, style_end - 1)
|
||||
for a_style in buf_styles
|
||||
if index(style, a_style) == -1
|
||||
if diff_style_start == 0
|
||||
if a_style =~ '\<Diff\(Change\|Text\|Add\|Delete\)'
|
||||
let diff_style_start = len(style)-1
|
||||
endif
|
||||
endif
|
||||
call insert(style, a_style, insert_index)
|
||||
let insert_index += 1
|
||||
endif
|
||||
call insert(style, a_style, insert_index)
|
||||
let insert_index += 1
|
||||
endif
|
||||
endfor
|
||||
endif " }}}
|
||||
endfor
|
||||
endif " }}}
|
||||
|
||||
" everything new will get added before the diff styles so diff highlight
|
||||
" properly overrides normal highlight
|
||||
if diff_style_start != 0
|
||||
let insert_index = diff_style_start
|
||||
" everything new will get added before the diff styles so diff highlight
|
||||
" properly overrides normal highlight
|
||||
if diff_style_start != 0
|
||||
let insert_index = diff_style_start
|
||||
endif
|
||||
|
||||
" Delete those parts that are not needed so we can include the rest into the
|
||||
" resulting table.
|
||||
1,/^<body.*\%(\n<!--.*-->\_s\+.*id='oneCharWidth'.*\_s\+.*id='oneInputWidth'.*\_s\+.*id='oneEmWidth'\)\?\zs/d_
|
||||
$
|
||||
?</body>?,$d_
|
||||
elseif !s:settings.no_modeline
|
||||
" remove modeline from source files if it is included and we haven't deleted
|
||||
" due to removing html footer already
|
||||
$d
|
||||
endif
|
||||
|
||||
" Delete those parts that are not needed so we can include the rest into the
|
||||
" resulting table.
|
||||
1,/^<body.*\%(\n<!--.*-->\_s\+.*id='oneCharWidth'.*\_s\+.*id='oneInputWidth'.*\_s\+.*id='oneEmWidth'\)\?\zs/d_
|
||||
$
|
||||
?</body>?,$d_
|
||||
let temp = getline(1,'$')
|
||||
" clean out id on the main content container because we already set it on
|
||||
" the table
|
||||
@@ -478,7 +486,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
|
||||
" undo deletion of start and end part
|
||||
" so we can later save the file as valid html
|
||||
" TODO: restore using grabbed lines if undolevel is 1?
|
||||
normal! 2u
|
||||
if !s:settings.no_doc
|
||||
normal! 2u
|
||||
elseif !s:settings.no_modeline
|
||||
normal! u
|
||||
endif
|
||||
if s:settings.use_css
|
||||
call add(html, '<td><div>')
|
||||
elseif s:settings.use_xhtml
|
||||
@@ -495,17 +507,23 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
|
||||
quit!
|
||||
endfor
|
||||
|
||||
let html[body_line_num] = body_line
|
||||
if !s:settings.no_doc
|
||||
let html[body_line_num] = body_line
|
||||
endif
|
||||
|
||||
call add(html, '</tr>')
|
||||
call add(html, '</table>')
|
||||
call add(html, s:body_end_line)
|
||||
call add(html, '</html>')
|
||||
if !s:settings.no_doc
|
||||
call add(html, s:body_end_line)
|
||||
call add(html, '</html>')
|
||||
endif
|
||||
|
||||
" The generated HTML is admittedly ugly and takes a LONG time to fold.
|
||||
" Make sure the user doesn't do syntax folding when loading a generated file,
|
||||
" using a modeline.
|
||||
call add(html, '<!-- vim: set foldmethod=manual : -->')
|
||||
if !s:settings.no_modeline
|
||||
call add(html, '<!-- vim: set foldmethod=manual : -->')
|
||||
endif
|
||||
|
||||
let i = 1
|
||||
let name = "Diff" . (s:settings.use_xhtml ? ".xhtml" : ".html")
|
||||
@@ -542,129 +560,131 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
|
||||
|
||||
call append(0, html)
|
||||
|
||||
if len(style) > 0
|
||||
1
|
||||
let style_start = search('^</head>')-1
|
||||
if !s:settings.no_doc
|
||||
if len(style) > 0
|
||||
1
|
||||
let style_start = search('^</head>')-1
|
||||
|
||||
" add required javascript in reverse order so we can just call append again
|
||||
" and again without adjusting {{{
|
||||
" add required javascript in reverse order so we can just call append again
|
||||
" and again without adjusting {{{
|
||||
|
||||
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
|
||||
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
|
||||
|
||||
" insert script closing tag if needed
|
||||
if s:uses_script
|
||||
call append(style_start, [
|
||||
\ '',
|
||||
\ s:settings.use_xhtml ? '//]]>' : '-->',
|
||||
\ "</script>"
|
||||
\ ])
|
||||
endif
|
||||
|
||||
" insert javascript to get IDs from line numbers, and to open a fold before
|
||||
" jumping to any lines contained therein
|
||||
if s:settings.line_ids
|
||||
call append(style_start, [
|
||||
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
|
||||
\ " * we corrected the raw number to a line ID.",
|
||||
\ " */",
|
||||
\ " if (lineElem) {",
|
||||
\ " lineElem.scrollIntoView(true);",
|
||||
\ " }",
|
||||
\ " return true;",
|
||||
\ "}",
|
||||
\ "if ('onhashchange' in window) {",
|
||||
\ " window.onhashchange = JumpToLine;",
|
||||
\ "}"
|
||||
\ ])
|
||||
|
||||
if s:settings.dynamic_folds
|
||||
" insert script closing tag if needed
|
||||
if s:uses_script
|
||||
call append(style_start, [
|
||||
\ "",
|
||||
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
|
||||
\ " var node = lineElem;",
|
||||
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
|
||||
\ " {",
|
||||
\ " if (node.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " /* toggle open the fold ID (remove window ID) */",
|
||||
\ " toggleFold(node.id.substr(4));",
|
||||
\ " }",
|
||||
\ " node = node.parentNode;",
|
||||
\ " }",
|
||||
\ '',
|
||||
\ s:settings.use_xhtml ? '//]]>' : '-->',
|
||||
\ "</script>"
|
||||
\ ])
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:settings.line_ids
|
||||
call append(style_start, [
|
||||
\ "",
|
||||
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
|
||||
\ "function JumpToLine()",
|
||||
\ "{",
|
||||
\ " var lineNum;",
|
||||
\ " lineNum = window.location.hash;",
|
||||
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
|
||||
\ "",
|
||||
\ " if (lineNum.indexOf('L') == -1) {",
|
||||
\ " lineNum = 'L'+lineNum;",
|
||||
\ " }",
|
||||
\ " if (lineNum.indexOf('W') == -1) {",
|
||||
\ " lineNum = 'W1'+lineNum;",
|
||||
\ " }",
|
||||
\ " var lineElem = document.getElementById(lineNum);"
|
||||
\ ])
|
||||
endif
|
||||
" insert javascript to get IDs from line numbers, and to open a fold before
|
||||
" jumping to any lines contained therein
|
||||
if s:settings.line_ids
|
||||
call append(style_start, [
|
||||
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
|
||||
\ " * we corrected the raw number to a line ID.",
|
||||
\ " */",
|
||||
\ " if (lineElem) {",
|
||||
\ " lineElem.scrollIntoView(true);",
|
||||
\ " }",
|
||||
\ " return true;",
|
||||
\ "}",
|
||||
\ "if ('onhashchange' in window) {",
|
||||
\ " window.onhashchange = JumpToLine;",
|
||||
\ "}"
|
||||
\ ])
|
||||
|
||||
" Insert javascript to toggle matching folds open and closed in all windows,
|
||||
" if dynamic folding is active.
|
||||
if s:settings.dynamic_folds
|
||||
call append(style_start, [
|
||||
\ " function toggleFold(objID)",
|
||||
\ " {",
|
||||
\ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)",
|
||||
\ " {",
|
||||
\ " var fold;",
|
||||
\ ' fold = document.getElementById("win"+win_num+objID);',
|
||||
\ " if(fold.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " else if (fold.className == 'open-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'closed-fold';",
|
||||
\ " }",
|
||||
\ " }",
|
||||
\ " }",
|
||||
\ ])
|
||||
endif
|
||||
if s:settings.dynamic_folds
|
||||
call append(style_start, [
|
||||
\ "",
|
||||
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
|
||||
\ " var node = lineElem;",
|
||||
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
|
||||
\ " {",
|
||||
\ " if (node.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " /* toggle open the fold ID (remove window ID) */",
|
||||
\ " toggleFold(node.id.substr(4));",
|
||||
\ " }",
|
||||
\ " node = node.parentNode;",
|
||||
\ " }",
|
||||
\ ])
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:uses_script
|
||||
" insert script tag if needed
|
||||
call append(style_start, [
|
||||
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
|
||||
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
|
||||
endif
|
||||
if s:settings.line_ids
|
||||
call append(style_start, [
|
||||
\ "",
|
||||
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
|
||||
\ "function JumpToLine()",
|
||||
\ "{",
|
||||
\ " var lineNum;",
|
||||
\ " lineNum = window.location.hash;",
|
||||
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
|
||||
\ "",
|
||||
\ " if (lineNum.indexOf('L') == -1) {",
|
||||
\ " lineNum = 'L'+lineNum;",
|
||||
\ " }",
|
||||
\ " if (lineNum.indexOf('W') == -1) {",
|
||||
\ " lineNum = 'W1'+lineNum;",
|
||||
\ " }",
|
||||
\ " var lineElem = document.getElementById(lineNum);"
|
||||
\ ])
|
||||
endif
|
||||
|
||||
" Insert styles from all the generated html documents and additional styles
|
||||
" for the table-based layout of the side-by-side diff. The diff should take
|
||||
" up the full browser window (but not more), and be static in size,
|
||||
" horizontally scrollable when the lines are too long. Otherwise, the diff
|
||||
" is pretty useless for really long lines. {{{
|
||||
if s:settings.use_css
|
||||
call append(style_start,
|
||||
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
|
||||
\ style+
|
||||
\ [ s:settings.use_xhtml ? '' : '<!--',
|
||||
\ 'table { table-layout: fixed; }',
|
||||
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
|
||||
\ 'table, td, th { border: 1px solid; }',
|
||||
\ 'td { vertical-align: top; }',
|
||||
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
|
||||
\ 'td div { overflow: auto; }',
|
||||
\ s:settings.use_xhtml ? '' : '-->',
|
||||
\ '</style>'
|
||||
\])
|
||||
endif "}}}
|
||||
" Insert javascript to toggle matching folds open and closed in all windows,
|
||||
" if dynamic folding is active.
|
||||
if s:settings.dynamic_folds
|
||||
call append(style_start, [
|
||||
\ " function toggleFold(objID)",
|
||||
\ " {",
|
||||
\ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)",
|
||||
\ " {",
|
||||
\ " var fold;",
|
||||
\ ' fold = document.getElementById("win"+win_num+objID);',
|
||||
\ " if(fold.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " else if (fold.className == 'open-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'closed-fold';",
|
||||
\ " }",
|
||||
\ " }",
|
||||
\ " }",
|
||||
\ ])
|
||||
endif
|
||||
|
||||
if s:uses_script
|
||||
" insert script tag if needed
|
||||
call append(style_start, [
|
||||
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
|
||||
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
|
||||
endif
|
||||
|
||||
" Insert styles from all the generated html documents and additional styles
|
||||
" for the table-based layout of the side-by-side diff. The diff should take
|
||||
" up the full browser window (but not more), and be static in size,
|
||||
" horizontally scrollable when the lines are too long. Otherwise, the diff
|
||||
" is pretty useless for really long lines. {{{
|
||||
if s:settings.use_css
|
||||
call append(style_start,
|
||||
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
|
||||
\ style+
|
||||
\ [ s:settings.use_xhtml ? '' : '<!--',
|
||||
\ 'table { table-layout: fixed; }',
|
||||
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
|
||||
\ 'table, td, th { border: 1px solid; }',
|
||||
\ 'td { vertical-align: top; }',
|
||||
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
|
||||
\ 'td div { overflow: auto; }',
|
||||
\ s:settings.use_xhtml ? '' : '-->',
|
||||
\ '</style>'
|
||||
\])
|
||||
endif "}}}
|
||||
endif
|
||||
endif
|
||||
|
||||
let &paste = s:old_paste
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 9.0. Last change: 2022 Dec 12
|
||||
*autocmd.txt* For Vim version 9.0. Last change: 2023 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -64,7 +64,7 @@ Example in Vim9 script: >
|
||||
In legacy script: >
|
||||
call autocmd_add(#{replace: v:true,
|
||||
\ group: 'DemoGroup',
|
||||
\ event: 'BufEnter',
|
||||
\ event: 'BufEnter',
|
||||
\ pattern: '*.txt',
|
||||
\ cmd: 'call DemoBufEnter()'
|
||||
\ })
|
||||
@@ -398,7 +398,7 @@ Name triggered by ~
|
||||
|InsertEnter| starting Insert mode
|
||||
|InsertChange| when typing <Insert> while in Insert or Replace mode
|
||||
|InsertLeave| when leaving Insert mode
|
||||
|InsertLeavePre| just before leaving Insert mode
|
||||
|InsertLeavePre| just before leaving Insert mode
|
||||
|InsertCharPre| when a character was typed in Insert mode, before
|
||||
inserting it
|
||||
|
||||
@@ -611,9 +611,11 @@ CmdlineEnter After moving the cursor to the command line,
|
||||
where the user can type a command or search
|
||||
string; including non-interactive use of ":"
|
||||
in a mapping, but not when using |<Cmd>|.
|
||||
The pattern is matched against the character
|
||||
representing the type of command-line.
|
||||
|cmdwin-char|
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdlineLeave*
|
||||
CmdlineLeave Before leaving the command line; including
|
||||
non-interactive use of ":" in a mapping, but
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2022 Dec 23
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2023 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -266,7 +266,7 @@ gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
|
||||
gettagstack([{nr}]) Dict get the tag stack of window {nr}
|
||||
gettext({text}) String lookup translation of {text}
|
||||
getwininfo([{winid}]) List list of info about each window
|
||||
getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window
|
||||
getwinpos([{timeout}]) List X and Y coord in pixels of Vim window
|
||||
getwinposx() Number X coord in pixels of the Vim window
|
||||
getwinposy() Number Y coord in pixels of the Vim window
|
||||
getwinvar({nr}, {varname} [, {def}])
|
||||
@@ -382,7 +382,7 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]])
|
||||
max({expr}) Number maximum value of items in {expr}
|
||||
menu_info({name} [, {mode}]) Dict get menu item information
|
||||
min({expr}) Number minimum value of items in {expr}
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
mkdir({name} [, {flags} [, {prot}]])
|
||||
Number create directory {name}
|
||||
mode([expr]) String current editing mode
|
||||
mzeval({expr}) any evaluate |MzScheme| expression
|
||||
@@ -3528,7 +3528,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
messages |:messages| suboptions
|
||||
option options
|
||||
packadd optional package |pack-add| names
|
||||
runtime runtime file names |:runtime|
|
||||
runtime |:runtime| completion
|
||||
scriptnames sourced script names |:scriptnames|
|
||||
shellcmd Shell command
|
||||
sign |:sign| suboptions
|
||||
@@ -6261,17 +6261,20 @@ min({expr}) Return the minimum value of all items in {expr}. Example: >
|
||||
mylist->min()
|
||||
|
||||
< *mkdir()* *E739*
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
mkdir({name} [, {flags} [, {prot}]])
|
||||
Create directory {name}.
|
||||
|
||||
If {path} contains "p" then intermediate directories are
|
||||
created as necessary. Otherwise it must be "".
|
||||
When {flags} is present it must be a string. An empty string
|
||||
has no effect.
|
||||
|
||||
If {path} contains "D" then {name} is deleted at the end of
|
||||
If {flags} contains "p" then intermediate directories are
|
||||
created as necessary.
|
||||
|
||||
If {flags} contains "D" then {name} is deleted at the end of
|
||||
the current function, as with: >
|
||||
defer delete({name}, 'd')
|
||||
<
|
||||
If {path} contains "R" then {name} is deleted recursively at
|
||||
If {flags} contains "R" then {name} is deleted recursively at
|
||||
the end of the current function, as with: >
|
||||
defer delete({name}, 'rf')
|
||||
< Note that when {name} has more than one part and "p" is used
|
||||
@@ -7958,7 +7961,7 @@ setcellwidths({list}) *setcellwidths()*
|
||||
terminal, counted in screen cells. The values override
|
||||
'ambiwidth'. Example: >
|
||||
call setcellwidths([
|
||||
\ [0x111, 0x111, 1],
|
||||
\ [0x111, 0x111, 1],
|
||||
\ [0x2194, 0x2199, 2],
|
||||
\ ])
|
||||
|
||||
@@ -7972,7 +7975,7 @@ setcellwidths({list}) *setcellwidths()*
|
||||
{width} must be either 1 or 2, indicating the character width
|
||||
in screen cells. *E1112*
|
||||
An error is given if the argument is invalid, also when a
|
||||
range overlaps with another. *E1113*
|
||||
range overlaps with another. *E1113*
|
||||
|
||||
If the new value causes 'fillchars' or 'listchars' to become
|
||||
invalid it is rejected and an error is given.
|
||||
@@ -10551,7 +10554,7 @@ writefile({object}, {fname} [, {flags}])
|
||||
<
|
||||
'D' Delete the file when the current function ends. This
|
||||
works like: >
|
||||
:defer delete({fname})
|
||||
:defer delete({fname})
|
||||
< Fails when not in a function. Also see |:defer|.
|
||||
|
||||
's' fsync() is called after writing the file. This flushes
|
||||
|
||||
@@ -1842,9 +1842,9 @@ editing text paragraphs. A few hints on how to use this:
|
||||
|
||||
- Set 'formatoptions' to "aw2tq" to make text with indents like this:
|
||||
|
||||
bla bla foobar bla
|
||||
bla bla foobar bla
|
||||
bla foobar bla foobar bla
|
||||
bla bla foobar bla
|
||||
bla bla foobar bla
|
||||
bla foobar bla bla foobar
|
||||
|
||||
- Add the 'c' flag to only auto-format comments. Useful in source code.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 9.0. Last change: 2022 Nov 11
|
||||
*cmdline.txt* For Vim version 9.0. Last change: 2023 Feb 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -617,6 +617,7 @@ followed by another Vim command:
|
||||
:read !
|
||||
:scscope
|
||||
:sign
|
||||
:tabdo
|
||||
:tcl
|
||||
:tcldo
|
||||
:tclfile
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 9.0. Last change: 2022 Dec 24
|
||||
*diff.txt* For Vim version 9.0. Last change: 2023 Jan 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -136,7 +136,7 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
buffers.
|
||||
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
using `:diffsplit`, `:diffpatch`, `:diffthis`. or starting Vim in diff mode.
|
||||
When using `:diffoff` twice the last saved values are restored.
|
||||
Otherwise they are set to their default value:
|
||||
|
||||
@@ -181,7 +181,7 @@ possible to view the changes you have made to a buffer since the file was
|
||||
loaded. Since Vim doesn't allow having two buffers for the same file, you
|
||||
need another buffer. This command is useful: >
|
||||
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_
|
||||
\ | diffthis | wincmd p | diffthis
|
||||
\ | diffthis | wincmd p | diffthis
|
||||
(this is in |defaults.vim|). Use ":DiffOrig" to see the differences between
|
||||
the current buffer and the file it was loaded from.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 9.0. Last change: 2023 Jan 03
|
||||
*eval.txt* For Vim version 9.0. Last change: 2023 Jan 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1372,7 +1372,7 @@ Note that the dot is also used for String concatenation. To avoid confusion
|
||||
always put spaces around the dot for String concatenation.
|
||||
|
||||
|
||||
expr10(expr1, ...) |Funcref| function call *E1085*
|
||||
expr10(expr1, ...) |Funcref| function call *E1085*
|
||||
|
||||
When expr10 is a |Funcref| type variable, invoke the function it refers to.
|
||||
|
||||
@@ -1654,7 +1654,7 @@ See below |functions|.
|
||||
|
||||
lambda expression *expr-lambda* *lambda*
|
||||
-----------------
|
||||
{args -> expr1} legacy lambda expression *E451*
|
||||
{args -> expr1} legacy lambda expression *E451*
|
||||
(args) => expr1 |Vim9| lambda expression
|
||||
|
||||
A lambda expression creates a new unnamed function which returns the result of
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 9.0. Last change: 2022 Apr 09
|
||||
*filetype.txt* For Vim version 9.0. Last change: 2023 Feb 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -679,7 +679,10 @@ MARKDOWN *ft-markdown-plugin*
|
||||
|
||||
To enable folding use this: >
|
||||
let g:markdown_folding = 1
|
||||
<
|
||||
|
||||
'expandtab' will be set by default. If you do not want that use this: >
|
||||
let g:markdown_recommended_style = 0
|
||||
|
||||
|
||||
PDF *ft-pdf-plugin*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 9.0. Last change: 2022 Nov 26
|
||||
*fold.txt* For Vim version 9.0. Last change: 2023 Jan 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -202,7 +202,7 @@ non-matching marker pairs. Example: >
|
||||
|
||||
/* funcB() {{{2 */
|
||||
void funcB() {}
|
||||
|
||||
< *{{{* *}}}*
|
||||
A fold starts at a "{{{" marker. The following number specifies the fold
|
||||
level. What happens depends on the difference between the current fold level
|
||||
and the level given by the marker:
|
||||
|
||||
@@ -48,7 +48,7 @@ typesetting command. That must be a function that takes a path and returns the
|
||||
command as a List. For example:
|
||||
>
|
||||
def ConTeXtCustomCommand(path: string): list<string>
|
||||
return ['mtxrun', '--script', 'context', '--nonstopmode, path]
|
||||
return ['mtxrun', '--script', 'context', '--nonstopmode', path]
|
||||
enddef
|
||||
|
||||
context.ConTeXtTypeset("%", v:none, ConTeXtCustomCommand)
|
||||
|
||||
@@ -84,7 +84,7 @@ METAFONT buffers, and it is set to 0 by default in MetaPost buffers.
|
||||
Define additional keywords that end indented blocks. For instance, if you
|
||||
define:
|
||||
>
|
||||
g:mp_end_tag = ['\<endfoo\>']
|
||||
g:mp_close_tag = ['\<endfoo\>']
|
||||
<
|
||||
any line starting with `endfoo` will be de-indented compared to its previous
|
||||
line.
|
||||
|
||||
@@ -95,11 +95,11 @@ terminal version.
|
||||
|
||||
Recommended place for your personal GUI initializations:
|
||||
Unix $HOME/.gvimrc or $HOME/.vim/gvimrc
|
||||
Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc
|
||||
Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc
|
||||
or $VIM/_gvimrc
|
||||
Amiga s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc
|
||||
or $VIM/.gvimrc
|
||||
Haiku $HOME/config/settings/vim/gvimrc
|
||||
Haiku $HOME/config/settings/vim/gvimrc
|
||||
|
||||
The personal initialization files are searched in the order specified above
|
||||
and only the first one that is found is read.
|
||||
@@ -1181,7 +1181,7 @@ When 'guifont' is set and a valid font is found in it and 'guifontwide' is
|
||||
empty Vim will attempt to find a matching double-width font and set
|
||||
'guifontwide' to it.
|
||||
|
||||
GTK+ GUI only: *guifontwide_gtk*
|
||||
GTK+ GUI only: *guifontwide_gtk*
|
||||
|
||||
If set and valid, 'guifontwide' is always used for double width characters,
|
||||
even if 'encoding' is not set to "utf-8".
|
||||
|
||||
@@ -17,7 +17,7 @@ Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
|
||||
|
||||
Other relevant documentation:
|
||||
|gui.txt| For generic items of the GUI.
|
||||
|os_win32.txt| For Win32 specific items.
|
||||
|os_win32.txt| For Win32 specific items.
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -101,7 +101,7 @@ Help on help files *helphelp*
|
||||
find a tag in a file with the same language as the
|
||||
current file. See |help-translated|.
|
||||
|
||||
*:helpc* *:helpclose*
|
||||
*:helpc* *:helpclose*
|
||||
:helpc[lose] Close one help window, if there is one.
|
||||
Vim will try to restore the window layout (including
|
||||
cursor position) to the same layout it was before
|
||||
|
||||
@@ -857,7 +857,7 @@ You can test what Python version is available with: >
|
||||
if has('python')
|
||||
echo 'there is Python 2.x'
|
||||
endif
|
||||
if has('python3')
|
||||
if has('python3')
|
||||
echo 'there is Python 3.x'
|
||||
endif
|
||||
|
||||
@@ -874,7 +874,7 @@ python support: >
|
||||
echo 'Python 2.x dynamically loaded'
|
||||
endif
|
||||
endif
|
||||
if has('python3_compiled')
|
||||
if has('python3_compiled')
|
||||
echo 'compiled with Python 3.x support'
|
||||
if has('python3_dynamic')
|
||||
echo 'Python 3.x dynamically loaded'
|
||||
|
||||
@@ -236,7 +236,7 @@ tag char note action in Normal mode ~
|
||||
|CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode (no-op)
|
||||
|CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
|
||||
CTRL-\ a - z reserved for extensions
|
||||
CTRL-\ others not used
|
||||
CTRL-\ others not used
|
||||
|CTRL-]| CTRL-] :ta to ident under cursor
|
||||
|CTRL-^| CTRL-^ edit Nth alternate file (equivalent to
|
||||
":e #N")
|
||||
@@ -247,7 +247,7 @@ tag char note action in Normal mode ~
|
||||
2 filter Nmove text through the {filter}
|
||||
command
|
||||
|!!| !!{filter} 2 filter N lines through the {filter} command
|
||||
|quote| "{register} use {register} for next delete, yank or put
|
||||
|quote| "{register} use {register} for next delete, yank or put
|
||||
({.%#:} only work with put)
|
||||
|#| # 1 search backward for the Nth occurrence of
|
||||
the ident under the cursor
|
||||
|
||||
@@ -877,7 +877,7 @@ Groß): >
|
||||
|
||||
func Thesaur(findstart, base)
|
||||
if a:findstart
|
||||
return searchpos('\<', 'bnW', line('.'))[1] - 1
|
||||
return searchpos('\<', 'bnW', line('.'))[1] - 1
|
||||
endif
|
||||
let res = []
|
||||
let h = ''
|
||||
@@ -1118,8 +1118,8 @@ cursor column will be replaced with the matches. If the returned value is
|
||||
larger than the cursor column, the cursor column is used.
|
||||
|
||||
Negative return values:
|
||||
-2 To cancel silently and stay in completion mode.
|
||||
-3 To cancel silently and leave completion mode.
|
||||
-2 To cancel silently and stay in completion mode.
|
||||
-3 To cancel silently and leave completion mode.
|
||||
Another negative value: completion starts at the cursor column
|
||||
|
||||
On the second invocation the arguments are:
|
||||
@@ -1176,7 +1176,7 @@ items:
|
||||
item with the same word is already present.
|
||||
empty when non-zero this match will be added even when it is
|
||||
an empty string
|
||||
user_data custom data which is associated with the item and
|
||||
user_data custom data which is associated with the item and
|
||||
available in |v:completed_item|; it can be any type;
|
||||
defaults to an empty string
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 9.0. Last change: 2023 Jan 09
|
||||
*map.txt* For Vim version 9.0. Last change: 2023 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -20,9 +20,10 @@ manual.
|
||||
1.8 Examples |map-examples|
|
||||
1.9 Using mappings |map-typing|
|
||||
1.10 Mapping alt-keys |:map-alt-keys|
|
||||
1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys|
|
||||
1.12 Mapping with Kitty keyboard protocol |kitty-keyboard-protocol|
|
||||
1.13 Mapping an operator |:map-operator|
|
||||
1.11 Mapping meta-keys |:map-meta-keys|
|
||||
1.12 Mapping in modifyOtherKeys mode |modifyOtherKeys|
|
||||
1.13 Mapping with Kitty keyboard protocol |kitty-keyboard-protocol|
|
||||
1.14 Mapping an operator |:map-operator|
|
||||
2. Abbreviations |abbreviations|
|
||||
3. Local mappings and functions |script-local|
|
||||
4. User-defined commands |user-commands|
|
||||
@@ -794,8 +795,8 @@ otherwise you would not be able to use those commands anymore. Here are a few
|
||||
suggestions:
|
||||
- Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>,
|
||||
<S-F2>, etc. Note that <F1> is already used for the help command.
|
||||
- Meta-keys (with the ALT key pressed). Depending on your keyboard accented
|
||||
characters may be used as well. |:map-alt-keys|
|
||||
- Any key with the Alt or Meta key pressed. Depending on your keyboard
|
||||
accented characters may be used as well. |:map-alt-keys|
|
||||
- Use the '_' or ',' character and then any other character. The "_" and ","
|
||||
commands do exist in Vim (see |_| and |,|), but you probably never use them.
|
||||
- Use a key that is a synonym for another command. For example: CTRL-P and
|
||||
@@ -844,7 +845,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
|
||||
you type slowly, or your system is slow, reset the 'timeout' option. Then you
|
||||
might want to set the 'ttimeout' option.
|
||||
|
||||
*map-precedence*
|
||||
*map-precedence*
|
||||
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
|
||||
global mappings. When a buffer-local mapping is the same as a global mapping,
|
||||
Vim will use the buffer-local mapping. In addition, Vim will use a complete
|
||||
@@ -922,12 +923,19 @@ in the original Vi, you would get back the text before the first undo).
|
||||
|
||||
1.10 MAPPING ALT-KEYS *:map-alt-keys*
|
||||
|
||||
For a readable mapping command the <A-k> form can be used. Note that <A-k>
|
||||
and <A-K> are different, the latter will use an upper case letter. Actually,
|
||||
<A-K> and <A-S-K> are the same. Instead of "A" you can use "M". If you have
|
||||
an actual Meta modifier key, please see |:map-meta-keys|.
|
||||
|
||||
In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
|
||||
always work. But in a terminal Vim gets a sequence of bytes and has to figure
|
||||
out whether ALT was pressed or not.
|
||||
|
||||
If the terminal supports the modifyOtherKeys mode and it has been enabled,
|
||||
then Vim can recognize more key combinations, see |modifyOtherKeys| below.
|
||||
The Kitty keyboard protocol works in a similar way, see
|
||||
|kitty-keyboard-protocol|.
|
||||
|
||||
By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
|
||||
character. Most decent terminals can work that way, such as xterm, aterm and
|
||||
@@ -966,7 +974,21 @@ on the terminal; that's a good last resource in case you want to send ESC when
|
||||
using other applications but not when inside Vim.
|
||||
|
||||
|
||||
1.11 MAPPING IN modifyOtherKeys mode *modifyOtherKeys*
|
||||
1.11 MAPPING META-KEYS *:map-meta-keys*
|
||||
|
||||
Mapping keys with the Meta modifier works very similar to using the Alt key.
|
||||
What key on your keyboard produces the Meta modifier depends on your keyboard
|
||||
and configuration.
|
||||
|
||||
Note that mapping <M-a> actually is for using the Alt key. That can be
|
||||
confusing! It cannot be changed, it would not be backwards compatible.
|
||||
|
||||
For the Meta modifier the "T" character is used. For example, to map Meta-b
|
||||
in Insert mode: >
|
||||
:imap <T-b> terrible
|
||||
|
||||
|
||||
1.12 MAPPING IN modifyOtherKeys mode *modifyOtherKeys*
|
||||
|
||||
Xterm and a few other terminals can be put in a mode where keys with modifiers
|
||||
are sent with a special escape code. Vim recognizes these codes and can then
|
||||
@@ -1011,7 +1033,7 @@ enabled when it spots an escape sequence that must have been created by it.
|
||||
To see if Vim detected such an escape sequence use `:verbose map`, the first
|
||||
line will then show "Seen modifyOtherKeys: true" (possibly translated).
|
||||
|
||||
This automatic detection depends on receiving an escape code starting with
|
||||
This automatic detection depends on receiving an escape code starting with
|
||||
"<1b>[27;". This is the normal way xterm sends these key codes. However, if
|
||||
the *formatOtherKeys* resource is set another form is used that is not
|
||||
recognized, therefore you must not set formatOtherKeys.
|
||||
@@ -1028,7 +1050,7 @@ When the 'esckeys' option is off, then modifyOtherKeys will be disabled in
|
||||
Insert mode to avoid every key with a modifier causing Insert mode to end.
|
||||
|
||||
|
||||
1.12 MAPPING WITH KITTY KEYBOARD PROTOCOL *kitty-keyboard-protocol*
|
||||
1.13 MAPPING WITH KITTY KEYBOARD PROTOCOL *kitty-keyboard-protocol*
|
||||
|
||||
If the value of 'term' contains "kitty" then Vim will send out an escape
|
||||
sequence to enable the Kitty keyboard protocol. This can be changed with the
|
||||
@@ -1052,10 +1074,10 @@ translated). The meaning of {value}:
|
||||
Disabled protocol was used but expected to have been disabled
|
||||
by 't_TE'
|
||||
Cleared protocol expected to have beeen disabled by 't_TE',
|
||||
previous state is unknown
|
||||
previous state is unknown
|
||||
|
||||
|
||||
1.13 MAPPING AN OPERATOR *:map-operator*
|
||||
1.14 MAPPING AN OPERATOR *:map-operator*
|
||||
|
||||
An operator is used before a {motion} command. To define your own operator
|
||||
you must create a mapping that first sets the 'operatorfunc' option and then
|
||||
@@ -1195,7 +1217,7 @@ non-id The "non-id" type ends in a non-keyword character, the other
|
||||
Examples of strings that cannot be abbreviations: "a.b", "#def", "a b", "_$r"
|
||||
|
||||
An abbreviation is only recognized when you type a non-keyword character.
|
||||
This can also be the <Esc> that ends insert mode or the <CR> that ends a
|
||||
This can also be the <Esc> that ends Insert mode or the <CR> that ends a
|
||||
command. The non-keyword character which ends the abbreviation is inserted
|
||||
after the expanded abbreviation. An exception to this is the character <C-]>,
|
||||
which is used to expand an abbreviation without inserting any extra
|
||||
@@ -1706,7 +1728,7 @@ by default correspond to the current line, last line and the whole buffer,
|
||||
relate to arguments, (loaded) buffers, windows or tab pages.
|
||||
|
||||
Possible values are (second column is the short name used in listing):
|
||||
-addr=lines Range of lines (this is the default for -range)
|
||||
-addr=lines Range of lines (this is the default for -range)
|
||||
-addr=arguments arg Range for arguments
|
||||
-addr=buffers buf Range for buffers (also not loaded buffers)
|
||||
-addr=loaded_buffers load Range for loaded buffers
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 9.0. Last change: 2023 Jan 02
|
||||
*options.txt* For Vim version 9.0. Last change: 2023 Feb 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1547,7 +1547,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
case mapping, the current locale is not effective.
|
||||
This probably only matters for Turkish.
|
||||
|
||||
*'cdhome'* *'cdh'*
|
||||
*'cdhome'* *'cdh'* *'nocdhome'* *'nocdh'*
|
||||
'cdhome' 'cdh' boolean (default: off)
|
||||
global
|
||||
When on, |:cd|, |:tcd| and |:lcd| without an argument changes the
|
||||
@@ -1899,7 +1899,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
'allowrevins' + off no CTRL-_ command
|
||||
'antialias' + off don't use antialiased fonts
|
||||
'arabic' + off reset arabic-related options
|
||||
'arabic' + off reset arabic-related options
|
||||
'arabicshape' + on correct character shapes
|
||||
'backspace' + "" normal backspace
|
||||
'backup' + off no backup file
|
||||
@@ -4911,7 +4911,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
< This means that when 'term' contains "kitty, "foot" or "wezterm"
|
||||
somewhere then the "kitty" protocol is used. When 'term' contains
|
||||
"xterm" somewhere, then the "mok2" protocol is used.
|
||||
"xterm" somewhere, then the "mok2" protocol is used.
|
||||
|
||||
The first match is used, thus if you want to have "kitty" use the
|
||||
kitty protocol, but "badkitty" not, then you should match "badkitty"
|
||||
@@ -4943,7 +4943,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
empty. Then set the 'term' option to have it take effect: >
|
||||
set keyprotocol=
|
||||
let &term = &term
|
||||
|
||||
<
|
||||
|
||||
*'keywordprg'* *'kp'*
|
||||
'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
|
||||
@@ -5201,8 +5201,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
are left blank.
|
||||
*lcs-multispace*
|
||||
multispace:c...
|
||||
One or more characters to use cyclically to show for
|
||||
multiple consecutive spaces. Overrides the "space"
|
||||
One or more characters to use cyclically to show for
|
||||
multiple consecutive spaces. Overrides the "space"
|
||||
setting, except for single spaces. When omitted, the
|
||||
"space" setting is used. For example,
|
||||
`:set listchars=multispace:---+` shows ten consecutive
|
||||
@@ -5665,7 +5665,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The 'mousemodel' option is set by the |:behave| command.
|
||||
|
||||
*'mousemoveevent'* *'mousemev'*
|
||||
*'mousemoveevent'* *'mousemev'* *'nomousemoveevent'* *'nomousemev'*
|
||||
'mousemoveevent' 'mousemev' boolean (default off)
|
||||
global
|
||||
{only works in the GUI}
|
||||
@@ -7157,7 +7157,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
A don't give the "ATTENTION" message when an existing *shm-A*
|
||||
swap file is found
|
||||
I don't give the intro message when starting Vim, *shm-I*
|
||||
see |:intro|
|
||||
see |:intro|
|
||||
c don't give |ins-completion-menu| messages; for *shm-c*
|
||||
example, "-- XXX completion (YYY)", "match 1 of 2", "The only
|
||||
match", "Pattern not found", "Back at original", etc.
|
||||
@@ -7167,8 +7167,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
F don't give the file info when editing a file, like *shm-F*
|
||||
`:silent` was used for the command; note that this also
|
||||
affects messages from autocommands
|
||||
S do not show search count message when searching, e.g. *shm-S*
|
||||
"[1/5]"
|
||||
S do not show search count message when searching, e.g. *shm-S*
|
||||
"[1/5]"
|
||||
|
||||
This gives you the opportunity to avoid that a change between buffers
|
||||
requires you to hit <Enter>, but still gives as useful a message as
|
||||
@@ -7345,9 +7345,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not available when compiled without the |+signs|
|
||||
feature}
|
||||
Whether or not to draw the signcolumn. Valid values are:
|
||||
"auto" only when there is a sign to display
|
||||
"no" never
|
||||
"yes" always
|
||||
"auto" only when there is a sign to display
|
||||
"no" never
|
||||
"yes" always
|
||||
"number" display signs in the 'number' column. If the number
|
||||
column is not present, then behaves like "auto".
|
||||
|
||||
@@ -7776,7 +7776,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mark. This information is used for mouse clicks.
|
||||
< - Where to truncate line if too long. Default is at the start.
|
||||
No width fields allowed.
|
||||
= - Separation point between left and right aligned items.
|
||||
= - Separation point between alignment sections. Each section will
|
||||
be separated by an equal number of spaces. With one %= what
|
||||
comes after it will be right-aligned. With two %= there is a
|
||||
middle part, with white space left and right of it.
|
||||
No width fields allowed.
|
||||
# - Set highlight group. The name must follow and then a # again.
|
||||
Thus use %#HLname# for highlight group HLname. The same
|
||||
@@ -7784,8 +7787,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
windows.
|
||||
* - Set highlight group to User{N}, where {N} is taken from the
|
||||
minwid field, e.g. %1*. Restore normal highlight with %* or %0*.
|
||||
The difference between User{N} and StatusLine will be applied
|
||||
to StatusLineNC for the statusline of non-current windows.
|
||||
The difference between User{N} and StatusLine will be applied to
|
||||
StatusLineNC for the statusline of non-current windows.
|
||||
The number N must be between 1 and 9. See |hl-User1..9|
|
||||
|
||||
When displaying a flag, Vim removes the leading comma, if any, when
|
||||
@@ -8231,7 +8234,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
:set encoding=utf-8
|
||||
< You need to do this when your system has no locale support for UTF-8.
|
||||
|
||||
*'termguicolors'* *'tgc'* *E954*
|
||||
*'termguicolors'* *'tgc'* *'notermguicolors'* *'notgc'* *E954*
|
||||
'termguicolors' 'tgc' boolean (default off)
|
||||
global
|
||||
{not available when compiled without the
|
||||
|
||||
@@ -10,7 +10,7 @@ This file contains the particulars for the z/OS UNIX version of Vim.
|
||||
2. Putty and Colors |zOS-PuTTY|
|
||||
3. Motif Problems |zOS-Motif|
|
||||
4. Bugs |zOS-Bugs|
|
||||
5. Limitations |zOS-limitations|
|
||||
5. Limitations |zOS-limitations|
|
||||
6. Open source on z/OS UNIX |zOS-open-source|
|
||||
|
||||
Contributors: ~
|
||||
@@ -75,7 +75,7 @@ There is no solution for this yet.
|
||||
this occurs in both the terminal and gui versions.
|
||||
|
||||
==============================================================================
|
||||
5. Limitations *OS390-limitations* *zOS-limitations*
|
||||
5. Limitations *OS390-limitations* *zOS-limitations*
|
||||
|
||||
- No binary search in tag files.
|
||||
The program /bin/sort sorts by ASCII value by default. This program is
|
||||
|
||||
@@ -203,7 +203,7 @@ You can check that everything is at the right place with the :version command.
|
||||
|
||||
Example LOGIN.COM: >
|
||||
|
||||
$ define/nolog VIM DKA0:[UTIL.VIM81]
|
||||
$ define/nolog VIM DKA0:[UTIL.VIM81]
|
||||
$ vi*m :== mcr VIM:VIM.EXE
|
||||
$ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40
|
||||
$ set disp/create/node=192.168.10.202/trans=tcpip
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 9.0. Last change: 2022 Sep 24
|
||||
*pattern.txt* For Vim version 9.0. Last change: 2023 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -101,6 +101,8 @@ g# Like "#", but don't put "\<" and "\>" around the word.
|
||||
*gd*
|
||||
gd Goto local Declaration. When the cursor is on a local
|
||||
variable, this command will jump to its declaration.
|
||||
This was made to work for C code, in other languages
|
||||
it may not work well.
|
||||
First Vim searches for the start of the current
|
||||
function, just like "[[". If it is not found the
|
||||
search stops in line 1. If it is found, Vim goes back
|
||||
@@ -1142,21 +1144,21 @@ x A single character, with no special meaning, matches itself
|
||||
are supported:
|
||||
Name Func Contents ~
|
||||
*[:alnum:]* [:alnum:] isalnum ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] isalpha ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab
|
||||
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
|
||||
*[:digit:]* [:digit:] decimal digits '0' to '9'
|
||||
*[:alpha:]* [:alpha:] isalpha ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab
|
||||
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
|
||||
*[:digit:]* [:digit:] decimal digits '0' to '9'
|
||||
*[:graph:]* [:graph:] isgraph ASCII printable characters excluding
|
||||
space
|
||||
*[:lower:]* [:lower:] (1) lowercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:print:]* [:print:] (2) printable characters including space
|
||||
*[:print:]* [:print:] (2) printable characters including space
|
||||
*[:punct:]* [:punct:] ispunct ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters: space, tab, CR,
|
||||
*[:space:]* [:space:] whitespace characters: space, tab, CR,
|
||||
NL, vertical tab, form feed
|
||||
*[:upper:]* [:upper:] (3) uppercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
|
||||
*[:return:]* [:return:] the <CR> character
|
||||
*[:tab:]* [:tab:] the <Tab> character
|
||||
*[:escape:]* [:escape:] the <Esc> character
|
||||
|
||||
@@ -24,7 +24,7 @@ get the latest versions of scripts listed therein from http://vim.sf.net/.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *glvs-contents* *glvs* *getscript*
|
||||
*GetLatestVimScripts*
|
||||
*GetLatestVimScripts*
|
||||
|
||||
1. Contents........................................: |glvs-contents|
|
||||
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
|
||||
@@ -116,7 +116,7 @@ reflect the latest version of script(s) so downloaded.
|
||||
|
||||
==============================================================================
|
||||
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
|
||||
*:GetLatestVimScripts_dat*
|
||||
*:GetLatestVimScripts_dat*
|
||||
The data file <GetLatestVimScripts.dat> must have for its first two lines
|
||||
the following text:
|
||||
>
|
||||
@@ -330,7 +330,7 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim.
|
||||
This variable holds the options to be used with the
|
||||
g:GetLatestVimScripts_wget command.
|
||||
>
|
||||
g:GetLatestVimScripts_allowautoinstall
|
||||
g:GetLatestVimScripts_allowautoinstall
|
||||
< default= 1
|
||||
This variable indicates whether GetLatestVimScripts is allowed
|
||||
to attempt to automatically install scripts. Furthermore, the
|
||||
|
||||
@@ -1085,8 +1085,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
|
||||
- Makes Netrw go up one directory |netrw--|
|
||||
a Cycles between normal display, |netrw-a|
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
and showing (display only files which match g:netrw_list_hide)
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
and showing (display only files which match g:netrw_list_hide)
|
||||
cd Make browsing directory the current directory |netrw-cd|
|
||||
C Setting the editing window |netrw-C|
|
||||
d Make a directory |netrw-d|
|
||||
@@ -1118,7 +1118,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
|
||||
mz Compress/decompress marked files |netrw-mz|
|
||||
o Enter the file/directory under the cursor in a new |netrw-o|
|
||||
browser window. A horizontal split is used.
|
||||
browser window. A horizontal split is used.
|
||||
O Obtain a file specified by cursor |netrw-O|
|
||||
p Preview the file |netrw-p|
|
||||
P Browse in the previously used window |netrw-P|
|
||||
@@ -1134,7 +1134,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
u Change to recently-visited directory |netrw-u|
|
||||
U Change to subsequently-visited directory |netrw-U|
|
||||
v Enter the file/directory under the cursor in a new |netrw-v|
|
||||
browser window. A vertical split is used.
|
||||
browser window. A vertical split is used.
|
||||
x View file with an associated program |netrw-x|
|
||||
X Execute filename under cursor via |system()| |netrw-X|
|
||||
|
||||
@@ -2271,7 +2271,7 @@ Example:
|
||||
...
|
||||
|
||||
|
||||
MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
|
||||
MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the global marked-file list)
|
||||
|
||||
@@ -2620,7 +2620,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
Used to change access permission for a file.
|
||||
|
||||
*g:netrw_clipboard* =1
|
||||
By default, netrw will attempt to insure that
|
||||
By default, netrw will attempt to insure that
|
||||
the clipboard's values will remain unchanged.
|
||||
However, some users report that they have
|
||||
speed problems with this; consequently, this
|
||||
@@ -2768,7 +2768,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
escaped before applying glob()
|
||||
|
||||
*g:netrw_gx* ="<cfile>"
|
||||
This option controls how gx (|netrw-gx|) picks
|
||||
This option controls how gx (|netrw-gx|) picks
|
||||
up the text under the cursor. See |expand()|
|
||||
for possibilities.
|
||||
|
||||
@@ -2834,11 +2834,11 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
directory (|netrw-mt|, |netrw-mc|)
|
||||
|
||||
*g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin
|
||||
=' \c copy' Windows
|
||||
=' \c copy' Windows
|
||||
Options for the |g:netrw_localcopycmd|
|
||||
|
||||
*g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin
|
||||
=expand("$COMSPEC") Windows
|
||||
=expand("$COMSPEC") Windows
|
||||
Copies directories to target directory.
|
||||
(|netrw-mc|, |netrw-mt|)
|
||||
|
||||
@@ -2864,7 +2864,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
Options for |g:netrw_localmovecmd|
|
||||
|
||||
*g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin
|
||||
=expand("$COMSPEC") Windows
|
||||
=expand("$COMSPEC") Windows
|
||||
Remove directory command (rmdir)
|
||||
This variable is only used if your vim is
|
||||
earlier than 7.4 or if your vim doesn't
|
||||
@@ -2900,10 +2900,10 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
(see |'ballooneval'|)
|
||||
|
||||
*g:netrw_sizestyle* not defined: actual bytes (default)
|
||||
="b" : actual bytes (default)
|
||||
="h" : human-readable (ex. 5k, 4m, 3g)
|
||||
="b" : actual bytes (default)
|
||||
="h" : human-readable (ex. 5k, 4m, 3g)
|
||||
uses 1000 base
|
||||
="H" : human-readable (ex. 5K, 4M, 3G)
|
||||
="H" : human-readable (ex. 5K, 4M, 3G)
|
||||
uses 1024 base
|
||||
The long listing (|netrw-i|) and query-file
|
||||
maps (|netrw-qf|) will display file size
|
||||
@@ -2951,7 +2951,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
default: "NETRWSERVER"
|
||||
|
||||
*g:netrw_sort_by* sort by "name", "time", "size", or
|
||||
"exten".
|
||||
"exten".
|
||||
default: "name"
|
||||
|
||||
*g:netrw_sort_direction* sorting direction: "normal" or "reverse"
|
||||
@@ -3008,7 +3008,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
.vim/after/syntax/netrw.vim.
|
||||
< The netrwGray highlighting is set up by
|
||||
netrw when >
|
||||
* netrwGray has not been previously
|
||||
* netrwGray has not been previously
|
||||
defined
|
||||
* the gui is running
|
||||
< As an example, I myself use a dark-background
|
||||
@@ -3266,7 +3266,7 @@ If there are marked files: (see |netrw-mf|)
|
||||
name, applying that substitute, and renaming each file to the result.
|
||||
As an example : >
|
||||
|
||||
mr [query: reply with *.c]
|
||||
mr [query: reply with *.c]
|
||||
R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
|
||||
<
|
||||
This example will mark all *.c files and then rename them to *.cpp
|
||||
@@ -3275,7 +3275,7 @@ If there are marked files: (see |netrw-mf|)
|
||||
|
||||
The ctrl-X character has special meaning for renaming files: >
|
||||
|
||||
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response
|
||||
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response
|
||||
lying between the last '/' and the ctrl-x.
|
||||
|
||||
<c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
|
||||
@@ -3843,7 +3843,7 @@ netrw:
|
||||
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
|
||||
should edit the Decho.vba.gz file and source it in: >
|
||||
|
||||
vim Decho.vba.gz
|
||||
vim Decho.vba.gz
|
||||
:so %
|
||||
:q
|
||||
<
|
||||
@@ -3885,7 +3885,7 @@ netrw:
|
||||
To save the file: under linux, the output will be in a separate
|
||||
remote server window; in it, just save the file with >
|
||||
|
||||
:w! DBG
|
||||
:w! DBG
|
||||
|
||||
< Under a vim that doesn't support clientserver, your debugging
|
||||
output will appear in another tab: >
|
||||
|
||||
@@ -770,7 +770,7 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
cursorline TRUE: Highlight the cursor line. Also scrolls the
|
||||
text to show this line (only works properly
|
||||
when 'wrap' is off).
|
||||
zero: Do not highlight the cursor line.
|
||||
zero: Do not highlight the cursor line.
|
||||
Default is zero, except for |popup_menu()|.
|
||||
filter A callback that can filter typed characters, see
|
||||
|popup-filter|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
*quickfix.txt* For Vim version 9.0. Last change: 2023 Jan 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -365,8 +365,6 @@ processing a quickfix or location list command, it will be aborted.
|
||||
If numbers [from] and/or [to] are given, the respective
|
||||
range of errors is listed. A negative number counts
|
||||
from the last error backwards, -1 being the last error.
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
The |:filter| command can be used to display only the
|
||||
quickfix entries matching a supplied pattern. The
|
||||
pattern is matched against the filename, module name,
|
||||
@@ -1279,7 +1277,7 @@ The .NET CLI compiler outputs both errors and warnings by default. The output
|
||||
may be limited to include only errors, by setting the g:dotnet_errors_only
|
||||
variable to |v:true|.
|
||||
|
||||
The associated project name is included in each error and warning. To supress
|
||||
The associated project name is included in each error and warning. To suppress
|
||||
the project name, set the g:dotnet_show_project_file variable to |v:false|.
|
||||
|
||||
Example: limit output to only display errors, and suppress the project name: >
|
||||
|
||||
@@ -64,7 +64,7 @@ The following command line arguments are available:
|
||||
below). The name used will be uppercase.
|
||||
*--remote-send*
|
||||
--remote-send {keys} Send {keys} to server and exit. The {keys}
|
||||
are not mapped. Special key names are
|
||||
are not mapped. Special key names are
|
||||
recognized, e.g., "<CR>" results in a CR
|
||||
character.
|
||||
*--remote-expr*
|
||||
|
||||
@@ -267,7 +267,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
When [where] is omitted only 'runtimepath' is used.
|
||||
Other values:
|
||||
START search under "start" in 'packpath'
|
||||
OPT search under "opt" in 'packpath'
|
||||
OPT search under "opt" in 'packpath'
|
||||
PACK search under "start" and "opt" in
|
||||
'packpath'
|
||||
ALL first use 'runtimepath', then search
|
||||
@@ -729,15 +729,15 @@ up-to-date easily, but it requires a program like "git" to be available.
|
||||
You can do both, github can automatically create an archive for a release.
|
||||
|
||||
Your directory layout would be like this:
|
||||
start/foobar/plugin/foo.vim " always loaded, defines commands
|
||||
start/foobar/plugin/bar.vim " always loaded, defines commands
|
||||
start/foobar/autoload/foo.vim " loaded when foo command used
|
||||
start/foobar/doc/foo.txt " help for foo.vim
|
||||
start/foobar/doc/tags " help tags
|
||||
opt/fooextra/plugin/extra.vim " optional plugin, defines commands
|
||||
opt/fooextra/autoload/extra.vim " loaded when extra command used
|
||||
opt/fooextra/doc/extra.txt " help for extra.vim
|
||||
opt/fooextra/doc/tags " help tags
|
||||
start/foobar/plugin/foo.vim " always loaded, defines commands
|
||||
start/foobar/plugin/bar.vim " always loaded, defines commands
|
||||
start/foobar/autoload/foo.vim " loaded when foo command used
|
||||
start/foobar/doc/foo.txt " help for foo.vim
|
||||
start/foobar/doc/tags " help tags
|
||||
opt/fooextra/plugin/extra.vim " optional plugin, defines commands
|
||||
opt/fooextra/autoload/extra.vim " loaded when extra command used
|
||||
opt/fooextra/doc/extra.txt " help for extra.vim
|
||||
opt/fooextra/doc/tags " help tags
|
||||
|
||||
This allows for the user to do: >
|
||||
mkdir ~/.vim/pack
|
||||
|
||||
@@ -629,7 +629,7 @@ sign_placelist({list})
|
||||
be placed. For the accepted values, see
|
||||
|line()|.
|
||||
name name of the sign to place. See |sign_define()|
|
||||
for more information.
|
||||
for more information.
|
||||
priority priority of the sign. When multiple signs are
|
||||
placed on a line, the sign with the highest
|
||||
priority is used. If not specified, the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2022 Dec 26
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2023 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1307,18 +1307,32 @@ When not set 4 is used.
|
||||
|
||||
DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax*
|
||||
|
||||
There is one option with highlighting DOS batch files. This covers new
|
||||
extensions to the Command Interpreter introduced with Windows 2000 and
|
||||
is controlled by the variable dosbatch_cmdextversion. For Windows NT
|
||||
this should have the value 1, and for Windows 2000 it should be 2.
|
||||
Select the set of Windows Command interpreter extensions that should be
|
||||
supported with the variable dosbatch_cmdextversion. For versions of Windows
|
||||
NT (before Windows 2000) this should have the value of 1. For Windows 2000
|
||||
and later it should be 2.
|
||||
Select the version you want with the following line: >
|
||||
|
||||
:let dosbatch_cmdextversion = 1
|
||||
|
||||
If this variable is not defined it defaults to a value of 2 to support
|
||||
Windows 2000.
|
||||
Windows 2000 and later.
|
||||
|
||||
A second option covers whether *.btm files should be detected as type
|
||||
The original MS-DOS supports an idiom of using a double colon (::) as an
|
||||
alternative way to enter a comment line. This idiom can be used with the
|
||||
current Windows Command Interpreter, but it can lead to problems when used
|
||||
inside ( ... ) command blocks. You can find a discussion about this on
|
||||
Stack Overflow -
|
||||
|
||||
https://stackoverflow.com/questions/12407800/which-comment-style-should-i-use-in-batch-files
|
||||
|
||||
To allow the use of the :: idiom for comments in the Windows Command
|
||||
Interpreter or working with MS-DOS bat files, set the
|
||||
dosbatch_colons_comment variable to anything: >
|
||||
|
||||
:let dosbatch_colons_comment = 1
|
||||
|
||||
There is an option that covers whether *.btm files should be detected as type
|
||||
"dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter
|
||||
is used by default. You may select the former with the following line: >
|
||||
|
||||
@@ -3836,7 +3850,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||
|
||||
clear: Syntax specific iskeyword setting is disabled and the
|
||||
buffer-local 'iskeyword' setting is used.
|
||||
{option} Set the syntax 'iskeyword' option to a new value.
|
||||
{option} Set the syntax 'iskeyword' option to a new value.
|
||||
|
||||
Example: >
|
||||
:syntax iskeyword @,48-57,192-255,$,_
|
||||
@@ -5283,7 +5297,7 @@ guisp={color-name} *highlight-guisp*
|
||||
(guisp) color to use in the GUI. "guisp" is used for undercurl and
|
||||
strikethrough.
|
||||
There are a few special names:
|
||||
NONE no color (transparent)
|
||||
NONE no color (transparent) *E1361*
|
||||
bg use normal background color
|
||||
background use normal background color
|
||||
fg use normal foreground color
|
||||
|
||||
@@ -438,8 +438,10 @@ $quote eval.txt /*$quote*
|
||||
'keymap' options.txt /*'keymap'*
|
||||
'keymodel' options.txt /*'keymodel'*
|
||||
'keyprotocol' options.txt /*'keyprotocol'*
|
||||
'keywordprg' options.txt /*'keywordprg'*
|
||||
'km' options.txt /*'km'*
|
||||
'kmp' options.txt /*'kmp'*
|
||||
'kp' options.txt /*'kp'*
|
||||
'kpc' options.txt /*'kpc'*
|
||||
'langmap' options.txt /*'langmap'*
|
||||
'langmenu' options.txt /*'langmenu'*
|
||||
@@ -566,6 +568,8 @@ $quote eval.txt /*$quote*
|
||||
'nobreakindent' options.txt /*'nobreakindent'*
|
||||
'nobri' options.txt /*'nobri'*
|
||||
'nobuflisted' options.txt /*'nobuflisted'*
|
||||
'nocdh' options.txt /*'nocdh'*
|
||||
'nocdhome' options.txt /*'nocdhome'*
|
||||
'nocf' options.txt /*'nocf'*
|
||||
'noci' options.txt /*'noci'*
|
||||
'nocin' options.txt /*'nocin'*
|
||||
@@ -674,6 +678,8 @@ $quote eval.txt /*$quote*
|
||||
'nomousef' options.txt /*'nomousef'*
|
||||
'nomousefocus' options.txt /*'nomousefocus'*
|
||||
'nomousehide' options.txt /*'nomousehide'*
|
||||
'nomousemev' options.txt /*'nomousemev'*
|
||||
'nomousemoveevent' options.txt /*'nomousemoveevent'*
|
||||
'nonu' options.txt /*'nonu'*
|
||||
'nonumber' options.txt /*'nonumber'*
|
||||
'noodev' options.txt /*'noodev'*
|
||||
@@ -743,10 +749,12 @@ $quote eval.txt /*$quote*
|
||||
'notbidi' options.txt /*'notbidi'*
|
||||
'notbs' options.txt /*'notbs'*
|
||||
'notermbidi' options.txt /*'notermbidi'*
|
||||
'notermguicolors' options.txt /*'notermguicolors'*
|
||||
'noterse' options.txt /*'noterse'*
|
||||
'notextauto' options.txt /*'notextauto'*
|
||||
'notextmode' options.txt /*'notextmode'*
|
||||
'notf' options.txt /*'notf'*
|
||||
'notgc' options.txt /*'notgc'*
|
||||
'notgst' options.txt /*'notgst'*
|
||||
'notildeop' options.txt /*'notildeop'*
|
||||
'notimeout' options.txt /*'notimeout'*
|
||||
@@ -2840,6 +2848,7 @@ $quote eval.txt /*$quote*
|
||||
:map-commands map.txt /*:map-commands*
|
||||
:map-expression map.txt /*:map-expression*
|
||||
:map-local map.txt /*:map-local*
|
||||
:map-meta-keys map.txt /*:map-meta-keys*
|
||||
:map-modes map.txt /*:map-modes*
|
||||
:map-nowait map.txt /*:map-nowait*
|
||||
:map-operator map.txt /*:map-operator*
|
||||
@@ -4416,7 +4425,14 @@ E1351 vim9class.txt /*E1351*
|
||||
E1352 vim9class.txt /*E1352*
|
||||
E1353 vim9class.txt /*E1353*
|
||||
E1354 vim9class.txt /*E1354*
|
||||
E1355 vim9class.txt /*E1355*
|
||||
E1356 vim9class.txt /*E1356*
|
||||
E1357 vim9class.txt /*E1357*
|
||||
E1358 vim9class.txt /*E1358*
|
||||
E1359 vim9class.txt /*E1359*
|
||||
E136 starting.txt /*E136*
|
||||
E1360 vim9class.txt /*E1360*
|
||||
E1361 syntax.txt /*E1361*
|
||||
E137 starting.txt /*E137*
|
||||
E138 starting.txt /*E138*
|
||||
E139 message.txt /*E139*
|
||||
@@ -5633,6 +5649,7 @@ View starting.txt /*View*
|
||||
Vim9 vim9.txt /*Vim9*
|
||||
Vim9-abstract-class vim9class.txt /*Vim9-abstract-class*
|
||||
Vim9-class vim9class.txt /*Vim9-class*
|
||||
Vim9-class-member vim9class.txt /*Vim9-class-member*
|
||||
Vim9-class-overview vim9class.txt /*Vim9-class-overview*
|
||||
Vim9-enum vim9class.txt /*Vim9-enum*
|
||||
Vim9-script vim9.txt /*Vim9-script*
|
||||
@@ -6311,7 +6328,6 @@ cino-} indent.txt /*cino-}*
|
||||
cinoptions-values indent.txt /*cinoptions-values*
|
||||
class vim9class.txt /*class*
|
||||
class-function vim9class.txt /*class-function*
|
||||
class-member vim9class.txt /*class-member*
|
||||
clear-undo undo.txt /*clear-undo*
|
||||
clearmatches() builtin.txt /*clearmatches()*
|
||||
client-server remote.txt /*client-server*
|
||||
@@ -7558,6 +7574,7 @@ getbufinfo() builtin.txt /*getbufinfo()*
|
||||
getbufline() builtin.txt /*getbufline()*
|
||||
getbufoneline() builtin.txt /*getbufoneline()*
|
||||
getbufvar() builtin.txt /*getbufvar()*
|
||||
getcellwidths() builtin.txt /*getcellwidths()*
|
||||
getchangelist() builtin.txt /*getchangelist()*
|
||||
getchar() builtin.txt /*getchar()*
|
||||
getcharmod() builtin.txt /*getcharmod()*
|
||||
@@ -10042,6 +10059,7 @@ t_channel-variable eval.txt /*t_channel-variable*
|
||||
t_ci version4.txt /*t_ci*
|
||||
t_cil version4.txt /*t_cil*
|
||||
t_cl term.txt /*t_cl*
|
||||
t_class-variable eval.txt /*t_class-variable*
|
||||
t_cm term.txt /*t_cm*
|
||||
t_cri version4.txt /*t_cri*
|
||||
t_cs term.txt /*t_cs*
|
||||
@@ -10106,6 +10124,7 @@ t_ms term.txt /*t_ms*
|
||||
t_nd term.txt /*t_nd*
|
||||
t_none-variable eval.txt /*t_none-variable*
|
||||
t_number-variable eval.txt /*t_number-variable*
|
||||
t_object-variable eval.txt /*t_object-variable*
|
||||
t_op term.txt /*t_op*
|
||||
t_se term.txt /*t_se*
|
||||
t_sf1 version4.txt /*t_sf1*
|
||||
@@ -10614,6 +10633,7 @@ v:t_TYPE eval.txt /*v:t_TYPE*
|
||||
v:t_blob eval.txt /*v:t_blob*
|
||||
v:t_bool eval.txt /*v:t_bool*
|
||||
v:t_channel eval.txt /*v:t_channel*
|
||||
v:t_class eval.txt /*v:t_class*
|
||||
v:t_dict eval.txt /*v:t_dict*
|
||||
v:t_float eval.txt /*v:t_float*
|
||||
v:t_func eval.txt /*v:t_func*
|
||||
@@ -10621,6 +10641,7 @@ v:t_job eval.txt /*v:t_job*
|
||||
v:t_list eval.txt /*v:t_list*
|
||||
v:t_none eval.txt /*v:t_none*
|
||||
v:t_number eval.txt /*v:t_number*
|
||||
v:t_object eval.txt /*v:t_object*
|
||||
v:t_string eval.txt /*v:t_string*
|
||||
v:termblinkresp eval.txt /*v:termblinkresp*
|
||||
v:termrbgresp eval.txt /*v:termrbgresp*
|
||||
@@ -11208,6 +11229,8 @@ zz scroll.txt /*zz*
|
||||
{rhs} map.txt /*{rhs}*
|
||||
{server} remote.txt /*{server}*
|
||||
{subject} helphelp.txt /*{subject}*
|
||||
{{{ fold.txt /*{{{*
|
||||
{} intro.txt /*{}*
|
||||
} motion.txt /*}*
|
||||
}}} fold.txt /*}}}*
|
||||
~ change.txt /*~*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*tagsrch.txt* For Vim version 9.0. Last change: 2020 Dec 19
|
||||
*tagsrch.txt* For Vim version 9.0. Last change: 2023 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -98,7 +98,7 @@ The ignore-case matches are found when:
|
||||
- when 'tagcase' is "followscs" and 'ignorecase' is on or the 'smartcase'
|
||||
option is on and the pattern does not contain an upper case character
|
||||
- when 'tagcase' is "ignore"
|
||||
- when 'tagcase' is "smart" and the patter does not contain an upper case
|
||||
- when 'tagcase' is "smart" and the pattern does not contain an upper case
|
||||
character
|
||||
|
||||
Note that using ignore-case tag searching disables binary searching in the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 9.0. Last change: 2023 Jan 09
|
||||
*term.txt* For Vim version 9.0. Last change: 2023 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -322,9 +322,14 @@ using the "xterm" workaround. These are the relevant entries (so far):
|
||||
PS "\033[200~" pasted text start |t_PS|
|
||||
PE "\033[201~" pasted text end |t_PE|
|
||||
|
||||
XM "\033[?1006;1000%?%p1%{1}%=%th%el%;"
|
||||
XM "\033[?1006;1004;1000%?%p1%{1}%=%th%el%;"
|
||||
mouse enable / disable |t_XM|
|
||||
|
||||
The "XM" entry includes "1006" to enable SGR style mouse reporting. This
|
||||
supports columns above 223. It also includes "1004" which enables focus
|
||||
reporting. The t_fe and t_fd entries can be left empty (they don't have
|
||||
entries in terminfo/termcap anyway).
|
||||
|
||||
*xterm-kitty* *kitty-terminal*
|
||||
The Kitty terminal is a special case. Mainly because it works differently
|
||||
from most other terminals, but also because, instead of trying the fit in and
|
||||
|
||||
@@ -30,9 +30,9 @@ If the result is "1" you have it.
|
||||
Using the client-server feature |terminal-client-server|
|
||||
4. Remote testing |terminal-testing|
|
||||
5. Diffing screen dumps |terminal-diff|
|
||||
Writing a screen dump test for Vim |terminal-dumptest|
|
||||
Creating a screen dump |terminal-screendump|
|
||||
Comparing screen dumps |terminal-diffscreendump|
|
||||
Writing a screen dump test for Vim |terminal-dumptest|
|
||||
Creating a screen dump |terminal-screendump|
|
||||
Comparing screen dumps |terminal-diffscreendump|
|
||||
6. Debugging |terminal-debug|
|
||||
Starting |termdebug-starting|
|
||||
Example session |termdebug-example|
|
||||
@@ -240,7 +240,7 @@ Command syntax ~
|
||||
in a session file.
|
||||
++shell Instead of executing {command}
|
||||
directly, use a shell, like with
|
||||
`:!command` *E279*
|
||||
`:!command` *E279*
|
||||
{only works on Unix and MS-Windows}
|
||||
++kill={how} When trying to close the terminal
|
||||
window kill the job with {how}. See
|
||||
|
||||
@@ -197,7 +197,7 @@ test_gui_event({event}, {args})
|
||||
Inject an event to select a tabline menu entry. The
|
||||
supported items in {args} are:
|
||||
tabnr: tab page number
|
||||
item: tab page menu item number. 1 for the first
|
||||
item: tab page menu item number. 1 for the first
|
||||
menu item, 2 for the second item and so on.
|
||||
|
||||
After injecting the GUI events you probably should call
|
||||
@@ -223,12 +223,12 @@ test_ignore_error({expr}) *test_ignore_error()*
|
||||
Can also be used as a |method|: >
|
||||
GetErrorText()->test_ignore_error()
|
||||
|
||||
|
||||
|
||||
test_mswin_event({event}, {args}) *test_mswin_event()*
|
||||
Generate a low-level MS-Windows {event} with arguments {args}
|
||||
for testing Vim functionality. It works for MS-Windows GUI
|
||||
for testing Vim functionality. It works for MS-Windows GUI
|
||||
and for the console.
|
||||
|
||||
|
||||
{event} is a String and the supported values are:
|
||||
"mouse" mouse event.
|
||||
"key" keyboard event.
|
||||
@@ -369,7 +369,7 @@ test_override({name}, {val}) *test_override()*
|
||||
string is detected
|
||||
ui_delay time in msec to use in ui_delay(); overrules a
|
||||
wait time of up to 3 seconds for messages
|
||||
uptime overrules sysinfo.uptime
|
||||
uptime overrules sysinfo.uptime
|
||||
vterm_title setting the window title by a job running in a
|
||||
terminal window
|
||||
ALL clear all overrides, except alloc_lines ({val} is
|
||||
|
||||
@@ -56,7 +56,7 @@ how to highlight the text. The property type can have these entries:
|
||||
priority will be used.
|
||||
"start_incl" when TRUE inserts at the start position will be
|
||||
included in the text property
|
||||
"end_incl" when TRUE inserts at the end position will be
|
||||
"end_incl" when TRUE inserts at the end position will be
|
||||
included in the text property
|
||||
|
||||
|
||||
@@ -107,14 +107,14 @@ prop_type_list([{props}]) get list of property types
|
||||
|
||||
Manipulating text properties:
|
||||
|
||||
prop_add({lnum}, {col}, {props}) add a text property
|
||||
prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
|
||||
prop_add({lnum}, {col}, {props}) add a text property
|
||||
prop_add_list({props}, [{item}, ...])
|
||||
add a text property at multiple
|
||||
positions.
|
||||
prop_clear({lnum} [, {lnum-end} [, {bufnr}]])
|
||||
remove all text properties
|
||||
prop_find({props} [, {direction}]) search for a text property
|
||||
prop_list({lnum} [, {props}]) text properties in {lnum}
|
||||
prop_list({lnum} [, {props}]) text properties in {lnum}
|
||||
prop_remove({props} [, {lnum} [, {lnum-end}]])
|
||||
remove a text property
|
||||
|
||||
@@ -149,7 +149,7 @@ prop_add({lnum}, {col}, {props})
|
||||
highlighting; cannot be used with "length",
|
||||
"end_lnum" and "end_col"
|
||||
See |virtual-text| for more information.
|
||||
*E1294*
|
||||
*E1294*
|
||||
text_align when "text" is present and {col} is zero;
|
||||
specifies where to display the text:
|
||||
after after the end of the line
|
||||
@@ -172,7 +172,7 @@ prop_add({lnum}, {col}, {props})
|
||||
fit:
|
||||
wrap wrap the text to the next line
|
||||
truncate truncate the text to make it fit
|
||||
When omitted "truncate" is used.
|
||||
When omitted "truncate" is used.
|
||||
Note that this applies to the individual text
|
||||
property, the 'wrap' option sets the overall
|
||||
behavior
|
||||
@@ -263,12 +263,12 @@ prop_add_list({props}, [{item}, ...])
|
||||
It is not possible to add a text property with a "text" field
|
||||
here.
|
||||
|
||||
Example:
|
||||
Example: >
|
||||
call prop_add_list(#{type: 'MyProp', id: 2},
|
||||
\ [[1, 4, 1, 7],
|
||||
\ [1, 15, 1, 20],
|
||||
\ [2, 30, 3, 30]]
|
||||
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]])
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 9.0. Last change: 2023 Jan 09
|
||||
*todo.txt* For Vim version 9.0. Last change: 2023 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,6 +38,24 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Crash when splitting window: #11961. Set RedrawingDisabled in
|
||||
win_split_ins().
|
||||
|
||||
Do not use tt_member for class_T, add tt_class.
|
||||
|
||||
CI: include #12008 end of February.
|
||||
|
||||
In runtime/autoload/dist/script.vim change "set ft=" to "setlocal ft=" ?
|
||||
|
||||
Include #11952 after a runtime files update.
|
||||
|
||||
Errors when running tests with valgrind:
|
||||
- test_codestyle.vim: e.g.:
|
||||
command line..script /home/mool/vim/vim90/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 6: keycode_check.vim: space before tab: Expected 0 but got 7
|
||||
command line..script /home/mool/vim/vim90/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 10: setup.vim: trailing white space: Expected 0 but got 23
|
||||
- test_gui.vim:
|
||||
Found errors in Test_gui_mouse_event():
|
||||
|
||||
Upcoming larger works:
|
||||
- Make spell checking work with recent .dic/.aff files, e.g. French. #4916
|
||||
Make Vim understand the format somehow? Search for "spell" below.
|
||||
@@ -53,18 +71,33 @@ Upcoming larger works:
|
||||
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- implement :class and :interface: See |vim9-classes| #11544
|
||||
inheritance: how about super()?
|
||||
inheritance: new() method from parent used in child?
|
||||
import/export of a class
|
||||
type() should return different type for each class?
|
||||
give error for shadowing (variable and argument) when defining a class or
|
||||
interface, not later when compiling it.
|
||||
object empty(), len() - can class define a method to be used for them?
|
||||
how about lock/unlock?
|
||||
When checking "implements" also check types of members and function args.
|
||||
- implement :class and :interface: See |vim9-classes
|
||||
- Change access: public by default, private by prefixing "_".
|
||||
Check for error: can't have same name twice (ignoring "_" prefix).
|
||||
- Private methods?
|
||||
either: private def Func()
|
||||
or: def _Func()
|
||||
Perhaps use "private" keyword instead of "_" prefix?
|
||||
- "final" object members - can only be set in the constructor.
|
||||
- accept line breaks in member initialization. #11957
|
||||
- object empty(), len() - can class define a method to be used for them?
|
||||
- add to help: when using a default new() method then reordering object
|
||||
members may cause trouble. Can define new() without arguments to avoid.
|
||||
- TODO items: check types for "implements" - members and methods
|
||||
- how about lock/unlock?
|
||||
- When checking "implements" also check types of members and function args.
|
||||
- For chaining, allow using the class name as type for function return
|
||||
value.
|
||||
- Implement generics
|
||||
- Add "instanceof" (exact class name). And "assignable" (class or child)?
|
||||
- More efficient way for interface member index than iterating over list?
|
||||
- a variant of type() that returns a different type for each class?
|
||||
list<number> and list<string> should also differ.
|
||||
- Issue #11822: any.Func() can be a dict or an object call, need to handle
|
||||
this at runtime.
|
||||
- implement :type
|
||||
- implement :enum
|
||||
- class local to a function
|
||||
- Use Vim9 for more runtime files.
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
- When evaluating constants for script variables, some functions could work:
|
||||
@@ -72,16 +105,20 @@ Further Vim9 improvements, possibly after launch:
|
||||
- Implement as part of an expression: ++expr, --expr, expr++, expr--.
|
||||
|
||||
Information missing in terminfo:
|
||||
Priority:
|
||||
- Accept "hyper" and "meta" modifiers (16 and 32) from Kitty like Meta?
|
||||
8 is actually "super".
|
||||
- t_RV request terminal version string; xterm: "\033[>c"
|
||||
change in terminfo for "RV" uses the wrong escape sequence... ?
|
||||
Mouse support:
|
||||
on/off: hard coded in mch_setmouse() - use "XM" terminfo/termcap entry;
|
||||
If it starts with "\E[?1006;1000%" then set 'ttymouse' to "sgr".
|
||||
change in terminfo for "RV" uses the wrong escape sequence 7 - 14 Jan only
|
||||
Codes used for focus gained and lost (currently using use_xterm_like_mouse())
|
||||
termcodes are hard-coded in set_termname(), not named.
|
||||
Use the XF flag? enables recognizing the focus in/out events.
|
||||
Check if t_fe is not empty.
|
||||
Check for "1004" in t_XM. (disadvantage: only focus events when mouse is
|
||||
used)
|
||||
- t_fe enable focus-event tracking
|
||||
- t_fd disable focus-event tracking
|
||||
Modifiers for various keys
|
||||
- flag to indicate "xterm compatible modifiers" ?
|
||||
Underline and similar:
|
||||
- t_AU - Set underline color: like "AF" and "AB" entries.
|
||||
- t_Ce undercurl and underline end
|
||||
@@ -278,6 +315,9 @@ Can we not request XT key sequences, or reduce them drastically?
|
||||
Issue #10512: Dynamic loading broken with Perl 5.36
|
||||
Damien has a patch (2022 Dec 4)
|
||||
|
||||
Request #11965: Allow severaql "%=" items in 'statusline', makes it possible
|
||||
to have text in the center.
|
||||
|
||||
Add some kind of ":whathappend" command and functions to make visible what the
|
||||
last few typed keys and executed commands are. To be used when the user
|
||||
wonders what went wrong.
|
||||
@@ -317,7 +357,7 @@ Better terminal emulator support:
|
||||
"xterm" and then add "kitty" entries.
|
||||
|
||||
Using "A" and "o" in manually created fold (in empty buffer) does not behave
|
||||
consistenly (James McCoy, #10698)
|
||||
consistently (James McCoy, #10698)
|
||||
|
||||
In a timer callback, when using ":echo" and then input() the message is
|
||||
overwritten. Could use ":echowin" and call redraw_cmd() in get_user_input().
|
||||
@@ -362,8 +402,6 @@ IDEA: when drawing the text, store the text byte index in ScreenLinesIdx[].
|
||||
When converting screen column to text position use this.
|
||||
The line number can be obtained from win->w_lines[].
|
||||
|
||||
MS-Windows: did path modifier :p:8 stop working? #8600
|
||||
|
||||
Version of getchar() that does not move the cursor - #10603 Use a separate
|
||||
argument for the new flag.
|
||||
|
||||
@@ -445,6 +483,9 @@ Any way to convert "$" back by using a special value? (#6901)
|
||||
Can we detect true color support? https://gist.github.com/XVilka/8346728
|
||||
Try setting a color then request the current color, like using t_u7.
|
||||
|
||||
Add a v:register_used variable, which has the name of the register used for
|
||||
the last command, e.g. put. #12003
|
||||
|
||||
Make the jumplist behave like a tag stack. (#7738) Should there be a more
|
||||
time bound navigation, like with undo?
|
||||
|
||||
@@ -1150,9 +1191,6 @@ Avoids exceptions, e.g. when using the b: namespace as a dict.
|
||||
Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27)
|
||||
Useful to restore it. Is there another solution?
|
||||
|
||||
"ci[" does not look for next [ like ci" does look for next ".
|
||||
(J.F. 2017 Jan 7)
|
||||
|
||||
Patch for wrong cursor position on wrapped line, involving breakindent.
|
||||
(Ozaki Kiichi, 2016 Nov 25)
|
||||
|
||||
@@ -1176,9 +1214,6 @@ Should :vmap in matchit.vim be :xmap? (Tony Mechelynck)
|
||||
|
||||
Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
|
||||
|
||||
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
|
||||
no longer support.
|
||||
|
||||
Support sort(l, 'F'), convert strings to float. (#7857)
|
||||
|
||||
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
@@ -1364,9 +1399,6 @@ Do not include the linebreak at the start?
|
||||
Feature request: add the "al" text object, to manipulate a screen line.
|
||||
Especially useful when using 'linebreak'
|
||||
|
||||
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
|
||||
directory exists. (Sergio Gallelli, 2013 Dec 29)
|
||||
|
||||
Patch to avoid redrawing tabline when the popup menu is visible.
|
||||
(Christian Brabandt, 2016 Jan 28)
|
||||
|
||||
@@ -2951,10 +2983,6 @@ Win32 GUI known bugs:
|
||||
console, go back to Vim and click "reload" in the dialog for the changed
|
||||
file: Window moves with the cursor!
|
||||
Put focus event in input buffer and let generic Vim code handle it?
|
||||
8 Win32 GUI: With maximized window, ":set go-=r" doesn't use the space that
|
||||
comes available. (Poucet) It works OK on Win 98 but doesn't work on Win
|
||||
NT 4.0. Leaves a grey area where the scrollbar was. ":set go+=r" also
|
||||
doesn't work properly.
|
||||
8 When Vim is minimized and when maximizing it a file-changed dialog pops
|
||||
up, Vim isn't maximized. It should be done before the dialog, so that it
|
||||
appears in the right position. (Webb)
|
||||
@@ -3478,8 +3506,6 @@ Problems that will (probably) not be solved:
|
||||
input method called from GDK code. Without Perl it doesn't crash.
|
||||
- VMS: Vimdiff doesn't work with the VMS diff, because the output looks
|
||||
different. This makes test 47 fail. Install a Unix-compatible diff.
|
||||
- Win32 GUI: mouse wheel always scrolls rightmost window. The events arrive
|
||||
in Vim as if the rightmost scrollbar was used.
|
||||
- GTK with Gnome: Produces an error message when starting up:
|
||||
Gdk-WARNING **: locale not supported by C library
|
||||
This is caused by the gnome library gnome_init() setting $LC_CTYPE to
|
||||
@@ -4436,8 +4462,6 @@ Tags:
|
||||
Win32 GUI:
|
||||
8 Make debug mode work while starting up (vim -D). Open console window for
|
||||
the message and input?
|
||||
7 GvimExt: when there are several existing Vims, move the list to a submenu.
|
||||
(Mike McCollister)
|
||||
8 When using "Edit with Vim" for one file it changes directory, when several
|
||||
files are selected and using "Edit with single Vim" the directory isn't
|
||||
changed. At least change directory when the path is the same for all
|
||||
@@ -5982,7 +6006,7 @@ Various improvements:
|
||||
many percent down the windows).
|
||||
- Make it possible for the 'showbreak' to be displayed at the end of the
|
||||
line. Use a comma to separate the part at the end and the start of the
|
||||
line? Highlight the linebreak characters, add flag in 'highlight'.
|
||||
line? #754 Highlight the linebreak characters, add flag in 'highlight'.
|
||||
Make 'showbreak' local to a window.
|
||||
- Some string options should be expanded if they have wildcards, e.g.
|
||||
'dictionary' when it is "*.h".
|
||||
|
||||
@@ -250,7 +250,7 @@ Credit Card: You can use PayPal to send money with a Credit card. This is
|
||||
Bram@iccf-holland.org
|
||||
|
||||
Others: Transfer to this account if possible:
|
||||
ING bank: IBAN: NL95 INGB 0004 5487 74
|
||||
ING bank: IBAN: NL95 INGB 0004 5487 74
|
||||
Swift code: INGBNL2A
|
||||
under the name "stichting ICCF Holland", Amersfoort
|
||||
Checks are not accepted.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*userfunc.txt* For Vim version 9.0. Last change: 2023 Jan 09
|
||||
*userfunc.txt* For Vim version 9.0. Last change: 2023 Feb 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -211,7 +211,8 @@ See |:verbose-cmd| for more information.
|
||||
|
||||
*function-argument* *a:var*
|
||||
An argument can be defined by giving its name. In the function this can then
|
||||
be used as "a:name" ("a:" for argument).
|
||||
be used as "a:name" ("a:" for argument) (in a `:def` function "a:" is not
|
||||
used).
|
||||
*a:0* *a:1* *a:000* *E740* *...*
|
||||
Up to 20 arguments can be given, separated by commas. After the named
|
||||
arguments an argument "..." can be specified, which means that more arguments
|
||||
@@ -246,9 +247,10 @@ Example: >
|
||||
call Something('key', 20) "key: 20"
|
||||
|
||||
The argument default expressions are evaluated at the time of the function
|
||||
call, not definition. Thus it is possible to use an expression which is
|
||||
invalid the moment the function is defined. The expressions are also only
|
||||
evaluated when arguments are not specified during a call.
|
||||
call, not when the function is defined. Thus it is possible to use an
|
||||
expression which is invalid the moment the function is defined. The
|
||||
expressions are also only evaluated when arguments are not specified during a
|
||||
call.
|
||||
*none-function_argument*
|
||||
You can pass |v:none| to use the default expression. Note that this means you
|
||||
cannot pass v:none as an ordinary value when an argument has a default
|
||||
|
||||
@@ -505,7 +505,7 @@ You can use the error ID at the start to find help about it: >
|
||||
:help E37
|
||||
|
||||
|
||||
Summary: *help-summary* >
|
||||
Summary: *help-summary* >
|
||||
|
||||
1) Use Ctrl-D after typing a topic and let Vim show all available topics.
|
||||
Or press Tab to complete: >
|
||||
|
||||
@@ -409,7 +409,7 @@ an archive or as a repository. For an archive you can follow these steps:
|
||||
package.
|
||||
2. unpack the archive in that directory. This assumes the top
|
||||
directory in the archive is "start": >
|
||||
cd ~/.vim/pack/fancy
|
||||
cd ~/.vim/pack/fancy
|
||||
unzip /tmp/fancy.zip
|
||||
< If the archive layout is different make sure that you end up with a
|
||||
path like this:
|
||||
|
||||
@@ -77,25 +77,25 @@ browser. This is what you get: >
|
||||
9. Directory Browsing netrw-browse netrw-dir netrw-list netrw-help
|
||||
|
||||
MAPS netrw-maps
|
||||
<F1>.............Help.......................................|netrw-help|
|
||||
<cr>.............Browsing...................................|netrw-cr|
|
||||
<del>............Deleting Files or Directories..............|netrw-delete|
|
||||
-................Going Up...................................|netrw--|
|
||||
a................Hiding Files or Directories................|netrw-a|
|
||||
mb...............Bookmarking a Directory....................|netrw-mb|
|
||||
gb...............Changing to a Bookmarked Directory.........|netrw-gb|
|
||||
cd...............Make Browsing Directory The Current Dir....|netrw-c|
|
||||
d................Make A New Directory.......................|netrw-d|
|
||||
D................Deleting Files or Directories..............|netrw-D|
|
||||
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
|
||||
i................Change Listing Style.......................|netrw-i|
|
||||
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
|
||||
o................Browsing with a Horizontal Split...........|netrw-o|
|
||||
p................Use Preview Window.........................|netrw-p|
|
||||
P................Edit in Previous Window....................|netrw-p|
|
||||
q................Listing Bookmarks and History..............|netrw-qb|
|
||||
r................Reversing Sorting Order....................|netrw-r|
|
||||
< (etc)
|
||||
<F1>.............Help.......................................|netrw-help|
|
||||
<cr>.............Browsing...................................|netrw-cr|
|
||||
<del>............Deleting Files or Directories..............|netrw-delete|
|
||||
-................Going Up...................................|netrw--|
|
||||
a................Hiding Files or Directories................|netrw-a|
|
||||
mb...............Bookmarking a Directory....................|netrw-mb|
|
||||
gb...............Changing to a Bookmarked Directory.........|netrw-gb|
|
||||
cd...............Make Browsing Directory The Current Dir....|netrw-c|
|
||||
d................Make A New Directory.......................|netrw-d|
|
||||
D................Deleting Files or Directories..............|netrw-D|
|
||||
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
|
||||
i................Change Listing Style.......................|netrw-i|
|
||||
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
|
||||
o................Browsing with a Horizontal Split...........|netrw-o|
|
||||
p................Use Preview Window.........................|netrw-p|
|
||||
P................Edit in Previous Window....................|netrw-p|
|
||||
q................Listing Bookmarks and History..............|netrw-qb|
|
||||
r................Reversing Sorting Order....................|netrw-r|
|
||||
< (etc)
|
||||
|
||||
The <F1> key thus brings you to a netrw directory browsing contents help page.
|
||||
It's a regular help page; use the usual |CTRL-]| to jump to tagged help items
|
||||
@@ -106,7 +106,7 @@ To select files for display and editing: (with the cursor is atop a filename)
|
||||
<enter> Open the file in the current window. |netrw-cr|
|
||||
o Horizontally split window and display file |netrw-o|
|
||||
v Vertically split window and display file |netrw-v|
|
||||
p Use the |preview-window| |netrw-p|
|
||||
p Use the |preview-window| |netrw-p|
|
||||
P Edit in the previous window |netrw-P|
|
||||
t Open file in a new tab |netrw-t|
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 9.0. Last change: 2022 Dec 20
|
||||
*usr_41.txt* For Vim version 9.0. Last change: 2023 Jan 17
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
|
||||
@@ -342,11 +342,11 @@ New Vim variables: ~
|
||||
|v:mouse_winid| Window ID for a mouse click obtained with |getchar()|
|
||||
|v:none| an empty String, used for JSON
|
||||
|v:null| an empty String, used for JSON
|
||||
|v:option_new| new value of the option, used by |OptionSet|
|
||||
|v:option_old| old value of the option, used by |OptionSet|
|
||||
|v:option_new| new value of the option, used by |OptionSet|
|
||||
|v:option_old| old value of the option, used by |OptionSet|
|
||||
|v:option_oldlocal| old local value of the option, used by |OptionSet|
|
||||
|v:option_oldglobal| old global value of the option, used by |OptionSet|
|
||||
|v:option_type| scope of the set command, used by |OptionSet|
|
||||
|v:option_type| scope of the set command, used by |OptionSet|
|
||||
|v:option_command| command used to set the option, used by |OptionSet|
|
||||
|v:progpath| the command with which Vim was invoked
|
||||
|v:t_bool| value of Boolean type
|
||||
|
||||
@@ -105,7 +105,7 @@ script and `:def` functions; details are below:
|
||||
`:open`
|
||||
`:s` with only flags
|
||||
`:t`
|
||||
`:xit`
|
||||
`:xit`
|
||||
- Some commands, especially those used for flow control, cannot be shortened.
|
||||
E.g., `:throw` cannot be written as `:th`. *vim9-no-shorten*
|
||||
- You cannot use curly-braces names.
|
||||
@@ -113,7 +113,7 @@ script and `:def` functions; details are below:
|
||||
:%s/this/that
|
||||
- Executing a register with "@r" does not work, you can prepend a colon or use
|
||||
`:exe`: >
|
||||
:exe @a
|
||||
:exe @a
|
||||
- Unless mentioned specifically, the highest |scriptversion| is used.
|
||||
- When defining an expression mapping, the expression will be evaluated in the
|
||||
context of the script where it was defined.
|
||||
@@ -265,7 +265,7 @@ Detail: this is because "Inner" will actually become a function reference to a
|
||||
function with a generated name.
|
||||
|
||||
It is not possible to define a script-local function in a function. You can
|
||||
define a local function and assign it to a script-local funcref (it must have
|
||||
define a local function and assign it to a script-local Funcref (it must have
|
||||
been declared at the script level). It is possible to define a global
|
||||
function by using the "g:" prefix.
|
||||
|
||||
@@ -388,7 +388,6 @@ used: >
|
||||
echo temp # Error!
|
||||
|
||||
This is especially useful in a user command: >
|
||||
|
||||
command -range Rename {
|
||||
var save = @a
|
||||
@a = 'some expression'
|
||||
@@ -397,7 +396,6 @@ This is especially useful in a user command: >
|
||||
}
|
||||
|
||||
And with autocommands: >
|
||||
|
||||
au BufWritePre *.go {
|
||||
var save = winsaveview()
|
||||
silent! exe ':%! some formatting command'
|
||||
@@ -624,7 +622,7 @@ Additionally, a lambda can contain statements in {}: >
|
||||
}
|
||||
This can be useful for a timer, for example: >
|
||||
var count = 0
|
||||
var timer = timer_start(500, (_) => {
|
||||
var timer = timer_start(500, (_) => {
|
||||
count += 1
|
||||
echom 'Handler called ' .. count
|
||||
}, {repeat: 3})
|
||||
@@ -746,7 +744,7 @@ continuation is used without a backslash and a line starts with a bar: >
|
||||
*E1050*
|
||||
To make it possible for the operator at the start of the line to be
|
||||
recognized, it is required to put a colon before a range. This example will
|
||||
add "start" and print: >
|
||||
add "start" and "print": >
|
||||
var result = start
|
||||
+ print
|
||||
Like this: >
|
||||
@@ -805,7 +803,7 @@ Notes:
|
||||
echo [1, 2]
|
||||
[3, 4]
|
||||
- In some cases it is difficult for Vim to parse a command, especially when
|
||||
commands are used as an argument to another command, such as `windo`. In
|
||||
commands are used as an argument to another command, such as `:windo`. In
|
||||
those cases the line continuation with a backslash has to be used.
|
||||
|
||||
|
||||
@@ -826,7 +824,7 @@ White space is required around most operators.
|
||||
|
||||
White space is required in a sublist (list slice) around the ":", except at
|
||||
the start and end: >
|
||||
otherlist = mylist[v : count] # v:count has a different meaning
|
||||
otherlist = mylist[v : count] # v:count has a different meaning
|
||||
otherlist = mylist[:] # make a copy of the List
|
||||
otherlist = mylist[v :]
|
||||
otherlist = mylist[: v]
|
||||
@@ -881,7 +879,7 @@ This works for alphanumeric characters, underscore and dash. If you want to
|
||||
use another character, use a single or double quoted string: >
|
||||
var dict = {'key with space': value}
|
||||
var dict = {"key\twith\ttabs": value}
|
||||
var dict = {'': value} # empty key
|
||||
var dict = {'': value} # empty key
|
||||
< *E1139*
|
||||
In case the key needs to be an expression, square brackets can be used, just
|
||||
like in JavaScript: >
|
||||
@@ -1311,7 +1309,7 @@ Closures defined in a loop will share the same context. For example: >
|
||||
< *E1271*
|
||||
A closure must be compiled in the context that it is defined in, so that
|
||||
variables in that context can be found. This mostly happens correctly, except
|
||||
when a function is marked for debugging with `breakadd` after it was compiled.
|
||||
when a function is marked for debugging with `:breakadd` after it was compiled.
|
||||
Make sure to define the breakpoint before compiling the outer function.
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
@@ -1353,7 +1351,7 @@ closure: >
|
||||
}
|
||||
endfor
|
||||
|
||||
Using `echowindow` is useful in a timer, the messages go into a popup and will
|
||||
Using `:echowindow` is useful in a timer, the messages go into a popup and will
|
||||
not interfere with what the user is doing when it triggers.
|
||||
|
||||
|
||||
@@ -1404,7 +1402,7 @@ to a Vim9 function:
|
||||
echo line(1) .. line(2)
|
||||
|
||||
- line continuation does not always require a backslash: >
|
||||
echo ['one',
|
||||
echo ['one',
|
||||
\ 'two',
|
||||
\ 'three'
|
||||
\ ]
|
||||
@@ -1594,7 +1592,7 @@ That is because the declaration looks like a list of numbers, thus is
|
||||
equivalent to: >
|
||||
var ll: list<number> = [1, 2, 3]
|
||||
If you do want a more permissive list you need to declare the type: >
|
||||
var ll: list<any = [1, 2, 3]
|
||||
var ll: list<any> = [1, 2, 3]
|
||||
ll->extend(['x']) # OK
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
*vim9class.txt* For Vim version 9.0. Last change: 2023 Jan 09
|
||||
*vim9class.txt* For Vim version 9.0. Last change: 2023 Feb 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
NOTE - This is under development, anything can still change! - NOTE
|
||||
NOTE - This is not finished yet, anything can still change! - NOTE
|
||||
|
||||
|
||||
Vim9 classes, objects, interfaces, types and enums.
|
||||
|
||||
1. Overview |Vim9-class-overview|
|
||||
2. A simple class |Vim9-simple-class|
|
||||
3. Using an abstract class |Vim9-abstract-class|
|
||||
4. Using an interface |Vim9-using-interface|
|
||||
5. More class details |Vim9-class|
|
||||
6. Type definition |Vim9-type|
|
||||
7. Enum |Vim9-enum|
|
||||
3. Class members and functions |Vim9-class-member|
|
||||
4. Using an abstract class |Vim9-abstract-class|
|
||||
5. Using an interface |Vim9-using-interface|
|
||||
6. More class details |Vim9-class|
|
||||
7. Type definition |Vim9-type|
|
||||
8. Enum |Vim9-enum|
|
||||
|
||||
9. Rationale
|
||||
10. To be done later
|
||||
@@ -25,25 +26,25 @@ Vim9 classes, objects, interfaces, types and enums.
|
||||
1. Overview *Vim9-class-overview*
|
||||
|
||||
The fancy term is "object-oriented programming". You can find lots of study
|
||||
material about this subject. Here we document what |Vim9| script provides,
|
||||
assuming you know the basics already. Added are helpful hints about how
|
||||
to use this functionality effectively.
|
||||
material on this subject. Here we document what |Vim9| script provides,
|
||||
assuming you know the basics already. Added are helpful hints about how to
|
||||
use this functionality effectively.
|
||||
|
||||
The basic item is an object:
|
||||
- An object stores state. It contains one or more variables that can each
|
||||
have a value.
|
||||
- An object usually provides functions that manipulate its state. These
|
||||
- An object provides functions that use and manipulate its state. These
|
||||
functions are invoked "on the object", which is what sets it apart from the
|
||||
traditional separation of data and code that manipulates the data.
|
||||
- An object has a well defined interface, with typed member variables and
|
||||
member functions.
|
||||
- Objects are created by a class and all objects have the same interface.
|
||||
This never changes, it is not dynamic.
|
||||
- Objects are created from a class and all objects have the same interface.
|
||||
This does not change at runtime, it is not dynamic.
|
||||
|
||||
An object can only be created by a class. A class provides:
|
||||
- A new() method, the constructor, which returns an object for the class.
|
||||
This method is invoked on the class name: MyClass.new().
|
||||
- State shared by all objects of the class: class variables and constants.
|
||||
- State shared by all objects of the class: class variables (class members).
|
||||
- A hierarchy of classes, with super-classes and sub-classes, inheritance.
|
||||
|
||||
An interface is used to specify properties of an object:
|
||||
@@ -62,17 +63,18 @@ teachers use real-world objects to explain class relations and you might think
|
||||
your model should therefore reflect the real world. It doesn't! The model
|
||||
should match your purpose.
|
||||
|
||||
You will soon find that composition is often better than inheritance. Don't
|
||||
waste time trying to find the optimal class model. Or waste time discussing
|
||||
whether a square is a rectangle or that a rectangle is a square. It doesn't
|
||||
matter.
|
||||
Keep in mind that composition (an object contains other objects) is often
|
||||
better than inheritance (an object extends another object). Don't waste time
|
||||
trying to find the optimal class model. Or waste time discussing whether a
|
||||
square is a rectangle or that a rectangle is a square. It doesn't matter.
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
2. A simple class *Vim9-simple-class*
|
||||
|
||||
Let's start with a simple example: a class that stores a text position: >
|
||||
Let's start with a simple example: a class that stores a text position (see
|
||||
below for how to do this more efficiently): >
|
||||
|
||||
class TextPosition
|
||||
this.lnum: number
|
||||
@@ -107,7 +109,7 @@ The object members "lnum" and "col" can be accessed directly: >
|
||||
< *E1317* *E1327*
|
||||
If you have been using other object-oriented languages you will notice that
|
||||
in Vim the object members are consistently referred to with the "this."
|
||||
prefix. This is different from languages like Java and TypeScript. This
|
||||
prefix. This is different from languages like Java and TypeScript. The
|
||||
naming convention makes the object members easy to spot. Also, when a
|
||||
variable does not have the "this." prefix you know it is not an object member.
|
||||
|
||||
@@ -117,9 +119,9 @@ Member write access ~
|
||||
Now try to change an object member directly: >
|
||||
|
||||
pos.lnum = 9
|
||||
< *E1335*
|
||||
< *E1335*
|
||||
This will give you an error! That is because by default object members can be
|
||||
read but not set. That's why the class provides a method for it: >
|
||||
read but not set. That's why the TextPosition class provides a method for it: >
|
||||
|
||||
pos.SetLnum(9)
|
||||
|
||||
@@ -128,12 +130,12 @@ way. Most often there is no problem using a value, while setting a value may
|
||||
have side effects that need to be taken care of. In this case, the SetLnum()
|
||||
method could check if the line number is valid and either give an error or use
|
||||
the closest valid value.
|
||||
*:public* *E1331*
|
||||
*:public* *E1331*
|
||||
If you don't care about side effects and want to allow the object member to be
|
||||
changed at any time, you can make it public: >
|
||||
|
||||
public this.lnum: number
|
||||
public this.col number
|
||||
public this.col: number
|
||||
|
||||
Now you don't need the SetLnum(), SetCol() and SetPosition() methods, setting
|
||||
"pos.lnum" directly above will no longer give an error.
|
||||
@@ -153,7 +155,7 @@ name: >
|
||||
this._col number
|
||||
|
||||
Now you need to provide methods to get the value of the private members.
|
||||
These are commonly call getters. We recommend using a name that starts with
|
||||
These are commonly called getters. We recommend using a name that starts with
|
||||
"Get": >
|
||||
|
||||
def GetLnum(): number
|
||||
@@ -181,6 +183,7 @@ Simplifying the new() method ~
|
||||
Many constructors take values for the object members. Thus you very often see
|
||||
this pattern: >
|
||||
|
||||
class SomeClass
|
||||
this.lnum: number
|
||||
this.col: number
|
||||
|
||||
@@ -188,6 +191,7 @@ this pattern: >
|
||||
this.lnum = lnum
|
||||
this.col = col
|
||||
enddef
|
||||
endclass
|
||||
|
||||
Not only is this text you need to write, it also has the type of each member
|
||||
twice. Since this is so common a shorter way to write new() is provided: >
|
||||
@@ -197,8 +201,24 @@ twice. Since this is so common a shorter way to write new() is provided: >
|
||||
|
||||
The semantics are easy to understand: Providing the object member name,
|
||||
including "this.", as the argument to new() means the value provided in the
|
||||
new() call is assigned to that object member. This mechanism is coming from
|
||||
the Dart language.
|
||||
new() call is assigned to that object member. This mechanism comes from the
|
||||
Dart language.
|
||||
|
||||
Putting together this way of using new() and making the members public results
|
||||
in a much shorter class definition as what we started with: >
|
||||
|
||||
class TextPosition
|
||||
public this.lnum: number
|
||||
public this.col: number
|
||||
|
||||
def new(this.lnum, this.col)
|
||||
enddef
|
||||
|
||||
def SetPosition(lnum: number, col: number)
|
||||
this.lnum = lnum
|
||||
this.col = col
|
||||
enddef
|
||||
endclass
|
||||
|
||||
The sequence of constructing a new object is:
|
||||
1. Memory is allocated and cleared. All values are zero/false/empty.
|
||||
@@ -208,22 +228,69 @@ The sequence of constructing a new object is:
|
||||
3. Arguments in the new() method in the "this.name" form are assigned.
|
||||
4. The body of the new() method is executed.
|
||||
|
||||
TODO: for a sub-class the constructor of the parent class will be invoked
|
||||
somewhere.
|
||||
|
||||
If the class extends a parent class, the same thing happens. In the second
|
||||
step the members of the parent class are done first. There is no need to call
|
||||
"super()" or "new()" on the parent.
|
||||
|
||||
==============================================================================
|
||||
|
||||
3. Using an abstract class *Vim9-abstract-class*
|
||||
3. class members and functions *Vim9-class-member*
|
||||
|
||||
*:static* *E1337* *E1338*
|
||||
Class members are declared with "static". They are used by the name without a
|
||||
prefix: >
|
||||
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
def new(this.size)
|
||||
totalSize += this.size
|
||||
enddef
|
||||
endclass
|
||||
< *E1340* *E1341*
|
||||
Since the name is used as-is, shadowing the name by a function argument name
|
||||
or local variable name is not allowed.
|
||||
|
||||
Just like object members the access can be made private by using an underscore
|
||||
as the first character in the name, and it can be made public by prefixing
|
||||
"public": >
|
||||
|
||||
class OtherThing
|
||||
static total: number # anybody can read, only class can write
|
||||
static _sum: number # only class can read and write
|
||||
public static result: number # anybody can read and write
|
||||
endclass
|
||||
<
|
||||
*class-function*
|
||||
Class functions are also declared with "static". They have no access to
|
||||
object members, they cannot use the "this" keyword. >
|
||||
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
# Clear the total size and return the value it had before.
|
||||
static def ClearTotalSize(): number
|
||||
var prev = totalSize
|
||||
totalSize = 0
|
||||
return prev
|
||||
enddef
|
||||
endclass
|
||||
|
||||
Inside the class the function can be called by name directly, outside the
|
||||
class the class name must be prefixed: `OtherThing.ClearTotalSize()`.
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Using an abstract class *Vim9-abstract-class*
|
||||
|
||||
An abstract class forms the base for at least one sub-class. In the class
|
||||
model one often finds that a few classes have the same properties that can be
|
||||
shared, but a class with those properties does not have enough state to create
|
||||
shared, but a class with these properties does not have enough state to create
|
||||
an object from. A sub-class must extend the abstract class and add the
|
||||
missing state and/or methods before it can be used to create objects for.
|
||||
|
||||
An abstract class does not have a new() method.
|
||||
|
||||
For example, a Shape class could store a color and thickness. You cannot
|
||||
create a Shape object, it is missing the information about what kind of shape
|
||||
it is. The Shape class functions as the base for a Square and a Triangle
|
||||
@@ -249,51 +316,13 @@ class, for which objects can be created. Example: >
|
||||
enddef
|
||||
endclass
|
||||
<
|
||||
*class-member* *:static* *E1337* *E1338*
|
||||
Class members are declared with "static". They are used by the name without a
|
||||
prefix: >
|
||||
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
def new(this.size)
|
||||
totalSize += this.size
|
||||
enddef
|
||||
endclass
|
||||
< *E1340* *E1341*
|
||||
Since the name is used as-is, shadowing the name by a function argument name
|
||||
or variable name is not allowed.
|
||||
|
||||
Just like object members the access can be made private by using an underscore
|
||||
as the first character in the name, and it can be made public by prefixing
|
||||
"public": >
|
||||
class OtherThing
|
||||
static total: number # anybody can read, only class can write
|
||||
static _sum: number # only class can read and write
|
||||
public static result: number # anybody can read and write
|
||||
endclass
|
||||
<
|
||||
*class-function*
|
||||
Class functions are also declared with "static". They have no access to
|
||||
object members, they cannot use the "this" keyword. >
|
||||
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
" Clear the total size and return the value it had before.
|
||||
static def ClearTotalSize(): number
|
||||
var prev = totalSize
|
||||
totalSize = 0
|
||||
return prev
|
||||
enddef
|
||||
endclass
|
||||
An abstract class is defined the same way as a normal class, except that it
|
||||
does not have any new() method. *E1359*
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Using an interface *Vim9-using-interface*
|
||||
5. Using an interface *Vim9-using-interface*
|
||||
|
||||
The example above with Shape, Square and Triangle can be made more useful if
|
||||
we add a method to compute the surface of the object. For that we create the
|
||||
@@ -348,7 +377,7 @@ The interface name can be used as a type: >
|
||||
|
||||
==============================================================================
|
||||
|
||||
5. More class details *Vim9-class* *Class* *class*
|
||||
6. More class details *Vim9-class* *Class* *class*
|
||||
|
||||
Defining a class ~
|
||||
*:class* *:endclass* *:abstract*
|
||||
@@ -386,12 +415,52 @@ once. They can appear in any order, although this order is recommended: >
|
||||
extends ClassName
|
||||
implements InterfaceName, OtherInterface
|
||||
specifies SomeInterface
|
||||
< *extends*
|
||||
< *E1355*
|
||||
Each member and function name can be used only once. It is not possible to
|
||||
define a function with the same name and different type of arguments.
|
||||
|
||||
|
||||
Extending a class ~
|
||||
*extends*
|
||||
A class can extend one other class. *E1352* *E1353* *E1354*
|
||||
The basic idea is to build on top of an existing class, add properties to it.
|
||||
|
||||
The extended class is called the "base class" or "super class". The new class
|
||||
is called the "child class".
|
||||
|
||||
Object members from the base class are all taken over by the child class. It
|
||||
is not possible to override them (unlike some other languages).
|
||||
|
||||
*E1356* *E1357* *E1358*
|
||||
Object methods of the base class can be overruled. The signature (arguments,
|
||||
argument types and return type) must be exactly the same. The method of the
|
||||
base class can be called by prefixing "super.".
|
||||
|
||||
Other object methods of the base class are taken over by the child class.
|
||||
|
||||
Class functions, including functions starting with "new", can be overruled,
|
||||
like with object methods. The function on the base class can be called by
|
||||
prefixing the name of the class (for class functions) or "super.".
|
||||
|
||||
Unlike other languages, the constructor of the base class does not need to be
|
||||
invoked. In fact, it cannot be invoked. If some initialization from the base
|
||||
class also needs to be done in a child class, put it in an object method and
|
||||
call that method from every constructor().
|
||||
|
||||
If the base class did not specify a new() function then one was automatically
|
||||
created. This function will not be taken over by the child class. The child
|
||||
class can define its own new() function, or, if there isn't one, a new()
|
||||
function will be added automatically.
|
||||
|
||||
|
||||
A class implementing an interface ~
|
||||
*implements* *E1346* *E1347*
|
||||
A class can implement one or more interfaces. The "implements" keyword can
|
||||
only appear once *E1350* . Multiple interfaces can be specified, separated by
|
||||
commas. Each interface name can appear only once. *E1351*
|
||||
|
||||
|
||||
A class defining an interface ~
|
||||
*specifies*
|
||||
A class can declare its interface, the object members and methods, with a
|
||||
named interface. This avoids the need for separately specifying the
|
||||
@@ -402,14 +471,14 @@ Items in a class ~
|
||||
*E1318* *E1325* *E1326*
|
||||
Inside a class, in betweeen `:class` and `:endclass`, these items can appear:
|
||||
- An object member declaration: >
|
||||
this._memberName: memberType
|
||||
this.memberName: memberType
|
||||
this._memberName: memberType
|
||||
this.memberName: memberType
|
||||
public this.memberName: memberType
|
||||
- A constructor method: >
|
||||
def new(arguments)
|
||||
def newName(arguments)
|
||||
def new(arguments)
|
||||
def newName(arguments)
|
||||
- An object method: >
|
||||
def SomeMethod(arguments)
|
||||
def SomeMethod(arguments)
|
||||
< *E1329*
|
||||
For the object member the type must be specified. The best way is to do this
|
||||
explicitly with ": {type}". For simple types you can also use an initializer,
|
||||
@@ -451,6 +520,15 @@ name, with a hint about what it provides.
|
||||
An interface can only be defined in a |Vim9| script file. *E1342*
|
||||
|
||||
|
||||
null object ~
|
||||
|
||||
When a variable is decleared to have the type of an object, but it is not
|
||||
initialized, the value is null. When trying to use this null object Vim often
|
||||
does not know what class was supposed to be used. Vim then cannot check if
|
||||
a member name is correct and you will get an "Using a null object" error,
|
||||
even when the member name is invalid. *E1360*
|
||||
|
||||
|
||||
Default constructor ~
|
||||
|
||||
In case you define a class without a new() method, one will be automatically
|
||||
@@ -528,7 +606,7 @@ constructor methods.
|
||||
|
||||
==============================================================================
|
||||
|
||||
6. Type definition *Vim9-type* *:type*
|
||||
7. Type definition *Vim9-type* *:type*
|
||||
|
||||
A type definition is giving a name to a type specification. For Example: >
|
||||
|
||||
@@ -539,7 +617,7 @@ TODO: more explanation
|
||||
|
||||
==============================================================================
|
||||
|
||||
7. Enum *Vim9-enum* *:enum* *:endenum*
|
||||
8. Enum *Vim9-enum* *:enum* *:endenum*
|
||||
|
||||
An enum is a type that can have one of a list of values. Example: >
|
||||
|
||||
@@ -639,7 +717,7 @@ Some languages support multiple inheritance. Although that can be useful in
|
||||
some cases, it makes the rules of how a class works quite complicated.
|
||||
Instead, using interfaces to declare what is supported is much simpler. The
|
||||
very popular Java language does it this way, and it should be good enough for
|
||||
Vim. The "keep it simple" rule applies here.
|
||||
Vim. The "keep it simple" rule applies here.
|
||||
|
||||
Explicitly declaring that a class supports an interface makes it easy to see
|
||||
what a class is intended for. It also makes it possible to do proper type
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Dec 19
|
||||
" Last Change: 2023 Feb 07
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -371,6 +371,9 @@ au BufNewFile,BufRead *.ch call dist#ft#FTchange()
|
||||
" ChordPro
|
||||
au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro
|
||||
|
||||
" Clangd
|
||||
au BufNewFile,BufRead .clangd setf yaml
|
||||
|
||||
" Clang-format
|
||||
au BufNewFile,BufRead .clang-format setf yaml
|
||||
|
||||
@@ -629,6 +632,9 @@ au BufNewFile,BufRead *.elm setf elm
|
||||
" Elm Filter Rules file
|
||||
au BufNewFile,BufRead filter-rules setf elmfilt
|
||||
|
||||
" Elsa - https://github.com/ucsd-progsys/elsa
|
||||
au BufNewFile,BufRead *.lc setf elsa
|
||||
|
||||
" ESMTP rc file
|
||||
au BufNewFile,BufRead *esmtprc setf esmtprc
|
||||
|
||||
@@ -665,6 +671,9 @@ autocmd BufRead,BufNewFile *.fnl setf fennel
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
|
||||
" FIRRTL - Flexible Internal Representation for RTL
|
||||
au BufNewFile,BufRead *.fir setf firrtl
|
||||
|
||||
" Fish shell
|
||||
au BufNewFile,BufRead *.fish setf fish
|
||||
|
||||
@@ -697,6 +706,9 @@ au BufNewFile,BufRead *.fsl setf framescript
|
||||
" FStab
|
||||
au BufNewFile,BufRead fstab,mtab setf fstab
|
||||
|
||||
" Func
|
||||
au BufNewFile,BufRead *.fc setf func
|
||||
|
||||
" Fusion
|
||||
au BufRead,BufNewFile *.fusion setf fusion
|
||||
|
||||
@@ -853,7 +865,7 @@ au BufNewFile,BufRead *.htpp setf hastepreproc
|
||||
au BufRead,BufNewFile *.hcl setf hcl
|
||||
|
||||
" Go checksum file (must be before *.sum Hercules)
|
||||
au BufNewFile,BufRead go.sum setf gosum
|
||||
au BufNewFile,BufRead go.sum,go.work.sum setf gosum
|
||||
|
||||
" Hercules
|
||||
au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules
|
||||
@@ -1014,11 +1026,11 @@ au BufNewFile,BufRead *.json-patch setf json
|
||||
au BufNewFile,BufRead *.ipynb setf json
|
||||
|
||||
" Other files that look like json
|
||||
au BufNewFile,BufRead .prettierrc,.firebaserc setf json
|
||||
au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc setf json
|
||||
|
||||
" JSONC (JSON with comments)
|
||||
au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc setf jsonc
|
||||
au BufNewFile,BufRead .jshintc,.hintrc,.swrc,[jt]sconfig*.json setf jsonc
|
||||
au BufNewFile,BufRead .jshintrc,.hintrc,.swrc,[jt]sconfig*.json setf jsonc
|
||||
|
||||
" JSON
|
||||
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
|
||||
@@ -1029,6 +1041,9 @@ au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet
|
||||
" Julia
|
||||
au BufNewFile,BufRead *.jl setf julia
|
||||
|
||||
" KDL
|
||||
au BufNewFile,BufRead *.kdl setf kdl
|
||||
|
||||
" Kixtart
|
||||
au BufNewFile,BufRead *.kix setf kix
|
||||
|
||||
@@ -1252,6 +1267,9 @@ au BufNewFile,BufRead *.[mi][3g] setf modula3
|
||||
" Larch/Modula-3
|
||||
au BufNewFile,BufRead *.lm3 setf modula3
|
||||
|
||||
" Modconf
|
||||
au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
|
||||
|
||||
" Monk
|
||||
au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
|
||||
|
||||
@@ -1261,8 +1279,8 @@ au BufNewFile,BufRead *.moo setf moo
|
||||
" Moonscript
|
||||
au BufNewFile,BufRead *.moon setf moonscript
|
||||
|
||||
" Modconf
|
||||
au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
|
||||
" Move language
|
||||
au BufNewFile,BufRead *.move setf move
|
||||
|
||||
" MPD is based on XML
|
||||
au BufNewFile,BufRead *.mpd setf xml
|
||||
@@ -1399,6 +1417,7 @@ au BufNewFile,BufRead pf.conf setf pf
|
||||
" ini style config files, using # comments
|
||||
au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini
|
||||
au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini
|
||||
au BufNewFile,BufRead *.nmconnection setf confini
|
||||
|
||||
" Pacman hooks
|
||||
au BufNewFile,BufRead *.hook
|
||||
@@ -1704,12 +1723,15 @@ au BufNewFile,BufRead *.robot,*.resource setf robot
|
||||
" Robots.txt
|
||||
au BufNewFile,BufRead robots.txt setf robots
|
||||
|
||||
" Rpcgen
|
||||
au BufNewFile,BufRead *.x setf rpcgen
|
||||
" RON (Rusty Object Notation)
|
||||
au BufNewFile,BufRead *.ron setf ron
|
||||
|
||||
" MikroTik RouterOS script
|
||||
au BufRead,BufNewFile *.rsc setf routeros
|
||||
|
||||
" Rpcgen
|
||||
au BufNewFile,BufRead *.x setf rpcgen
|
||||
|
||||
" reStructuredText Documentation Format
|
||||
au BufNewFile,BufRead *.rst setf rst
|
||||
|
||||
@@ -1898,6 +1920,9 @@ au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
|
||||
" SKILL
|
||||
au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
|
||||
|
||||
" Cadence
|
||||
au BufNewFile,BufRead *.cdc setf cdc
|
||||
|
||||
" SLRN
|
||||
au BufNewFile,BufRead .slrnrc setf slrnrc
|
||||
au BufNewFile,BufRead *.score setf slrnsc
|
||||
@@ -1983,6 +2008,9 @@ au BufNewFile,BufRead *.sql call dist#ft#SQL()
|
||||
" SQLJ
|
||||
au BufNewFile,BufRead *.sqlj setf sqlj
|
||||
|
||||
" PRQL
|
||||
au BufNewFile,BufRead *.prql setf prql
|
||||
|
||||
" SQR
|
||||
au BufNewFile,BufRead *.sqr,*.sqi setf sqr
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
" Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org>
|
||||
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
|
||||
" Stefano Zacchiroli <zack@debian.org>
|
||||
" Last Change: 2022 Jul 25
|
||||
" Last Change: 2023 Jan 16
|
||||
" License: Vim License
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debchangelog.vim
|
||||
|
||||
" Bug completion requires apt-listbugs installed for Debian packages or
|
||||
" python-launchpadlib installed for Ubuntu packages
|
||||
@@ -35,14 +35,14 @@ if exists('g:did_changelog_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin (this is global)
|
||||
let g:did_changelog_ftplugin = 1
|
||||
|
||||
" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
|
||||
" <CR> would not be recognized. See ":help 'cpoptions'".
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Don't load another plugin (this is global)
|
||||
let g:did_changelog_ftplugin = 1
|
||||
|
||||
" {{{1 GUI menu
|
||||
|
||||
" Helper functions returning various data.
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: Debian control files
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Pierre Habouzit <madcoder@debian.org>
|
||||
" Last Change: 2018-01-28
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debcontrol.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debcontrol.vim
|
||||
|
||||
" Do these settings once per buffer
|
||||
if exists('b:did_ftplugin')
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: MS-DOS .bat files
|
||||
" Maintainer: Mike Williams <mrw@eandem.co.uk>
|
||||
" Last Change: 7th May 2020
|
||||
" Language: MS-DOS/Windows .bat files
|
||||
" Maintainer: Mike Williams <mrmrdubya@gmail.com>
|
||||
" Last Change: 12th February 2023
|
||||
"
|
||||
" Options Flags:
|
||||
" dosbatch_colons_comment - any value to treat :: as comment line
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -15,8 +18,13 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" BAT comment formatting
|
||||
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
|
||||
setlocal commentstring=::\ %s
|
||||
setlocal comments=b:rem,b:@rem,b:REM,b:@REM
|
||||
if exists("dosbatch_colons_comment")
|
||||
setlocal comments+=:::
|
||||
setlocal commentstring=::\ %s
|
||||
else
|
||||
setlocal commentstring=REM\ %s
|
||||
endif
|
||||
setlocal formatoptions-=t formatoptions+=rol
|
||||
|
||||
" Lookup DOS keywords using Windows command help.
|
||||
|
||||
15
runtime/ftplugin/fish.vim
Normal file
15
runtime/ftplugin/fish.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: fish
|
||||
" Maintainer: Nicholas Boyle (github.com/nickeb96)
|
||||
" Repository: https://github.com/nickeb96/fish.vim
|
||||
" Last Change: February 1, 2023
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal iskeyword=@,48-57,_,192-255,-,.
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions+=crjq
|
||||
@@ -1,9 +1,9 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Logcheck
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Last Change: 2018 Dec 27
|
||||
" Last Change: 2023 Jan 16
|
||||
" License: Vim License
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/logcheck.vim
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/logcheck.vim
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Nov 27
|
||||
" Last Change: 2023 Feb 07
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -99,18 +99,23 @@ if exists("loaded_matchit")
|
||||
" func name
|
||||
" require a parenthesis following, then there can be an "endfunc".
|
||||
let b:match_words =
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' .
|
||||
\ '{:},' .
|
||||
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' .
|
||||
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,'
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' ..
|
||||
\ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\%(w\%[hile]\|fo\%[r]\)\>,' ..
|
||||
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' ..
|
||||
\ '{:},' ..
|
||||
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' ..
|
||||
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' ..
|
||||
\ '\<class\>:\<endclass\>,' ..
|
||||
\ '\<inte\%[rface]\>:\<endinterface\>,' ..
|
||||
\ '\<enu\%[m]\>:\<endenum\>,'
|
||||
|
||||
" Ignore syntax region commands and settings, any 'en*' would clobber
|
||||
" if-endif.
|
||||
" - set spl=de,en
|
||||
" - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
|
||||
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
|
||||
\ =~? "comment\\|string\\|vimLetHereDoc\\|vimSynReg\\|vimSet"'
|
||||
" Also ignore here-doc and dictionary keys (vimVar).
|
||||
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||
\ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"'
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
82
runtime/indent/fish.vim
Normal file
82
runtime/indent/fish.vim
Normal file
@@ -0,0 +1,82 @@
|
||||
" Vim indent file
|
||||
" Language: fish
|
||||
" Maintainer: Nicholas Boyle (github.com/nickeb96)
|
||||
" Repository: https://github.com/nickeb96/fish.vim
|
||||
" Last Change: February 4, 2023
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetFishIndent(v:lnum)
|
||||
setlocal indentkeys+==end,=else,=case
|
||||
|
||||
function s:PrevCmdStart(linenum)
|
||||
let l:linenum = a:linenum
|
||||
" look for the first line that isn't a line continuation
|
||||
while l:linenum > 1 && getline(l:linenum - 1) =~# '\\$'
|
||||
let l:linenum = l:linenum - 1
|
||||
endwhile
|
||||
return l:linenum
|
||||
endfunction
|
||||
|
||||
function GetFishIndent(lnum)
|
||||
let l:shiftwidth = shiftwidth()
|
||||
|
||||
let l:prevlnum = prevnonblank(a:lnum - 1)
|
||||
if l:prevlnum ==# 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" if the previous line ended with a line continuation
|
||||
if getline(a:lnum - 1) =~# '\\$'
|
||||
if a:lnum ==# 0 || getline(a:lnum - 2) !~# '\\$'
|
||||
" this is the first line continuation in a chain, so indent it
|
||||
return indent(a:lnum - 1) + l:shiftwidth
|
||||
else
|
||||
" use the same indentation as the previous continued line
|
||||
return indent(a:lnum - 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:prevlnum = s:PrevCmdStart(l:prevlnum)
|
||||
|
||||
let l:prevline = getline(l:prevlnum)
|
||||
if l:prevline =~# '^\s*\(begin\|if\|else\|while\|for\|function\|case\|switch\)\>'
|
||||
let l:indent = l:shiftwidth
|
||||
else
|
||||
let l:indent = 0
|
||||
endif
|
||||
|
||||
let l:line = getline(a:lnum)
|
||||
if l:line =~# '^\s*end\>'
|
||||
" find end's matching start
|
||||
let l:depth = 1
|
||||
let l:currentlnum = a:lnum
|
||||
while l:depth > 0 && l:currentlnum > 0
|
||||
let l:currentlnum = s:PrevCmdStart(prevnonblank(l:currentlnum - 1))
|
||||
let l:currentline = getline(l:currentlnum)
|
||||
if l:currentline =~# '^\s*end\>'
|
||||
let l:depth = l:depth + 1
|
||||
elseif l:currentline =~# '^\s*\(begin\|if\|while\|for\|function\|switch\)\>'
|
||||
let l:depth = l:depth - 1
|
||||
endif
|
||||
endwhile
|
||||
if l:currentline =~# '^\s*switch\>'
|
||||
return indent(l:currentlnum)
|
||||
else
|
||||
return indent(l:prevlnum) + l:indent - l:shiftwidth
|
||||
endif
|
||||
elseif l:line =~# '^\s*else\>'
|
||||
return indent(l:prevlnum) + l:indent - l:shiftwidth
|
||||
elseif l:line =~# '^\s*case\>'
|
||||
if getline(l:prevlnum) =~# '^\s*switch\>'
|
||||
return indent(l:prevlnum) + l:indent
|
||||
else
|
||||
return indent(l:prevlnum) + l:indent - l:shiftwidth
|
||||
endif
|
||||
else
|
||||
return indent(l:prevlnum) + l:indent
|
||||
endif
|
||||
endfunction
|
||||
@@ -887,3 +887,55 @@ if true
|
||||
elseif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if (
|
||||
true)
|
||||
&& true
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
abstract class Shape
|
||||
this.color = Color.Black
|
||||
this.thickness = 10
|
||||
endclass
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
static def ClearTotalSize(): number
|
||||
var prev = totalSize
|
||||
totalSize = 0
|
||||
return prev
|
||||
enddef
|
||||
endclass
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
interface HasSurface
|
||||
this.size: number
|
||||
def Surface(): number
|
||||
endinterface
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
interface EnterExit
|
||||
def Enter(): void
|
||||
def Exit(): void
|
||||
endinterface
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
enum Color
|
||||
White
|
||||
Red
|
||||
Green
|
||||
Blue
|
||||
Black
|
||||
endenum
|
||||
" END_INDENT
|
||||
|
||||
@@ -887,3 +887,55 @@ if true
|
||||
elseif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if (
|
||||
true)
|
||||
&& true
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
abstract class Shape
|
||||
this.color = Color.Black
|
||||
this.thickness = 10
|
||||
endclass
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
|
||||
static def ClearTotalSize(): number
|
||||
var prev = totalSize
|
||||
totalSize = 0
|
||||
return prev
|
||||
enddef
|
||||
endclass
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
interface HasSurface
|
||||
this.size: number
|
||||
def Surface(): number
|
||||
endinterface
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
interface EnterExit
|
||||
def Enter(): void
|
||||
def Exit(): void
|
||||
endinterface
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
enum Color
|
||||
White
|
||||
Red
|
||||
Green
|
||||
Blue
|
||||
Black
|
||||
endenum
|
||||
" END_INDENT
|
||||
|
||||
@@ -3,7 +3,7 @@ vim9script
|
||||
# Vim indent file
|
||||
# Language: Vim script
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Oct 5
|
||||
# Last Change: 2023 Feb 02
|
||||
|
||||
# Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -16,7 +16,7 @@ b:undo_indent = 'setlocal indentkeys< indentexpr<'
|
||||
import autoload '../autoload/dist/vimindent.vim'
|
||||
|
||||
setlocal indentexpr=vimindent.Expr()
|
||||
setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=},=else,=cat,=finall,=END,0\\
|
||||
setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=endclass,=endinterface,=endenum,=},=else,=cat,=finall,=END,0\\
|
||||
execute('setlocal indentkeys+=0=\"\\\ ,0=#\\\ ')
|
||||
setlocal indentkeys-=0#
|
||||
setlocal indentkeys-=:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for converting a syntax highlighted file to HTML.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2019 Nov 13
|
||||
" Last Change: 2023 Jan 01
|
||||
"
|
||||
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
|
||||
" $VIMRUNTIME/syntax/2html.vim
|
||||
@@ -8,11 +8,23 @@
|
||||
if exists('g:loaded_2html_plugin')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_2html_plugin = 'vim8.1_v2'
|
||||
let g:loaded_2html_plugin = 'vim9.0_v1'
|
||||
|
||||
"
|
||||
" Changelog: {{{
|
||||
" 8.1_v2 (this version): - Fix Bitbucket issue #19: fix calculation of tab
|
||||
" 9.0_v1 (this version): - Implement g:html_no_doc and g:html_no_modeline
|
||||
" for diff mode. Add tests.
|
||||
" (Vim 9.0.1122): NOTE: no version string update for this version!
|
||||
" - Bugfix for variable name in g:html_no_doc
|
||||
" (Vim 9.0.0819): NOTE: no version string update for this version!
|
||||
" - Add options g:html_no_doc, g:html_no_lines,
|
||||
" and g:html_no_modeline (partially included in Vim
|
||||
" runtime prior to version string update).
|
||||
" - Updates for new Vim9 string append style (i.e. use
|
||||
" ".." instead of ".")
|
||||
"
|
||||
" 8.1 updates: {{{
|
||||
" 8.1_v2 (Vim 8.1.2312): - Fix SourceForge issue #19: fix calculation of tab
|
||||
" stop position to use in expanding a tab, when that
|
||||
" tab occurs after a syntax match which in turn
|
||||
" comes after previously expanded tabs.
|
||||
@@ -20,17 +32,17 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
|
||||
" destination file to ignore FileType events;
|
||||
" speeds up processing when the destination file
|
||||
" already exists and HTML highlight takes too long.
|
||||
" - Fix Bitbucket issue #20: progress bar could not be
|
||||
" - Fix SourceForge issue #20: progress bar could not be
|
||||
" seen when DiffDelete background color matched
|
||||
" StatusLine background color. Added TOhtmlProgress
|
||||
" highlight group for manual user override, but
|
||||
" calculate it to be visible compared to StatusLine
|
||||
" by default.
|
||||
" - Fix Bitbucket issue #1: Remove workaround for old
|
||||
" - Fix SourceForge issue #1: Remove workaround for old
|
||||
" browsers which don't support 'ch' CSS unit, since
|
||||
" all modern browsers, including IE>=9, support it.
|
||||
" - Fix Bitbucket issue #10: support termguicolors
|
||||
" - Fix Bitbucket issue #21: default to using
|
||||
" - Fix SourceForge issue #10: support termguicolors
|
||||
" - Fix SourceForge issue #21: default to using
|
||||
" generated content instead of <input> tags for
|
||||
" uncopyable text, so that text is correctly
|
||||
" prevented from being copied in chrome. Use
|
||||
@@ -41,13 +53,14 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
|
||||
" - Fix fallback sizing of <input> tags for browsers
|
||||
" without "ch" support.
|
||||
" - Fix cursor on unselectable diff filler text.
|
||||
" 8.1_v1 (Vim 8.1.0528): - Fix Bitbucket issue #6: Don't generate empty
|
||||
" 8.1_v1 (Vim 8.1.0528): - Fix SourceForge issue #6: Don't generate empty
|
||||
" script tag.
|
||||
" - Fix Bitbucket issue #5: javascript should
|
||||
" - Fix SourceForge issue #5: javascript should
|
||||
" declare variables with "var".
|
||||
" - Fix Bitbucket issue #13: errors thrown sourcing
|
||||
" - Fix SourceForge issue #13: errors thrown sourcing
|
||||
" 2html.vim directly when plugins not loaded.
|
||||
" - Fix Bitbucket issue #16: support 'vartabstop'.
|
||||
" - Fix SourceForge issue #16: support 'vartabstop'.
|
||||
"}}}
|
||||
"
|
||||
" 7.4 updates: {{{
|
||||
" 7.4_v2 (Vim 7.4.0899): Fix error raised when converting a diff containing
|
||||
@@ -152,7 +165,7 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
|
||||
|
||||
" TODO: {{{
|
||||
" * Check the issue tracker:
|
||||
" https://bitbucket.org/fritzophrenic/vim-tohtml/issues?status=new&status=open
|
||||
" https://sourceforge.net/p/vim-tohtml/issues/search/?q=%21status%3Aclosed
|
||||
" * Options for generating the CSS in external style sheets. New :TOcss
|
||||
" command to convert the current color scheme into a (mostly) generic CSS
|
||||
" stylesheet which can be re-used. Alternate stylesheet support? Good start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax support file
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2022 Dec 26
|
||||
" Last Change: 2023 Jan 01
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: automake Makefile.am
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: John Williams <jrw@pobox.com>
|
||||
" Last Change: 2018 Dec 27
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/automake.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/automake.vim
|
||||
"
|
||||
" XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain
|
||||
" it only because patches have been submitted for it by Debian users and the
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2022 Oct 29
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debchangelog.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
if exists('b:current_syntax')
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2022 May 11
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcontrol.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
if exists('b:current_syntax')
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Debian copyright file
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Last Change: 2019 Sep 07
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcopyright.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcopyright.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
if exists('b:current_syntax')
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2022 Oct 29
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
|
||||
" Last Change: 2023 Feb 06
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
if exists('b:current_syntax')
|
||||
@@ -14,7 +14,9 @@ endif
|
||||
syn case match
|
||||
|
||||
" A bunch of useful keywords
|
||||
syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
|
||||
syn match debsourcesType /\(deb-src\|deb\)/
|
||||
syn match debsourcesFreeComponent /\(main\|universe\)/
|
||||
syn match debsourcesNonFreeComponent /\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)/
|
||||
|
||||
" Match comments
|
||||
syn match debsourcesComment /#.*/ contains=@Spell
|
||||
@@ -48,7 +50,9 @@ exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join
|
||||
|
||||
" Associate our matches and regions with pretty colours
|
||||
hi def link debsourcesLine Error
|
||||
hi def link debsourcesKeyword Statement
|
||||
hi def link debsourcesType Statement
|
||||
hi def link debsourcesFreeComponent Statement
|
||||
hi def link debsourcesNonFreeComponent Statement
|
||||
hi def link debsourcesDistrKeyword Type
|
||||
hi def link debsourcesUnsupportedDistrKeyword WarningMsg
|
||||
hi def link debsourcesComment Comment
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Debian DEP3 Patch headers
|
||||
" Maintainer: Gabriel Filion <gabster@lelutin.ca>
|
||||
" Last Change: 2022 Apr 06
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/dep3patch.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/dep3patch.vim
|
||||
"
|
||||
" Specification of the DEP3 patch header format is available at:
|
||||
" https://dep-team.pages.debian.net/deps/dep3/
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
" Vim syntax file
|
||||
" Language: MS-DOS batch file (with NT command extensions)
|
||||
" Maintainer: Mike Williams <mrw@eandem.co.uk>
|
||||
" Language: MS-DOS/Windows batch file (with NT command extensions)
|
||||
" Maintainer: Mike Williams <mrmrdubya@gmail.com>
|
||||
" Filenames: *.bat
|
||||
" Last Change: 6th September 2009
|
||||
" Web Page: http://www.eandem.co.uk/mrw/vim
|
||||
" Last Change: 12th February 2023
|
||||
"
|
||||
" Options Flags:
|
||||
" dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default]
|
||||
" dosbatch_colons_comment - any value to treat :: as comment line
|
||||
"
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
@@ -92,7 +92,11 @@ syn match dosbatchComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,dosbatchS
|
||||
syn match dosbatchComment "^@rem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
syn match dosbatchComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
syn match dosbatchComment "\s@rem\($\|\s.*$\)"lc=5 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
if exists("dosbatch_colons_comment")
|
||||
syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
else
|
||||
syn match dosbatchError "\s*:\s*:.*$"
|
||||
endif
|
||||
|
||||
" Comments in ()'s - still to handle spaces before rem
|
||||
syn match dosbatchComment "(rem\([^)]\|\^\@<=)\)*"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell
|
||||
@@ -110,34 +114,35 @@ syn keyword dosbatchImplicit vol xcopy
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link dosbatchTodo Todo
|
||||
hi def link dosbatchTodo Todo
|
||||
hi def link dosbatchError Error
|
||||
|
||||
hi def link dosbatchStatement Statement
|
||||
hi def link dosbatchCommands dosbatchStatement
|
||||
hi def link dosbatchLabel Label
|
||||
hi def link dosbatchLabel Label
|
||||
hi def link dosbatchConditional Conditional
|
||||
hi def link dosbatchRepeat Repeat
|
||||
hi def link dosbatchRepeat Repeat
|
||||
|
||||
hi def link dosbatchOperator Operator
|
||||
hi def link dosbatchEchoOperator dosbatchOperator
|
||||
hi def link dosbatchIfOperator dosbatchOperator
|
||||
hi def link dosbatchOperator Operator
|
||||
hi def link dosbatchEchoOperator dosbatchOperator
|
||||
hi def link dosbatchIfOperator dosbatchOperator
|
||||
|
||||
hi def link dosbatchArgument Identifier
|
||||
hi def link dosbatchIdentifier Identifier
|
||||
hi def link dosbatchIdentifier Identifier
|
||||
hi def link dosbatchVariable dosbatchIdentifier
|
||||
|
||||
hi def link dosbatchSpecialChar SpecialChar
|
||||
hi def link dosbatchString String
|
||||
hi def link dosbatchNumber Number
|
||||
hi def link dosbatchString String
|
||||
hi def link dosbatchNumber Number
|
||||
hi def link dosbatchInteger dosbatchNumber
|
||||
hi def link dosbatchHex dosbatchNumber
|
||||
hi def link dosbatchBinary dosbatchNumber
|
||||
hi def link dosbatchOctal dosbatchNumber
|
||||
hi def link dosbatchBinary dosbatchNumber
|
||||
hi def link dosbatchOctal dosbatchNumber
|
||||
|
||||
hi def link dosbatchComment Comment
|
||||
hi def link dosbatchImplicit Function
|
||||
|
||||
hi def link dosbatchSwitch Special
|
||||
hi def link dosbatchSwitch Special
|
||||
|
||||
hi def link dosbatchCmd PreProc
|
||||
|
||||
|
||||
225
runtime/syntax/fish.vim
Normal file
225
runtime/syntax/fish.vim
Normal file
@@ -0,0 +1,225 @@
|
||||
" Vim syntax file
|
||||
" Language: fish
|
||||
" Maintainer: Nicholas Boyle (github.com/nickeb96)
|
||||
" Repository: https://github.com/nickeb96/fish.vim
|
||||
" Last Change: February 1, 2023
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
" Statements
|
||||
syn cluster fishStatement contains=fishKeywordAndOr,fishNot,fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand,fishVariable
|
||||
|
||||
syn keyword fishKeywordAndOr and or nextgroup=fishNot,fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand
|
||||
hi def link fishKeywordAndOr fishOperator
|
||||
|
||||
syn keyword fishNot not skipwhite nextgroup=fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand
|
||||
syn match fishNot /!/ skipwhite nextgroup=fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand
|
||||
hi def link fishNot fishOperator
|
||||
|
||||
syn keyword fishSelectStatement command builtin skipwhite nextgroup=fishKeyword,fishKeywordIf,fishCommand,fishOption
|
||||
hi def link fishSelectStatement fishKeyword
|
||||
|
||||
syn keyword fishKeyword end skipwhite nextgroup=@fishTerminator
|
||||
|
||||
syn keyword fishKeywordIf if skipwhite nextgroup=@fishStatement
|
||||
syn keyword fishKeyword else skipwhite nextgroup=fishKeywordIf,fishSemicolon
|
||||
hi def link fishKeywordIf fishKeyword
|
||||
|
||||
syn keyword fishKeyword switch skipwhite nextgroup=@fishArgument
|
||||
syn keyword fishKeyword case skipwhite nextgroup=@fishArgument
|
||||
|
||||
syn keyword fishKeyword while skipwhite nextgroup=@fishStatement
|
||||
|
||||
syn keyword fishKeyword for skipwhite nextgroup=fishForVariable
|
||||
syn match fishForVariable /[[:alnum:]_]\+/ contained skipwhite nextgroup=fishKeywordIn
|
||||
syn keyword fishKeywordIn in contained skipwhite nextgroup=@fishArgument
|
||||
hi def link fishForVariable fishParameter
|
||||
hi def link fishKeywordIn fishKeyword
|
||||
|
||||
syn keyword fishKeyword _ abbr argparse begin bg bind block break breakpoint cd commandline
|
||||
\ complete continue count disown echo emit eval exec exit false fg function functions
|
||||
\ history jobs math printf pwd random read realpath return set set_color source status
|
||||
\ string test time true type ulimit wait
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
syn match fishKeyword /\<contains\>/ skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishCommand /[[:alnum:]_\/[][[:alnum:]+._-]*/ skipwhite nextgroup=@fishNext
|
||||
|
||||
|
||||
" Internally Nested Arguments
|
||||
|
||||
syn cluster fishSubscriptArgs contains=fishInnerVariable,fishIndexNum,fishIndexRange,fishInnerCommandSub
|
||||
|
||||
syn match fishInnerVariable /\$\+[[:alnum:]_]\+/ contained
|
||||
syn match fishInnerVariable /\$\+[[:alnum:]_]\+\[/me=e-1,he=e-1 contained nextgroup=fishInnerSubscript
|
||||
hi def link fishInnerVariable fishVariable
|
||||
|
||||
syn region fishInnerSubscript matchgroup=fishVariable start=/\[/ end=/]/ contained
|
||||
\ keepend contains=@fishSubscriptArgs
|
||||
hi def link fishInnerSubscript fishSubscript
|
||||
|
||||
syn match fishIndexNum /[+-]?[[:digit:]]\+/ contained
|
||||
hi def link fishIndexNum fishParameter
|
||||
|
||||
syn match fishIndexRange /\.\./ contained
|
||||
hi def link fishIndexRange fishParameter
|
||||
|
||||
syn region fishInnerCommandSub matchgroup=fishOperator start=/(/ start=/\$(/ end=/)/ contained
|
||||
\ contains=@fishStatement
|
||||
hi def link fishInnerCommandSub fishCommandSub
|
||||
|
||||
syn region fishQuotedCommandSub matchgroup=fishOperator start=/\$(/ end=/)/ contained
|
||||
\ contains=@fishStatement
|
||||
hi def link fishQuotedCommandSub fishCommandSub
|
||||
|
||||
syn match fishBraceExpansionComma /,/ contained
|
||||
hi def link fishBraceExpansionComma fishOperator
|
||||
|
||||
syn match fishBracedParameter '[[:alnum:]\u5b\u5d@:=+.%/!_-]\+' contained contains=fishInnerPathGlob
|
||||
hi def link fishBracedParameter fishParameter
|
||||
|
||||
syn region fishBracedQuote start=/'/ skip=/\\'/ end=/'/ contained
|
||||
\ contains=fishEscapedEscape,fishEscapedSQuote
|
||||
syn region fishBracedQuote start=/"/ skip=/\\"/ end=/"/ contained
|
||||
\ contains=fishEscapedEscape,fishEscapedDQuote,fishEscapedDollar,fishInnerVariable,fishInnerCommandSub
|
||||
hi def link fishBracedQuote fishQuote
|
||||
|
||||
|
||||
" Arguments
|
||||
|
||||
syn cluster fishArgument contains=fishParameter,fishOption,fishVariable,fishPathGlob,fishBraceExpansion,fishQuote,fishCharacter,fishCommandSub,fishRedirection,fishSelfPid
|
||||
|
||||
syn match fishParameter '[[:alnum:]\u5b\u5d@:=+.,%/!_-]\+' contained skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishOption /-[[:alnum:]=_-]*/ contained skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishPathGlob /\(\~\|*\|?\)/ contained skipwhite nextgroup=@fishNext
|
||||
|
||||
syn region fishBraceExpansion matchgroup=fishOperator start=/{/ end=/}/ contained
|
||||
\ contains=fishBraceExpansionComma,fishInnerVariable,fishInnerCommandSub,fishBracedParameter,fishBracedQuote
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishVariable /\$\+[[:alnum:]_]\+/ skipwhite nextgroup=@fishNext
|
||||
syn match fishVariable /\$\+[[:alnum:]_]\+\[/me=e-1,he=e-1 nextgroup=fishSubscript
|
||||
|
||||
syn region fishSubscript matchgroup=fishVariable start=/\[/ end=/]/ contained
|
||||
\ keepend contains=@fishSubscriptArgs
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
|
||||
syn region fishCommandSub matchgroup=fishOperator start=/(/ start=/\$(/ end=/)/ contained
|
||||
\ contains=@fishStatement
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
|
||||
syn region fishQuote start=/'/ skip=/\\'/ end=/'/ contained
|
||||
\ contains=fishEscapedEscape,fishEscapedSQuote
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
syn region fishQuote start=/"/ skip=/\\"/ end=/"/ contained
|
||||
\ contains=fishEscapedEscape,fishEscapedDQuote,fishEscapedDollar,fishInnerVariable,fishQuotedCommandSub
|
||||
\ skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishEscapedEscape /\\\\/ contained
|
||||
syn match fishEscapedSQuote /\\'/ contained
|
||||
syn match fishEscapedDQuote /\\"/ contained
|
||||
syn match fishEscapedDollar /\\\$/ contained
|
||||
hi def link fishEscapedEscape fishCharacter
|
||||
hi def link fishEscapedSQuote fishCharacter
|
||||
hi def link fishEscapedDQuote fishCharacter
|
||||
hi def link fishEscapedDollar fishCharacter
|
||||
|
||||
syn match fishCharacter /\\[0-7]\{1,3}/ contained skipwhite nextgroup=@fishNext
|
||||
syn match fishCharacter /\\u[0-9a-fA-F]\{4}/ contained skipwhite nextgroup=@fishNext
|
||||
syn match fishCharacter /\\U[0-9a-fA-F]\{8}/ contained skipwhite nextgroup=@fishNext
|
||||
syn match fishCharacter /\\x[0-7][0-9a-fA-F]\|\\x[0-9a-fA-F]/ contained skipwhite nextgroup=@fishNext
|
||||
syn match fishCharacter /\\X[0-9a-fA-F]\{1,2}/ contained skipwhite nextgroup=@fishNext
|
||||
syn match fishCharacter /\\[abcefnrtv[\](){}<>\\*?~%#$|&;'" ]/ contained skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishRedirection /</ contained skipwhite nextgroup=fishRedirectionTarget
|
||||
syn match fishRedirection /[0-9&]\?>[>?]\?/ contained skipwhite nextgroup=fishRedirectionTarget
|
||||
syn match fishRedirection /[0-9&]\?>&[0-9-]/ contained skipwhite nextgroup=@fishNext
|
||||
|
||||
syn match fishRedirectionTarget /[[:alnum:]$~*?{,}"'\/._-]\+/ contained contains=fishInnerVariable skipwhite nextgroup=@fishNext
|
||||
hi def link fishRedirectionTarget fishRedirection
|
||||
|
||||
syn match fishSelfPid /%self\>/ contained nextgroup=@fishNext
|
||||
hi def link fishSelfPid fishOperator
|
||||
|
||||
|
||||
" Terminators
|
||||
|
||||
syn cluster fishTerminator contains=fishPipe,fishBackgroundJob,fishSemicolon,fishSymbolicAndOr
|
||||
|
||||
syn match fishPipe /\(1>\|2>\|&\)\?|/ contained skipwhite nextgroup=@fishStatement
|
||||
hi def link fishPipe fishEnd
|
||||
|
||||
syn match fishBackgroundJob /&$/ contained skipwhite nextgroup=@fishStatement
|
||||
syn match fishBackgroundJob /&[^<>&|]/me=s+1,he=s+1 contained skipwhite nextgroup=@fishStatement
|
||||
hi def link fishBackgroundJob fishEnd
|
||||
|
||||
syn match fishSemicolon /;/ skipwhite nextgroup=@fishStatement
|
||||
hi def link fishSemicolon fishEnd
|
||||
|
||||
syn match fishSymbolicAndOr /\(&&\|||\)/ contained skipwhite skipempty nextgroup=@fishStatement
|
||||
hi def link fishSymbolicAndOr fishOperator
|
||||
|
||||
|
||||
" Other
|
||||
|
||||
syn cluster fishNext contains=fishEscapedNl,@fishArgument,@fishTerminator
|
||||
|
||||
syn match fishEscapedNl /\\$/ skipnl skipwhite contained nextgroup=@fishNext
|
||||
|
||||
syn match fishComment /#.*/ contains=fishTodo,@Spell
|
||||
|
||||
syn keyword fishTodo TODO contained
|
||||
|
||||
|
||||
|
||||
syn sync minlines=200
|
||||
syn sync maxlines=300
|
||||
|
||||
|
||||
" Intermediate highlight groups matching $fish_color_* variables
|
||||
|
||||
hi def link fishCommand fish_color_command
|
||||
hi def link fishComment fish_color_comment
|
||||
hi def link fishEnd fish_color_end
|
||||
hi def link fishCharacter fish_color_escape
|
||||
hi def link fishKeyword fish_color_keyword
|
||||
hi def link fishEscapedNl fish_color_normal
|
||||
hi def link fishOperator fish_color_operator
|
||||
hi def link fishVariable fish_color_operator
|
||||
hi def link fishInnerVariable fish_color_operator
|
||||
hi def link fishPathGlob fish_color_operator
|
||||
hi def link fishOption fish_color_option
|
||||
hi def link fishParameter fish_color_param
|
||||
hi def link fishQuote fish_color_quote
|
||||
hi def link fishRedirection fish_color_redirection
|
||||
|
||||
|
||||
" Default highlight groups
|
||||
|
||||
hi def link fish_color_param Normal
|
||||
hi def link fish_color_normal Normal
|
||||
hi def link fish_color_option Normal
|
||||
hi def link fish_color_command Function
|
||||
hi def link fish_color_keyword Keyword
|
||||
hi def link fish_color_end Delimiter
|
||||
hi def link fish_color_operator Operator
|
||||
hi def link fish_color_redirection Type
|
||||
hi def link fish_color_quote String
|
||||
hi def link fish_color_escape Character
|
||||
hi def link fish_color_comment Comment
|
||||
|
||||
hi def link fishTodo Todo
|
||||
|
||||
|
||||
let b:current_syntax = 'fish'
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: FORTH
|
||||
" Current Maintainer: Johan Kotlinski <kotlinski@gmail.com>
|
||||
" Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Last Change: 2018-03-29
|
||||
" Previous Maintainer: Christian V. J. Br<EFBFBD>ssow <cvjb@cvjb.de>
|
||||
" Last Change: 2023-01-12
|
||||
" Filenames: *.fs,*.ft
|
||||
" URL: https://github.com/jkotlinski/forth.vim
|
||||
|
||||
@@ -23,7 +23,6 @@ syn case ignore
|
||||
|
||||
" Some special, non-FORTH keywords
|
||||
syn keyword forthTodo contained TODO FIXME XXX
|
||||
syn match forthTodo contained 'Copyright\(\s([Cc])\)\=\(\s[0-9]\{2,4}\)\='
|
||||
|
||||
" Characters allowed in keywords
|
||||
" I don't know if 128-255 are allowed in ANS-FORTH
|
||||
@@ -98,13 +97,16 @@ syn keyword forthEndOfColonDef ; ;M ;m
|
||||
syn keyword forthEndOfClassDef ;class
|
||||
syn keyword forthEndOfObjectDef ;object
|
||||
syn keyword forthDefine CONSTANT 2CONSTANT FCONSTANT VARIABLE 2VARIABLE
|
||||
syn keyword forthDefine FVARIABLE CREATE USER VALUE TO DEFER IS DOES> IMMEDIATE
|
||||
syn keyword forthDefine FVARIABLE CREATE USER VALUE TO DEFER IS <BUILDS DOES> IMMEDIATE
|
||||
syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE
|
||||
syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION>
|
||||
syn keyword forthDefine <INTERPRETATION COMPILATION> <COMPILATION ] LASTXT
|
||||
syn keyword forthDefine COMP' POSTPONE, FIND-NAME NAME>INT NAME?INT NAME>COMP
|
||||
syn keyword forthDefine NAME>STRING STATE C; CVARIABLE BUFFER: MARKER
|
||||
syn keyword forthDefine , 2, F, C, COMPILE,
|
||||
syn match forthDefine "\[DEFINED]"
|
||||
syn match forthDefine "\[UNDEFINED]"
|
||||
syn match forthDefine "\[IF]"
|
||||
syn match forthDefine "\[IFDEF]"
|
||||
syn match forthDefine "\[IFUNDEF]"
|
||||
syn match forthDefine "\[THEN]"
|
||||
@@ -180,6 +182,7 @@ syn keyword forthBlocks BLOCK-INCLUDED BLK
|
||||
syn keyword forthMath DECIMAL HEX BASE
|
||||
syn match forthInteger '\<-\=[0-9]\+.\=\>'
|
||||
syn match forthInteger '\<&-\=[0-9]\+.\=\>'
|
||||
syn match forthInteger '\<#-\=[0-9]\+.\=\>'
|
||||
" recognize hex and binary numbers, the '$' and '%' notation is for gforth
|
||||
syn match forthInteger '\<\$\x*\x\+\>' " *1* --- don't mess
|
||||
syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order!
|
||||
@@ -192,18 +195,18 @@ syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>'
|
||||
syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo
|
||||
|
||||
" Strings
|
||||
syn region forthString start=+\.*\"+ end=+"+ end=+$+
|
||||
syn region forthString start=+\.*\"+ end=+"+ end=+$+ contains=@Spell
|
||||
" XXX
|
||||
syn region forthString start=+s\"+ end=+"+ end=+$+
|
||||
syn region forthString start=+s\\\"+ end=+"+ end=+$+
|
||||
syn region forthString start=+c\"+ end=+"+ end=+$+
|
||||
syn region forthString start=+s\"+ end=+"+ end=+$+ contains=@Spell
|
||||
syn region forthString start=+s\\\"+ end=+"+ end=+$+ contains=@Spell
|
||||
syn region forthString start=+c\"+ end=+"+ end=+$+ contains=@Spell
|
||||
|
||||
" Comments
|
||||
syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError
|
||||
syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError
|
||||
syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError
|
||||
syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError
|
||||
syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError
|
||||
syn match forthComment '\\\%(\s.*\)\=$' contains=@Spell,forthTodo,forthSpaceError
|
||||
syn region forthComment start='\\S\s' end='.*' contains=@Spell,forthTodo,forthSpaceError
|
||||
syn match forthComment '\.(\s[^)]*)' contains=@Spell,forthTodo,forthSpaceError
|
||||
syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=@Spell,forthTodo,forthSpaceError
|
||||
syn region forthComment start='/\*' end='\*/' contains=@Spell,forthTodo,forthSpaceError
|
||||
|
||||
" Include files
|
||||
syn match forthInclude '^INCLUDE\s\+\k\+'
|
||||
@@ -260,3 +263,4 @@ let b:current_syntax = "forth"
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim:ts=8:sw=4:nocindent:smartindent:
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: fstab file
|
||||
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
|
||||
" URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim
|
||||
" Last Change: 2022 Dec 11
|
||||
" Version: 1.6.2
|
||||
" Last Change: 2023 Feb 19
|
||||
" Version: 1.6.3
|
||||
"
|
||||
" Credits:
|
||||
" David Necas (Yeti) <yeti@physics.muni.cz>
|
||||
@@ -389,7 +389,7 @@ syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained
|
||||
syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster
|
||||
syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained
|
||||
syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained
|
||||
syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
|
||||
syn match fsOptions /\s\+.\{-}\%(\s\|$\)/ nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
|
||||
syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
|
||||
|
||||
" Whole line comments
|
||||
@@ -491,4 +491,4 @@ let b:current_syntax = "fstab"
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8 ft=vim
|
||||
" vim: ts=8 noet ft=vim
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
" go.vim: Vim syntax file for Go.
|
||||
" Language: Go
|
||||
" Maintainer: Billie Cleek <bhcleek@gmail.com>
|
||||
" Latest Revision: 2022-11-17
|
||||
" Latest Revision: 2023-02-19
|
||||
" License: BSD-style. See LICENSE file in source repository.
|
||||
" Repository: https://github.com/fatih/vim-go
|
||||
|
||||
@@ -136,8 +136,11 @@ syn keyword goBoolean true false
|
||||
syn keyword goPredefinedIdentifiers nil iota
|
||||
|
||||
hi def link goBuiltins Identifier
|
||||
hi def link goPredefinedIdentifiers Constant
|
||||
" Boolean links to Constant by default by vim: goBoolean and goPredefinedIdentifiers
|
||||
" will be highlighted the same, but having the separate groups allows users to
|
||||
" have separate highlighting for them if they desire.
|
||||
hi def link goBoolean Boolean
|
||||
hi def link goPredefinedIdentifiers goBoolean
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained TODO FIXME XXX BUG
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: gpg(1) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2010-10-14
|
||||
" Language: gpg(1) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2010-10-14
|
||||
" Updated: 2023-01-23 @ObserverOfTime: added a couple of keywords
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -12,91 +13,92 @@ set cpo&vim
|
||||
|
||||
setlocal iskeyword+=-
|
||||
|
||||
syn keyword gpgTodo contained FIXME TODO XXX NOTE
|
||||
syn keyword gpgTodo contained FIXME TODO XXX NOTE
|
||||
|
||||
syn region gpgComment contained display oneline start='#' end='$'
|
||||
\ contains=gpgTodo,gpgID,@Spell
|
||||
syn region gpgComment contained display oneline start='#' end='$'
|
||||
\ contains=gpgTodo,gpgID,@Spell
|
||||
|
||||
syn match gpgID contained display '\<\(0x\)\=\x\{8,}\>'
|
||||
syn match gpgID contained display '\<\(0x\)\=\x\{8,}\>'
|
||||
|
||||
syn match gpgBegin display '^' skipwhite nextgroup=gpgComment,gpgOption,gpgCommand
|
||||
syn match gpgBegin display '^' skipwhite nextgroup=gpgComment,gpgOption,gpgCommand
|
||||
|
||||
syn keyword gpgCommand contained skipwhite nextgroup=gpgArg
|
||||
\ check-sigs decrypt decrypt-files delete-key
|
||||
\ delete-secret-and-public-key delete-secret-key
|
||||
\ edit-key encrypt-files export export-all
|
||||
\ export-ownertrust export-secret-keys
|
||||
\ export-secret-subkeys fast-import fingerprint
|
||||
\ gen-prime gen-random import import-ownertrust
|
||||
\ list-keys list-public-keys list-secret-keys
|
||||
\ list-sigs lsign-key nrsign-key print-md print-mds
|
||||
\ recv-keys search-keys send-keys sign-key verify
|
||||
\ verify-files
|
||||
syn keyword gpgCommand contained skipwhite nextgroup=gpgArgError
|
||||
\ check-trustdb clearsign desig-revoke detach-sign
|
||||
\ encrypt gen-key gen-revoke help list-packets
|
||||
\ rebuild-keydb-caches sign store symmetric
|
||||
\ update-trustdb version warranty
|
||||
syn keyword gpgCommand contained skipwhite nextgroup=gpgArg
|
||||
\ check-sigs decrypt decrypt-files delete-key
|
||||
\ delete-secret-and-public-key delete-secret-key
|
||||
\ edit-key encrypt-files export export-all
|
||||
\ export-ownertrust export-secret-keys
|
||||
\ export-secret-subkeys fast-import fingerprint
|
||||
\ gen-prime gen-random import import-ownertrust
|
||||
\ list-keys list-public-keys list-secret-keys
|
||||
\ list-sigs lsign-key nrsign-key print-md print-mds
|
||||
\ recv-keys search-keys send-keys sign-key verify
|
||||
\ verify-files
|
||||
syn keyword gpgCommand contained skipwhite nextgroup=gpgArgError
|
||||
\ check-trustdb clearsign desig-revoke detach-sign
|
||||
\ encrypt gen-key gen-revoke help list-packets
|
||||
\ rebuild-keydb-caches sign store symmetric
|
||||
\ update-trustdb version warranty
|
||||
|
||||
syn keyword gpgOption contained skipwhite nextgroup=gpgArg
|
||||
\ attribute-fd cert-digest-algo charset cipher-algo
|
||||
\ command-fd comment completes-needed compress
|
||||
\ compress-algo debug default-cert-check-level
|
||||
\ default-key default-preference-list
|
||||
\ default-recipient digest-algo disable-cipher-algo
|
||||
\ disable-pubkey-algo encrypt-to exec-path
|
||||
\ export-options group homedir import-options
|
||||
\ keyring keyserver keyserver-options load-extension
|
||||
\ local-user logger-fd marginals-needed max-cert-depth
|
||||
\ notation-data options output override-session-key
|
||||
\ passphrase-fd personal-cipher-preferences
|
||||
\ personal-compress-preferences
|
||||
\ personal-digest-preferences photo-viewer
|
||||
\ recipient s2k-cipher-algo s2k-digest-algo s2k-mode
|
||||
\ secret-keyring set-filename set-policy-url status-fd
|
||||
\ trusted-key verify-options keyid-format list-options
|
||||
syn keyword gpgOption contained skipwhite nextgroup=gpgArgError
|
||||
\ allow-freeform-uid allow-non-selfsigned-uid
|
||||
\ allow-secret-key-import always-trust
|
||||
\ armor ask-cert-expire ask-sig-expire
|
||||
\ auto-check-trustdb batch debug-all default-comment
|
||||
\ default-recipient-self dry-run emit-version
|
||||
\ emulate-md-encode-bug enable-special-filenames
|
||||
\ escape-from-lines expert fast-list-mode
|
||||
\ fixed-list-mode for-your-eyes-only
|
||||
\ force-mdc force-v3-sigs force-v4-certs
|
||||
\ gpg-agent-info ignore-crc-error ignore-mdc-error
|
||||
\ ignore-time-conflict ignore-valid-from interactive
|
||||
\ list-only lock-multiple lock-never lock-once
|
||||
\ merge-only no no-allow-non-selfsigned-uid
|
||||
\ no-armor no-ask-cert-expire no-ask-sig-expire
|
||||
\ no-auto-check-trustdb no-batch no-comment
|
||||
\ no-default-keyring no-default-recipient
|
||||
\ no-encrypt-to no-expensive-trust-checks
|
||||
\ no-expert no-for-your-eyes-only no-force-v3-sigs
|
||||
\ no-force-v4-certs no-greeting no-literal
|
||||
\ no-mdc-warning no-options no-permission-warning
|
||||
\ no-pgp2 no-pgp6 no-pgp7 no-random-seed-file
|
||||
\ no-secmem-warning no-show-notation no-show-photos
|
||||
\ no-show-policy-url no-sig-cache no-sig-create-check
|
||||
\ no-sk-comments no-tty no-utf8-strings no-verbose
|
||||
\ no-version not-dash-escaped openpgp pgp2
|
||||
\ pgp6 pgp7 preserve-permissions quiet rfc1991
|
||||
\ set-filesize show-keyring show-notation show-photos
|
||||
\ show-policy-url show-session-key simple-sk-checksum
|
||||
\ sk-comments skip-verify textmode throw-keyid
|
||||
\ try-all-secrets use-agent use-embedded-filename
|
||||
\ utf8-strings verbose with-colons with-fingerprint
|
||||
\ with-key-data yes
|
||||
syn keyword gpgOption contained skipwhite nextgroup=gpgArg
|
||||
\ attribute-fd cert-digest-algo charset cipher-algo
|
||||
\ command-fd comment completes-needed compress
|
||||
\ compress-algo debug default-cert-check-level
|
||||
\ default-key default-preference-list
|
||||
\ default-recipient digest-algo disable-cipher-algo
|
||||
\ disable-pubkey-algo encrypt-to exec-path
|
||||
\ export-options group homedir import-options
|
||||
\ keyring keyserver keyserver-options load-extension
|
||||
\ local-user logger-fd marginals-needed max-cert-depth
|
||||
\ notation-data options output override-session-key
|
||||
\ passphrase-fd personal-cipher-preferences
|
||||
\ personal-compress-preferences
|
||||
\ personal-digest-preferences photo-viewer
|
||||
\ recipient s2k-cipher-algo s2k-digest-algo s2k-mode
|
||||
\ secret-keyring set-filename set-policy-url status-fd
|
||||
\ trusted-key verify-options keyid-format list-options
|
||||
\ default-new-key-algo weak-digest
|
||||
syn keyword gpgOption contained skipwhite nextgroup=gpgArgError
|
||||
\ allow-freeform-uid allow-non-selfsigned-uid
|
||||
\ allow-secret-key-import always-trust
|
||||
\ armor ask-cert-expire ask-sig-expire
|
||||
\ auto-check-trustdb batch debug-all default-comment
|
||||
\ default-recipient-self dry-run emit-version
|
||||
\ emulate-md-encode-bug enable-special-filenames
|
||||
\ escape-from-lines expert fast-list-mode
|
||||
\ fixed-list-mode for-your-eyes-only
|
||||
\ force-mdc force-v3-sigs force-v4-certs
|
||||
\ gpg-agent-info ignore-crc-error ignore-mdc-error
|
||||
\ ignore-time-conflict ignore-valid-from interactive
|
||||
\ list-only lock-multiple lock-never lock-once
|
||||
\ merge-only no no-allow-non-selfsigned-uid
|
||||
\ no-armor no-ask-cert-expire no-ask-sig-expire
|
||||
\ no-auto-check-trustdb no-batch no-comment
|
||||
\ no-default-keyring no-default-recipient
|
||||
\ no-encrypt-to no-expensive-trust-checks
|
||||
\ no-expert no-for-your-eyes-only no-force-v3-sigs
|
||||
\ no-force-v4-certs no-greeting no-literal
|
||||
\ no-mdc-warning no-options no-permission-warning
|
||||
\ no-pgp2 no-pgp6 no-pgp7 no-random-seed-file
|
||||
\ no-secmem-warning no-show-notation no-show-photos
|
||||
\ no-show-policy-url no-sig-cache no-sig-create-check
|
||||
\ no-sk-comments no-tty no-utf8-strings no-verbose
|
||||
\ no-version not-dash-escaped openpgp pgp2
|
||||
\ pgp6 pgp7 preserve-permissions quiet rfc1991
|
||||
\ set-filesize show-keyring show-notation show-photos
|
||||
\ show-policy-url show-session-key simple-sk-checksum
|
||||
\ sk-comments skip-verify textmode throw-keyid
|
||||
\ try-all-secrets use-agent use-embedded-filename
|
||||
\ utf8-strings verbose with-colons with-fingerprint
|
||||
\ with-key-data yes
|
||||
|
||||
syn match gpgArg contained display '\S\+\(\s\+\S\+\)*' contains=gpgID
|
||||
syn match gpgArg contained display '\S\+\(\s\+\S\+\)*' contains=gpgID
|
||||
syn match gpgArgError contained display '\S\+\(\s\+\S\+\)*'
|
||||
|
||||
hi def link gpgComment Comment
|
||||
hi def link gpgTodo Todo
|
||||
hi def link gpgID Number
|
||||
hi def link gpgOption Keyword
|
||||
hi def link gpgCommand Error
|
||||
hi def link gpgComment Comment
|
||||
hi def link gpgTodo Todo
|
||||
hi def link gpgID Number
|
||||
hi def link gpgOption Keyword
|
||||
hi def link gpgCommand Error
|
||||
hi def link gpgArgError Error
|
||||
|
||||
let b:current_syntax = "gpg"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainers: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Claudio Fleiner <claudio@fleiner.com>
|
||||
" Last Change: 2022 Nov 18
|
||||
" Last Change: 2023 Feb 20
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
|
||||
@@ -221,7 +221,7 @@ if main_syntax != 'java' || exists("java_javascript")
|
||||
" JAVA SCRIPT
|
||||
syn include @htmlJavaScript syntax/javascript.vim
|
||||
unlet b:current_syntax
|
||||
syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
|
||||
syn region javaScript start=+<script\>\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
|
||||
syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
|
||||
hi def link htmlScriptTag htmlTag
|
||||
|
||||
|
||||
31
runtime/syntax/lc.vim
Normal file
31
runtime/syntax/lc.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file
|
||||
" Language: Elsa
|
||||
" Maintainer: Miles Glapa-Grossklag <miles@glapa-grossklag.com>
|
||||
" Last Change: 2023-01-29
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syntax keyword elsaKeyword let eval
|
||||
syntax match elsaKeyword "\v:"
|
||||
highlight link elsaKeyword Keyword
|
||||
|
||||
" Comments
|
||||
setlocal commentstring=--%s
|
||||
syntax match elsaComment "\v--.*$"
|
||||
highlight link elsaComment Comment
|
||||
|
||||
" Operators
|
||||
syntax match elsaOperator "\v\="
|
||||
syntax match elsaOperator "\v\=[abd*~]\>"
|
||||
syntax match elsaOperator "\v-\>"
|
||||
syntax match elsaOperator "\v\\"
|
||||
highlight link elsaOperator Operator
|
||||
|
||||
" Definitions
|
||||
syntax match elsaConstant "\v[A-Z]+[A-Z_0-9]*"
|
||||
highlight link elsaConstant Constant
|
||||
|
||||
let b:current_syntax = 'elsa'
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: nginx.conf
|
||||
" Maintainer: Chris Aumann <me@chr4.org>
|
||||
" Last Change: Apr 15, 2017
|
||||
" Last Change: Jan 25, 2023
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -84,6 +84,8 @@ syn keyword ngxListenOptions default_server contained
|
||||
syn keyword ngxListenOptions ssl contained
|
||||
syn keyword ngxListenOptions http2 contained
|
||||
syn keyword ngxListenOptions spdy contained
|
||||
syn keyword ngxListenOptions http3 contained
|
||||
syn keyword ngxListenOptions quic contained
|
||||
syn keyword ngxListenOptions proxy_protocol contained
|
||||
syn keyword ngxListenOptions setfib contained
|
||||
syn keyword ngxListenOptions fastopen contained
|
||||
@@ -265,8 +267,16 @@ syn keyword ngxDirective http2_max_concurrent_streams
|
||||
syn keyword ngxDirective http2_max_field_size
|
||||
syn keyword ngxDirective http2_max_header_size
|
||||
syn keyword ngxDirective http2_max_requests
|
||||
syn keyword ngxDirective http2_push
|
||||
syn keyword ngxDirective http2_push_preload
|
||||
syn keyword ngxDirective http2_recv_buffer_size
|
||||
syn keyword ngxDirective http2_recv_timeout
|
||||
syn keyword ngxDirective http3_hq
|
||||
syn keyword ngxDirective http3_max_concurrent_pushes
|
||||
syn keyword ngxDirective http3_max_concurrent_streams
|
||||
syn keyword ngxDirective http3_push
|
||||
syn keyword ngxDirective http3_push_preload
|
||||
syn keyword ngxDirective http3_stream_buffer_size
|
||||
syn keyword ngxDirective if_modified_since
|
||||
syn keyword ngxDirective ignore_invalid_headers
|
||||
syn keyword ngxDirective image_filter
|
||||
@@ -444,6 +454,10 @@ syn keyword ngxDirective proxy_temp_path
|
||||
syn keyword ngxDirective proxy_timeout
|
||||
syn keyword ngxDirective proxy_upload_rate
|
||||
syn keyword ngxDirective queue
|
||||
syn keyword ngxDirective quic_gso
|
||||
syn keyword ngxDirective quic_host_key
|
||||
syn keyword ngxDirective quic_mtu
|
||||
syn keyword ngxDirective quic_retry
|
||||
syn keyword ngxDirective random_index
|
||||
syn keyword ngxDirective read_ahead
|
||||
syn keyword ngxDirective real_ip_header
|
||||
@@ -545,8 +559,10 @@ syn keyword ngxDirective ssl_certificate
|
||||
syn keyword ngxDirective ssl_certificate_key
|
||||
syn keyword ngxDirective ssl_ciphers
|
||||
syn keyword ngxDirective ssl_client_certificate
|
||||
syn keyword ngxDirective ssl_conf_command
|
||||
syn keyword ngxDirective ssl_crl
|
||||
syn keyword ngxDirective ssl_dhparam
|
||||
syn keyword ngxDirective ssl_early_data
|
||||
syn keyword ngxDirective ssl_ecdh_curve
|
||||
syn keyword ngxDirective ssl_engine
|
||||
syn keyword ngxDirective ssl_handshake_timeout
|
||||
@@ -556,6 +572,7 @@ syn keyword ngxSSLPreferServerCiphersOn on contained
|
||||
syn keyword ngxSSLPreferServerCiphersOff off contained
|
||||
syn keyword ngxDirective ssl_preread
|
||||
syn keyword ngxDirective ssl_protocols nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
|
||||
syn keyword ngxDirective ssl_reject_handshake
|
||||
syn match ngxSSLProtocol 'TLSv1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
|
||||
syn match ngxSSLProtocol 'TLSv1\.1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
|
||||
syn match ngxSSLProtocol 'TLSv1\.2' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
|
||||
@@ -622,6 +639,7 @@ syn keyword ngxDirective uwsgi_buffering
|
||||
syn keyword ngxDirective uwsgi_buffers
|
||||
syn keyword ngxDirective uwsgi_busy_buffers_size
|
||||
syn keyword ngxDirective uwsgi_cache
|
||||
syn keyword ngxDirective uwsgi_cache_background_update
|
||||
syn keyword ngxDirective uwsgi_cache_bypass
|
||||
syn keyword ngxDirective uwsgi_cache_key
|
||||
syn keyword ngxDirective uwsgi_cache_lock
|
||||
@@ -2225,6 +2243,19 @@ syn keyword ngxDirectiveThirdParty xss_override_status
|
||||
syn keyword ngxDirectiveThirdParty xss_check_status
|
||||
syn keyword ngxDirectiveThirdParty xss_input_types
|
||||
|
||||
" CT Module <https://github.com/grahamedgecombe/nginx-ct>
|
||||
" Certificate Transparency module for nginx
|
||||
syn keyword ngxDirectiveThirdParty ssl_ct
|
||||
syn keyword ngxDirectiveThirdParty ssl_ct_static_scts
|
||||
|
||||
" Dynamic TLS records patch <https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__dynamic_tls_records.patch>
|
||||
" TLS Dynamic Record Resizing
|
||||
syn keyword ngxDirectiveThirdParty ssl_dyn_rec_enable
|
||||
syn keyword ngxDirectiveThirdParty ssl_dyn_rec_size_hi
|
||||
syn keyword ngxDirectiveThirdParty ssl_dyn_rec_size_lo
|
||||
syn keyword ngxDirectiveThirdParty ssl_dyn_rec_threshold
|
||||
syn keyword ngxDirectiveThirdParty ssl_dyn_rec_timeout
|
||||
|
||||
" ZIP Module <https://www.nginx.com/resources/wiki/modules/zip/>
|
||||
" ZIP archiver for nginx
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: PoE item filter
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.filter
|
||||
" Last Change: 2022 Oct 07
|
||||
" Last Change: 2023 Feb 10
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -17,7 +17,7 @@ syn match poefilterCommentTag /\[[0-9A-Z\[\]]\+\]/ contained
|
||||
syn match poefilterComment /#.*$/ contains=poefilterTodo,poefilterCommentTag,@Spell
|
||||
|
||||
" Blocks
|
||||
syn keyword poefilterBlock Show Hide
|
||||
syn keyword poefilterBlock Show Hide Minimal
|
||||
|
||||
" Conditions
|
||||
syn keyword poefilterCondition
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Nov 25, 2022
|
||||
" Version: 204
|
||||
" Last Change: Dec 20, 2022
|
||||
" Version: 205
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras
|
||||
@@ -190,8 +190,10 @@ syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" ski
|
||||
" =====
|
||||
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
|
||||
syn match shStatement "\<alias\>"
|
||||
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`"
|
||||
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="="
|
||||
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]*\)\@=" skip="\\$" end="\>\|`"
|
||||
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]*=\)\@=" skip="\\$" end="="
|
||||
" syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`"
|
||||
" syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="="
|
||||
|
||||
" Touch: {{{1
|
||||
" =====
|
||||
@@ -333,7 +335,7 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment
|
||||
" systems too, however, so the following syntax will flag $(..) as
|
||||
" an Error under /bin/sh. By consensus of vimdev'ers!
|
||||
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
|
||||
syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
|
||||
syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
|
||||
syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList
|
||||
syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList
|
||||
syn match shSkipInitWS contained "^\s\+"
|
||||
@@ -483,7 +485,9 @@ endif
|
||||
|
||||
" Parameter Dereferencing: {{{1
|
||||
" ========================
|
||||
if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix"))
|
||||
" Note: sh04 failure with following line
|
||||
"if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix"))
|
||||
if !exists("g:sh_no_error")
|
||||
syn match shDerefWordError "[^}$[~]" contained
|
||||
endif
|
||||
syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
This directory "runtime/syntax/shared" contains Vim script files that are
|
||||
generated or used by more then one syntax file.
|
||||
generated or used by more than one syntax file.
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: tpp - Text Presentation Program
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Gerfried Fuchs <alfie@ist.org>
|
||||
" Last Change: 2018 Dec 27
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/master/syntax/tpp.vim
|
||||
" Last Change: 2023 Jan 16
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/tpp.vim
|
||||
" Filenames: *.tpp
|
||||
" License: BSD
|
||||
"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 9.0 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: Jan 08, 2023
|
||||
" Version: 9.0-18
|
||||
" Last Change: January 18, 2023
|
||||
" Version: 9.0-21
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -19,12 +19,13 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] defer deletl dep diffpu[t] dj[ump] dp earlier echow[indow] endf[unction] ex files fini[sh] folddoc[losed] grepa[dd] helpf[ind] hor[izontal] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained ab arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec el[se] endfo[r] exi[t] filet fir[st] foldo[pen] gui helpg[rep] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] elsei[f] endt[ry] exp filetype fix[del] for gvim helpt[ags] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] h[elp] hi iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained addd argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] en[dif] ene[w] exu[sage] fin[d] foldc[lose] go[to] ha[rdcopy] hid[e] if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xr[estore] z[^.=]
|
||||
syn keyword vimCommand contained al[l] arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletep delp diffp[atch] disa[ssemble] doaut ea echon enddef eval f[ile] fina[lly] foldd[oopen] gr[ep] helpc[lose] his[tory] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] bad[d] bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] em[enu] endfo[r] eval f[ile] fina[lly] foldd[oopen] gr[ep] helpc[lose] his[tory] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] balt bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] en[dif] endinterface ex files fini[sh] folddoc[losed] grepa[dd] helpf[ind] hor[izontal] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] public py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletep delp diffp[atch] disa[ssemble] doaut ea echon endclass endt[ry] exi[t] filet fir[st] foldo[pen] gui helpg[rep] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] au bel[owright] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] defer deletl dep diffpu[t] dj[ump] dp earlier echow[indow] enddef endw[hile] exp filetype fix[del] for gvim helpt[ags] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp static sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xnoreme xwininfo
|
||||
syn keyword vimCommand contained abstract argdo bN[ext] bf[irst] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec el[se] endenum ene[w] export filt[er] fo[ld] fu[nction] h[elp] hi iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained addd arge[dit] b[uffer] bl[ast] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] elsei[f] endf[unction] enum exu[sage] fin[d] foldc[lose] go[to] ha[rdcopy] hid[e] if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xprop z[^.=]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] ba[ll] bm[odified]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns
|
||||
|
||||
@@ -49,8 +50,8 @@ syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd i
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo invendofline invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousehide invodev invpi
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_Ds t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_KH t_KI t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_ds t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_fe t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke t_KF t_kh t_kI t_KJ
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_Ds t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_KH t_KI t_KK t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_ds t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_fe t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke t_KF t_kh t_kI t_KJ t_kl
|
||||
syn match vimOption contained "t_%1"
|
||||
syn match vimOption contained "t_#2"
|
||||
syn match vimOption contained "t_#4"
|
||||
@@ -78,12 +79,12 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getchar getcmdline getcurpos getfsize getloclist getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode libcallnr listener_add luaeval mapset matchend max nextnonblank popup_atcursor popup_dialog popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdline setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharmod getcmdpos getcursorcharpos getftime getmarklist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line listener_flush map match matchfuzzy menu_info nr2char popup_beval popup_filter_menu popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_dict test_null_string test_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharpos getcmdscreenpos getcwd getftype getmatches getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys line2byte listener_remove maparg matchadd matchfuzzypos min or popup_clear popup_filter_yesno popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapfilelist synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_function test_option_not_set test_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufoneline getcharsearch getcmdtype getenv getimstatus getmousepos getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join keytrans lispindent localtime mapcheck matchaddpos matchlist mkdir pathshorten popup_close popup_findecho popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_mswin_event test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getbufvar getcharstr getcmdwintype getfontname getjumplist getmouseshape getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode len list2blob log maplist matcharg matchstr mode perleval popup_create popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchangelist getcmdcompltype getcompletion getfperm getline getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcall list2str log10 mapnew matchdelete matchstrpos mzeval
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getchangelist getcmdcompltype getcompletion getfperm getline getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcall list2str log10 mapnew matchdelete matchstrpos mzeval popup_atcursor popup_dialog popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdline setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getchar getcmdline getcurpos getfsize getloclist getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode libcallnr listener_add luaeval mapset matchend max nextnonblank popup_beval popup_filter_menu popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_dict test_null_string test_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharmod getcmdpos getcursorcharpos getftime getmarklist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line listener_flush map match matchfuzzy menu_info nr2char popup_clear popup_filter_yesno popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapfilelist synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_function test_option_not_set test_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufoneline getcharpos getcmdscreenpos getcwd getftype getmatches getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys line2byte listener_remove maparg matchadd matchfuzzypos min or popup_close popup_findecho popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_mswin_event test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getbufvar getcharsearch getcmdtype getenv getimstatus getmousepos getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join keytrans lispindent localtime mapcheck matchaddpos matchlist mkdir pathshorten popup_create popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getcellwidths getcharstr getcmdwintype getfontname getjumplist getmouseshape getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode len list2blob log maplist matcharg matchstr mode perleval
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
" Vim syntax file
|
||||
" This is a GENERATED FILE. Please always refer to source file at the URI below.
|
||||
" Language: XF86Config (XFree86 configuration file)
|
||||
" Former Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
|
||||
" Last Change: 2010 Nov 01
|
||||
" URL: http://trific.ath.cx/Ftp/vim/syntax/xf86conf.vim
|
||||
" Last Change By David: 2010 Nov 01
|
||||
" Last Change: 2023 Jan 23
|
||||
" Required Vim Version: 6.0
|
||||
"
|
||||
" Options: let xf86conf_xfree86_version = 3 or 4
|
||||
" to force XFree86 3.x or 4.x XF86Config syntax
|
||||
" to force XFree86 3.x or 4.x XF86Config syntax
|
||||
|
||||
" Setup
|
||||
" quit when a syntax file was already loaded
|
||||
@@ -147,6 +146,8 @@ syn keyword xf86confKeyword Hskew HTimings InputDevice IOBase MemBase Mode nextg
|
||||
syn keyword xf86confKeyword Modes Ramdac Screen TextClockFreq UseModes VendorName nextgroup=xf86confComment,xf86confValue
|
||||
syn keyword xf86confKeyword VertRefresh VideoRam ViewPort Virtual VScan VTimings nextgroup=xf86confComment,xf86confValue
|
||||
syn keyword xf86confKeyword Weight White nextgroup=xf86confComment,xf86confValue
|
||||
syn keyword xf86confMatch MatchDevicePath MatchDriver MatchLayout MatchOS MatchPnPID MatchProduct MatchTag MatchUSBID MatchVendor nextgroup=xf86confComment,xf86confString skipwhite
|
||||
syn keyword xf86confMatch MatchIsPointer MatchIsKeyboard MatchIsTouchpad MatchIsTouchscreen MatchIsJoystick nextgroup=xf86confComment,xf86confValue skipwhite
|
||||
syn keyword xf86confModeLine ModeLine nextgroup=xf86confComment,xf86confModeLineValue skipwhite skipnl
|
||||
|
||||
" Constants
|
||||
@@ -185,6 +186,7 @@ hi def link xf86confOctalNumberError xf86confError
|
||||
hi def link xf86confError Error
|
||||
|
||||
hi def link xf86confOption xf86confKeyword
|
||||
hi def link xf86confMatch xf86confKeyword
|
||||
hi def link xf86confModeLine xf86confKeyword
|
||||
hi def link xf86confKeyword Type
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
5. Now type a capital U to return the line to its original state.
|
||||
6. Now type u a few times to undo the U and preceding commands.
|
||||
7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
|
||||
to redo the commands (undo the undo's).
|
||||
to redo the commands (undo the undos).
|
||||
|
||||
---> Fiix the errors oon thhis line and reeplace them witth undo.
|
||||
|
||||
@@ -365,7 +365,7 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
|
||||
8. To undo previous actions, type: u (lowercase u)
|
||||
To undo all the changes on a line, type: U (capital U)
|
||||
To undo the undo's, type: CTRL-R
|
||||
To undo the undos, type: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: THE PUT COMMAND
|
||||
|
||||
@@ -335,7 +335,7 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
5. Now type a capital U to return the line to its original state.
|
||||
6. Now type u a few times to undo the U and preceding commands.
|
||||
7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
|
||||
to redo the commands (undo the undo's).
|
||||
to redo the commands (undo the undos).
|
||||
|
||||
---> Fiix the errors oon thhis line and reeplace them witth undo.
|
||||
|
||||
@@ -365,7 +365,7 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
|
||||
8. To undo previous actions, type: u (lowercase u)
|
||||
To undo all the changes on a line, type: U (capital U)
|
||||
To undo the undo's, type: CTRL-R
|
||||
To undo the undos, type: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: THE PUT COMMAND
|
||||
|
||||
@@ -1695,6 +1695,7 @@ win_found:
|
||||
globaldir = aco->globaldir;
|
||||
|
||||
// the buffer contents may have changed
|
||||
VIsual_active = aco->save_VIsual_active;
|
||||
check_cursor();
|
||||
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
@@ -1741,14 +1742,16 @@ win_found:
|
||||
curwin = save_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
prevwin = win_find_by_id(aco->save_prevwin_id);
|
||||
|
||||
// In case the autocommand moves the cursor to a position that
|
||||
// does not exist in curbuf.
|
||||
VIsual_active = aco->save_VIsual_active;
|
||||
check_cursor();
|
||||
}
|
||||
}
|
||||
|
||||
check_cursor(); // just in case lines got deleted
|
||||
VIsual_active = aco->save_VIsual_active;
|
||||
check_cursor(); // just in case lines got deleted
|
||||
if (VIsual_active)
|
||||
check_pos(curbuf, &VIsual);
|
||||
}
|
||||
|
||||
88
src/buffer.c
88
src/buffer.c
@@ -1953,7 +1953,7 @@ enter_buffer(buf_T *buf)
|
||||
maketitle();
|
||||
// when autocmds didn't change it
|
||||
if (curwin->w_topline == 1 && !curwin->w_topline_was_set)
|
||||
scroll_cursor_halfway(FALSE); // redisplay at correct position
|
||||
scroll_cursor_halfway(FALSE, FALSE); // redisplay at correct position
|
||||
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
// Send fileOpened event because we've changed buffers.
|
||||
@@ -1971,7 +1971,7 @@ enter_buffer(buf_T *buf)
|
||||
// May need to set the spell language. Can only do this after the buffer
|
||||
// has been properly setup.
|
||||
if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
|
||||
(void)did_set_spelllang(curwin);
|
||||
(void)parse_spelllang(curwin);
|
||||
#endif
|
||||
#ifdef FEAT_VIMINFO
|
||||
curbuf->b_last_used = vim_time();
|
||||
@@ -4179,7 +4179,7 @@ typedef struct
|
||||
Normal,
|
||||
Empty,
|
||||
Group,
|
||||
Middle,
|
||||
Separate,
|
||||
Highlight,
|
||||
TabPage,
|
||||
Trunc
|
||||
@@ -4191,6 +4191,7 @@ static stl_item_T *stl_items = NULL;
|
||||
static int *stl_groupitem = NULL;
|
||||
static stl_hlrec_T *stl_hltab = NULL;
|
||||
static stl_hlrec_T *stl_tabtab = NULL;
|
||||
static int *stl_separator_locations = NULL;
|
||||
|
||||
/*
|
||||
* Build a string from the status line items in "fmt".
|
||||
@@ -4200,7 +4201,7 @@ static stl_hlrec_T *stl_tabtab = NULL;
|
||||
* is "curwin".
|
||||
*
|
||||
* Items are drawn interspersed with the text that surrounds it
|
||||
* Specials: %-<wid>(xxx%) => group, %= => middle marker, %< => truncation
|
||||
* Specials: %-<wid>(xxx%) => group, %= => separation marker, %< => truncation
|
||||
* Item: %-<minwid>.<maxwid><itemch> All but <itemch> are optional
|
||||
*
|
||||
* If maxwidth is not zero, the string will be filled at any middle marker
|
||||
@@ -4282,6 +4283,8 @@ build_stl_str_hl(
|
||||
// end of the list.
|
||||
stl_hltab = ALLOC_MULT(stl_hlrec_T, stl_items_len + 1);
|
||||
stl_tabtab = ALLOC_MULT(stl_hlrec_T, stl_items_len + 1);
|
||||
|
||||
stl_separator_locations = ALLOC_MULT(int, stl_items_len);
|
||||
}
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -4350,19 +4353,20 @@ build_stl_str_hl(
|
||||
if (curitem == (int)stl_items_len)
|
||||
{
|
||||
size_t new_len = stl_items_len * 3 / 2;
|
||||
stl_item_T *new_items;
|
||||
int *new_groupitem;
|
||||
stl_hlrec_T *new_hlrec;
|
||||
|
||||
new_items = vim_realloc(stl_items, sizeof(stl_item_T) * new_len);
|
||||
stl_item_T *new_items =
|
||||
vim_realloc(stl_items, sizeof(stl_item_T) * new_len);
|
||||
if (new_items == NULL)
|
||||
break;
|
||||
stl_items = new_items;
|
||||
new_groupitem = vim_realloc(stl_groupitem, sizeof(int) * new_len);
|
||||
|
||||
int *new_groupitem =
|
||||
vim_realloc(stl_groupitem, sizeof(int) * new_len);
|
||||
if (new_groupitem == NULL)
|
||||
break;
|
||||
stl_groupitem = new_groupitem;
|
||||
new_hlrec = vim_realloc(stl_hltab,
|
||||
|
||||
stl_hlrec_T *new_hlrec = vim_realloc(stl_hltab,
|
||||
sizeof(stl_hlrec_T) * (new_len + 1));
|
||||
if (new_hlrec == NULL)
|
||||
break;
|
||||
@@ -4372,6 +4376,13 @@ build_stl_str_hl(
|
||||
if (new_hlrec == NULL)
|
||||
break;
|
||||
stl_tabtab = new_hlrec;
|
||||
|
||||
int *new_separator_locs = vim_realloc(stl_separator_locations,
|
||||
sizeof(int) * new_len);
|
||||
if (new_separator_locs == NULL)
|
||||
break;
|
||||
stl_separator_locations = new_separator_locs;;
|
||||
|
||||
stl_items_len = new_len;
|
||||
}
|
||||
|
||||
@@ -4400,12 +4411,13 @@ build_stl_str_hl(
|
||||
prevchar_isflag = prevchar_isitem = FALSE;
|
||||
continue;
|
||||
}
|
||||
if (*s == STL_MIDDLEMARK)
|
||||
// STL_SEPARATE: Separation between items, filled with white space.
|
||||
if (*s == STL_SEPARATE)
|
||||
{
|
||||
s++;
|
||||
if (groupdepth > 0)
|
||||
continue;
|
||||
stl_items[curitem].stl_type = Middle;
|
||||
stl_items[curitem].stl_type = Separate;
|
||||
stl_items[curitem++].stl_start = p;
|
||||
continue;
|
||||
}
|
||||
@@ -5121,19 +5133,45 @@ build_stl_str_hl(
|
||||
}
|
||||
else if (width < maxwidth && STRLEN(out) + maxwidth - width + 1 < outlen)
|
||||
{
|
||||
// Apply STL_MIDDLE if any
|
||||
// Find how many separators there are, which we will use when
|
||||
// figuring out how many groups there are.
|
||||
int num_separators = 0;
|
||||
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
if (stl_items[l].stl_type == Middle)
|
||||
break;
|
||||
if (l < itemcnt)
|
||||
{
|
||||
int middlelength = (maxwidth - width) * MB_CHAR2LEN(fillchar);
|
||||
p = stl_items[l].stl_start + middlelength;
|
||||
STRMOVE(p, stl_items[l].stl_start);
|
||||
for (s = stl_items[l].stl_start; s < p;)
|
||||
MB_CHAR2BYTES(fillchar, s);
|
||||
for (l++; l < itemcnt; l++)
|
||||
stl_items[l].stl_start += middlelength;
|
||||
if (stl_items[l].stl_type == Separate)
|
||||
{
|
||||
// Create an array of the start location for each separator
|
||||
// mark.
|
||||
stl_separator_locations[num_separators] = l;
|
||||
num_separators++;
|
||||
}
|
||||
}
|
||||
|
||||
// If we have separated groups, then we deal with it now
|
||||
if (num_separators)
|
||||
{
|
||||
int standard_spaces;
|
||||
int final_spaces;
|
||||
|
||||
standard_spaces = (maxwidth - width) / num_separators;
|
||||
final_spaces = (maxwidth - width) -
|
||||
standard_spaces * (num_separators - 1);
|
||||
for (l = 0; l < num_separators; l++)
|
||||
{
|
||||
int dislocation = (l == (num_separators - 1)) ?
|
||||
final_spaces : standard_spaces;
|
||||
dislocation *= MB_CHAR2LEN(fillchar);
|
||||
char_u *start = stl_items[stl_separator_locations[l]].stl_start;
|
||||
char_u *seploc = start + dislocation;
|
||||
STRMOVE(seploc, start);
|
||||
for (s = start; s < seploc;)
|
||||
MB_CHAR2BYTES(fillchar, s);
|
||||
|
||||
for (int i = stl_separator_locations[l] + 1; i < itemcnt; i++)
|
||||
stl_items[i].stl_start += dislocation;
|
||||
}
|
||||
|
||||
width = maxwidth;
|
||||
}
|
||||
}
|
||||
@@ -5364,6 +5402,10 @@ ex_buffer_all(exarg_T *eap)
|
||||
else
|
||||
all = TRUE;
|
||||
|
||||
// Stop Visual mode, the cursor and "VIsual" may very well be invalid after
|
||||
// switching to another buffer.
|
||||
reset_VIsual_and_resel();
|
||||
|
||||
setpcmark();
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
|
||||
@@ -611,7 +611,9 @@ changed_common(
|
||||
{
|
||||
if (wp->w_lines[i].wl_lnum >= lnum)
|
||||
{
|
||||
if (wp->w_lines[i].wl_lnum < lnume)
|
||||
// Do not change wl_lnum at index zero, it is used to
|
||||
// compare with w_topline. Invalidate it instead.
|
||||
if (wp->w_lines[i].wl_lnum < lnume || i == 0)
|
||||
{
|
||||
// line included in change
|
||||
wp->w_lines[i].wl_valid = FALSE;
|
||||
|
||||
@@ -979,11 +979,13 @@ channel_open(
|
||||
|
||||
ch_log(channel, "Trying to connect to %s port %d", dst, port);
|
||||
|
||||
// On Mac and Solaris a zero timeout almost never works. At least wait
|
||||
// one millisecond. Let's do it for all systems, because we don't know
|
||||
// why this is needed.
|
||||
// On Mac and Solaris a zero timeout almost never works. Waiting for
|
||||
// one millisecond already helps a lot. Later Mac systems (using IPv6)
|
||||
// need more time, 15 milliseconds appears to work well.
|
||||
// Let's do it for all systems, because we don't know why this is
|
||||
// needed.
|
||||
if (waittime == 0)
|
||||
waittime = 1;
|
||||
waittime = 15;
|
||||
|
||||
sd = channel_connect(channel, addr->ai_addr, (int)addr->ai_addrlen,
|
||||
&waittime);
|
||||
|
||||
@@ -523,22 +523,31 @@ transchar_buf(buf_T *buf, int c)
|
||||
|
||||
/*
|
||||
* Like transchar(), but called with a byte instead of a character. Checks
|
||||
* for an illegal UTF-8 byte.
|
||||
* for an illegal UTF-8 byte. Uses 'fileformat' of the current buffer.
|
||||
*/
|
||||
char_u *
|
||||
transchar_byte(int c)
|
||||
{
|
||||
if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
transchar_nonprint(curbuf, transchar_charbuf, c);
|
||||
return transchar_charbuf;
|
||||
}
|
||||
return transchar(c);
|
||||
return transchar_byte_buf(curbuf, c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Like transchar_buf(), but called with a byte instead of a character. Checks
|
||||
* for an illegal UTF-8 byte. Uses 'fileformat' of "buf", unless it is NULL.
|
||||
*/
|
||||
char_u *
|
||||
transchar_byte_buf(buf_T *buf, int c)
|
||||
{
|
||||
if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
transchar_nonprint(buf, transchar_charbuf, c);
|
||||
return transchar_charbuf;
|
||||
}
|
||||
return transchar_buf(buf, c);
|
||||
}
|
||||
/*
|
||||
* Convert non-printable character to two or more printable characters in
|
||||
* "buf[]". "charbuf" needs to be able to hold five bytes.
|
||||
* "charbuf[]". "charbuf" needs to be able to hold five bytes.
|
||||
* Does NOT work for multi-byte characters, c must be <= 255.
|
||||
*/
|
||||
void
|
||||
@@ -546,7 +555,7 @@ transchar_nonprint(buf_T *buf, char_u *charbuf, int c)
|
||||
{
|
||||
if (c == NL)
|
||||
c = NUL; // we use newline in place of a NUL
|
||||
else if (c == CAR && get_fileformat(buf) == EOL_MAC)
|
||||
else if (buf != NULL && c == CAR && get_fileformat(buf) == EOL_MAC)
|
||||
c = NL; // we use CR in place of NL in this case
|
||||
|
||||
if (dy_flags & DY_UHEX) // 'display' has "uhex"
|
||||
@@ -813,6 +822,11 @@ win_linetabsize_cts(chartabsize_T *cts, colnr_T len)
|
||||
{
|
||||
(void)win_lbr_chartabsize(cts, NULL);
|
||||
cts->cts_vcol += cts->cts_cur_text_width;
|
||||
|
||||
// when properties are above or below the empty line must also be
|
||||
// counted
|
||||
if (cts->cts_prop_lines > 0)
|
||||
++cts->cts_vcol;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1152,6 +1166,8 @@ win_lbr_chartabsize(
|
||||
* First get the normal size, without 'linebreak' or text properties
|
||||
*/
|
||||
size = win_chartabsize(wp, s, vcol);
|
||||
if (*s == NUL)
|
||||
size = 0; // NUL is not displayed
|
||||
|
||||
# ifdef FEAT_PROP_POPUP
|
||||
if (cts->cts_has_prop_with_text)
|
||||
@@ -1180,7 +1196,7 @@ win_lbr_chartabsize(
|
||||
|| (tp->tp_col == MAXCOL
|
||||
&& ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE)
|
||||
? col == 0
|
||||
: (s[0] == NUL || s[1] == NUL)
|
||||
: (s[0] == NUL || s[charlen] == NUL)
|
||||
&& cts->cts_with_trailing)))
|
||||
&& -tp->tp_id - 1 < gap->ga_len)
|
||||
{
|
||||
@@ -1215,6 +1231,10 @@ win_lbr_chartabsize(
|
||||
tab_size = win_chartabsize(wp, s, vcol + size);
|
||||
size += tab_size;
|
||||
}
|
||||
if (tp->tp_col == MAXCOL && (tp->tp_flags
|
||||
& (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)))
|
||||
// count extra line for property above/below
|
||||
++cts->cts_prop_lines;
|
||||
}
|
||||
}
|
||||
if (tp->tp_col != MAXCOL && tp->tp_col - 1 > col)
|
||||
|
||||
@@ -1253,7 +1253,7 @@ clip_gen_owner_exists(Clipboard_T *cbd UNUSED)
|
||||
* Return an error message or NULL for success.
|
||||
*/
|
||||
char *
|
||||
check_clipboard_option(void)
|
||||
did_set_clipboard(optset_T *args UNUSED)
|
||||
{
|
||||
int new_unnamed = 0;
|
||||
int new_autoselect_star = FALSE;
|
||||
|
||||
@@ -1363,11 +1363,11 @@ addstar(
|
||||
// For a tag pattern starting with "/" no translation is needed.
|
||||
if (context == EXPAND_HELP
|
||||
|| context == EXPAND_COLORS
|
||||
|| context == EXPAND_RUNTIME
|
||||
|| context == EXPAND_COMPILER
|
||||
|| context == EXPAND_OWNSYNTAX
|
||||
|| context == EXPAND_FILETYPE
|
||||
|| context == EXPAND_PACKADD
|
||||
|| context == EXPAND_RUNTIME
|
||||
|| ((context == EXPAND_TAGS_LISTFILES
|
||||
|| context == EXPAND_TAGS)
|
||||
&& fname[0] == '/'))
|
||||
@@ -2314,10 +2314,6 @@ set_context_by_cmdname(
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_runtime:
|
||||
set_context_in_runtime_cmd(xp, arg);
|
||||
break;
|
||||
|
||||
case CMD_compiler:
|
||||
xp->xp_context = EXPAND_COMPILER;
|
||||
xp->xp_pattern = arg;
|
||||
@@ -2338,6 +2334,10 @@ set_context_by_cmdname(
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_runtime:
|
||||
set_context_in_runtime_cmd(xp, arg);
|
||||
break;
|
||||
|
||||
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
||||
case CMD_language:
|
||||
return set_context_in_lang_cmd(xp, arg);
|
||||
@@ -3025,10 +3025,6 @@ ExpandFromContext(
|
||||
return ExpandRTDir(pat, DIP_START + DIP_OPT, numMatches, matches,
|
||||
directories);
|
||||
}
|
||||
if (xp->xp_context == EXPAND_RUNTIME)
|
||||
{
|
||||
return expand_runtime_cmd(pat, numMatches, matches);
|
||||
}
|
||||
if (xp->xp_context == EXPAND_COMPILER)
|
||||
{
|
||||
char *directories[] = {"compiler", NULL};
|
||||
@@ -3050,6 +3046,8 @@ ExpandFromContext(
|
||||
#endif
|
||||
if (xp->xp_context == EXPAND_PACKADD)
|
||||
return ExpandPackAddDir(pat, numMatches, matches);
|
||||
if (xp->xp_context == EXPAND_RUNTIME)
|
||||
return expand_runtime_cmd(pat, numMatches, matches);
|
||||
|
||||
// When expanding a function name starting with s:, match the <SNR>nr_
|
||||
// prefix.
|
||||
|
||||
@@ -1682,7 +1682,7 @@ registerdigraph(int char1, int char2, int n)
|
||||
}
|
||||
|
||||
// Add a new digraph to the table.
|
||||
if (ga_grow(&user_digraphs, 1) != OK)
|
||||
if (ga_grow(&user_digraphs, 1) == FAIL)
|
||||
return;
|
||||
|
||||
dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len;
|
||||
|
||||
154
src/drawline.c
154
src/drawline.c
@@ -96,8 +96,9 @@ typedef struct {
|
||||
#ifdef FEAT_CONCEAL
|
||||
int boguscols; // nonexistent columns added to "col" to force
|
||||
// wrapping
|
||||
int vcol_off; // offset for concealed characters
|
||||
int vcol_off_co; // offset for concealed characters
|
||||
#endif
|
||||
int vcol_off_tp; // offset for virtual text
|
||||
#ifdef FEAT_SYN_HL
|
||||
int draw_color_col; // highlight colorcolumn
|
||||
int *color_cols; // pointer to according columns array
|
||||
@@ -839,9 +840,9 @@ draw_screen_line(win_T *wp, winlinevars_T *wlv)
|
||||
// edge for 'cursorcolumn'.
|
||||
wlv->col -= wlv->boguscols;
|
||||
wlv->boguscols = 0;
|
||||
# define VCOL_HLC (wlv->vcol - wlv->vcol_off)
|
||||
# define VCOL_HLC (wlv->vcol - wlv->vcol_off_co - wlv->vcol_off_tp)
|
||||
# else
|
||||
# define VCOL_HLC (wlv->vcol)
|
||||
# define VCOL_HLC (wlv->vcol - wlv->vcol_off_tp)
|
||||
# endif
|
||||
|
||||
if (wlv->draw_color_col)
|
||||
@@ -1085,6 +1086,7 @@ win_line(
|
||||
int save_did_emsg;
|
||||
#endif
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
int did_line = FALSE; // set to TRUE when line text done
|
||||
int text_prop_count;
|
||||
int text_prop_next = 0; // next text property to use
|
||||
textprop_T *text_props = NULL;
|
||||
@@ -1176,18 +1178,18 @@ win_line(
|
||||
int is_concealing = FALSE;
|
||||
int did_wcol = FALSE;
|
||||
int old_boguscols = 0;
|
||||
# define VCOL_HLC (wlv.vcol - wlv.vcol_off)
|
||||
# define VCOL_HLC (wlv.vcol - wlv.vcol_off_co - wlv.vcol_off_tp)
|
||||
# define FIX_FOR_BOGUSCOLS \
|
||||
{ \
|
||||
wlv.n_extra += wlv.vcol_off; \
|
||||
wlv.vcol -= wlv.vcol_off; \
|
||||
wlv.vcol_off = 0; \
|
||||
wlv.n_extra += wlv.vcol_off_co; \
|
||||
wlv.vcol -= wlv.vcol_off_co; \
|
||||
wlv.vcol_off_co = 0; \
|
||||
wlv.col -= wlv.boguscols; \
|
||||
old_boguscols = wlv.boguscols; \
|
||||
wlv.boguscols = 0; \
|
||||
}
|
||||
#else
|
||||
# define VCOL_HLC (wlv.vcol)
|
||||
# define VCOL_HLC (wlv.vcol - wlv.vcol_off_tp)
|
||||
#endif
|
||||
|
||||
if (startrow > endrow) // past the end already!
|
||||
@@ -1596,6 +1598,15 @@ win_line(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (number_only)
|
||||
{
|
||||
// skip over rows only used for virtual text above
|
||||
wlv.row += wlv.text_prop_above_count;
|
||||
if (wlv.row > endrow)
|
||||
return wlv.row;
|
||||
wlv.screen_row += wlv.text_prop_above_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
// 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
|
||||
@@ -1863,7 +1874,8 @@ win_line(
|
||||
// When only displaying the (relative) line number and that's done,
|
||||
// stop here.
|
||||
if (((dollar_vcol >= 0 && wp == curwin
|
||||
&& lnum == wp->w_cursor.lnum && wlv.vcol >= (long)wp->w_virtcol)
|
||||
&& lnum == wp->w_cursor.lnum
|
||||
&& wlv.vcol >= (long)wp->w_virtcol)
|
||||
|| (number_only && wlv.draw_state > WL_NR))
|
||||
#ifdef FEAT_DIFF
|
||||
&& wlv.filler_todo <= 0
|
||||
@@ -1914,17 +1926,20 @@ win_line(
|
||||
// Check if any active property ends.
|
||||
for (pi = 0; pi < text_props_active; ++pi)
|
||||
{
|
||||
int tpi = text_prop_idxs[pi];
|
||||
int tpi = text_prop_idxs[pi];
|
||||
textprop_T *tp = &text_props[tpi];
|
||||
|
||||
if (text_props[tpi].tp_col != MAXCOL
|
||||
&& bcol >= text_props[tpi].tp_col - 1
|
||||
+ text_props[tpi].tp_len)
|
||||
// An inline property ends when after the start column plus
|
||||
// length. An "above" property ends when used and n_extra
|
||||
// is zero.
|
||||
if ((tp->tp_col != MAXCOL
|
||||
&& bcol >= tp->tp_col - 1 + tp->tp_len))
|
||||
{
|
||||
if (pi + 1 < text_props_active)
|
||||
mch_memmove(text_prop_idxs + pi,
|
||||
text_prop_idxs + pi + 1,
|
||||
sizeof(int)
|
||||
* (text_props_active - (pi + 1)));
|
||||
* (text_props_active - (pi + 1)));
|
||||
--text_props_active;
|
||||
--pi;
|
||||
# ifdef FEAT_LINEBREAK
|
||||
@@ -1940,6 +1955,8 @@ win_line(
|
||||
// not on the next char yet, don't start another prop
|
||||
--bcol;
|
||||
# endif
|
||||
int display_text_first = FALSE;
|
||||
|
||||
// Add any text property that starts in this column.
|
||||
// With 'nowrap' and not in the first screen line only "below"
|
||||
// text prop can show.
|
||||
@@ -1950,18 +1967,11 @@ win_line(
|
||||
|| wlv.row == startrow
|
||||
|| (text_props[text_prop_next].tp_flags
|
||||
& TP_FLAG_ALIGN_BELOW)))
|
||||
|| (bcol == 0 &&
|
||||
(text_props[text_prop_next].tp_flags
|
||||
|| (bcol == 0
|
||||
&& (text_props[text_prop_next].tp_flags
|
||||
& TP_FLAG_ALIGN_ABOVE)))
|
||||
: bcol >= text_props[text_prop_next].tp_col - 1))
|
||||
{
|
||||
if (text_props[text_prop_next].tp_col == MAXCOL
|
||||
&& *ptr == NUL && wp->w_p_list && lcs_eol_one > 0)
|
||||
{
|
||||
// first display the '$' after the line
|
||||
text_prop_follows = TRUE;
|
||||
break;
|
||||
}
|
||||
if (text_props[text_prop_next].tp_col == MAXCOL
|
||||
|| bcol <= text_props[text_prop_next].tp_col - 1
|
||||
+ text_props[text_prop_next].tp_len)
|
||||
@@ -1978,16 +1988,18 @@ win_line(
|
||||
text_prop_id = 0;
|
||||
reset_extra_attr = FALSE;
|
||||
}
|
||||
if (text_props_active > 0 && wlv.n_extra == 0)
|
||||
if (text_props_active > 0 && wlv.n_extra == 0
|
||||
&& !display_text_first)
|
||||
{
|
||||
int used_tpi = -1;
|
||||
int used_attr = 0;
|
||||
int other_tpi = -1;
|
||||
|
||||
// Sort the properties on priority and/or starting last.
|
||||
// Then combine the attributes, highest priority last.
|
||||
text_prop_above = FALSE;
|
||||
text_prop_follows = FALSE;
|
||||
|
||||
// Sort the properties on priority and/or starting last.
|
||||
// Then combine the attributes, highest priority last.
|
||||
sort_text_props(wp->w_buffer, text_props,
|
||||
text_prop_idxs, text_props_active);
|
||||
|
||||
@@ -2011,6 +2023,24 @@ win_line(
|
||||
| TP_FLAG_ALIGN_BELOW)) == 0
|
||||
&& wlv.col >= wp->w_width))
|
||||
{
|
||||
if (tp->tp_col == MAXCOL
|
||||
&& *ptr == NUL
|
||||
&& ((wp->w_p_list && lcs_eol_one > 0
|
||||
&& (tp->tp_flags
|
||||
& TP_FLAG_ALIGN_ABOVE) == 0)
|
||||
|| (ptr == line
|
||||
&& !did_line
|
||||
&& (tp->tp_flags
|
||||
& TP_FLAG_ALIGN_BELOW))))
|
||||
{
|
||||
// skip this prop, first display the '$' after
|
||||
// the line or display an empty line
|
||||
text_prop_follows = TRUE;
|
||||
if (used_tpi < 0)
|
||||
display_text_first = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pt->pt_hl_id > 0)
|
||||
used_attr = syn_id2attr(pt->pt_hl_id);
|
||||
text_prop_type = pt;
|
||||
@@ -2021,6 +2051,7 @@ win_line(
|
||||
text_prop_flags = pt->pt_flags;
|
||||
text_prop_id = tp->tp_id;
|
||||
used_tpi = tpi;
|
||||
display_text_first = FALSE;
|
||||
}
|
||||
}
|
||||
if (text_prop_id < 0 && used_tpi >= 0
|
||||
@@ -2103,6 +2134,9 @@ win_line(
|
||||
p_extra_free2 = wlv.p_extra;
|
||||
}
|
||||
|
||||
if (above)
|
||||
wlv.vcol_off_tp = wlv.n_extra;
|
||||
|
||||
if (lcs_eol_one < 0
|
||||
&& wp->w_p_wrap
|
||||
&& wlv.col
|
||||
@@ -2159,8 +2193,8 @@ win_line(
|
||||
// must wrap anyway.
|
||||
text_prop_above = above;
|
||||
text_prop_follows |= other_tpi != -1
|
||||
&& (wp->w_p_wrap
|
||||
|| (text_props[other_tpi].tp_flags
|
||||
&& (wp->w_p_wrap
|
||||
|| (text_props[other_tpi].tp_flags
|
||||
& (TP_FLAG_ALIGN_BELOW | TP_FLAG_ALIGN_RIGHT)));
|
||||
|
||||
if (bail_out)
|
||||
@@ -2495,6 +2529,12 @@ win_line(
|
||||
#ifdef FEAT_LINEBREAK
|
||||
c0 = *ptr;
|
||||
#endif
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
if (c == NUL)
|
||||
// text is finished, may display a "below" virtual text
|
||||
did_line = TRUE;
|
||||
#endif
|
||||
|
||||
if (has_mbyte)
|
||||
{
|
||||
mb_c = c;
|
||||
@@ -2965,9 +3005,9 @@ win_line(
|
||||
int saved_nextra = wlv.n_extra;
|
||||
|
||||
# ifdef FEAT_CONCEAL
|
||||
if (wlv.vcol_off > 0)
|
||||
if (wlv.vcol_off_co > 0)
|
||||
// there are characters to conceal
|
||||
tab_len += wlv.vcol_off;
|
||||
tab_len += wlv.vcol_off_co;
|
||||
|
||||
// boguscols before FIX_FOR_BOGUSCOLS macro from above
|
||||
if (wp->w_p_list && wp->w_lcs_chars.tab1
|
||||
@@ -3021,8 +3061,8 @@ win_line(
|
||||
// n_extra will be increased by
|
||||
// FIX_FOX_BOGUSCOLS macro below, so need to
|
||||
// adjust for that here
|
||||
if (wlv.vcol_off > 0)
|
||||
wlv.n_extra -= wlv.vcol_off;
|
||||
if (wlv.vcol_off_co > 0)
|
||||
wlv.n_extra -= wlv.vcol_off_co;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
@@ -3030,12 +3070,12 @@ win_line(
|
||||
#endif
|
||||
#ifdef FEAT_CONCEAL
|
||||
{
|
||||
int vc_saved = wlv.vcol_off;
|
||||
int vc_saved = wlv.vcol_off_co;
|
||||
|
||||
// Tab alignment should be identical regardless of
|
||||
// 'conceallevel' value. So tab compensates of all
|
||||
// previous concealed characters, and thus resets
|
||||
// vcol_off and boguscols accumulated so far in the
|
||||
// vcol_off_co and boguscols accumulated so far in the
|
||||
// line. Note that the tab can be longer than
|
||||
// 'tabstop' when there are concealed characters.
|
||||
FIX_FOR_BOGUSCOLS;
|
||||
@@ -3081,6 +3121,7 @@ win_line(
|
||||
}
|
||||
}
|
||||
else if (c == NUL
|
||||
&& wlv.n_extra == 0
|
||||
&& (wp->w_p_list
|
||||
|| ((wlv.fromcol >= 0 || fromcol_prev >= 0)
|
||||
&& wlv.tocol > wlv.vcol
|
||||
@@ -3299,7 +3340,7 @@ win_line(
|
||||
prev_syntax_id = syntax_seqnr;
|
||||
|
||||
if (wlv.n_extra > 0)
|
||||
wlv.vcol_off += wlv.n_extra;
|
||||
wlv.vcol_off_co += wlv.n_extra;
|
||||
wlv.vcol += wlv.n_extra;
|
||||
if (wp->w_p_wrap && wlv.n_extra > 0)
|
||||
{
|
||||
@@ -3576,20 +3617,31 @@ win_line(
|
||||
// At end of the text line.
|
||||
if (c == NUL)
|
||||
{
|
||||
draw_screen_line(wp, &wlv);
|
||||
|
||||
// Update w_cline_height and w_cline_folded if the cursor line was
|
||||
// updated (saves a call to plines() later).
|
||||
if (wp == curwin && lnum == curwin->w_cursor.lnum)
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
if (text_prop_follows)
|
||||
{
|
||||
curwin->w_cline_row = startrow;
|
||||
curwin->w_cline_height = wlv.row - startrow;
|
||||
#ifdef FEAT_FOLDING
|
||||
curwin->w_cline_folded = FALSE;
|
||||
#endif
|
||||
curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
|
||||
// Put the pointer back to the NUL.
|
||||
--ptr;
|
||||
c = ' ';
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
draw_screen_line(wp, &wlv);
|
||||
|
||||
// Update w_cline_height and w_cline_folded if the cursor line
|
||||
// was updated (saves a call to plines() later).
|
||||
if (wp == curwin && lnum == curwin->w_cursor.lnum)
|
||||
{
|
||||
curwin->w_cline_row = startrow;
|
||||
curwin->w_cline_height = wlv.row - startrow;
|
||||
#ifdef FEAT_FOLDING
|
||||
curwin->w_cline_folded = FALSE;
|
||||
#endif
|
||||
curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Show "extends" character from 'listchars' if beyond the line end and
|
||||
@@ -3762,9 +3814,9 @@ win_line(
|
||||
else if (wp->w_p_cole > 0 && is_concealing)
|
||||
{
|
||||
--n_skip;
|
||||
++wlv.vcol_off;
|
||||
++wlv.vcol_off_co;
|
||||
if (wlv.n_extra > 0)
|
||||
wlv.vcol_off += wlv.n_extra;
|
||||
wlv.vcol_off_co += wlv.n_extra;
|
||||
if (wp->w_p_wrap)
|
||||
{
|
||||
// Special voodoo required if 'wrap' is on.
|
||||
@@ -3857,7 +3909,7 @@ win_line(
|
||||
wlv.char_attr = vcol_save_attr;
|
||||
#endif
|
||||
|
||||
// restore attributes after "predeces" in 'listchars'
|
||||
// restore attributes after "precedes" in 'listchars'
|
||||
if (wlv.draw_state > WL_NR && n_attr3 > 0 && --n_attr3 == 0)
|
||||
wlv.char_attr = saved_attr3;
|
||||
|
||||
@@ -3894,7 +3946,7 @@ win_line(
|
||||
wlv_screen_line(wp, &wlv, FALSE);
|
||||
wlv.col += wlv.boguscols;
|
||||
wlv.boguscols = 0;
|
||||
wlv.vcol_off = 0;
|
||||
wlv.vcol_off_co = 0;
|
||||
#else
|
||||
wlv_screen_line(wp, &wlv, FALSE);
|
||||
#endif
|
||||
|
||||
@@ -1182,6 +1182,8 @@ EXTERN char e_invalid_command[]
|
||||
INIT(= N_("E476: Invalid command"));
|
||||
EXTERN char e_invalid_command_str[]
|
||||
INIT(= N_("E476: Invalid command: %s"));
|
||||
EXTERN char e_invalid_command_str_expected_str[]
|
||||
INIT(= N_("E476: Invalid command: %s, expected %s"));
|
||||
EXTERN char e_no_bang_allowed[]
|
||||
INIT(= N_("E477: No ! allowed"));
|
||||
EXTERN char e_dont_panic[]
|
||||
@@ -3442,4 +3444,8 @@ EXTERN char e_using_super_not_in_child_class[]
|
||||
INIT(= N_("E1358: Using \"super\" not in a child class"));
|
||||
EXTERN char e_cannot_define_new_function_in_abstract_class[]
|
||||
INIT(= N_("E1359: Cannot define a \"new\" function in an abstract class"));
|
||||
EXTERN char e_using_null_object[]
|
||||
INIT(= N_("E1360: Using a null object"));
|
||||
#endif
|
||||
EXTERN char e_cannot_use_color_none_did_you_mean_none[]
|
||||
INIT(= N_("E1361: Cannot use color \"none\", did you mean \"NONE\"?"));
|
||||
|
||||
12
src/eval.c
12
src/eval.c
@@ -1093,7 +1093,7 @@ get_lval(
|
||||
--p;
|
||||
lp->ll_name_end = p;
|
||||
}
|
||||
if (*p == ':')
|
||||
if (*skipwhite(p) == ':')
|
||||
{
|
||||
char_u *tp = skipwhite(p + 1);
|
||||
|
||||
@@ -1102,6 +1102,11 @@ get_lval(
|
||||
semsg(_(e_cannot_use_type_with_this_variable_str), name);
|
||||
return NULL;
|
||||
}
|
||||
if (VIM_ISWHITE(*p))
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_colon_str), p);
|
||||
return NULL;
|
||||
}
|
||||
if (tp == p + 1 && !quiet)
|
||||
{
|
||||
semsg(_(e_white_space_required_after_str_str), ":", p);
|
||||
@@ -6747,7 +6752,10 @@ handle_subscript(
|
||||
// the next line then consume the line break.
|
||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||
if (getnext
|
||||
&& ((rettv->v_type == VAR_DICT && *p == '.' && eval_isdictc(p[1]))
|
||||
&& ((*p == '.'
|
||||
&& ((rettv->v_type == VAR_DICT && eval_isdictc(p[1]))
|
||||
|| rettv->v_type == VAR_CLASS
|
||||
|| rettv->v_type == VAR_OBJECT))
|
||||
|| (p[0] == '-' && p[1] == '>' && (p[2] == '{'
|
||||
|| ASCII_ISALPHA(in_vim9script() ? *skipwhite(p + 2)
|
||||
: p[2])))))
|
||||
|
||||
@@ -585,7 +585,7 @@ check_map_filter_arg2(type_T *type, argcontext_T *context, int is_map)
|
||||
{
|
||||
type_T *expected_member = NULL;
|
||||
type_T *(args[2]);
|
||||
type_T t_func_exp = {VAR_FUNC, 2, 0, 0, NULL, args};
|
||||
type_T t_func_exp = {VAR_FUNC, 2, 0, 0, NULL, NULL, args};
|
||||
|
||||
if (context->arg_types[0].type_curr->tt_type == VAR_LIST
|
||||
|| context->arg_types[0].type_curr->tt_type == VAR_DICT)
|
||||
@@ -699,7 +699,7 @@ arg_sort_how(type_T *type, type_T *decl_type UNUSED, argcontext_T *context)
|
||||
if (type->tt_type == VAR_FUNC)
|
||||
{
|
||||
type_T *(args[2]);
|
||||
type_T t_func_exp = {VAR_FUNC, 2, 0, 0, &t_number, args};
|
||||
type_T t_func_exp = {VAR_FUNC, 2, 0, 0, &t_number, NULL, args};
|
||||
|
||||
if (context->arg_types[0].type_curr->tt_type == VAR_LIST)
|
||||
args[0] = context->arg_types[0].type_curr->tt_member;
|
||||
@@ -3056,8 +3056,8 @@ internal_func_is_map(int idx)
|
||||
int
|
||||
check_internal_func(int idx, int argcount)
|
||||
{
|
||||
int res;
|
||||
char *name;
|
||||
funcerror_T res;
|
||||
char *name;
|
||||
|
||||
if (argcount < global_functions[idx].f_min_argc)
|
||||
res = FCERR_TOOFEW;
|
||||
@@ -3074,7 +3074,7 @@ check_internal_func(int idx, int argcount)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
funcerror_T
|
||||
call_internal_func(
|
||||
char_u *name,
|
||||
int argcount,
|
||||
@@ -3107,7 +3107,7 @@ call_internal_func_by_idx(
|
||||
/*
|
||||
* Invoke a method for base->method().
|
||||
*/
|
||||
int
|
||||
funcerror_T
|
||||
call_internal_method(
|
||||
char_u *name,
|
||||
int argcount,
|
||||
@@ -3966,7 +3966,7 @@ execute_redir_str(char_u *value, int value_len)
|
||||
len = (int)STRLEN(value); // Append the entire string
|
||||
else
|
||||
len = value_len; // Append only "value_len" characters
|
||||
if (ga_grow(&redir_execute_ga, len) != OK)
|
||||
if (ga_grow(&redir_execute_ga, len) == FAIL)
|
||||
return;
|
||||
|
||||
mch_memmove((char *)redir_execute_ga.ga_data
|
||||
@@ -9940,7 +9940,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (!curwin->w_p_spell)
|
||||
{
|
||||
did_set_spelllang(curwin);
|
||||
parse_spelllang(curwin);
|
||||
curwin->w_p_spell = TRUE;
|
||||
}
|
||||
|
||||
@@ -10030,7 +10030,7 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (!curwin->w_p_spell)
|
||||
{
|
||||
did_set_spelllang(curwin);
|
||||
parse_spelllang(curwin);
|
||||
curwin->w_p_spell = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1363,8 +1363,8 @@ skip_var_one(char_u *arg, int include_type)
|
||||
|
||||
if (include_type && vim9)
|
||||
{
|
||||
if (*end == ':')
|
||||
end = skip_type(skipwhite(end + 1), FALSE);
|
||||
if (*skipwhite(end) == ':')
|
||||
end = skip_type(skipwhite(skipwhite(end) + 1), FALSE);
|
||||
}
|
||||
return end;
|
||||
}
|
||||
@@ -3960,7 +3960,7 @@ set_var_const(
|
||||
|| STRNCMP(name, "g:", 2) == 0 || var_in_autoload))
|
||||
goto failed;
|
||||
|
||||
di = alloc(sizeof(dictitem_T) + STRLEN(varname));
|
||||
di = alloc(offsetof(dictitem_T, di_key) + STRLEN(varname) + 1);
|
||||
if (di == NULL)
|
||||
goto failed;
|
||||
STRCPY(di->di_key, varname);
|
||||
|
||||
@@ -3142,7 +3142,7 @@ do_ecmd(
|
||||
// If the window options were changed may need to set the spell language.
|
||||
// Can only do this after the buffer has been properly setup.
|
||||
if (did_get_winopts && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
|
||||
(void)did_set_spelllang(curwin);
|
||||
(void)parse_spelllang(curwin);
|
||||
#endif
|
||||
|
||||
if (command == NULL)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user