Compare commits
216 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d4c1c7ba8 | ||
|
|
4f2df37a0d | ||
|
|
2d1c57ed3d | ||
|
|
4c13721482 | ||
|
|
e8209b91b9 | ||
|
|
39211cba72 | ||
|
|
b7c21afef1 | ||
|
|
d551d6c268 | ||
|
|
f7e92aae15 | ||
|
|
d23b714d8b | ||
|
|
51e933261b | ||
|
|
0995c81f2f | ||
|
|
c70fe460b0 | ||
|
|
6c7cc347af | ||
|
|
56994d2158 | ||
|
|
112a006417 | ||
|
|
635bd60804 | ||
|
|
aa1959bd5e | ||
|
|
fe090eb58f | ||
|
|
6bc00699c5 | ||
|
|
f387f5dfbc | ||
|
|
bd6406f15d | ||
|
|
b141926890 | ||
|
|
0e3ff19196 | ||
|
|
b47bed2f7a | ||
|
|
a3589a0d6c | ||
|
|
f62d73933a | ||
|
|
2e240bd428 | ||
|
|
f6a8d420a8 | ||
|
|
f2253963c2 | ||
|
|
f48b2fa33c | ||
|
|
68452177ca | ||
|
|
cfc3023cb6 | ||
|
|
af8ea0d066 | ||
|
|
09f067fca3 | ||
|
|
f93bbd0262 | ||
|
|
e8e3078184 | ||
|
|
fed9e830fc | ||
|
|
da479c7597 | ||
|
|
fe95b94ffa | ||
|
|
c429769776 | ||
|
|
bb8a7ce0a1 | ||
|
|
87795939d0 | ||
|
|
51e7e78de7 | ||
|
|
962c43bf0d | ||
|
|
599410cb3c | ||
|
|
701cc6ca9e | ||
|
|
1088b69451 | ||
|
|
2a38908b05 | ||
|
|
767034c5b8 | ||
|
|
dcae51facc | ||
|
|
d8db838392 | ||
|
|
175a41c13f | ||
|
|
fa5963880d | ||
|
|
15e5e53ef2 | ||
|
|
130cbfc312 | ||
|
|
125ed2745c | ||
|
|
e5b0b98a90 | ||
|
|
8dddc1f0e2 | ||
|
|
c9605f0595 | ||
|
|
643ce6c0c6 | ||
|
|
e3d1f4c982 | ||
|
|
e9b8b78e04 | ||
|
|
86cdb8a4bd | ||
|
|
e8c4660a55 | ||
|
|
0d351a04e1 | ||
|
|
58fb7c39a0 | ||
|
|
b9c0cd897a | ||
|
|
2927c07b0e | ||
|
|
01ac0a1f66 | ||
|
|
e42939af87 | ||
|
|
0865b15bc6 | ||
|
|
ce5b06a6a9 | ||
|
|
0b94e297af | ||
|
|
886e5e737d | ||
|
|
409da842db | ||
|
|
68ffe8cade | ||
|
|
f2dd9cb995 | ||
|
|
3c49e74e18 | ||
|
|
90193e6140 | ||
|
|
26af8e54ff | ||
|
|
3a6aadb328 | ||
|
|
ceb0619433 | ||
|
|
a7511c0f4f | ||
|
|
77709b194c | ||
|
|
440cf096fa | ||
|
|
6e50ec2f0a | ||
|
|
c17ba791a9 | ||
|
|
26f201345d | ||
|
|
6437475ffb | ||
|
|
c48f2dc0be | ||
|
|
b9c6b6fb73 | ||
|
|
0df6030145 | ||
|
|
f65ed86f6f | ||
|
|
1e6bbfb560 | ||
|
|
5b8cabfef7 | ||
|
|
dcf29ac87f | ||
|
|
f5906aa780 | ||
|
|
3fa5e64e0e | ||
|
|
ef38bcf051 | ||
|
|
160a2b4dac | ||
|
|
ca51cc0a33 | ||
|
|
d877a5700f | ||
|
|
ce0b75711a | ||
|
|
49c51b825a | ||
|
|
5c504f680e | ||
|
|
b91d3f857f | ||
|
|
529fb5a5f6 | ||
|
|
12be734faf | ||
|
|
e535db86e7 | ||
|
|
dad4473f02 | ||
|
|
ae0f151ddf | ||
|
|
82820d9bf1 | ||
|
|
38a3bfa9a2 | ||
|
|
9ea7e55ab9 | ||
|
|
8b9abfd86c | ||
|
|
9dbe701fe1 | ||
|
|
3215466af9 | ||
|
|
b2cb6c8bbd | ||
|
|
f6bdd82c7e | ||
|
|
b2ac7d0663 | ||
|
|
df749a2b9c | ||
|
|
f49a1fcdb9 | ||
|
|
24f21fdfca | ||
|
|
c580943965 | ||
|
|
7b45d46cf7 | ||
|
|
32105ae88f | ||
|
|
79efa2e3b3 | ||
|
|
7007e31bde | ||
|
|
bb5d87c850 | ||
|
|
ccc25aa285 | ||
|
|
c61cb8bfe1 | ||
|
|
74e54fcb44 | ||
|
|
522eefd9a2 | ||
|
|
a2b3e7dc92 | ||
|
|
0a1a6a1aa4 | ||
|
|
ff87140046 | ||
|
|
3a0f092ac0 | ||
|
|
fa984418e7 | ||
|
|
a91a71322d | ||
|
|
2fecb53115 | ||
|
|
1ff89deeaa | ||
|
|
c54f347d63 | ||
|
|
f4a2ed0714 | ||
|
|
f28f2ac425 | ||
|
|
49f1e9ec3e | ||
|
|
da1dbed0df | ||
|
|
1f448d906b | ||
|
|
e98f60a591 | ||
|
|
2cec027af4 | ||
|
|
f1387285e2 | ||
|
|
5ea79a2599 | ||
|
|
4c86830fc5 | ||
|
|
09f8b3a022 | ||
|
|
67da21a147 | ||
|
|
7a6eaa06f9 | ||
|
|
f90c855c71 | ||
|
|
196a1f7409 | ||
|
|
c5cf369e95 | ||
|
|
a0c8aea479 | ||
|
|
592f57f5fe | ||
|
|
a0399efa72 | ||
|
|
5c7a299c16 | ||
|
|
4355894869 | ||
|
|
240014321b | ||
|
|
af125866db | ||
|
|
74b99f6ab6 | ||
|
|
17709e280a | ||
|
|
a555e6fcb6 | ||
|
|
108cf0153c | ||
|
|
4b3e1964d8 | ||
|
|
5f91e74bf9 | ||
|
|
3f32788000 | ||
|
|
8863bda25d | ||
|
|
3e1916947d | ||
|
|
a4c81bea38 | ||
|
|
c970e4225b | ||
|
|
6ccfd99b92 | ||
|
|
18b7d86d7f | ||
|
|
f8c52e8d08 | ||
|
|
1e448465e1 | ||
|
|
3214812997 | ||
|
|
f4fcedc59d | ||
|
|
02b4d9b18a | ||
|
|
70ce8a1561 | ||
|
|
0289a093a4 | ||
|
|
240309c9bf | ||
|
|
77b10ffad4 | ||
|
|
2e34c34be1 | ||
|
|
6bce5856b5 | ||
|
|
93e1cae739 | ||
|
|
edba70703b | ||
|
|
6508880d6c | ||
|
|
cb4e80fab9 | ||
|
|
41cd80335c | ||
|
|
9e813b3dea | ||
|
|
0756f757ed | ||
|
|
0de8e2d6a3 | ||
|
|
c8cdf0f80b | ||
|
|
6fd367a97c | ||
|
|
c80f647512 | ||
|
|
12bce95887 | ||
|
|
776b954622 | ||
|
|
23b32a8d6b | ||
|
|
6635ae1437 | ||
|
|
f52f0606ed | ||
|
|
c23555de34 | ||
|
|
d345fb9216 | ||
|
|
7ad67d1150 | ||
|
|
ffb7dcdb77 | ||
|
|
37294bd6a2 | ||
|
|
e3ffcd9902 | ||
|
|
d00a7fb81a | ||
|
|
86c3a2162c | ||
|
|
9355ae4149 | ||
|
|
608d78fb45 |
20
.github/CODEOWNERS
vendored
20
.github/CODEOWNERS
vendored
@@ -22,6 +22,7 @@ runtime/autoload/vimball.vim @cecamp
|
||||
runtime/autoload/xmlformat.vim @chrisbra
|
||||
runtime/autoload/zip.vim @cecamp
|
||||
runtime/compiler/checkstyle.vim @dkearns
|
||||
runtime/compiler/cm3.vim @dkearns
|
||||
runtime/compiler/cucumber.vim @tpope
|
||||
runtime/compiler/dart.vim @dkearns
|
||||
runtime/compiler/dart2js.vim @dkearns
|
||||
@@ -42,6 +43,7 @@ runtime/compiler/jshint.vim @dkearns
|
||||
runtime/compiler/jsonlint.vim @dkearns
|
||||
runtime/compiler/lazbuild.vim @dkearns
|
||||
runtime/compiler/php.vim @dkearns
|
||||
runtime/compiler/powershell.vim @heaths
|
||||
runtime/compiler/rake.vim @tpope @dkearns
|
||||
runtime/compiler/rhino.vim @dkearns
|
||||
runtime/compiler/rspec.vim @tpope @dkearns
|
||||
@@ -67,6 +69,7 @@ runtime/doc/pi_netrw.txt @cecamp
|
||||
runtime/doc/pi_tar.txt @cecamp
|
||||
runtime/doc/pi_vimball.txt @cecamp
|
||||
runtime/doc/pi_zip.txt @cecamp
|
||||
runtime/doc/ps1.txt @heaths
|
||||
runtime/ftplugin/awk.vim @dkearns
|
||||
runtime/ftplugin/basic.vim @dkearns
|
||||
runtime/ftplugin/bst.vim @tpope
|
||||
@@ -88,11 +91,16 @@ runtime/ftplugin/javascript.vim @dkearns
|
||||
runtime/ftplugin/javascriptreact.vim @dkearns
|
||||
runtime/ftplugin/kconfig.vim @chrisbra
|
||||
runtime/ftplugin/liquid.vim @tpope
|
||||
runtime/ftplugin/m3build.vim @dkearns
|
||||
runtime/ftplugin/m3quake.vim @dkearns
|
||||
runtime/ftplugin/markdown.vim @tpope
|
||||
runtime/ftplugin/matlab.vim @cecamp
|
||||
runtime/ftplugin/modula3.vim @dkearns
|
||||
runtime/ftplugin/nroff.vim @a-vrma
|
||||
runtime/ftplugin/nsis.vim @k-takata
|
||||
runtime/ftplugin/pdf.vim @tpope
|
||||
runtime/ftplugin/ps1.vim @heaths
|
||||
runtime/ftplugin/ps1xml.vim @heaths
|
||||
runtime/ftplugin/ruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/sass.vim @tpope
|
||||
runtime/ftplugin/scss.vim @tpope
|
||||
@@ -111,6 +119,7 @@ runtime/indent/gitconfig.vim @tpope
|
||||
runtime/indent/haml.vim @tpope
|
||||
runtime/indent/liquid.vim @tpope
|
||||
runtime/indent/nsis.vim @k-takata
|
||||
runtime/indent/ps1.vim @heaths
|
||||
runtime/indent/ruby.vim @AndrewRadev @dkearns
|
||||
runtime/indent/sass.vim @tpope
|
||||
runtime/indent/scss.vim @tpope
|
||||
@@ -142,6 +151,7 @@ runtime/syntax/csh.vim @cecamp
|
||||
runtime/syntax/cucumber.vim @tpope
|
||||
runtime/syntax/datascript.vim @dpelle
|
||||
runtime/syntax/dcl.vim @cecamp
|
||||
runtime/syntax/desktop.vim @e-kwsm
|
||||
runtime/syntax/doxygen.vim @frogonwheels
|
||||
runtime/syntax/dtd.vim @chrisbra
|
||||
runtime/syntax/elmfilt.vim @cecamp
|
||||
@@ -152,6 +162,7 @@ runtime/syntax/gitcommit.vim @tpope
|
||||
runtime/syntax/gitconfig.vim @tpope
|
||||
runtime/syntax/gitrebase.vim @tpope
|
||||
runtime/syntax/gprof.vim @dpelle
|
||||
runtime/syntax/groff.vim @jmarshall
|
||||
runtime/syntax/haml.vim @tpope
|
||||
runtime/syntax/haskell.vim @coot
|
||||
runtime/syntax/hgcommit.vim @k-takata
|
||||
@@ -160,17 +171,22 @@ runtime/syntax/lex.vim @cecamp
|
||||
runtime/syntax/liquid.vim @tpope
|
||||
runtime/syntax/lisp.vim @cecamp
|
||||
runtime/syntax/lynx.vim @dkearns
|
||||
runtime/syntax/m3build.vim @dkearns
|
||||
runtime/syntax/m3quake.vim @dkearns
|
||||
runtime/syntax/mailcap.vim @dkearns
|
||||
runtime/syntax/make.vim @rohieb
|
||||
runtime/syntax/make.vim @rohieb
|
||||
runtime/syntax/maple.vim @cecamp
|
||||
runtime/syntax/markdown.vim @tpope
|
||||
runtime/syntax/modula3.vim @dkearns
|
||||
runtime/syntax/netrw.vim @cecamp
|
||||
runtime/syntax/nroff.vim @jmarshall
|
||||
runtime/syntax/nsis.vim @k-takata
|
||||
runtime/syntax/pdf.vim @tpope
|
||||
runtime/syntax/php.vim @TysonAndre
|
||||
runtime/syntax/privoxy.vim @dkearns
|
||||
runtime/syntax/prolog.vim @XVilka
|
||||
runtime/syntax/ps1.vim @heaths
|
||||
runtime/syntax/ps1xml.vim @heaths
|
||||
runtime/syntax/rc.vim @chrisbra
|
||||
runtime/syntax/rpcgen.vim @cecamp
|
||||
runtime/syntax/ruby.vim @dkearns
|
||||
@@ -180,7 +196,9 @@ runtime/syntax/sh.vim @cecamp
|
||||
runtime/syntax/sm.vim @cecamp
|
||||
runtime/syntax/spec.vim @ignatenkobrain
|
||||
runtime/syntax/sqloracle.vim @chrisbra
|
||||
runtime/syntax/sshconfig.vim @Jakuje
|
||||
runtime/syntax/sshdconfig.vim @Jakuje
|
||||
runtime/syntax/sudoers.vim @e-kwsm
|
||||
runtime/syntax/tags.vim @cecamp
|
||||
runtime/syntax/teraterm.vim @k-takata
|
||||
runtime/syntax/tex.vim @cecamp
|
||||
|
||||
3
Filelist
3
Filelist
@@ -13,7 +13,8 @@ SRC_ALL = \
|
||||
.hgignore \
|
||||
.lgtm.yml \
|
||||
.travis.yml \
|
||||
appveyor.yml \
|
||||
.appveyor.yml \
|
||||
.codecov.yml \
|
||||
ci/appveyor.bat \
|
||||
ci/build-snd-dummy.sh \
|
||||
ci/config.mk*.sed \
|
||||
|
||||
29
README.md
29
README.md
@@ -7,12 +7,14 @@
|
||||
|
||||
## What is Vim? ##
|
||||
|
||||
Vim is a greatly improved version of the good old UNIX editor Vi. Many new
|
||||
Vim is a greatly improved version of the good old UNIX editor
|
||||
[Vi](https://en.wikipedia.org/wiki/Vi). Many new
|
||||
features have been added: multi-level undo, syntax highlighting, command line
|
||||
history, on-line help, spell checking, filename completion, block operations,
|
||||
script language, etc. There is also a Graphical User Interface (GUI)
|
||||
available. Still, Vi compatibility is maintained, those who have Vi "in the
|
||||
fingers" will feel at home. See `runtime/doc/vi_diff.txt` for differences with
|
||||
fingers" will feel at home.
|
||||
See [`runtime/doc/vi_diff.txt`](runtime/doc/vi_diff.txt) for differences with
|
||||
Vi.
|
||||
|
||||
This editor is very useful for editing programs and other plain text files.
|
||||
@@ -42,7 +44,7 @@ want or must compile it yourself. Check http://www.vim.org/download.php for
|
||||
an overview of currently available distributions.
|
||||
|
||||
Some popular places to get the latest Vim:
|
||||
* Check out the git repository from [github](https://github.com/vim/vim).
|
||||
* Check out the git repository from [GitHub](https://github.com/vim/vim).
|
||||
* Get the source code as an [archive](https://github.com/vim/vim/releases).
|
||||
* Get a Windows executable from the
|
||||
[vim-win32-installer](https://github.com/vim/vim-win32-installer/releases) repository.
|
||||
@@ -53,14 +55,14 @@ Some popular places to get the latest Vim:
|
||||
|
||||
If you obtained a binary distribution you don't need to compile Vim. If you
|
||||
obtained a source distribution, all the stuff for compiling Vim is in the
|
||||
`src` directory. See `src/INSTALL` for instructions.
|
||||
[`src`](/src) directory. See [`src/INSTALL`](src/INSTALL) for instructions.
|
||||
|
||||
|
||||
## Installation ##
|
||||
|
||||
See one of these files for system-specific instructions. Either in the
|
||||
READMEdir directory (in the repository) or the top directory (if you unpack an
|
||||
archive):
|
||||
[READMEdir directory](./READMEdir/) (in the repository) or
|
||||
the top directory (if you unpack an archive):
|
||||
|
||||
README_ami.txt Amiga
|
||||
README_unix.txt Unix
|
||||
@@ -78,8 +80,9 @@ The Vim tutor is a one hour training course for beginners. Often it can be
|
||||
started as `vimtutor`. See `:help tutor` for more information.
|
||||
|
||||
The best is to use `:help` in Vim. If you don't have an executable yet, read
|
||||
`runtime/doc/help.txt`. It contains pointers to the other documentation
|
||||
files. The User Manual reads like a book and is recommended to learn to use
|
||||
[`runtime/doc/help.txt`](/runtime/doc/help.txt).
|
||||
It contains pointers to the other documentation files.
|
||||
The User Manual reads like a book and is recommended to learn to use
|
||||
Vim. See `:help user-manual`.
|
||||
|
||||
|
||||
@@ -87,7 +90,8 @@ Vim. See `:help user-manual`.
|
||||
|
||||
Vim is Charityware. You can use and copy it as much as you like, but you are
|
||||
encouraged to make a donation to help orphans in Uganda. Please read the file
|
||||
`runtime/doc/uganda.txt` for details (do `:help uganda` inside Vim).
|
||||
[`runtime/doc/uganda.txt`](runtime/doc/uganda.txt)
|
||||
for details (do `:help uganda` inside Vim).
|
||||
|
||||
Summary of the license: There are no restrictions on using or distributing an
|
||||
unmodified copy of Vim. Parts of Vim may also be distributed, but the license
|
||||
@@ -103,8 +107,8 @@ your appreciation for the work and motivate Bram and others to continue
|
||||
working on Vim please send a donation.
|
||||
|
||||
Since Bram is back to a paid job the money will now be used to help children
|
||||
in Uganda. See `runtime/doc/uganda.txt`. But at the same time donations
|
||||
increase Bram's motivation to keep working on Vim!
|
||||
in Uganda. See [`runtime/doc/uganda.txt`](runtime/doc/uganda.txt). But
|
||||
at the same time donations increase Bram's motivation to keep working on Vim!
|
||||
|
||||
For the most recent information about sponsoring look on the Vim web site:
|
||||
http://www.vim.org/sponsor/
|
||||
@@ -112,7 +116,8 @@ For the most recent information about sponsoring look on the Vim web site:
|
||||
|
||||
## Contributing ##
|
||||
|
||||
If you would like to help making Vim better, see the [CONTRIBUTING.md](https://github.com/vim/vim/blob/master/CONTRIBUTING.md) file.
|
||||
If you would like to help making Vim better, see the
|
||||
[CONTRIBUTING.md](/CONTRIBUTING.md) file.
|
||||
|
||||
|
||||
## Information ##
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
README_mac.txt for version 8.2 of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on Macintosh systems.
|
||||
This file explains the installation of Vim on MacOS systems.
|
||||
See "README.txt" for general information about Vim.
|
||||
|
||||
To build from source get the files with git from https://github.com/vim/vim.
|
||||
The find the instructions in src/INSTALLmac.txt.
|
||||
|
||||
To build from sources, like on Unix
|
||||
|
||||
1. Get the build tools: "clang" and "make". These can be installed with the
|
||||
"CommandLineTools" package. If you don't have one, do
|
||||
xcode-select --install
|
||||
Just like for any software development with OS X.
|
||||
|
||||
2. Get the source code. Best is to use git (which you need to install first),
|
||||
see http://www.vim.org/git.php
|
||||
Or you can download and unpack the Unix tar archive, see
|
||||
http://www.vim.org/download.php
|
||||
|
||||
3. Go to the top directory of the source tree, do
|
||||
make
|
||||
sudo make install
|
||||
A newly built vim will be installed under "/usr/local".
|
||||
|
||||
|
||||
If you can't manage to make this work, there is a fallback using Homebrew:
|
||||
|
||||
Installing Vim using Homebrew:
|
||||
1. Install Homebrew from http://brew.sh/
|
||||
2. Install latest Vim with: brew install vim
|
||||
2. Install the latest Vim with:
|
||||
brew install vim
|
||||
|
||||
@@ -6,7 +6,7 @@ if 1
|
||||
echo "*** Interface versions ***\n"
|
||||
|
||||
echo 'Lua:'
|
||||
PrintVer lua print(_VERSION)
|
||||
PrintVer lua print(vim.lua_version, jit and "(LuaJIT)" or "")
|
||||
|
||||
echo 'MzScheme:'
|
||||
PrintVer mzscheme (display (version))
|
||||
|
||||
26
runtime/compiler/cm3.vim
Normal file
26
runtime/compiler/cm3.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Critical Mass Modula-3 Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "cm3"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" TODO: better handling of Quake errors
|
||||
CompilerSet makeprg=cm3
|
||||
CompilerSet errorformat=%D---\ building\ in\ %f\ ---,
|
||||
\%W\"%f\"\\,\ line\ %l:\ warning:\ %m,
|
||||
\%E\"%f\"\\,\ line\ %l:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
84
runtime/compiler/powershell.vim
Normal file
84
runtime/compiler/powershell.vim
Normal file
@@ -0,0 +1,84 @@
|
||||
" Vim compiler file
|
||||
" Compiler: powershell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2020 Mar 30
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "powershell"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
if !exists("g:ps1_makeprg_cmd")
|
||||
if executable('pwsh')
|
||||
" pwsh is the future
|
||||
let g:ps1_makeprg_cmd = 'pwsh'
|
||||
elseif executable('pwsh.exe')
|
||||
let g:ps1_makeprg_cmd = 'pwsh.exe'
|
||||
elseif executable('powershell.exe')
|
||||
let g:ps1_makeprg_cmd = 'powershell.exe'
|
||||
else
|
||||
let g:ps1_makeprg_cmd = ''
|
||||
endif
|
||||
endif
|
||||
|
||||
if !executable(g:ps1_makeprg_cmd)
|
||||
echoerr "To use the powershell compiler, please set g:ps1_makeprg_cmd to the powershell executable!"
|
||||
endif
|
||||
|
||||
" Show CategoryInfo, FullyQualifiedErrorId, etc?
|
||||
let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0)
|
||||
|
||||
" Use absolute path because powershell requires explicit relative paths
|
||||
" (./file.ps1 is okay, but # expands to file.ps1)
|
||||
let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S'
|
||||
|
||||
" Parse file, line, char from callstacks:
|
||||
" Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a
|
||||
" cmdlet, function, script file, or operable program. Check the spelling
|
||||
" of the name, or if a path was included, verify that the path is correct
|
||||
" and try again.
|
||||
" At C:\script.ps1:11 char:5
|
||||
" + Write-Ouput $content
|
||||
" + ~~~~~~~~~~~
|
||||
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
|
||||
" + FullyQualifiedErrorId : CommandNotFoundException
|
||||
|
||||
" Showing error in context with underlining.
|
||||
CompilerSet errorformat=%+G+%m
|
||||
" Error summary.
|
||||
CompilerSet errorformat+=%E%*\\S\ :\ %m
|
||||
" Error location.
|
||||
CompilerSet errorformat+=%CAt\ %f:%l\ char:%c
|
||||
" Errors that span multiple lines (may be wrapped to width of terminal).
|
||||
CompilerSet errorformat+=%C%m
|
||||
" Ignore blank/whitespace-only lines.
|
||||
CompilerSet errorformat+=%Z\\s%#
|
||||
|
||||
if g:ps1_efm_show_error_categories
|
||||
CompilerSet errorformat^=%+G\ \ \ \ +\ %.%#\\s%#:\ %m
|
||||
else
|
||||
CompilerSet errorformat^=%-G\ \ \ \ +\ %.%#\\s%#:\ %m
|
||||
endif
|
||||
|
||||
|
||||
" Parse file, line, char from of parse errors:
|
||||
" At C:\script.ps1:22 char:16
|
||||
" + Stop-Process -Name "invalidprocess
|
||||
" + ~~~~~~~~~~~~~~~
|
||||
" The string is missing the terminator: ".
|
||||
" + CategoryInfo : ParserError: (:) [], ParseException
|
||||
" + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
|
||||
CompilerSet errorformat+=At\ %f:%l\ char:%c
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set sw=2 sts=2:
|
||||
@@ -30,6 +30,7 @@ DOCS = \
|
||||
filetype.txt \
|
||||
fold.txt \
|
||||
ft_ada.txt \
|
||||
ft_ps1.txt \
|
||||
ft_rust.txt \
|
||||
ft_sql.txt \
|
||||
gui.txt \
|
||||
@@ -173,6 +174,7 @@ HTMLS = \
|
||||
filetype.html \
|
||||
fold.html \
|
||||
ft_ada.html \
|
||||
ft_ps1.html \
|
||||
ft_rust.html \
|
||||
ft_sql.html \
|
||||
gui.html \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 Jan 28
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 Mar 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1519,9 +1519,11 @@ option will not cause any commands to be executed.
|
||||
*:doautoa* *:doautoall*
|
||||
:doautoa[ll] [<nomodeline>] [group] {event} [fname]
|
||||
Like ":doautocmd", but apply the autocommands to each
|
||||
loaded buffer. Note that [fname] is used to select
|
||||
the autocommands, not the buffers to which they are
|
||||
applied.
|
||||
loaded buffer. The current buffer is done last.
|
||||
|
||||
Note that [fname] is used to select the autocommands,
|
||||
not the buffers to which they are applied.
|
||||
|
||||
Careful: Don't use this for autocommands that delete a
|
||||
buffer, change to another buffer or change the
|
||||
contents of a buffer; the result is unpredictable.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -649,6 +649,8 @@ For other systems the tmpnam() library function is used.
|
||||
The space between `:substitute` and the 'c', 'g',
|
||||
'i', 'I' and 'r' flags isn't required, but in scripts
|
||||
it's a good idea to keep it to avoid confusion.
|
||||
Also see the two and three letter commands to repeat
|
||||
:substitute below |:substitute-repeat|.
|
||||
|
||||
:[range]~[&][flags] [count] *:~*
|
||||
Repeat last substitute with same substitute string
|
||||
@@ -877,20 +879,26 @@ either the first or second pattern in parentheses did not match, so either
|
||||
*:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
|
||||
*:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
|
||||
*:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
|
||||
*:srn* *:srp*
|
||||
*:srn* *:srp* *:substitute-repeat*
|
||||
2-letter and 3-letter :substitute commands ~
|
||||
|
||||
These commands repeat the previous `:substitute` command with the given flags.
|
||||
The first letter is always "s", followed by one or two of the possible flag
|
||||
characters. For example `:sce` works like `:s///ce`. The table lists the
|
||||
possible combinations, not all flags are possible, because the command is
|
||||
short for another command.
|
||||
|
||||
List of :substitute commands
|
||||
| c e g i I n p l r
|
||||
| c :sc :sce :scg :sci :scI :scn :scp :scl ---
|
||||
| c :sc :sce :scg :sci :scI :scn :scp :scl
|
||||
| e
|
||||
| g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
|
||||
| i :sic :sie --- :si :siI :sin :sip --- :sir
|
||||
| i :sic :sie :si :siI :sin :sip :sir
|
||||
| I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
|
||||
| n
|
||||
| p
|
||||
| l
|
||||
| r :src --- :srg :sri :srI :srn :srp :srl :sr
|
||||
| r :src :srg :sri :srI :srn :srp :srl :sr
|
||||
|
||||
Exceptions:
|
||||
:scr is `:scriptnames`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Jan 26
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -597,9 +597,11 @@ followed by another Vim command:
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:helpgrep
|
||||
:lcscope
|
||||
:ldo
|
||||
:lfdo
|
||||
:lhelpgrep
|
||||
:make
|
||||
:normal
|
||||
:perl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Jan 08
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1253,7 +1253,7 @@ For versions of Vim where browsing is not supported, the command is executed
|
||||
unmodified.
|
||||
|
||||
*browsefilter*
|
||||
For MS Windows and GTK, you can modify the filters that are used in the browse
|
||||
For MS-Windows and GTK, you can modify the filters that are used in the browse
|
||||
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
|
||||
change the filters globally or locally to the buffer. The variable is set to
|
||||
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Feb 10
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Apr 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -439,8 +439,8 @@ Changing the order of items in a list: >
|
||||
|
||||
For loop ~
|
||||
|
||||
The |:for| loop executes commands for each item in a list. A variable is set
|
||||
to each item in the list in sequence. Example: >
|
||||
The |:for| loop executes commands for each item in a List, String or Blob.
|
||||
A variable is set to each item in sequence. Example with a List: >
|
||||
:for item in mylist
|
||||
: call Doit(item)
|
||||
:endfor
|
||||
@@ -457,7 +457,7 @@ If all you want to do is modify each item in the list then the |map()|
|
||||
function will be a simpler method than a for loop.
|
||||
|
||||
Just like the |:let| command, |:for| also accepts a list of variables. This
|
||||
requires the argument to be a list of lists. >
|
||||
requires the argument to be a List of Lists. >
|
||||
:for [lnum, col] in [[1, 3], [2, 8], [3, 0]]
|
||||
: call Doit(lnum, col)
|
||||
:endfor
|
||||
@@ -473,6 +473,14 @@ It is also possible to put remaining items in a List variable: >
|
||||
: endif
|
||||
:endfor
|
||||
|
||||
For a Blob one byte at a time is used.
|
||||
|
||||
For a String one character, including any composing characters, is used as a
|
||||
String. Example: >
|
||||
for c in text
|
||||
echo 'This character is ' .. c
|
||||
endfor
|
||||
|
||||
|
||||
List functions ~
|
||||
*E714*
|
||||
@@ -1187,7 +1195,8 @@ byte under the cursor: >
|
||||
|
||||
In Vim9 script:
|
||||
If expr8 is a String this results in a String that contains the expr1'th
|
||||
single character from expr8. To use byte indexes use |strpart()|.
|
||||
single character (including any composing characters) from expr8. To use byte
|
||||
indexes use |strpart()|.
|
||||
|
||||
Index zero gives the first byte or character. Careful: text column numbers
|
||||
start with one!
|
||||
@@ -1217,8 +1226,9 @@ In legacy Vim script the indexes are byte indexes. This doesn't recognize
|
||||
multibyte encodings, see |byteidx()| for computing the indexes. If expr8 is
|
||||
a Number it is first converted to a String.
|
||||
|
||||
In Vim9 script the indexes are character indexes. To use byte indexes use
|
||||
|strpart()|.
|
||||
In Vim9 script the indexes are character indexes and include composing
|
||||
characters. To use byte indexes use |strpart()|. To use character indexes
|
||||
without including composing characters use |strcharpart()|.
|
||||
|
||||
The item at index expr1b is included, it is inclusive. For an exclusive index
|
||||
use the |slice()| function.
|
||||
@@ -1540,8 +1550,11 @@ the following ways:
|
||||
|
||||
The arguments are optional. Example: >
|
||||
:let F = {-> 'error function'}
|
||||
:echo F()
|
||||
:echo F('ignored')
|
||||
< error function
|
||||
|
||||
Note that in Vim9 script another kind of lambda can be used: |vim9-lambda|.
|
||||
|
||||
*closure*
|
||||
Lambda expressions can access outer scope variables and arguments. This is
|
||||
often called a closure. Example where "i" and "a:arg" are used in a lambda
|
||||
@@ -1576,7 +1589,7 @@ The lambda expression is also useful for Channel, Job and timer: >
|
||||
Handler called
|
||||
|
||||
Note how execute() is used to execute an Ex command. That's ugly though.
|
||||
|
||||
In Vim9 script you can use a command block, see |inline-function|.
|
||||
|
||||
Lambda expressions have internal names like '<lambda>42'. If you get an error
|
||||
for a lambda expression, you can find what it is with the following command: >
|
||||
@@ -2430,6 +2443,7 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}])
|
||||
Number assert {actual} is inside the range
|
||||
assert_match({pat}, {text} [, {msg}])
|
||||
Number assert {pat} matches {text}
|
||||
assert_nobeep({cmd}) Number assert {cmd} does not cause a beep
|
||||
assert_notequal({exp}, {act} [, {msg}])
|
||||
Number assert {exp} is not equal {act}
|
||||
assert_notmatch({pat}, {text} [, {msg}])
|
||||
@@ -2923,10 +2937,11 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to
|
||||
ASCII/UTF8 value
|
||||
str2nr({expr} [, {base} [, {quoted}]])
|
||||
Number convert String to Number
|
||||
strcharpart({str}, {start} [, {len}])
|
||||
strcharlen({expr}) Number character length of the String {expr}
|
||||
strcharpart({str}, {start} [, {len} [, {skipcc}]])
|
||||
String {len} characters of {str} at
|
||||
character {start}
|
||||
strchars({expr} [, {skipcc}]) Number character length of the String {expr}
|
||||
strchars({expr} [, {skipcc}]) Number character count of the String {expr}
|
||||
strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
|
||||
strftime({format} [, {time}]) String format time with a specified format
|
||||
strgetchar({str}, {index}) Number get char {index} from {str}
|
||||
@@ -5096,6 +5111,13 @@ getbufinfo([{dict}])
|
||||
listed TRUE if the buffer is listed.
|
||||
lnum Line number used for the buffer when
|
||||
opened in the current window.
|
||||
Only valid if the buffer has been
|
||||
displayed in the window in the past.
|
||||
If you want the line number of the
|
||||
last known cursor position in a given
|
||||
window, use |line()|: >
|
||||
:echo line('.', {winid})
|
||||
<
|
||||
linecount Number of lines in the buffer (only
|
||||
valid when loaded)
|
||||
loaded TRUE if the buffer is loaded.
|
||||
@@ -5300,6 +5322,9 @@ getcharpos({expr})
|
||||
Get the position for {expr}. Same as |getpos()| but the column
|
||||
number in the returned List is a character index instead of
|
||||
a byte index.
|
||||
If |getpos()| returns a very large column number, such as
|
||||
2147483647, then getcharpos() will return the character index
|
||||
of the last character.
|
||||
|
||||
Example:
|
||||
With the cursor on '세' in line 5 with text "여보세요": >
|
||||
@@ -5779,6 +5804,8 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
|
||||
The column number in the returned List is the byte position
|
||||
within the line. To get the character position in the line,
|
||||
use |getcharpos()|
|
||||
The column number can be very large, e.g. 2147483647, in which
|
||||
case it means "after the end of the line".
|
||||
This can be used to save and restore the position of a mark: >
|
||||
let save_a_mark = getpos("'a")
|
||||
...
|
||||
@@ -6063,7 +6090,7 @@ getwininfo([{winid}]) *getwininfo()*
|
||||
tab pages is returned.
|
||||
|
||||
Each List item is a |Dictionary| with the following entries:
|
||||
botline last displayed buffer line
|
||||
botline last complete displayed buffer line
|
||||
bufnr number of buffer in the window
|
||||
height window height (excluding winbar)
|
||||
loclist 1 if showing a location list
|
||||
@@ -6079,12 +6106,12 @@ getwininfo([{winid}]) *getwininfo()*
|
||||
width window width
|
||||
winbar 1 if the window has a toolbar, 0
|
||||
otherwise
|
||||
wincol leftmost screen column of the window,
|
||||
col from |win_screenpos()|
|
||||
wincol leftmost screen column of the window;
|
||||
"col" from |win_screenpos()|
|
||||
winid |window-ID|
|
||||
winnr window number
|
||||
winrow topmost screen column of the window,
|
||||
row from |win_screenpos()|
|
||||
winrow topmost screen line of the window;
|
||||
"row" from |win_screenpos()|
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWinnr()->getwininfo()
|
||||
@@ -7450,7 +7477,8 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
|
||||
to be used when fast match additions and deletions are
|
||||
required, for example to highlight matching parentheses.
|
||||
|
||||
The list {pos} can contain one of these items:
|
||||
{pos} is a list of positions. Each position can be one of
|
||||
these:
|
||||
- A number. This whole line will be highlighted. The first
|
||||
line has number 1.
|
||||
- A list with one number, e.g., [23]. The whole line with this
|
||||
@@ -7463,7 +7491,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
|
||||
- A list with three numbers, e.g., [23, 11, 3]. As above, but
|
||||
the third number gives the length of the highlight in bytes.
|
||||
|
||||
The maximum number of positions is 8.
|
||||
The maximum number of positions in {pos} is 8.
|
||||
|
||||
Example: >
|
||||
:highlight MyGroup ctermbg=green guibg=green
|
||||
@@ -7472,8 +7500,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
|
||||
:call matchdelete(m)
|
||||
|
||||
< Matches added by |matchaddpos()| are returned by
|
||||
|getmatches()| with an entry "pos1", "pos2", etc., with the
|
||||
value a list like the {pos} item.
|
||||
|getmatches()|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetGroup()->matchaddpos([23, 11])
|
||||
@@ -9913,7 +9940,7 @@ slice({expr}, {start} [, {end}]) *slice()*
|
||||
Similar to using a |slice| "expr[start : end]", but "end" is
|
||||
used exclusive. And for a string the indexes are used as
|
||||
character indexes instead of byte indexes, like in
|
||||
|vim9script|.
|
||||
|vim9script|. Also, composing characters are not counted.
|
||||
When {end} is omitted the slice continues to the last item.
|
||||
When {end} is -1 the last item is omitted.
|
||||
|
||||
@@ -10271,23 +10298,44 @@ str2nr({expr} [, {base} [, {quoted}]]) *str2nr()*
|
||||
Can also be used as a |method|: >
|
||||
GetText()->str2nr()
|
||||
|
||||
strcharpart({src}, {start} [, {len}]) *strcharpart()*
|
||||
|
||||
strcharlen({expr}) *strcharlen()*
|
||||
The result is a Number, which is the number of characters
|
||||
in String {expr}. Composing characters are ignored.
|
||||
|strchars()| can count the number of characters, counting
|
||||
composing characters separately.
|
||||
|
||||
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetText()->strcharlen()
|
||||
|
||||
|
||||
strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()*
|
||||
Like |strpart()| but using character index and length instead
|
||||
of byte index and length.
|
||||
When {skipcc} is omitted or zero, composing characters are
|
||||
counted separately.
|
||||
When {skipcc} set to 1, Composing characters are ignored,
|
||||
similar to |slice()|.
|
||||
When a character index is used where a character does not
|
||||
exist it is assumed to be one character. For example: >
|
||||
exist it is omitted and counted as one character. For
|
||||
example: >
|
||||
strcharpart('abc', -1, 2)
|
||||
< results in 'a'.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetText()->strcharpart(5)
|
||||
|
||||
|
||||
strchars({expr} [, {skipcc}]) *strchars()*
|
||||
The result is a Number, which is the number of characters
|
||||
in String {expr}.
|
||||
When {skipcc} is omitted or zero, composing characters are
|
||||
counted separately.
|
||||
When {skipcc} set to 1, Composing characters are ignored.
|
||||
|strcharlen()| always does this.
|
||||
|
||||
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
{skipcc} is only available after 7.4.755. For backward
|
||||
@@ -11821,7 +11869,7 @@ gui_mac Compiled with Macintosh GUI.
|
||||
gui_motif Compiled with Motif GUI.
|
||||
gui_photon Compiled with Photon GUI.
|
||||
gui_running Vim is running in the GUI, or it will start soon.
|
||||
gui_win32 Compiled with MS Windows Win32 GUI.
|
||||
gui_win32 Compiled with MS-Windows Win32 GUI.
|
||||
gui_win32s idem, and Win32s system being used (Windows 3.1)
|
||||
haiku Haiku version of Vim.
|
||||
hangul_input Compiled with Hangul input support. |hangul|
|
||||
@@ -12773,8 +12821,8 @@ text...
|
||||
it can no longer be changed (until it is unlocked).
|
||||
A locked variable can be deleted: >
|
||||
:lockvar v
|
||||
:let v = 'asdf' " fails!
|
||||
:unlet v
|
||||
:let v = 'asdf' " fails!
|
||||
:unlet v " works
|
||||
< *E741* *E940*
|
||||
If you try to change a locked variable you get an
|
||||
error message: "E741: Value is locked: {name}".
|
||||
@@ -13112,7 +13160,12 @@ text...
|
||||
< If you just want a highlighted message use |:echohl|.
|
||||
And to get a beep: >
|
||||
:exe "normal \<Esc>"
|
||||
<
|
||||
|
||||
:echoc[onsole] {expr1} .. *:echoc* *:echoconsole*
|
||||
Intended for testing: works like `:echomsg` but when
|
||||
running in the GUI and started from a terminal write
|
||||
the text to stdout.
|
||||
|
||||
*:eval*
|
||||
:eval {expr} Evaluate {expr} and discard the result. Example: >
|
||||
:eval Getlist()->Filter()->append('$')
|
||||
@@ -13142,7 +13195,7 @@ text...
|
||||
Cannot be followed by a comment.
|
||||
Examples: >
|
||||
:execute "buffer" nextbuf
|
||||
:execute "normal" count . "w"
|
||||
:execute "normal" count .. "w"
|
||||
<
|
||||
":execute" can be used to append a command to commands
|
||||
that don't accept a '|'. Example: >
|
||||
@@ -13158,8 +13211,8 @@ text...
|
||||
file names. The |fnameescape()| function can be used
|
||||
for Vim commands, |shellescape()| for |:!| commands.
|
||||
Examples: >
|
||||
:execute "e " . fnameescape(filename)
|
||||
:execute "!ls " . shellescape(filename, 1)
|
||||
:execute "e " .. fnameescape(filename)
|
||||
:execute "!ls " .. shellescape(filename, 1)
|
||||
<
|
||||
Note: The executed string may be any command-line, but
|
||||
starting or ending "if", "while" and "for" does not
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2021 Mar 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -628,6 +628,13 @@ For fish, add to the config file
|
||||
|
||||
set -x MANPAGER "vim -M +MANPAGER -"
|
||||
|
||||
|
||||
MARKDOWN *ft-markdown-plugin*
|
||||
|
||||
To enable folding use this: >
|
||||
let g:markdown_folding = 1
|
||||
<
|
||||
|
||||
PDF *ft-pdf-plugin*
|
||||
|
||||
Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating
|
||||
|
||||
64
runtime/doc/ft_ps1.txt
Normal file
64
runtime/doc/ft_ps1.txt
Normal file
@@ -0,0 +1,64 @@
|
||||
*ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
|
||||
Author: Peter Provost <https://www.github.com/PProvost>
|
||||
License: Apache 2.0
|
||||
URL: https://github.com/PProvost/vim-ps1
|
||||
|
||||
INTRODUCTION *ps1-syntax*
|
||||
|
||||
This plugin provides Vim syntax, indent and filetype detection for Windows
|
||||
PowerShell scripts, modules, and XML configuration files.
|
||||
|
||||
|
||||
ABOUT *ps1-about*
|
||||
|
||||
Grab the latest version or report a bug on GitHub:
|
||||
|
||||
https://github.com/PProvost/vim-ps1
|
||||
|
||||
|
||||
FOLDING *ps1-folding*
|
||||
|
||||
The ps1 syntax file provides syntax folding (see |:syn-fold|) for script blocks
|
||||
and digital signatures in scripts.
|
||||
|
||||
When 'foldmethod' is set to "syntax" then function script blocks will be
|
||||
folded unless you use the following in your .vimrc or before opening a script: >
|
||||
|
||||
:let g:ps1_nofold_blocks = 1
|
||||
<
|
||||
Digital signatures in scripts will also be folded unless you use: >
|
||||
|
||||
:let g:ps1_nofold_sig = 1
|
||||
<
|
||||
Note: syntax folding might slow down syntax highlighting significantly,
|
||||
especially for large files.
|
||||
|
||||
|
||||
COMPILER *ps1-compiler*
|
||||
|
||||
The powershell `:compiler` script configures |:make| to execute the script in
|
||||
PowerShell.
|
||||
|
||||
It tries to pick a smart default PowerShell command: `pwsh` if available and
|
||||
`powershell` otherwise, but you can customize the command: >
|
||||
|
||||
:let g:ps1_makeprg_cmd = '/path/to/pwsh'
|
||||
<
|
||||
To configure whether to show the exception type information: >
|
||||
|
||||
:let g:ps1_efm_show_error_categories = 1
|
||||
<
|
||||
|
||||
KEYWORD LOOKUP *ps1-keyword*
|
||||
|
||||
To look up keywords using PowerShell's Get-Help, press the |K| key. For more
|
||||
convenient paging, the pager `less` should be installed, which is included in
|
||||
many Linux distributions and in macOS.
|
||||
|
||||
Many other distributions are available for Windows like
|
||||
https://chocolatey.org/packages/less/. Make sure `less` is in a directory
|
||||
listed in the `PATH` environment variable, which chocolatey above does.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
vim:ft=help:
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2020 Mar 25
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -403,7 +403,7 @@ The "File/Print" menu prints the text with syntax highlighting, see
|
||||
printer installed this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
Vim supports a number of standard MS-Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
|
||||
*drag-n-drop-win32*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_lua.txt* For Vim version 8.2. Last change: 2020 Jun 28
|
||||
*if_lua.txt* For Vim version 8.2. Last change: 2021 Apr 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Luis Carvalho
|
||||
@@ -208,6 +208,8 @@ Vim evaluation and command execution, and others.
|
||||
created on demand. Example: >
|
||||
:lua print(vim.fn.has('timers'))
|
||||
<
|
||||
vim.lua_version The Lua version Vim was compiled with, in the
|
||||
form {major}.{minor}.{patch}, e.g. "5.1.4".
|
||||
|
||||
==============================================================================
|
||||
3. List userdata *lua-list*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Feb 14
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Mar 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1294,6 +1294,7 @@ tag command action ~
|
||||
|:edit| :e[dit] edit a file
|
||||
|:earlier| :ea[rlier] go to older change, undo
|
||||
|:echo| :ec[ho] echoes the result of expressions
|
||||
|:echoconsole| :echoc[onsole] like :echomsg but write to stdout
|
||||
|:echoerr| :echoe[rr] like :echo, show like an error and use history
|
||||
|:echohl| :echoh[l] set highlighting for echo commands
|
||||
|:echomsg| :echom[sg] same as :echo, put message in history
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2020 Dec 10
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Mar 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -263,6 +263,20 @@ input. Example: >
|
||||
endfunc
|
||||
nnoremap <expr> <F3> <Sid>OpenPopup()
|
||||
|
||||
Also, keep in mind that the expression may be evaluated when looking for
|
||||
typeahead, before the previous command has been executed. For example: >
|
||||
func StoreColumn()
|
||||
let g:column = col('.')
|
||||
return 'x'
|
||||
endfunc
|
||||
nnoremap <expr> x StoreColumn()
|
||||
nmap ! f!x
|
||||
You will notice that g:column has the value from before executing "f!",
|
||||
because "x" is evaluated before "f!" is executed.
|
||||
This can be solved by inserting <Ignore> before the character that is
|
||||
expression-mapped: >
|
||||
nmap ! f!<Ignore>x
|
||||
|
||||
Be very careful about side effects! The expression is evaluated while
|
||||
obtaining characters, you may very well make the command dysfunctional.
|
||||
For this reason the following is blocked:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*mbyte.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*mbyte.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
@@ -770,7 +770,7 @@ is suitable for complex input, such as CJK.
|
||||
of the two ways: FrontEnd system and BackEnd system. In the FrontEnd
|
||||
system, input events are snatched by the |IM-server| first, then |IM-server|
|
||||
give the application the result of input. On the other hand, the BackEnd
|
||||
system works reverse order. MS Windows adopt BackEnd system. In X, most of
|
||||
system works reverse order. MS-Windows adopt BackEnd system. In X, most of
|
||||
|IM-server|s adopt FrontEnd system. The demerit of BackEnd system is the
|
||||
large overhead in communication, but it provides safe synchronization with
|
||||
no restrictions on applications.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.2. Last change: 2020 Oct 18
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Mar 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -942,8 +942,7 @@ These commands are not marks themselves, but jump to a mark:
|
||||
line.
|
||||
|
||||
*]`*
|
||||
]` [count] times to lowercase mark after the cursor. {not
|
||||
in Vi}
|
||||
]` [count] times to lowercase mark after the cursor.
|
||||
|
||||
*['*
|
||||
[' [count] times to previous line with a lowercase mark
|
||||
@@ -1037,6 +1036,12 @@ CTRL-I Go to [count] newer cursor position in jump list
|
||||
(not a motion command).
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
NOTE: In the GUI and in a terminal supporting
|
||||
|modifyOtherKeys|, CTRL-I can be mapped separately
|
||||
from <Tab>, on the condition that CTRL-I is
|
||||
mapped before <Tab>, otherwise the mapping applies to
|
||||
both.
|
||||
|
||||
*:ju* *:jumps*
|
||||
:ju[mps] Print the jump list (not a motion command).
|
||||
{not available without the |+jumplist| feature}
|
||||
@@ -1054,11 +1059,11 @@ The maximum number of entries is fixed at 100.
|
||||
|
||||
For example, after three jump commands you have this jump list:
|
||||
|
||||
jump line col file/text ~
|
||||
3 1 0 some text ~
|
||||
2 70 0 another line ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
jump line col file/text ~
|
||||
3 1 0 some text ~
|
||||
2 70 0 another line ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
|
||||
The "file/text" column shows the file name, or the text at the jump if it is
|
||||
in the current file (an indent is removed and a long line is truncated to fit
|
||||
@@ -1067,11 +1072,11 @@ in the window).
|
||||
You are currently in line 1167. If you then use the CTRL-O command, the
|
||||
cursor is put in line 1154. This results in:
|
||||
|
||||
jump line col file/text ~
|
||||
2 1 0 some text ~
|
||||
1 70 0 another line ~
|
||||
> 0 1154 23 end. ~
|
||||
1 1167 0 foo bar ~
|
||||
jump line col file/text ~
|
||||
2 1 0 some text ~
|
||||
1 70 0 another line ~
|
||||
> 0 1154 23 end. ~
|
||||
1 1167 0 foo bar ~
|
||||
|
||||
The pointer will be set at the last used jump position. The next CTRL-O
|
||||
command will use the entry above it, the next CTRL-I command will use the
|
||||
@@ -1098,12 +1103,12 @@ that calling setpos() does not do this.
|
||||
After the CTRL-O command that got you into line 1154 you could give another
|
||||
jump command (e.g., "G"). The jump list would then become:
|
||||
|
||||
jump line col file/text ~
|
||||
4 1 0 some text ~
|
||||
3 70 0 another line ~
|
||||
2 1167 0 foo bar ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
jump line col file/text ~
|
||||
4 1 0 some text ~
|
||||
3 70 0 another line ~
|
||||
2 1167 0 foo bar ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
|
||||
The line numbers will be adjusted for deleted and inserted lines. This fails
|
||||
if you stop editing a file without writing, like with ":n!".
|
||||
@@ -1152,7 +1157,7 @@ Note that when text has been inserted or deleted the cursor position might be
|
||||
a bit different from the position of the change. Especially when lines have
|
||||
been deleted.
|
||||
|
||||
When the |:keepjumps| command modifier is used the position of a change is not
|
||||
When the `:keepjumps` command modifier is used the position of a change is not
|
||||
remembered.
|
||||
|
||||
*:changes*
|
||||
@@ -1193,7 +1198,7 @@ remembered.
|
||||
#if, #ifdef, #else, #elif, #endif
|
||||
C preprocessor conditionals (when the
|
||||
cursor is on the # or no ([{
|
||||
following)
|
||||
is following)
|
||||
For other items the matchit plugin can be used, see
|
||||
|matchit-install|. This plugin also helps to skip
|
||||
matches in comments.
|
||||
@@ -1222,19 +1227,16 @@ remembered.
|
||||
#if/#else/#endif makes the movement linewise.
|
||||
|
||||
*[(*
|
||||
[( go to [count] previous unmatched '('.
|
||||
[( Go to [count] previous unmatched '('.
|
||||
|exclusive| motion.
|
||||
|
||||
*[{*
|
||||
[{ go to [count] previous unmatched '{'.
|
||||
[{ Go to [count] previous unmatched '{'.
|
||||
|exclusive| motion.
|
||||
|
||||
*])*
|
||||
]) go to [count] next unmatched ')'.
|
||||
]) Go to [count] next unmatched ')'.
|
||||
|exclusive| motion.
|
||||
|
||||
*]}*
|
||||
]} go to [count] next unmatched '}'.
|
||||
]} Go to [count] next unmatched '}'.
|
||||
|exclusive| motion.
|
||||
|
||||
The above four commands can be used to go to the start or end of the current
|
||||
@@ -1268,7 +1270,7 @@ bring you back to the switch statement.
|
||||
class. When no '}' is found before the cursor this is
|
||||
an error. |exclusive| motion.
|
||||
|
||||
The above two commands assume that the file contains a class with methods.
|
||||
The above four commands assume that the file contains a class with methods.
|
||||
The class definition is surrounded in '{' and '}'. Each method in the class
|
||||
is also surrounded with '{' and '}'. This applies to the Java language. The
|
||||
file looks like this: >
|
||||
@@ -1282,17 +1284,21 @@ file looks like this: >
|
||||
body_two();
|
||||
}
|
||||
}
|
||||
|
||||
[To try this out copy the text and put it in a new buffer, the help text above
|
||||
confuses the jump commands]
|
||||
|
||||
Starting with the cursor on "body_two()", using "[m" will jump to the '{' at
|
||||
the start of "method_two()" (obviously this is much more useful when the
|
||||
method is long!). Using "2[m" will jump to the start of "method_one()".
|
||||
Using "3[m" will jump to the start of the class.
|
||||
|
||||
*[#*
|
||||
[# go to [count] previous unmatched "#if" or "#else".
|
||||
[# Go to [count] previous unmatched "#if" or "#else".
|
||||
|exclusive| motion.
|
||||
|
||||
*]#*
|
||||
]# go to [count] next unmatched "#else" or "#endif".
|
||||
]# Go to [count] next unmatched "#else" or "#endif".
|
||||
|exclusive| motion.
|
||||
|
||||
These two commands work in C programs that contain #if/#else/#endif
|
||||
@@ -1300,11 +1306,11 @@ constructs. It brings you to the start or end of the #if/#else/#endif where
|
||||
the current line is included. You can then use "%" to go to the matching line.
|
||||
|
||||
*[star* *[/*
|
||||
[* or [/ go to [count] previous start of a C comment "/*".
|
||||
[* or [/ Go to [count] previous start of a C comment "/*".
|
||||
|exclusive| motion.
|
||||
|
||||
*]star* *]/*
|
||||
]* or ]/ go to [count] next end of a C comment "*/".
|
||||
]* or ]/ Go to [count] next end of a C comment "*/".
|
||||
|exclusive| motion.
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Apr 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -749,6 +749,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
or selected.
|
||||
Note: When this option is on some plugins may not work.
|
||||
|
||||
*'autoshelldir'* *'asd'* *'noautoshelldir'* *'noasd'*
|
||||
'autoshelldir' 'asd' boolean (default off)
|
||||
global
|
||||
When on, Vim will change the current working directory whenever you
|
||||
change the directory of the shell running in a terminal window. You
|
||||
need proper setting-up, so whenever the shell's pwd changes an OSC 7
|
||||
escape sequence will be emitted. For example, on Linux, you can source
|
||||
/etc/profile.d/vte.sh in your shell profile if you use bash or zsh.
|
||||
|
||||
*'arabic'* *'arab'* *'noarabic'* *'noarab'*
|
||||
'arabic' 'arab' boolean (default off)
|
||||
local to window
|
||||
@@ -3856,7 +3865,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'go-v'*
|
||||
'v' Use a vertical button layout for dialogs. When not included,
|
||||
a horizontal layout is preferred, but when it doesn't fit a
|
||||
vertical layout is used anyway.
|
||||
vertical layout is used anyway. Not supported in GTK 3.
|
||||
*'go-p'*
|
||||
'p' Use Pointer callbacks for X11 GUI. This is required for some
|
||||
window managers. If the cursor is not blinking or hollow at
|
||||
@@ -4139,7 +4148,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the window. This happens only when the 'icon' option is on.
|
||||
Only works if the terminal supports setting window icon text
|
||||
(currently only X11 GUI and terminals with a non-empty 't_IS' option).
|
||||
Does not work for MS Windows.
|
||||
Does not work for MS-Windows.
|
||||
When Vim was compiled with HAVE_X11 defined, the original icon will be
|
||||
restored if possible |X11|.
|
||||
When this option contains printf-style '%' items, they will be
|
||||
@@ -5027,7 +5036,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
jump between two double quotes.
|
||||
The characters must be separated by a colon.
|
||||
The pairs must be separated by a comma. Example for including '<' and
|
||||
'>' (HTML): >
|
||||
'>' (for HTML): >
|
||||
:set mps+=<:>
|
||||
|
||||
< A more exotic example, to jump between the '=' and ';' in an
|
||||
@@ -6502,6 +6511,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global values for local options)
|
||||
options all options and mappings (also global values for local
|
||||
options)
|
||||
skiprtp exclude 'runtimepath' and 'packpath' from the options
|
||||
resize size of the Vim window: 'lines' and 'columns'
|
||||
sesdir the directory in which the session file is located
|
||||
will become the current directory (useful with
|
||||
@@ -8781,23 +8791,31 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
part specifies what to do for each consecutive use of 'wildchar'. The
|
||||
first part specifies the behavior for the first use of 'wildchar',
|
||||
The second part for the second use, etc.
|
||||
These are the possible values for each part:
|
||||
|
||||
Each part consists of a colon separated list consisting of the
|
||||
following possible values:
|
||||
"" Complete only the first match.
|
||||
"full" Complete the next full match. After the last match,
|
||||
the original string is used and then the first match
|
||||
again.
|
||||
again. Will also start 'wildmenu' if it is enabled.
|
||||
"longest" Complete till longest common string. If this doesn't
|
||||
result in a longer string, use the next part.
|
||||
"longest:full" Like "longest", but also start 'wildmenu' if it is
|
||||
enabled.
|
||||
"list" When more than one match, list all matches.
|
||||
"lastused" When completing buffer names and more than one buffer
|
||||
matches, sort buffers by time last used (other than
|
||||
the current buffer).
|
||||
When there is only a single match, it is fully completed in all cases.
|
||||
|
||||
Examples of useful colon-separated values:
|
||||
"longest:full" Like "longest", but also start 'wildmenu' if it is
|
||||
enabled. Will not complete to the next full match.
|
||||
"list:full" When more than one match, list all matches and
|
||||
complete first match.
|
||||
"list:longest" When more than one match, list all matches and
|
||||
complete till longest common string.
|
||||
"list:lastused" When more than one buffer matches, sort buffers
|
||||
by time last used (other than the current buffer).
|
||||
When there is only a single match, it is fully completed in all cases.
|
||||
"list:lastused" When more than one buffer matches, list all matches
|
||||
and sort buffers by time last used (other than the
|
||||
current buffer).
|
||||
|
||||
Examples: >
|
||||
:set wildmode=full
|
||||
@@ -8856,15 +8874,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'window'* *'wi'*
|
||||
'window' 'wi' number (default screen height - 1)
|
||||
global
|
||||
Window height. Do not confuse this with the height of the Vim window,
|
||||
use 'lines' for that.
|
||||
Used for |CTRL-F| and |CTRL-B| when there is only one window and the
|
||||
value is smaller than 'lines' minus one. The screen will scroll
|
||||
'window' minus two lines, with a minimum of one.
|
||||
Window height used for |CTRL-F| and |CTRL-B| when there is only one
|
||||
window and the value is smaller than 'lines' minus one. The screen
|
||||
will scroll 'window' minus two lines, with a minimum of one.
|
||||
When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll
|
||||
in a much smarter way, taking care of wrapping lines.
|
||||
When resizing the Vim window, the value is smaller than 1 or more than
|
||||
or equal to 'lines' it will be set to 'lines' minus 1.
|
||||
Note: Do not confuse this with the height of the Vim window, use
|
||||
'lines' for that.
|
||||
|
||||
*'winheight'* *'wh'* *E591*
|
||||
'winheight' 'wh' number (default 1)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 8.2. Last change: 2017 Mar 21
|
||||
*os_win32.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@@ -83,7 +83,7 @@ executable() returns 1 the executable can actually be executed.
|
||||
|
||||
Command line arguments *win32-cmdargs*
|
||||
|
||||
Analysis of a command line into parameters is not standardised in MS Windows.
|
||||
Analysis of a command line into parameters is not standardised in MS-Windows.
|
||||
Vim and gvim used to use different logic to parse it (before 7.4.432), and the
|
||||
logic was also depended on what it was compiled with. Now Vim and gvim both
|
||||
use the CommandLineToArgvW() Win32 API, so they behave in the same way.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2021 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -605,6 +605,7 @@ Short explanation of each option: *option-list*
|
||||
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
|
||||
'antialias' 'anti' Mac OS X: use smooth, antialiased fonts
|
||||
'autochdir' 'acd' change directory to the file in the current window
|
||||
'autoshelldir' 'asd' change directory to the shell's current directory
|
||||
'arabic' 'arab' for Arabic as a default second language
|
||||
'arabicshape' 'arshape' do shaping for Arabic characters
|
||||
'autoindent' 'ai' take indent for new line from previous line
|
||||
|
||||
@@ -677,9 +677,9 @@ Your directory layout would be like this:
|
||||
opt/fooextra/doc/tags " help tags
|
||||
|
||||
This allows for the user to do: >
|
||||
mkdir ~/.vim/pack/myfoobar
|
||||
cd ~/.vim/pack/myfoobar
|
||||
git clone https://github.com/you/foobar.git
|
||||
mkdir ~/.vim/pack
|
||||
cd ~/.vim/pack
|
||||
git clone https://github.com/you/foobar.git myfoobar
|
||||
|
||||
Here "myfoobar" is a name that the user can choose, the only condition is that
|
||||
it differs from other packages.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*sign.txt* For Vim version 8.2. Last change: 2020 Oct 28
|
||||
*sign.txt* For Vim version 8.2. Last change: 2021 Mar 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -146,6 +146,9 @@ See |sign_define()| for the equivalent Vim script function.
|
||||
texthl={group}
|
||||
Highlighting group used for the text item.
|
||||
|
||||
Example: >
|
||||
:sign define MySign text=>> texthl=Search linehl=DiffText
|
||||
<
|
||||
|
||||
DELETING A SIGN *:sign-undefine* *E155*
|
||||
|
||||
@@ -155,7 +158,9 @@ See |sign_undefine()| for the equivalent Vim script function.
|
||||
Deletes a previously defined sign. If signs with this {name}
|
||||
are still placed this will cause trouble.
|
||||
|
||||
|
||||
Example: >
|
||||
:sign undefine MySign
|
||||
<
|
||||
|
||||
LISTING SIGNS *:sign-list* *E156*
|
||||
|
||||
@@ -209,6 +214,10 @@ See |sign_place()| for the equivalent Vim script function.
|
||||
Same, but use buffer {nr}. If the buffer argument is not
|
||||
given, place the sign in the current buffer.
|
||||
|
||||
Example: >
|
||||
:sign place 10 line=99 name=sign3
|
||||
:sign place 10 line=99 name=sign3 buffer=3
|
||||
<
|
||||
*E885*
|
||||
:sign place {id} name={name} file={fname}
|
||||
Change the placed sign {id} in file {fname} to use the defined
|
||||
@@ -221,10 +230,17 @@ See |sign_place()| for the equivalent Vim script function.
|
||||
"priority={prio}" attribute can be used to change the priority
|
||||
of an existing sign.
|
||||
|
||||
Example: >
|
||||
:sign place 23 name=sign1 file=/path/to/edit.py
|
||||
<
|
||||
:sign place {id} name={name} [buffer={nr}]
|
||||
Same, but use buffer {nr}. If the buffer argument is not
|
||||
given, use the current buffer.
|
||||
|
||||
Example: >
|
||||
:sign place 23 name=sign1
|
||||
:sign place 23 name=sign1 buffer=7
|
||||
<
|
||||
|
||||
REMOVING SIGNS *:sign-unplace* *E159*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Apr 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1741,8 +1741,8 @@ The coloring scheme for tags in the HTML file works as follows.
|
||||
|
||||
The <> of opening tags are colored differently than the </> of a closing tag.
|
||||
This is on purpose! For opening tags the 'Function' color is used, while for
|
||||
closing tags the 'Type' color is used (See syntax.vim to check how those are
|
||||
defined for you)
|
||||
closing tags the 'Identifier' color is used (See syntax.vim to check how those
|
||||
are defined for you)
|
||||
|
||||
Known tag names are colored the same way as statements in C. Unknown tag
|
||||
names are colored with the same color as the <> or </> respectively which
|
||||
@@ -2236,9 +2236,10 @@ can use them.
|
||||
|
||||
For example, Linux and BSD distributions use groff as their default text
|
||||
processing package. In order to activate the extra syntax highlighting
|
||||
features for groff, add the following option to your start-up files: >
|
||||
features for groff, arrange for files to be recognized as groff (see
|
||||
|ft-groff-syntax|) or add the following option to your start-up files: >
|
||||
|
||||
:let b:nroff_is_groff = 1
|
||||
:let nroff_is_groff = 1
|
||||
|
||||
Groff is different from the old AT&T n/troff that you may still find in
|
||||
Solaris. Groff macro and request names can be longer than 2 characters and
|
||||
@@ -4676,7 +4677,7 @@ matches, nextgroup, etc. But there are a few differences:
|
||||
- A line continuation pattern can be given. It is used to decide which group
|
||||
of lines need to be searched like they were one line. This means that the
|
||||
search for a match with the specified items starts in the first of the
|
||||
consecutive that contain the continuation pattern.
|
||||
consecutive lines that contain the continuation pattern.
|
||||
- When using "nextgroup" or "contains", this only works within one line (or
|
||||
group of continued lines).
|
||||
- When using a region, it must start and end in the same line (or group of
|
||||
|
||||
@@ -57,11 +57,13 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'ari' options.txt /*'ari'*
|
||||
'arshape' options.txt /*'arshape'*
|
||||
'as' todo.txt /*'as'*
|
||||
'asd' options.txt /*'asd'*
|
||||
'autochdir' options.txt /*'autochdir'*
|
||||
'autoindent' options.txt /*'autoindent'*
|
||||
'autoprint' vi_diff.txt /*'autoprint'*
|
||||
'autoread' options.txt /*'autoread'*
|
||||
'autosave' todo.txt /*'autosave'*
|
||||
'autoshelldir' options.txt /*'autoshelldir'*
|
||||
'autowrite' options.txt /*'autowrite'*
|
||||
'autowriteall' options.txt /*'autowriteall'*
|
||||
'aw' options.txt /*'aw'*
|
||||
@@ -508,10 +510,12 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'noari' options.txt /*'noari'*
|
||||
'noarshape' options.txt /*'noarshape'*
|
||||
'noas' todo.txt /*'noas'*
|
||||
'noasd' options.txt /*'noasd'*
|
||||
'noautochdir' options.txt /*'noautochdir'*
|
||||
'noautoindent' options.txt /*'noautoindent'*
|
||||
'noautoread' options.txt /*'noautoread'*
|
||||
'noautosave' todo.txt /*'noautosave'*
|
||||
'noautoshelldir' options.txt /*'noautoshelldir'*
|
||||
'noautowrite' options.txt /*'noautowrite'*
|
||||
'noautowriteall' options.txt /*'noautowriteall'*
|
||||
'noaw' options.txt /*'noaw'*
|
||||
@@ -2397,6 +2401,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:ec eval.txt /*:ec*
|
||||
:echo eval.txt /*:echo*
|
||||
:echo-redraw eval.txt /*:echo-redraw*
|
||||
:echoc eval.txt /*:echoc*
|
||||
:echoconsole eval.txt /*:echoconsole*
|
||||
:echoe eval.txt /*:echoe*
|
||||
:echoerr eval.txt /*:echoerr*
|
||||
:echoh eval.txt /*:echoh*
|
||||
@@ -3191,6 +3197,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:stselect tagsrch.txt /*:stselect*
|
||||
:su change.txt /*:su*
|
||||
:substitute change.txt /*:substitute*
|
||||
:substitute-repeat change.txt /*:substitute-repeat*
|
||||
:sun windows.txt /*:sun*
|
||||
:sunhide windows.txt /*:sunhide*
|
||||
:sunm map.txt /*:sunm*
|
||||
@@ -3929,6 +3936,7 @@ E1050 vim9.txt /*E1050*
|
||||
E107 eval.txt /*E107*
|
||||
E108 eval.txt /*E108*
|
||||
E109 eval.txt /*E109*
|
||||
E1091 vim9.txt /*E1091*
|
||||
E1092 vim9.txt /*E1092*
|
||||
E1094 vim9.txt /*E1094*
|
||||
E11 cmdline.txt /*E11*
|
||||
@@ -5427,6 +5435,7 @@ assert_fails() testing.txt /*assert_fails()*
|
||||
assert_false() testing.txt /*assert_false()*
|
||||
assert_inrange() testing.txt /*assert_inrange()*
|
||||
assert_match() testing.txt /*assert_match()*
|
||||
assert_nobeep() testing.txt /*assert_nobeep()*
|
||||
assert_notequal() testing.txt /*assert_notequal()*
|
||||
assert_notmatch() testing.txt /*assert_notmatch()*
|
||||
assert_report() testing.txt /*assert_report()*
|
||||
@@ -6578,6 +6587,7 @@ ft-mail.vim syntax.txt /*ft-mail.vim*
|
||||
ft-make-syntax syntax.txt /*ft-make-syntax*
|
||||
ft-man-plugin filetype.txt /*ft-man-plugin*
|
||||
ft-maple-syntax syntax.txt /*ft-maple-syntax*
|
||||
ft-markdown-plugin filetype.txt /*ft-markdown-plugin*
|
||||
ft-masm-syntax syntax.txt /*ft-masm-syntax*
|
||||
ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax*
|
||||
ft-matlab-indent indent.txt /*ft-matlab-indent*
|
||||
@@ -7499,6 +7509,7 @@ info-message starting.txt /*info-message*
|
||||
inform.vim syntax.txt /*inform.vim*
|
||||
informix ft_sql.txt /*informix*
|
||||
initialization starting.txt /*initialization*
|
||||
inline-function vim9.txt /*inline-function*
|
||||
input() eval.txt /*input()*
|
||||
inputdialog() eval.txt /*inputdialog()*
|
||||
inputlist() eval.txt /*inputlist()*
|
||||
@@ -8574,6 +8585,12 @@ prop_type_change() textprop.txt /*prop_type_change()*
|
||||
prop_type_delete() textprop.txt /*prop_type_delete()*
|
||||
prop_type_get() textprop.txt /*prop_type_get()*
|
||||
prop_type_list() textprop.txt /*prop_type_list()*
|
||||
ps1-about ft_ps1.txt /*ps1-about*
|
||||
ps1-compiler ft_ps1.txt /*ps1-compiler*
|
||||
ps1-folding ft_ps1.txt /*ps1-folding*
|
||||
ps1-keyword ft_ps1.txt /*ps1-keyword*
|
||||
ps1-syntax ft_ps1.txt /*ps1-syntax*
|
||||
ps1.txt ft_ps1.txt /*ps1.txt*
|
||||
psql ft_sql.txt /*psql*
|
||||
ptcap.vim syntax.txt /*ptcap.vim*
|
||||
pterm-mouse options.txt /*pterm-mouse*
|
||||
@@ -9162,6 +9179,7 @@ str2float() eval.txt /*str2float()*
|
||||
str2list() eval.txt /*str2list()*
|
||||
str2nr() eval.txt /*str2nr()*
|
||||
strcasestr() eval.txt /*strcasestr()*
|
||||
strcharlen() eval.txt /*strcharlen()*
|
||||
strcharpart() eval.txt /*strcharpart()*
|
||||
strchars() eval.txt /*strchars()*
|
||||
strchr() eval.txt /*strchr()*
|
||||
@@ -10127,7 +10145,10 @@ vim9-differences vim9.txt /*vim9-differences*
|
||||
vim9-export vim9.txt /*vim9-export*
|
||||
vim9-final vim9.txt /*vim9-final*
|
||||
vim9-gotchas vim9.txt /*vim9-gotchas*
|
||||
vim9-ignored-argument vim9.txt /*vim9-ignored-argument*
|
||||
vim9-import vim9.txt /*vim9-import*
|
||||
vim9-lambda vim9.txt /*vim9-lambda*
|
||||
vim9-lambda-arguments vim9.txt /*vim9-lambda-arguments*
|
||||
vim9-mix vim9.txt /*vim9-mix*
|
||||
vim9-namespace vim9.txt /*vim9-namespace*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
@@ -10135,7 +10156,9 @@ vim9-reload vim9.txt /*vim9-reload*
|
||||
vim9-scopes vim9.txt /*vim9-scopes*
|
||||
vim9-script-intro usr_46.txt /*vim9-script-intro*
|
||||
vim9-types vim9.txt /*vim9-types*
|
||||
vim9-unpack-ignore vim9.txt /*vim9-unpack-ignore*
|
||||
vim9-user-command vim9.txt /*vim9-user-command*
|
||||
vim9-variable-arguments vim9.txt /*vim9-variable-arguments*
|
||||
vim9.txt vim9.txt /*vim9.txt*
|
||||
vim9script vim9.txt /*vim9script*
|
||||
vim: options.txt /*vim:*
|
||||
|
||||
@@ -888,19 +888,25 @@ like |CTRL-]|.
|
||||
|
||||
The function used for generating the taglist is specified by setting the
|
||||
'tagfunc' option. The function will be called with three arguments:
|
||||
a:pattern The tag identifier used during the tag search.
|
||||
a:flags List of flags to control the function behavior.
|
||||
a:pattern The tag identifier or pattern used during the tag search.
|
||||
a:flags String containing flags to control the function behavior.
|
||||
a:info Dict containing the following entries:
|
||||
buf_ffname Full filename which can be used for priority.
|
||||
user_data Custom data String, if stored in the tag
|
||||
stack previously by tagfunc.
|
||||
|
||||
Currently two flags may be passed to the tag function:
|
||||
Currently up to three flags may be passed to the tag function:
|
||||
'c' The function was invoked by a normal command being processed
|
||||
(mnemonic: the tag function may use the context around the
|
||||
cursor to perform a better job of generating the tag list.)
|
||||
'i' In Insert mode, the user was completing a tag (with
|
||||
|i_CTRL-X_CTRL-]|).
|
||||
|i_CTRL-X_CTRL-]| or 'completeopt' contains `t`).
|
||||
'r' The first argument to tagfunc should be interpreted as a
|
||||
|pattern| (see |tag-regexp|), such as when using: >
|
||||
:tag /pat
|
||||
< It is also given when completing in insert mode.
|
||||
If this flag is not present, the argument is usually taken
|
||||
literally as the full tag name.
|
||||
|
||||
Note that when 'tagfunc' is set, the priority of the tags described in
|
||||
|tag-priority| does not apply. Instead, the priority is exactly as the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2020 Dec 12
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Apr 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -168,6 +168,7 @@ test_override({name}, {val}) *test_override()*
|
||||
wait time of up to 3 seconds for messages
|
||||
term_props reset all terminal properties when the version
|
||||
string is detected
|
||||
uptime overrules sysinfo.uptime
|
||||
ALL clear all overrides ({val} is not used)
|
||||
|
||||
"starting" is to be used when a test should behave like
|
||||
@@ -242,7 +243,8 @@ test_srand_seed([seed]) *test_srand_seed()*
|
||||
assert_beeps({cmd}) *assert_beeps()*
|
||||
Run {cmd} and add an error message to |v:errors| if it does
|
||||
NOT produce a beep or visual bell.
|
||||
Also see |assert_fails()| and |assert-return|.
|
||||
Also see |assert_fails()|, |assert_nobeep()| and
|
||||
|assert-return|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetCmd()->assert_beeps()
|
||||
@@ -375,6 +377,14 @@ assert_match({pattern}, {actual} [, {msg}])
|
||||
|
||||
Can also be used as a |method|: >
|
||||
getFile()->assert_match('foo.*')
|
||||
<
|
||||
assert_nobeep({cmd}) *assert_nobeep()*
|
||||
Run {cmd} and add an error message to |v:errors| if it
|
||||
produces a beep or visual bell.
|
||||
Also see |assert_beeps()|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetCmd()->assert_nobeep()
|
||||
<
|
||||
*assert_notequal()*
|
||||
assert_notequal({expected}, {actual} [, {msg}])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*textprop.txt* For Vim version 8.2. Last change: 2020 Oct 14
|
||||
*textprop.txt* For Vim version 8.2. Last change: 2021 Mar 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -175,6 +175,7 @@ prop_find({props} [, {direction}])
|
||||
Search for a text property as specified with {props}:
|
||||
id property with this ID
|
||||
type property with this type name
|
||||
both "id" and "type" must both match
|
||||
bufnr buffer to search in; when present a
|
||||
start position with "lnum" and "col"
|
||||
must be given; when omitted the
|
||||
@@ -187,6 +188,7 @@ prop_find({props} [, {direction}])
|
||||
skipstart do not look for a match at the start
|
||||
position
|
||||
|
||||
A property matches when either "id" or "type" matches.
|
||||
{direction} can be "f" for forward and "b" for backward. When
|
||||
omitted forward search is performed.
|
||||
|
||||
@@ -258,8 +260,8 @@ prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970*
|
||||
properties the one with the highest priority
|
||||
will be used; negative values can be used, the
|
||||
default priority is zero
|
||||
combine when TRUE combine the highlight with any
|
||||
syntax highlight; when omitted or FALSE syntax
|
||||
combine when omitted or TRUE combine the highlight
|
||||
with any syntax highlight; when FALSE syntax
|
||||
highlight will not be used
|
||||
start_incl when TRUE inserts at the start position will
|
||||
be included in the text property
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Feb 20
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Apr 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,50 +38,19 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
make "skiprtp" also omit 'packpath'?
|
||||
|
||||
- Implement blob index and slice assignment?
|
||||
Make all of test_blob run in three ways
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- Implement "export {one, two three}".
|
||||
- Disallow :open ?
|
||||
- ISN_CHECKTYPE could use check_argtype()
|
||||
- Using a script variable inside a :def function doesn't work if the variable
|
||||
is inside a block, see Test_nested_function(). Should it work?
|
||||
- give error for variable name:
|
||||
var p = function('NoSuchFunc')
|
||||
- Make closures work better:
|
||||
- Create closure in a loop. Need to make a list of them.
|
||||
- If a :def function is called with a function reference, compile it to get
|
||||
the function type.
|
||||
def Filter(x: string, Cond: func(string): bool)
|
||||
Filter(x, (v) => v =~ '^b')
|
||||
- Make inline function work, to be used as a funcref:
|
||||
var Ref = (arg: type): type => {
|
||||
statement
|
||||
return expr
|
||||
}
|
||||
var Ref = (arg: type) => {
|
||||
statement
|
||||
statement
|
||||
}
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type.
|
||||
- Implement :lockvar and :unlockvar. How about local variables? Perhaps only
|
||||
allow this for global variables. Use :final or :const otherwise.
|
||||
- Allow function names that will be script-local to start with lower case
|
||||
letter? Or also require names with s: prefix to use upper case?
|
||||
Also apply this function references "var ref = SomeFunc"
|
||||
- Support passing v:none to use the default argument value. (#6504)
|
||||
- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
|
||||
more strict about the argument type (not a bool).
|
||||
done: balloon_()
|
||||
- Check many more builtin function arguments at compile time.
|
||||
- make 0 == 'string' fail on the script level, like inside :def.
|
||||
- Check that when using a user function name without prefix, it does not find
|
||||
a global function. Prefixing g: is required.
|
||||
- Need the equivalent of get_lval() and set_var_lval() to implement assignment
|
||||
to nested list and dict members.
|
||||
- Assignment to dict doesn't work:
|
||||
var ret: dict<string> = #{}
|
||||
ret[i] = string(i)
|
||||
- Appending to dict item doesn't work:
|
||||
var d[i] ..= value
|
||||
- Using ".." at script level doesn't convert arguments to a string.
|
||||
map() could check that the return type of the function argument matches
|
||||
the type of the list or dict member. (#8092)
|
||||
- Compile replacement of :s command: s/pat/\=expr/
|
||||
- Compile redir to local variable: var_redir_start().
|
||||
- Implement type cast at the script level.
|
||||
@@ -89,19 +58,23 @@ Vim9 - Make everything work:
|
||||
islocked()
|
||||
- When evaluating constants for script variables, some functions could work:
|
||||
has('asdf'), len('string')
|
||||
- Implement "as Name" in "import Item as Name from ..."
|
||||
- Implement using imported items at script level from "import * as X" in
|
||||
eval_variable(). Should pass the ".xxx" that follows and return that.
|
||||
- Make "++nr" work. "++g:count" doesn't work, thinks it is a range.
|
||||
- Reload: How to make sure type of script function hasn't changed?
|
||||
- expandcmd() with `=expr` in filename uses legacy expression.
|
||||
- eval_expr() in ex_cexpr()
|
||||
- eval_expr() call in dbg_parsearg() and debuggy_find()
|
||||
- compile_member() guesses the type, should figure out at runtime.
|
||||
- compile "skip" argument of searchpair()
|
||||
- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
|
||||
- give an error for "echo Func()" if Func() does not return anything.
|
||||
- Using "windo echo expr" does not accept a line break inside "expr" (in a
|
||||
:def function and at script level in a not executed block). #7681
|
||||
- "assert_fails()" cannot access local variables. Perhaps add this:
|
||||
assertfails
|
||||
... cmd ...
|
||||
endassertfails /E99:.*cmd/
|
||||
Similar to try/catch/endtry but without the boilerplate.
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
@@ -157,6 +130,8 @@ Popup windows:
|
||||
- Add a termcap entry for changing the cursor when it goes under the popup and
|
||||
back. like t_SI and t_EI (t_SU and t_EU, where "U" means under?)
|
||||
- With terminal in popup, allow for popup_hide() to temporarily hide it.?
|
||||
- Make it possible to scroll horizontally when 'wrap' is off. Does this
|
||||
require an ascii scrollbar, like with the vertical one?
|
||||
- Fire some autocommand event after a new popup window was created and
|
||||
positioned? PopupNew? Could be used to set some options or move it out of
|
||||
the way. (#5737)
|
||||
@@ -184,6 +159,7 @@ Text properties:
|
||||
- Popup attached to text property stays visible when text is deleted with
|
||||
"cc". (#7737) "C" works OK. "dd" also files in a buffer with a single
|
||||
line.
|
||||
- Auto-indenting may cause highlighting to shift. (#7719)
|
||||
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
|
||||
- Combining text property with 'cursorline' does not always work (Billie
|
||||
Cleek, #5533)
|
||||
@@ -263,7 +239,26 @@ Terminal emulator window:
|
||||
- When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
conversions.
|
||||
|
||||
Valgrind reports memory leaks in test_options
|
||||
Include patch #6290: recognize shell directory change.
|
||||
|
||||
Valgrind reports memory leaks in test_options.
|
||||
Valgrind reports overlapping memcpy in
|
||||
test_conceal.3
|
||||
test_edit.1
|
||||
test_functions.4
|
||||
test_ins_complete.3
|
||||
test_method
|
||||
test_normal
|
||||
test_popupwin.35 et al.
|
||||
test_search_stat
|
||||
Using uninitialized value in test_crypt (can't explain why).
|
||||
Memory leak in test_debugger
|
||||
Memory leak in test_paste, using XtOpenDisplay several times
|
||||
OLD:
|
||||
TODO: be able to run all parts of test_alot with valgrind separately
|
||||
Memory leak in test_alot with pyeval() (allocating partial)
|
||||
Memory leak in test_alot with expand()
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
|
||||
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
|
||||
|
||||
@@ -277,9 +272,16 @@ Was originally written by Felipe Morales.
|
||||
|
||||
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
(#4087) Did patch 8.2.2379 help?
|
||||
Also, z= in German on a long word can take a very long time, but CTRL-C to
|
||||
interrupt does not work. Where to add ui_breakcheck()?
|
||||
|
||||
Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
|
||||
Add optional argument to virtcol() that specifies "start", "cursor" or "end"
|
||||
to tell which value from getvvcol() should be used. (#7964)
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
inconsistent with the documentation.
|
||||
|
||||
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
|
||||
Scroll doesn't work correctly, why?
|
||||
|
||||
@@ -288,6 +290,8 @@ with 'termguicolors'. #1740
|
||||
|
||||
Patch for blockwise paste reporting changes: #6660.
|
||||
|
||||
Patch to make fillchars global-local. (#5206)
|
||||
|
||||
Missing filetype test for bashrc, PKGBUILD, etc.
|
||||
|
||||
Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co
|
||||
@@ -306,6 +310,10 @@ Try setting a color then request the current color, like using t_u7.
|
||||
Regexp to search for duplicate lines does not work correctly:
|
||||
/\(^.*\n\)\1 (Chris Morgan, #6239)
|
||||
|
||||
MS-Windows: when writing undo file the infostreams are copied in
|
||||
mch_copy_file_attribute(), that seems unnecessary. (#7925)
|
||||
Add a flag to only copy attributes?
|
||||
|
||||
Changing a capturing group to non-capturing changes the result: #7607
|
||||
:echo matchstr('aaa bbb', '\(.\{-1,}\>\)\|.*')
|
||||
aaa
|
||||
@@ -382,6 +390,10 @@ manager. Problem with Motif?
|
||||
|
||||
Patch to add :argdedupe. (Nir Lichtman, #6235)
|
||||
|
||||
When editing a file with ":edit" the output of :swapname is relative, while
|
||||
editing it with "vim file" it is absolute. (#355)
|
||||
Which one should it be?
|
||||
|
||||
:map output does not clear the reset of the command line.
|
||||
(#5623, also see #5962)
|
||||
|
||||
@@ -489,6 +501,9 @@ Assuming the files are text, print the line with the difference.
|
||||
|
||||
Result of synID() sometimes wrong in help files. (#5252)
|
||||
|
||||
When a help file is opened that doesn't have "ft=help" in the modeline then
|
||||
the FileType is first set to "text" before it is set to "help". (#8099)
|
||||
|
||||
Problem showing a line if the number column width changes when using "o".
|
||||
(Mateusz Morusiewicz, #4245)
|
||||
|
||||
@@ -564,7 +579,7 @@ The quoting of the [command] argument of :terminal is not clearly documented.
|
||||
Give a few examples. (#4288)
|
||||
|
||||
Opening a file with --remote-tab-silent that matches 'wildignore' does not
|
||||
work, results in (E479: No match". (#4610)
|
||||
work, results in "E479: No match". (#4610)
|
||||
|
||||
7 Add an option to add one pixel column to the character width? Lucida
|
||||
Console italic is wider than the normal font ("d" overlaps with next char).
|
||||
@@ -753,14 +768,6 @@ Make ":interactive !cmd" stop termcap mode, also when used in an autocommand.
|
||||
|
||||
Add buffer argument to undotree(). (#4001)
|
||||
|
||||
Memory leak in test_debugger
|
||||
Using uninitialized value in test_crypt (can't explain why).
|
||||
Memory leak in test_terminal_fail
|
||||
TODO: be able to run all parts of test_alot with valgrind separately
|
||||
Memory leak in test_alot with pyeval() (allocating partial)
|
||||
Memory leak in test_alot with expand()
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
|
||||
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
|
||||
19.
|
||||
|
||||
@@ -1015,8 +1022,7 @@ for a path separator. (xtal8, #2201)
|
||||
Would be nice for Insert mode completion to highlight the text that was added
|
||||
(and may change when picking another completion).
|
||||
|
||||
Test runtime files.
|
||||
Start with filetype detection: testdir/test_filetype.vim
|
||||
Test more runtime files.
|
||||
|
||||
Window not closed when deleting buffer. (Harm te Hennepe, 2017 Aug 27, #2029)
|
||||
|
||||
@@ -1156,9 +1162,6 @@ timer expires.
|
||||
Rule to use "^" for statusline does not work if a space is defined with
|
||||
highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11)
|
||||
|
||||
8 "stl" and "stlnc" in 'fillchars' don't work for multibyte characters.
|
||||
Patch by Christian Wellenbrock, 2013 Jul 5.
|
||||
|
||||
Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca
|
||||
Fuentes, 2017 Feb 12, #1470)
|
||||
|
||||
@@ -1484,9 +1487,6 @@ specifically? First try with the parens, then without.
|
||||
Patch to add :mapgroup, put mappings in a group like augroup.
|
||||
(Yasuhiro Matsumoto, 2016 Feb 19)
|
||||
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
inconsistent with the documentation.
|
||||
|
||||
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||
'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
|
||||
before combining them.
|
||||
@@ -1995,6 +1995,10 @@ Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30)
|
||||
|
||||
Problem with "syn sync grouphere". (Gustavo Niemeyer, 2011 Jan 27)
|
||||
|
||||
Using "syn sync breaklines=2" works for when text is changed, but not when
|
||||
scrolling or redrawing. Should start search for syntax patterns above the
|
||||
first drawn line. (#8103)
|
||||
|
||||
Loading autoload script even when usage is inside "if 0". (Christian Brabandt,
|
||||
2010 Dec 18)
|
||||
|
||||
@@ -2441,9 +2445,6 @@ backslash? (Robert Vibrant, 2008 Jun 5)
|
||||
When 'rightleft' is set, cursorcolumn isn't highlighted after the end of a
|
||||
line. It's also wrong in folds. (Dominique Pelle, 2010 Aug 21)
|
||||
|
||||
Using an insert mode expression mapping, cursor is not in the expected
|
||||
position. (ZyX, 2010 Aug 29)
|
||||
|
||||
After using <Tab> for command line completion after ":ta blah" and getting E33
|
||||
(no tags file), further editing the command to e.g., ":echo 'blah'", the
|
||||
command is not executed. Fix by Ian Kelling?
|
||||
|
||||
@@ -43,7 +43,7 @@ like:
|
||||
|~ |
|
||||
|"file.txt" [New file] |
|
||||
+---------------------------------------+
|
||||
('#" is the cursor position.)
|
||||
('#' is the cursor position.)
|
||||
|
||||
The tilde (~) lines indicate lines not in the file. In other words, when Vim
|
||||
runs out of file to display, it displays tilde lines. At the bottom of the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Feb 01
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Mar 14
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -611,7 +611,8 @@ String manipulation: *string-functions*
|
||||
stridx() first index of a short string in a long string
|
||||
strridx() last index of a short string in a long string
|
||||
strlen() length of a string in bytes
|
||||
strchars() length of a string in characters
|
||||
strcharlen() length of a string in characters
|
||||
strchars() number of characters in a string
|
||||
strwidth() size of string when displayed
|
||||
strdisplaywidth() size of string when displayed, deals with tabs
|
||||
setcellwidths() set character cell width overrides
|
||||
@@ -1002,6 +1003,7 @@ Testing: *test-functions*
|
||||
assert_true() assert that an expression is true
|
||||
assert_exception() assert that a command throws an exception
|
||||
assert_beeps() assert that a command beeps
|
||||
assert_nobeep() assert that a command does not cause a beep
|
||||
assert_fails() assert that a command fails
|
||||
assert_report() report a test failure
|
||||
test_alloc_fail() make memory allocation fail
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2021 Jan 26
|
||||
*various.txt* For Vim version 8.2. Last change: 2021 Mar 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -572,7 +572,7 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
it in / any non-ID character (see |'isident'|) can be
|
||||
used, so long as it does not appear in {pat}. Without
|
||||
the enclosing character the pattern cannot include the
|
||||
bar character.
|
||||
bar character. 'ignorecase' is not used.
|
||||
|
||||
The pattern is matched against the relevant part of
|
||||
the output, not necessarily the whole line. Only some
|
||||
@@ -724,7 +724,7 @@ K Run a program to lookup the keyword under the
|
||||
feature}
|
||||
|
||||
*:sl!* *:sleep!*
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor.
|
||||
|
||||
*:xrestore* *:xr*
|
||||
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version5.txt* For Vim version 8.2. Last change: 2020 Dec 19
|
||||
*version5.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -405,7 +405,7 @@ Both of these are only available when enabled at compile time.
|
||||
Win32 GUI version *added-win32-GUI*
|
||||
-----------------
|
||||
|
||||
The GUI has been ported to MS Windows 95 and NT. All the features of the X11
|
||||
The GUI has been ported to MS-Windows 95 and NT. All the features of the X11
|
||||
GUI are available to Windows users now. |gui-w32|
|
||||
This also fixes problems with running the Win32 console version under Windows
|
||||
95, where console support has always been bad.
|
||||
@@ -4403,7 +4403,7 @@ the last char of the line, "<<" moved an extra line. Also for other operators
|
||||
that always work on lines.
|
||||
|
||||
link.sh changed "-lnsl_s" to "_s" when looking for "nsl" to be removed.
|
||||
Now it only remove whole words.
|
||||
Now it only removes whole words.
|
||||
|
||||
When jumped to a mark or using "fz", and there is an error, the current column
|
||||
was lost. E.g. when using "$fzj".
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version6.txt* For Vim version 8.2. Last change: 2021 Jan 17
|
||||
*version6.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1025,7 +1025,7 @@ Port to OS/390 Unix (Ralf Schandl)
|
||||
Included jsbmouse support. (Darren Garth)
|
||||
Support for dec mouse in Unix. (Steve Wall)
|
||||
|
||||
Port to 16-bit MS Windows (Windows 3.1x) (Vince Negri)
|
||||
Port to 16-bit MS-Windows (Windows 3.1x) (Vince Negri)
|
||||
|
||||
Port to QNX. Supports the Photon GUI, mouse, etc. (Julian Kinraid)
|
||||
|
||||
|
||||
@@ -2300,7 +2300,7 @@ value didn't fill the whole screen. (SungHyun Nam)
|
||||
Win32 installer: The generated _vimrc contained an absolute path to diff.exe.
|
||||
After upgrading it becomes invalid. Now use $VIMRUNTIME instead.
|
||||
|
||||
The command line was cleared to often when 'showmode' was set and ":silent
|
||||
The command line was cleared too often when 'showmode' was set and ":silent
|
||||
normal vy" was used. Don't clear the command line unless the mode was
|
||||
actually displayed. Added the "mode_displayed" variable.
|
||||
|
||||
|
||||
@@ -1776,7 +1776,7 @@ Files: runtime/doc/change.txt, runtime/doc/eval.txt,
|
||||
|
||||
Patch 7.4.219
|
||||
Problem: When 'relativenumber' or 'cursorline' are set the window is
|
||||
redrawn much to often. (Patrick Hemmer, Dominique Pelle)
|
||||
redrawn much too often. (Patrick Hemmer, Dominique Pelle)
|
||||
Solution: Check the VALID_CROW flag instead of VALID_WROW.
|
||||
Files: src/move.c
|
||||
|
||||
|
||||
@@ -416,6 +416,10 @@ Denotes the end of the options.
|
||||
Arguments after this will be handled as a file name.
|
||||
This can be used to edit a filename that starts with a '\-'.
|
||||
.TP
|
||||
\-\-clean
|
||||
Do not use any personal configuration (vimrc, plugins, etc.). Useful to see if
|
||||
a problem reproduces with a clean Vim setup.
|
||||
.TP
|
||||
\-\-echo\-wid
|
||||
GTK GUI only: Echo the Window ID on stdout.
|
||||
.TP
|
||||
|
||||
@@ -300,6 +300,10 @@ OPTIONS
|
||||
be handled as a file name. This can be used to edit a
|
||||
filename that starts with a '-'.
|
||||
|
||||
--clean Do not use any personal configuration (vimrc, plugins,
|
||||
etc.). Useful to see if a problem reproduces with a clean
|
||||
Vim setup.
|
||||
|
||||
--echo-wid GTK GUI only: Echo the Window ID on stdout.
|
||||
|
||||
--help Give a help message and exit, just like "-h".
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Feb 23
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Apr 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -96,8 +96,8 @@ script and `:def` functions; details are below:
|
||||
def CallMe(count: number, message: string): bool
|
||||
- Call functions without `:call`: >
|
||||
writefile(['done'], 'file.txt')
|
||||
- You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert` or
|
||||
curly-braces names.
|
||||
- You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert`, `:open`
|
||||
or curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
- Unless mentioned specifically, the highest |scriptversion| is used.
|
||||
@@ -125,6 +125,10 @@ that starts a comment: >
|
||||
var name = value # comment
|
||||
var name = value# error!
|
||||
|
||||
Do not start a comment with #{, it looks like the legacy dictionary literal
|
||||
and produces an error where this might be confusing. #{{ or #{{{ are OK,
|
||||
these can be used to start a fold.
|
||||
|
||||
In legacy Vim script # is also used for the alternate file name. In Vim9
|
||||
script you need to use %% instead. Instead of ## use %%% (stands for all
|
||||
arguments).
|
||||
@@ -133,18 +137,21 @@ arguments).
|
||||
Vim9 functions ~
|
||||
|
||||
A function defined with `:def` is compiled. Execution is many times faster,
|
||||
often 10x to 100x times.
|
||||
often 10 to 100 times.
|
||||
|
||||
Many errors are already found when compiling, before the function is executed.
|
||||
The syntax is strict, to enforce code that is easy to read and understand.
|
||||
|
||||
Compilation is done when either of these is encountered:
|
||||
Compilation is done when any of these is encountered:
|
||||
- the first time the function is called
|
||||
- when the `:defcompile` command is encountered in the script where the
|
||||
- when the `:defcompile` command is encountered in the script after the
|
||||
function was defined
|
||||
- `:disassemble` is used for the function.
|
||||
- a function that is compiled calls the function or uses it as a function
|
||||
reference
|
||||
*E1091*
|
||||
If compilation fails it is not tried again on the next call, instead this
|
||||
error is given: "E1091: Function is not compiled: {name}".
|
||||
|
||||
`:def` has no options like `:function` does: "range", "abort", "dict" or
|
||||
"closure". A `:def` function always aborts on an error (unless `:silent!` was
|
||||
@@ -157,13 +164,31 @@ functions.
|
||||
|
||||
Arguments are accessed by name, without "a:", just like any other language.
|
||||
There is no "a:" dictionary or "a:000" list.
|
||||
|
||||
*vim9-variable-arguments*
|
||||
Variable arguments are defined as the last argument, with a name and have a
|
||||
list type, similar to TypeScript. For example, a list of numbers: >
|
||||
def MyFunc(...itemlist: list<number>)
|
||||
for item in itemlist
|
||||
...
|
||||
|
||||
When a function argument is optional (it has a default value) passing `v:none`
|
||||
as the argument results in using the default value. This is useful when you
|
||||
want to specify a value for an argument that comes after an argument that
|
||||
should use its default value. Example: >
|
||||
def MyFunc(one = 'one', last = 'last)
|
||||
...
|
||||
enddef
|
||||
MyFunc(v:none, 'LAST') # first argument uses default value 'one'
|
||||
<
|
||||
*vim9-ignored-argument*
|
||||
The argument "_" (an underscore) can be used to ignore the argument. This is
|
||||
most useful in callbacks where you don't need it, but do need to give an
|
||||
argument to match the call. E.g. when using map() two arguments are passed,
|
||||
the key and the value, to ignore the key: >
|
||||
map(myList, (_, v) => v * 2)
|
||||
There is no error for using the "_" argument multiple times. No type needs to
|
||||
be given.
|
||||
|
||||
|
||||
Functions and variables are script-local by default ~
|
||||
*vim9-scopes*
|
||||
@@ -190,6 +215,12 @@ search for the function:
|
||||
However, it is recommended to always use "g:" to refer to a global function
|
||||
for clarity.
|
||||
|
||||
Since a script-local function reference can be used without "s:" the name must
|
||||
start with an upper case letter even when using the "s:" prefix. In legacy
|
||||
script "s:funcref" could be used, because it could not be referred to with
|
||||
"funcref". In Vim9 script it can, therefore "s:Funcref" must be used to avoid
|
||||
that the name interferes with builtin functions.
|
||||
|
||||
In all cases the function must be defined before used. That is when it is
|
||||
called, when `:defcompile` causes it to be compiled, or when code that calls
|
||||
it is being compiled (to figure out the return type).
|
||||
@@ -279,19 +310,43 @@ without any command. The same for global, window, tab, buffer and Vim
|
||||
variables, because they are not really declared. They can also be deleted
|
||||
with `:unlet`.
|
||||
|
||||
`:lockvar` does not work on local variables. Use `:const` and `:final`
|
||||
instead.
|
||||
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
|
||||
Global variables and user defined functions must be prefixed with "g:", also
|
||||
at the script level. >
|
||||
Global variables must be prefixed with "g:", also at the script level. >
|
||||
vim9script
|
||||
var script_local = 'text'
|
||||
g:global = 'value'
|
||||
var Funcref = g:ThatFunction
|
||||
|
||||
Global functions must be prefixed with "g:" when defining them, but can be
|
||||
called without "g:". >
|
||||
vim9script
|
||||
def g:GlobalFunc(): string
|
||||
return 'text'
|
||||
enddef
|
||||
echo GlobalFunc()
|
||||
The "g:" prefix is not needed for auto-load functions.
|
||||
|
||||
Since `&opt = value` is now assigning a value to option "opt", ":&" cannot be
|
||||
used to repeat a `:substitute` command.
|
||||
*vim9-unpack-ignore*
|
||||
For an unpack assignment the underscore can be used to ignore a list item,
|
||||
similar to how a function argument can be ignored: >
|
||||
[a, _, c] = theList
|
||||
To ignore any remaining items: >
|
||||
[a, b; _] = longList
|
||||
|
||||
< *E1092*
|
||||
Declaring more than one variable at a time, using the unpack notation, is
|
||||
currently not supported: >
|
||||
var [v1, v2] = GetValues() # Error!
|
||||
That is because the type needs to be inferred from the list item type, which
|
||||
isn't that easy.
|
||||
|
||||
|
||||
Constants ~
|
||||
@@ -326,13 +381,6 @@ The constant only applies to the value itself, not what it refers to. >
|
||||
NAMES[1] = ["Emma"] # Error!
|
||||
NAMES[1][0] = "Emma" # OK, now females[0] == "Emma"
|
||||
|
||||
< *E1092*
|
||||
Declaring more than one variable at a time, using the unpack notation, is
|
||||
currently not supported: >
|
||||
var [v1, v2] = GetValues() # Error!
|
||||
That is because the type needs to be inferred from the list item type, which
|
||||
isn't that easy.
|
||||
|
||||
|
||||
Omitting :call and :eval ~
|
||||
|
||||
@@ -341,7 +389,8 @@ Functions can be called without `:call`: >
|
||||
Using `:call` is still possible, but this is discouraged.
|
||||
|
||||
A method call without `eval` is possible, so long as the start is an
|
||||
identifier or can't be an Ex command. Examples: >
|
||||
identifier or can't be an Ex command. For a function either "(" or "->" must
|
||||
be following, without a line break. Examples: >
|
||||
myList->add(123)
|
||||
g:myList->add(123)
|
||||
[1, 2, 3]->Process()
|
||||
@@ -378,7 +427,7 @@ number of arguments and any return type. The function can be defined later.
|
||||
|
||||
|
||||
Lambda using => instead of -> ~
|
||||
|
||||
*vim9-lambda*
|
||||
In legacy script there can be confusion between using "->" for a method call
|
||||
and for a lambda. Also, when a "{" is found the parser needs to figure out if
|
||||
it is the start of a lambda or a dictionary, which is now more complicated
|
||||
@@ -402,13 +451,40 @@ But you can use a backslash to concatenate the lines before parsing: >
|
||||
filter(list, (k,
|
||||
\ v)
|
||||
\ => v > 0)
|
||||
< *vim9-lambda-arguments*
|
||||
In legacy script a lambda could be called with any number of extra arguments,
|
||||
there was no way to warn for not using them. In Vim9 script the number of
|
||||
arguments must match. If you do want to accept any arguments, or any further
|
||||
arguments, use "..._", which makes the function accept
|
||||
|vim9-variable-arguments|. Example: >
|
||||
var Callback = (..._) => 'anything'
|
||||
echo Callback(1, 2, 3) # displays "anything"
|
||||
|
||||
< *inline-function*
|
||||
Additionally, a lambda can contain statements in {}: >
|
||||
var Lambda = (arg) => {
|
||||
g:was_called = 'yes'
|
||||
return expression
|
||||
}
|
||||
NOT IMPLEMENTED YET
|
||||
This can be useful for a timer, for example: >
|
||||
var count = 0
|
||||
var timer = timer_start(500, (_) => {
|
||||
count += 1
|
||||
echom 'Handler called ' .. count
|
||||
}, {repeat: 3})
|
||||
|
||||
|
||||
The ending "}" must be at the start of a line. It can be followed by other
|
||||
characters, e.g.: >
|
||||
var d = mapnew(dict, (k, v): string => {
|
||||
return 'value'
|
||||
})
|
||||
No command can follow the "{", only a comment can be used there.
|
||||
|
||||
Rationale: The "}" cannot be after a command because it would require parsing
|
||||
the commands to find it. For consistency with that no command can follow the
|
||||
"{". Unfortunately this means using "() => { command }" does not work, line
|
||||
breaks are always required.
|
||||
|
||||
*vim9-curly*
|
||||
To avoid the "{" of a dictionary literal to be recognized as a statement block
|
||||
@@ -696,13 +772,15 @@ for v:null. When converting a boolean to a string "false" and "true" are
|
||||
used, not "v:false" and "v:true" like in legacy script. "v:none" is not
|
||||
changed, it is only used in JSON and has no equivalent in other languages.
|
||||
|
||||
Indexing a string with [idx] or [idx : idx] uses character indexes instead of
|
||||
byte indexes. Example: >
|
||||
Indexing a string with [idx] or taking a slice with [idx : idx] uses character
|
||||
indexes instead of byte indexes. Composing characters are included.
|
||||
Example: >
|
||||
echo 'bár'[1]
|
||||
In legacy script this results in the character 0xc3 (an illegal byte), in Vim9
|
||||
script this results in the string 'á'.
|
||||
A negative index is counting from the end, "[-1]" is the last character.
|
||||
To exclude the last character use |slice()|.
|
||||
To count composing characters separately use |strcharpart()|.
|
||||
If the index is out of range then an empty string results.
|
||||
|
||||
In legacy script "++var" and "--var" would be silently accepted and have no
|
||||
@@ -800,6 +878,8 @@ Patterns are used like 'magic' is set, unless explicitly overruled.
|
||||
The 'edcompatible' option value is not used.
|
||||
The 'gdefault' option value is not used.
|
||||
|
||||
You may also find this wiki useful. It was written by an early adopter of
|
||||
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -843,12 +923,14 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
:enddef End of a function defined with `:def`. It should be on
|
||||
a line by its own.
|
||||
|
||||
You may also find this wiki useful. It was written by an early adopter of
|
||||
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
|
||||
|
||||
If the script the function is defined in is Vim9 script, then script-local
|
||||
variables can be accessed without the "s:" prefix. They must be defined
|
||||
before the function is compiled. If the script the function is defined in is
|
||||
legacy script, then script-local variables must be accessed with the "s:"
|
||||
prefix and they do not need to exist (they can be deleted any time).
|
||||
prefix if they do not exist at the time of compiling.
|
||||
|
||||
*:defc* *:defcompile*
|
||||
:defc[ompile] Compile functions defined in the current script that
|
||||
@@ -886,6 +968,27 @@ For these the backtick expansion can be used. Example: >
|
||||
g/pattern/s/^/`=newText`/
|
||||
enddef
|
||||
|
||||
Closures defined in a loop will share the same context. For example: >
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
var inloop = i
|
||||
flist[i] = () => inloop
|
||||
endfor
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
to the same instance, which in the end will have the value 9. This is
|
||||
efficient. If you do want a separate context for each closure call a function
|
||||
to define it: >
|
||||
def GetFunc(i: number): func
|
||||
var inloop = i
|
||||
return () => inloop
|
||||
enddef
|
||||
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
flist[i] = GetFunc(i)
|
||||
endfor
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Types *vim9-types*
|
||||
@@ -1012,12 +1115,15 @@ dictionary. If there is a mix of types, the "any" type is used. >
|
||||
['a', 'b', 'c'] list<string>
|
||||
[1, 'x', 3] list<any>
|
||||
|
||||
For script-local variables in Vim9 script the type is checked, also when the
|
||||
variable was declared in a legacy function.
|
||||
|
||||
|
||||
Stricter type checking ~
|
||||
*type-checking*
|
||||
In legacy Vim script, where a number was expected, a string would be
|
||||
automatically converted to a number. This was convenient for an actual number
|
||||
such as "123", but leads to unexpected problems (but no error message) if the
|
||||
such as "123", but leads to unexpected problems (and no error message) if the
|
||||
string doesn't start with a number. Quite often this leads to hard-to-find
|
||||
bugs.
|
||||
|
||||
@@ -1076,7 +1182,9 @@ A side effect of `:vim9script` is that the 'cpoptions' option is set to the
|
||||
Vim default value, like with: >
|
||||
:set cpo&vim
|
||||
One of the effects is that |line-continuation| is always enabled.
|
||||
The original value of 'cpoptions' is restored at the end of the script.
|
||||
The original value of 'cpoptions' is restored at the end of the script, while
|
||||
flags added or removed in the script are also added to or removed from the
|
||||
original value to get the same effect. The order of flags may change.
|
||||
|
||||
*vim9-mix*
|
||||
There is one way to use both legacy and Vim9 syntax in one script file: >
|
||||
@@ -1111,7 +1219,7 @@ Exporting an item can be written as: >
|
||||
export class MyClass ...
|
||||
|
||||
As this suggests, only constants, variables, `:def` functions and classes can
|
||||
be exported. {classes are not implemented yet}
|
||||
be exported. {not implemented yet: export class}
|
||||
|
||||
*E1042*
|
||||
`:export` can only be used in Vim9 script, at the script level.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.2. Last change: 2021 Feb 06
|
||||
*windows.txt* For Vim version 8.2. Last change: 2021 Apr 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -521,14 +521,14 @@ CTRL-W J Move the current window to be at the very bottom, using the
|
||||
CTRL-W H Move the current window to be at the far left, using the
|
||||
full height of the screen. This works like closing the
|
||||
current window and then creating another one with
|
||||
":vert topleft split", except that the current window contents
|
||||
`:vert topleft split`, except that the current window contents
|
||||
is used for the new window.
|
||||
|
||||
*CTRL-W_L*
|
||||
CTRL-W L Move the current window to be at the far right, using the full
|
||||
height of the screen. This works like closing the
|
||||
current window and then creating another one with
|
||||
":vert botright split", except that the current window
|
||||
`:vert botright split`, except that the current window
|
||||
contents is used for the new window.
|
||||
|
||||
*CTRL-W_T*
|
||||
@@ -571,7 +571,7 @@ CTRL-W < Decrease current window width by N (default 1).
|
||||
*CTRL-W_>*
|
||||
CTRL-W > Increase current window width by N (default 1).
|
||||
|
||||
:vertical res[ize] [N] *:vertical-resize* *CTRL-W_bar*
|
||||
:vert[ical] res[ize] [N] *:vertical-resize* *CTRL-W_bar*
|
||||
CTRL-W | Set current window width to N (default: widest possible).
|
||||
|
||||
You can also resize a window by dragging a status line up or down with the
|
||||
@@ -790,7 +790,7 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
|
||||
Examples: >
|
||||
|
||||
:windo set nolist nofoldcolumn | normal zn
|
||||
:windo set nolist foldcolumn=0 | normal! zn
|
||||
|
||||
This resets the 'list' option and disables folding in all windows. >
|
||||
|
||||
@@ -798,7 +798,7 @@ This resets the 'list' option and disables folding in all windows. >
|
||||
|
||||
This resets the 'fileencoding' in each buffer and writes it if this changed
|
||||
the buffer. The result is that all buffers will use the 'encoding' encoding
|
||||
(if conversion works properly).
|
||||
(if conversion succeeds).
|
||||
|
||||
==============================================================================
|
||||
9. Tag or file name under the cursor *window-tag*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Jan 21
|
||||
" Last Change: 2021 Apr 17
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -168,6 +168,9 @@ au BufNewFile,BufRead *.mar setf vmasm
|
||||
" Atlas
|
||||
au BufNewFile,BufRead *.atl,*.as setf atlas
|
||||
|
||||
" Atom is based on XML
|
||||
au BufNewFile,BufRead *.atom setf xml
|
||||
|
||||
" Autoit v3
|
||||
au BufNewFile,BufRead *.au3 setf autoit
|
||||
|
||||
@@ -414,6 +417,10 @@ endif
|
||||
" Lynx config files
|
||||
au BufNewFile,BufRead lynx.cfg setf lynx
|
||||
|
||||
" Modula-3 configuration language (must be before *.cfg and *makefile)
|
||||
au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
|
||||
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
|
||||
|
||||
" Quake
|
||||
au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
|
||||
au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
|
||||
@@ -593,7 +600,7 @@ au BufNewFile,BufRead *.fan,*.fwt setf fan
|
||||
au BufNewFile,BufRead *.factor setf factor
|
||||
|
||||
" Fennel
|
||||
autocmd BufRead,BufNewFile *.fnl setf fennel
|
||||
autocmd BufRead,BufNewFile *.fnl setf fennel
|
||||
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
@@ -637,7 +644,7 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||
|
||||
" Gift (Moodle)
|
||||
autocmd BufRead,BufNewFile *.gift setf gift
|
||||
autocmd BufRead,BufNewFile *.gift setf gift
|
||||
|
||||
" Git
|
||||
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
|
||||
@@ -708,7 +715,7 @@ au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
|
||||
au BufNewFile,BufRead *.haml setf haml
|
||||
|
||||
" Hamster Classic | Playground files
|
||||
au BufNewFile,BufRead *.hsm setf hamster
|
||||
au BufNewFile,BufRead *.hsm setf hamster
|
||||
|
||||
" Haskell
|
||||
au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot setf haskell
|
||||
@@ -1042,10 +1049,10 @@ au BufNewFile,BufRead *.mod
|
||||
\ setf modsim3 |
|
||||
\ endif
|
||||
|
||||
" Modula 2 (.md removed in favor of Markdown)
|
||||
" Modula-2 (.md removed in favor of Markdown)
|
||||
au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2
|
||||
|
||||
" Modula 3 (.m3, .i3, .mg, .ig)
|
||||
" Modula-3 (.m3, .i3, .mg, .ig)
|
||||
au BufNewFile,BufRead *.[mi][3g] setf modula3
|
||||
|
||||
" Monk
|
||||
@@ -1276,6 +1283,11 @@ au BufNewFile,BufRead .povrayrc setf povini
|
||||
" Povray, Pascal, PHP or assembly
|
||||
au BufNewFile,BufRead *.inc call dist#ft#FTinc()
|
||||
|
||||
" PowerShell
|
||||
au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc setf ps1
|
||||
au BufNewFile,BufRead *.ps1xml setf ps1xml
|
||||
au BufNewFile,BufRead *.cdxml,*.psc1 setf xml
|
||||
|
||||
" Printcap and Termcap
|
||||
au BufNewFile,BufRead *printcap
|
||||
\ let b:ptcap_type = "print" | setf ptcap
|
||||
@@ -1330,10 +1342,16 @@ au BufNewFile,BufRead *.pdb setf prolog
|
||||
" Promela
|
||||
au BufNewFile,BufRead *.pml setf promela
|
||||
|
||||
" Property Specification Language (PSL)
|
||||
au BufNewFile,BufRead *.psl setf psl
|
||||
|
||||
" Google protocol buffers
|
||||
au BufNewFile,BufRead *.proto setf proto
|
||||
au BufNewFile,BufRead *.pbtxt setf pbtxt
|
||||
|
||||
" Poke
|
||||
au BufNewFile,BufRead *.pk setf poke
|
||||
|
||||
" Protocols
|
||||
au BufNewFile,BufRead */etc/protocols setf protocols
|
||||
|
||||
@@ -1391,6 +1409,9 @@ else
|
||||
au BufNewFile,BufRead *.rmd,*.smd setf rmd
|
||||
endif
|
||||
|
||||
" RSS looks like XML
|
||||
au BufNewFile,BufRead *.rss setf xml
|
||||
|
||||
" R reStructuredText file
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst
|
||||
@@ -1543,11 +1564,10 @@ au BufNewFile,BufRead catalog setf catalog
|
||||
" Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
|
||||
" bash scripts.
|
||||
" NOTE: Patterns ending in a star are further down, these have lower priority.
|
||||
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
|
||||
|
||||
|
||||
" Shell script (Arch Linux) or PHP file (Drupal)
|
||||
au BufNewFile,BufRead *.install
|
||||
\ if getline(1) =~ '<?php' |
|
||||
@@ -2218,8 +2238,11 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
||||
" SGML catalog file
|
||||
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
||||
|
||||
" avoid doc files being recognized a shell files
|
||||
au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
|
||||
|
||||
" Shell scripts ending in a star
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
" Vim settings file
|
||||
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
|
||||
" Version: (v52) 2020 October 07
|
||||
" Version: (v53) 2021 April 06
|
||||
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
||||
" Usage: For instructions, do :help fortran-plugin from Vim
|
||||
" Credits:
|
||||
" Version 0.1 was created in September 2000 by Ajit Thakkar.
|
||||
" Since then, useful suggestions and contributions have been made, in order, by:
|
||||
" Stefano Zacchiroli, Hendrik Merx, Ben Fritz, David Barnett, Eisuke Kawashima,
|
||||
" and Doug Kearns.
|
||||
" Doug Kearns, and Fritz Reese.
|
||||
|
||||
" Only do these settings when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -66,12 +66,19 @@ endif
|
||||
" Set comments and textwidth according to source type
|
||||
if (b:fortran_fixed_source == 1)
|
||||
setlocal comments=:!,:*,:C
|
||||
" Fixed format requires a textwidth of 72 for code
|
||||
setlocal tw=72
|
||||
" Fixed format requires a textwidth of 72 for code,
|
||||
" but some vendor extensions allow longer lines
|
||||
if exists("fortran_extended_line_length")
|
||||
setlocal tw=132
|
||||
elseif exists("fortran_cardimage_line_length")
|
||||
setlocal tw=80
|
||||
else
|
||||
setlocal tw=72
|
||||
" If you need to add "&" on continued lines so that the code is
|
||||
" compatible with both free and fixed format, then you should do so
|
||||
" in column 73 and uncomment the next line
|
||||
" setlocal tw=73
|
||||
endif
|
||||
else
|
||||
setlocal comments=:!
|
||||
" Free format allows a textwidth of 132
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Language: gprof
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Last Change: 2013 Jun 09
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
" When cursor is on one line of the gprof call graph,
|
||||
" calling this function jumps to this function in the call graph.
|
||||
@@ -16,7 +16,7 @@ fun! <SID>GprofJumpToFunctionIndex()
|
||||
norm! $y%
|
||||
call search('^' . escape(@", '[]'), 'sw')
|
||||
norm! zz
|
||||
elseif l:line =~ '^\(\s\+[0-9\.]\+\)\{3}\s\+'
|
||||
elseif l:line =~ '^\(\s*[0-9\.]\+\)\{3}\s\+'
|
||||
" We're in line in the flat profile.
|
||||
norm! 55|eby$
|
||||
call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" URL: http://sites.google.com/site/khorser/opensource/vim
|
||||
" Original author: Dorai Sitaram <ds26@gte.com>
|
||||
" Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
|
||||
" Last Change: Oct 23, 2013
|
||||
" Last Change: Mar 10, 2021
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
|
||||
24
runtime/ftplugin/m3build.vim
Normal file
24
runtime/ftplugin/m3build.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Modula-3 Makefile
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 April 15
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
runtime! ftplugin/m3quake.vim
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Modula-3 Makefile (m3makefile m3overrides)\tm3makefile;m3overrides\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
33
runtime/ftplugin/m3quake.vim
Normal file
33
runtime/ftplugin/m3quake.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Modula-3 Quake
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 April 15
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,:%
|
||||
setlocal commentstring=%\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_words = '\<\%(proc\|if\|foreach\)\>:\<else\>:\<end\>'
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Modula-3 Quake Source Files (*.quake)\t*.quake\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< " ..
|
||||
\ "| unlet! b:browsefilter b:match_words"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
39
runtime/ftplugin/modula2.vim
Normal file
39
runtime/ftplugin/modula2.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Modula-2
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=s0:(*,mb:\ ,ex:*)
|
||||
setlocal commentstring=(*%s*)
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
" The second branch of the middle pattern is intended to match CASE labels
|
||||
let b:match_words = '\<REPEAT\>:\<UNTIL\>,' ..
|
||||
\ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' ..
|
||||
\ ':' ..
|
||||
\ '\<END\>'
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Modula-2 Source Files (*.def *.mod)\t*.def;*.mod\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< " ..
|
||||
\ "| unlet! b:browsefilter b:match_words"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
38
runtime/ftplugin/modula3.vim
Normal file
38
runtime/ftplugin/modula3.vim
Normal file
@@ -0,0 +1,38 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Modula-3
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=s0:(*,mb:\ ,ex:*)
|
||||
setlocal commentstring=(*%s*)
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_words = '\<REPEAT\>:\<UNTIL\>,' ..
|
||||
\ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\)\>\|\%(^\s*\)\@<=\S.*=>' ..
|
||||
\ ':' ..
|
||||
\ '\<END\>'
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Modula-3 Source Files (*.m3)\t*.m3\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< " ..
|
||||
\ "| unlet! b:browsefilter b:match_words"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
32
runtime/ftplugin/poke.vim
Normal file
32
runtime/ftplugin/poke.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: GNU Poke
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 March 11
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal include=load
|
||||
setlocal suffixesadd=.pk
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Poke Files (*.pk)\t*.pk\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< inc< sua<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8
|
||||
59
runtime/ftplugin/ps1.vim
Normal file
59
runtime/ftplugin/ps1.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Windows PowerShell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2021 Apr 02
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Don't load another plug-in for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
" Enable autocompletion of hyphenated PowerShell commands,
|
||||
" e.g. Get-Content or Get-ADUser
|
||||
setlocal iskeyword+=-
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
let b:browsefilter =
|
||||
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Look up keywords by Get-Help:
|
||||
" check for PowerShell Core in Windows, Linux or MacOS
|
||||
if executable('pwsh') | let s:pwsh_cmd = 'pwsh'
|
||||
" on Windows Subsystem for Linux, check for PowerShell Core in Windows
|
||||
elseif exists('$WSLENV') && executable('pwsh.exe') | let s:pwsh_cmd = 'pwsh.exe'
|
||||
" check for PowerShell <= 5.1 in Windows
|
||||
elseif executable('powershell.exe') | let s:pwsh_cmd = 'powershell.exe'
|
||||
endif
|
||||
|
||||
if exists('s:pwsh_cmd')
|
||||
if !has('gui_running') && executable('less') &&
|
||||
\ !(exists('$ConEmuBuild') && &term =~? '^xterm')
|
||||
" For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048
|
||||
command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
else
|
||||
command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
endif
|
||||
endif
|
||||
setlocal keywordprg=:GetHelp
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
34
runtime/ftplugin/ps1xml.vim
Normal file
34
runtime/ftplugin/ps1xml.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Windows PowerShell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2021 Apr 02
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Don't load another plug-in for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
let b:browsefilter =
|
||||
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Feb 20
|
||||
" Last Change: 2021 Apr 11
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -94,11 +94,11 @@ 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\+(:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\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\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
|
||||
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' .
|
||||
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,'
|
||||
" Ignore syntax region commands and settings, any 'en*' would clobber
|
||||
" if-endif.
|
||||
|
||||
@@ -62,10 +62,14 @@ fun! CdlGetIndent(lnum)
|
||||
" PREVIOUS LINE
|
||||
let ind = indent(lnum)
|
||||
let line = getline(lnum)
|
||||
let f = -1 " wether a '=' is a conditional or a asignment, -1 means we don't know yet
|
||||
" one 'closing' element at the beginning of the line has already reduced the
|
||||
" indent, but 'else', 'elseif' & 'then' increment it for the next line
|
||||
" '=' at the beginning has already de right indent (increased for asignments)
|
||||
|
||||
" Whether a '=' is a conditional or an assignment. -1 means we don't know
|
||||
" yet.
|
||||
" One 'closing' element at the beginning of the line has already reduced the
|
||||
" indent, but 'else', 'elseif' & 'then' increment it for the next line.
|
||||
" '=' at the beginning already has the right indent (increased for
|
||||
" asignments).
|
||||
let f = -1
|
||||
let inicio = matchend(line, '^\c\s*\(else\a*\|then\|endif\|/[*/]\|[);={]\)')
|
||||
if inicio > 0
|
||||
let c = line[inicio-1]
|
||||
|
||||
17
runtime/indent/ps1.vim
Normal file
17
runtime/indent/ps1.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Vim indent file
|
||||
" Language: Windows PowerShell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2017 Oct 19
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" smartindent is good enough for powershell
|
||||
setlocal smartindent
|
||||
" disable the indent removal for # marks
|
||||
inoremap <buffer> # X#
|
||||
|
||||
let b:undo_indent = "setl si<"
|
||||
@@ -1,8 +1,9 @@
|
||||
" Menu Translations: Francais
|
||||
" Maintainer: Adrien Beau <version.francaise@free.fr>
|
||||
" First Version: Francois Thunus <thunus@systran.fr>
|
||||
" Last Modification: David Blanchet <david.blanchet@free.fr>
|
||||
" Last Change: 2018 Apr 25
|
||||
" Contributors: David Blanchet <david.blanchet@free.fr>
|
||||
" Gabriel Dupras <gabrieldupras@gmail.com>
|
||||
" Last Change: 2021 Feb 16
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
@@ -78,11 +79,12 @@ menutrans Find\ and\ Rep&lace<Tab>:%s Re&mplacer<Tab>:%s
|
||||
menutrans Find\ and\ Rep&lace<Tab>:s Re&mplacer<Tab>:s
|
||||
" -SEP3-
|
||||
menutrans Settings\ &Window Fe&nêtre\ des\ réglages
|
||||
menutrans Startup\ &Settings Réglages\ de\ &lancement
|
||||
menutrans &Global\ Settings Réglages\ globau&x
|
||||
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Surligner\ recherche\ on/off<Tab>:set\ hls!
|
||||
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Ignorer\ casse\ on/off<Tab>:set\ ic!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! Vérifier\ parenth&èses\ on/off<Tab>:set\ sm!
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Surligner\ recherche\ on/off<Tab>:set\ hls!
|
||||
menutrans Toggle\ &Ignoring\ case<Tab>:set\ ic! &Ignorer\ casse\ on/off<Tab>:set\ ic!
|
||||
menutrans Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! Vérifier\ parenth&èses\ on/off<Tab>:set\ sm!
|
||||
|
||||
menutrans &Context\ lines Lignes\ &autour\ du\ curseur
|
||||
|
||||
@@ -94,7 +96,7 @@ menutrans Block\ and\ Insert &Bloc\ et\ insertion
|
||||
menutrans Always &Toujours
|
||||
|
||||
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! I&nsertion\ permanente\ on/off<Tab>:set\ im!
|
||||
menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &Compatibilité\ Vi\ on/off<Tab>:set\ cp!
|
||||
menutrans Toggle\ Vi\ C&ompatibility<Tab>:set\ cp! &Compatibilité\ Vi\ on/off<Tab>:set\ cp!
|
||||
menutrans Search\ &Path\.\.\. Chemin\ de\ rec&herche\ des\ fichiers\.\.\.
|
||||
menutrans Ta&g\ Files\.\.\. Fichiers\ d'&étiquettes\.\.\.
|
||||
" -SEP1-
|
||||
@@ -109,12 +111,13 @@ let g:menutrans_tags_dialog = "Entrez les noms des fichiers d'
|
||||
menutrans F&ile\ Settings Réglages\ fichie&r
|
||||
|
||||
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numérotation\ on/off<Tab>:set\ nu!
|
||||
menutrans Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! &Numérotation\ relative\ on/off<Tab>:set\ nu!
|
||||
menutrans Toggle\ &List\ Mode<Tab>:set\ list! Mode\ &listing\ on/off<Tab>:set\ list!
|
||||
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! &Retour\ à\ la\ ligne\ on/off<Tab>:set\ wrap!
|
||||
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Retour\ sur\ &mot\ on/off<Tab>:set\ lbr!
|
||||
menutrans Toggle\ &expand-tab<Tab>:set\ et! &Tab\.\ en\ espaces\ on/off<Tab>:set\ et!
|
||||
menutrans Toggle\ &auto-indent<Tab>:set\ ai! Indentation\ &auto\.\ on/off<Tab>:set\ ai!
|
||||
menutrans Toggle\ &C-indenting<Tab>:set\ cin! Indent\.\ langage\ &C\ on/off<Tab>:set\ cin!
|
||||
menutrans Toggle\ Line\ &Wrapping<Tab>:set\ wrap! &Retour\ à\ la\ ligne\ on/off<Tab>:set\ wrap!
|
||||
menutrans Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! Retour\ sur\ &mot\ on/off<Tab>:set\ lbr!
|
||||
menutrans Toggle\ Tab\ &Expanding<Tab>:set\ et! &Tab\.\ en\ espaces\ on/off<Tab>:set\ et!
|
||||
menutrans Toggle\ &Auto\ Indenting<Tab>:set\ ai! Indentation\ &auto\.\ on/off<Tab>:set\ ai!
|
||||
menutrans Toggle\ &C-Style\ Indenting<Tab>:set\ cin! Indent\.\ langage\ &C\ on/off<Tab>:set\ cin!
|
||||
" -SEP2-
|
||||
menutrans &Shiftwidth Largeur\ des\ in&dentations
|
||||
menutrans Soft\ &Tabstop &Pseudo-tabulations
|
||||
@@ -126,7 +129,9 @@ let g:menutrans_fileformat_dialog = "Choisissez le format dans lequel
|
||||
let g:menutrans_fileformat_choices = " &Unix \n &Dos \n &Mac \n &Annuler "
|
||||
|
||||
menutrans C&olor\ Scheme &Jeu\ de\ couleurs
|
||||
menutrans Show\ C&olor\ Schemes\ in\ Menu Afficher\ les\ &jeux\ de\ couleurs
|
||||
menutrans &Keymap &Type\ de\ clavier
|
||||
menutrans Show\ &Keymaps\ in\ Menu Afficher\ les\ &types\ de\ clavier
|
||||
menutrans None (aucun)
|
||||
menutrans Select\ Fo&nt\.\.\. Sélectionner\ &police\.\.\.
|
||||
|
||||
@@ -146,16 +151,17 @@ menutrans To\ &Previous\ error<Tab>[s
|
||||
menutrans Suggest\ &Corrections<Tab>z= Suggérer\ &correction<Tab>z=
|
||||
menutrans &Repeat\ correction<Tab>:spellrepall &Reporter\ la\ correction<Tab>:spellrepall
|
||||
|
||||
an 40.335.205 &Tools.&Spelling.Français\ (fr) :set spl=fr spell<CR>
|
||||
menutrans Set\ language\ to\ "en" Anglais
|
||||
menutrans Set\ language\ to\ "en_au" Anglais\ (en_au)
|
||||
menutrans Set\ language\ to\ "en_ca" Anglais\ (en_ca)
|
||||
menutrans Set\ language\ to\ "en_gb" Anglais\ (en_gb)
|
||||
menutrans Set\ language\ to\ "en_nz" Anglais\ (en_nz)
|
||||
menutrans Set\ language\ to\ "en_us" Anglais\ (en_us)
|
||||
an 40.335.205 &Tools.&Spelling.Dictionnaire\ &français\ (fr) :set spl=fr spell<CR>
|
||||
menutrans Set\ language\ to\ "en" Dictionnaire\ &anglais\ (en)
|
||||
menutrans Set\ language\ to\ "en_au" Dictionnaire\ anglais\ (en_au)
|
||||
menutrans Set\ language\ to\ "en_ca" Dictionnaire\ anglais\ (en_ca)
|
||||
menutrans Set\ language\ to\ "en_gb" Dictionnaire\ anglais\ (en_gb)
|
||||
menutrans Set\ language\ to\ "en_nz" Dictionnaire\ anglais\ (en_nz)
|
||||
menutrans Set\ language\ to\ "en_us" Dictionnaire\ anglais\ (en_us)
|
||||
|
||||
menutrans &Find\ More\ Languages &Trouver\ d'autres\ langues
|
||||
|
||||
let g:menutrans_set_lang_to = "Dictionnaire "
|
||||
|
||||
|
||||
menutrans &Folding &Replis
|
||||
@@ -211,6 +217,7 @@ menutrans &Convert\ to\ HEX<Tab>:%!xxd Convertir\ en\ he&xa<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Décon&vertir<Tab>:%!xxd\ -r
|
||||
|
||||
menutrans Se&T\ Compiler &Type\ de\ compilateur
|
||||
menutrans Show\ Compiler\ Se&ttings\ in\ Menu &Afficher\ les\ compilateurs
|
||||
|
||||
|
||||
menutrans &Buffers &Tampons
|
||||
@@ -268,10 +275,15 @@ menutrans &Delete &Effacer
|
||||
" -SEP2-
|
||||
menutrans Select\ Blockwise Sélectionner\ &bloc
|
||||
menutrans Select\ &Word Sélectionner\ &mot
|
||||
menutrans Select\ &Sentence Sélectionner\ &phrase
|
||||
menutrans Select\ Pa&ragraph Sélectionner\ pa&ragraphe
|
||||
menutrans Select\ &Line Sélectionner\ &ligne
|
||||
menutrans Select\ &Block Sélectionner\ &bloc
|
||||
menutrans Select\ &All Sélectionner\ &tout
|
||||
|
||||
let g:menutrans_spell_change_ARG_to = 'Remplacer\ "%s"\ par'
|
||||
let g:menutrans_spell_add_ARG_to_word_list = 'Ajouter\ "%s"\ au\ dictionnaire'
|
||||
let g:menutrans_spell_ignore_ARG = 'Ignorer\ "%s"'
|
||||
|
||||
" ToolBar
|
||||
|
||||
@@ -459,7 +471,7 @@ menutrans XXD\ hex\ dump Sortie\ hexa\.\ de\ xxd
|
||||
menutrans XFree86\ Config Config\.\ XFree86
|
||||
" The End Of The Syntax Menu
|
||||
|
||||
menutrans &Show\ filetypes\ in\ menu &Afficher\ tout\ le\ menu
|
||||
menutrans &Show\ file\ types\ in\ menu &Afficher\ tout\ le\ menu
|
||||
" -SEP1-
|
||||
menutrans Set\ '&syntax'\ only Changer\ '&syntax'\ seulement
|
||||
menutrans Set\ '&filetype'\ too Changer\ '&filetype'\ aussi
|
||||
|
||||
@@ -266,6 +266,8 @@ if exists("+autochdir")
|
||||
call <SID>AddOption("autochdir", gettext("change to directory of file in buffer"))
|
||||
call <SID>BinOptionG("acd", &acd)
|
||||
endif
|
||||
call <SID>AddOption("autoshelldir", gettext("change to pwd of shell in terminal buffer"))
|
||||
call <SID>BinOptionG("asd", &asd)
|
||||
call <SID>AddOption("wrapscan", gettext("search commands wrap around the end of the buffer"))
|
||||
call <SID>BinOptionG("ws", &ws)
|
||||
call <SID>AddOption("incsearch", gettext("show match for partly typed search command"))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Jun 18
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@@ -107,9 +107,10 @@ func s:Highlight_Matching_Pair()
|
||||
" Build an expression that detects whether the current cursor position is
|
||||
" in certain syntax types (string, comment, etc.), for use as
|
||||
" searchpairpos()'s skip argument.
|
||||
" We match "escape" for special items, such as lispEscapeSpecial.
|
||||
" We match "escape" for special items, such as lispEscapeSpecial, and
|
||||
" match "symbol" for lispBarSymbol.
|
||||
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
|
||||
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
|
||||
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|symbol\\|comment"''))'
|
||||
" If executing the expression determines that the cursor is currently in
|
||||
" one of the syntax types, then we want searchpairpos() to find the pair
|
||||
" within those syntax types (i.e., not skip). Otherwise, the cursor is
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
" Vim syntax file
|
||||
" Language: Dot
|
||||
" Filenames: *.dot
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: http://www.ocaml.info/vim/syntax/dot.vim
|
||||
" Last Change: 2011 May 17 - improved identifier matching + two new keywords
|
||||
" Last Change: 2021 Mar 24 - better attr + escape string matching, new keywords (Farbod Salamat-Zadeh)
|
||||
" 2011 May 17 - improved identifier matching + two new keywords
|
||||
" 2001 May 04 - initial version
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Errors
|
||||
syn match dotParErr ")"
|
||||
syn match dotBrackErr "]"
|
||||
@@ -29,39 +35,43 @@ syn keyword dotTodo contained TODO FIXME XXX
|
||||
" Strings
|
||||
syn region dotString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
|
||||
" Escape strings
|
||||
syn match dotEscString /\v\\(N|G|E|T|H|L)/ containedin=dotString
|
||||
syn match dotEscString /\v\\(n|l|r)/ containedin=dotString
|
||||
|
||||
" General keywords
|
||||
syn keyword dotKeyword digraph node edge subgraph
|
||||
syn keyword dotKeyword graph digraph subgraph node edge strict
|
||||
|
||||
" Graph attributes
|
||||
syn keyword dotType center layers margin mclimit name nodesep nslimit
|
||||
syn keyword dotType ordering page pagedir rank rankdir ranksep ratio
|
||||
syn keyword dotType rotate size
|
||||
|
||||
" Node attributes
|
||||
syn keyword dotType distortion fillcolor fontcolor fontname fontsize
|
||||
syn keyword dotType height layer orientation peripheries regular
|
||||
syn keyword dotType shape shapefile sides skew width
|
||||
|
||||
" Edge attributes
|
||||
syn keyword dotType arrowhead arrowsize arrowtail constraint decorateP
|
||||
syn keyword dotType dir headclip headlabel headport labelangle labeldistance
|
||||
syn keyword dotType labelfontcolor labelfontname labelfontsize
|
||||
syn keyword dotType minlen port_label_distance samehead sametail
|
||||
syn keyword dotType tailclip taillabel tailport weight
|
||||
|
||||
" Shared attributes (graphs, nodes, edges)
|
||||
syn keyword dotType color
|
||||
|
||||
" Shared attributes (graphs and edges)
|
||||
syn keyword dotType bgcolor label URL
|
||||
|
||||
" Shared attributes (nodes and edges)
|
||||
syn keyword dotType fontcolor fontname fontsize layer style
|
||||
" Node, edge and graph attributes
|
||||
syn keyword dotType _background area arrowhead arrowsize arrowtail bb bgcolor
|
||||
\ center charset class clusterrank color colorscheme comment compound
|
||||
\ concentrate constraint Damping decorate defaultdist dim dimen dir
|
||||
\ diredgeconstraints distortion dpi edgehref edgetarget edgetooltip
|
||||
\ edgeURL epsilon esep fillcolor fixedsize fontcolor fontname fontnames
|
||||
\ fontpath fontsize forcelabels gradientangle group head_lp headclip
|
||||
\ headhref headlabel headport headtarget headtooltip headURL height href
|
||||
\ id image imagepath imagepos imagescale inputscale K label label_scheme
|
||||
\ labelangle labeldistance labelfloat labelfontcolor labelfontname
|
||||
\ labelfontsize labelhref labeljust labelloc labeltarget labeltooltip
|
||||
\ labelURL landscape layer layerlistsep layers layerselect layersep
|
||||
\ layout len levels levelsgap lhead lheight lp ltail lwidth margin
|
||||
\ maxiter mclimit mindist minlen mode model mosek newrank nodesep
|
||||
\ nojustify normalize notranslate nslimit nslimit1 ordering orientation
|
||||
\ outputorder overlap overlap_scaling overlap_shrink pack packmode pad
|
||||
\ page pagedir pencolor penwidth peripheries pin pos quadtree quantum
|
||||
\ rank rankdir ranksep ratio rects regular remincross repulsiveforce
|
||||
\ resolution root rotate rotation samehead sametail samplepoints scale
|
||||
\ searchsize sep shape shapefile showboxes sides size skew smoothing
|
||||
\ sortv splines start style stylesheet tail_lp tailclip tailhref
|
||||
\ taillabel tailport tailtarget tailtooltip tailURL target tooltip
|
||||
\ truecolor URL vertices viewport voro_margin weight width xdotversion
|
||||
\ xlabel xlp z
|
||||
|
||||
" Special chars
|
||||
syn match dotKeyChar "="
|
||||
syn match dotKeyChar ";"
|
||||
syn match dotKeyChar "->"
|
||||
syn match dotKeyChar "--"
|
||||
|
||||
" Identifier
|
||||
syn match dotIdentifier /\<\w\+\(:\w\+\)\?\>/
|
||||
@@ -71,27 +81,41 @@ syn sync minlines=50
|
||||
syn sync maxlines=500
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_dot_syntax_inits")
|
||||
if version < 508
|
||||
let did_dot_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
hi def link dotParErr Error
|
||||
hi def link dotBraceErr Error
|
||||
hi def link dotBrackErr Error
|
||||
HiLink dotParErr Error
|
||||
HiLink dotBraceErr Error
|
||||
HiLink dotBrackErr Error
|
||||
|
||||
hi def link dotComment Comment
|
||||
hi def link dotTodo Todo
|
||||
HiLink dotComment Comment
|
||||
HiLink dotTodo Todo
|
||||
|
||||
hi def link dotParEncl Keyword
|
||||
hi def link dotBrackEncl Keyword
|
||||
hi def link dotBraceEncl Keyword
|
||||
HiLink dotParEncl Keyword
|
||||
HiLink dotBrackEncl Keyword
|
||||
HiLink dotBraceEncl Keyword
|
||||
|
||||
hi def link dotKeyword Keyword
|
||||
hi def link dotType Type
|
||||
hi def link dotKeyChar Keyword
|
||||
HiLink dotKeyword Keyword
|
||||
HiLink dotType Type
|
||||
HiLink dotKeyChar Keyword
|
||||
|
||||
hi def link dotString String
|
||||
hi def link dotIdentifier Identifier
|
||||
HiLink dotString String
|
||||
HiLink dotEscString Keyword
|
||||
HiLink dotIdentifier Identifier
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "dot"
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
|
||||
" Version: (v103) 2020 October 07
|
||||
" Version: (v104) 2021 April 06
|
||||
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
||||
" Usage: For instructions, do :help fortran-syntax from Vim
|
||||
" Credits:
|
||||
@@ -8,10 +8,10 @@
|
||||
" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg.
|
||||
" Since then, useful suggestions and contributions have been made, in order, by:
|
||||
" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
|
||||
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
|
||||
" Walter Dieudonne, Alexander Wagner, Roman Bertle, Charles Rendleman,
|
||||
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann,
|
||||
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, Takuma Yoshida,
|
||||
" Eisuke Kawashima, and André Chalella.`
|
||||
" Stefano Zaghi, Vishnu V. Krishnan, Judicael Grasset, Takuma Yoshida,
|
||||
" Eisuke Kawashima, Andre Chalella, and Fritz Reese.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -360,8 +360,15 @@ syn cluster fortranCommentGroup contains=fortranTodo
|
||||
|
||||
if (b:fortran_fixed_source == 1)
|
||||
if !exists("fortran_have_tabs")
|
||||
"Flag items beyond column 72
|
||||
syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72
|
||||
" Fixed format requires a textwidth of 72 for code,
|
||||
" but some vendor extensions allow longer lines
|
||||
if exists("fortran_extended_line_length")
|
||||
syn match fortranSerialNumber excludenl "^.\{133,}$"lc=132
|
||||
elseif exists("fortran_cardimage_line_length")
|
||||
syn match fortranSerialNumber excludenl "^.\{81,}$"lc=80
|
||||
else
|
||||
syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72
|
||||
endif
|
||||
"Flag left margin errors
|
||||
syn match fortranLabelError "^.\{-,4}[^0-9 ]" contains=fortranTab
|
||||
syn match fortranLabelError "^.\{4}\d\S"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Syntax for Gprof Output
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Last Change: 2013 Jun 09
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -28,7 +28,7 @@ syn match gprofCallGraphTitle "Call graph (explanation follows)"
|
||||
syn region gprofCallGraphHeader
|
||||
\ start="^granularity: each sample hit covers.*"
|
||||
\ end="^\s*index % time\s\+self\s\+children\s\+called\s\+name$"
|
||||
syn match gprofCallGraphFunction "\s\+\(\d\+\.\d\+\s\+\)\{3}\([0-9+]\+\)\?\s\+[a-zA-Z_<].*\ze\["
|
||||
syn match gprofCallGraphFunction "\<\(\d\+\.\d\+\s\+\)\{3}\([0-9+]\+\)\?\s\+[a-zA-Z_<].*\ze\["
|
||||
syn match gprofCallGraphSeparator "^-\+$"
|
||||
syn region gprofCallGraphTrailer
|
||||
\ start="This table describes the call tree of the program"
|
||||
@@ -41,7 +41,7 @@ syn region gprofIndex
|
||||
|
||||
syn match gprofIndexFunctionTitle "^Index by function name$"
|
||||
|
||||
syn match gprofNumbers "^\s\+[0-9 ./+]\+"
|
||||
syn match gprofNumbers "^\s*[0-9 ./+]\+"
|
||||
syn match gprofFunctionIndex "\[\d\+\]"
|
||||
syn match gprofSpecial "<\(spontaneous\|cycle \d\+\)>"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" VIM syntax file
|
||||
" Language: groff
|
||||
" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
|
||||
" URL: http://dradul.tripod.com/vim
|
||||
" Maintainer: John Marshall <jmarshall@hey.com>
|
||||
" Previous Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
|
||||
" Last Change: 2003-05-08-12:41:13 GMT-5.
|
||||
|
||||
" This uses the nroff.vim syntax file.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,8 +3,9 @@
|
||||
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2021 Feb 25
|
||||
" Last Change: 2021 Mar 02
|
||||
" Included patch #7900 to fix comments
|
||||
" Included patch #7916 to fix a few more things
|
||||
"
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -79,26 +80,16 @@ syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
|
||||
syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
|
||||
|
||||
" aria attributes
|
||||
syn match htmlArg contained "\<\(aria-activedescendant\|aria-atomic\)\>"
|
||||
syn match htmlArg contained "\<\(aria-autocomplete\|aria-busy\|aria-checked\)\>"
|
||||
syn match htmlArg contained "\<\(aria-colcount\|aria-colindex\|aria-colspan\)\>"
|
||||
syn match htmlArg contained "\<\(aria-controls\|aria-current\)\>"
|
||||
syn match htmlArg contained "\<\(aria-describedby\|aria-details\)\>"
|
||||
syn match htmlArg contained "\<\(aria-disabled\|aria-dropeffect\)\>"
|
||||
syn match htmlArg contained "\<\(aria-errormessage\|aria-expanded\)\>"
|
||||
syn match htmlArg contained "\<\(aria-flowto\|aria-grabbed\|aria-haspopup\)\>"
|
||||
syn match htmlArg contained "\<\(aria-hidden\|aria-invalid\)\>"
|
||||
syn match htmlArg contained "\<\(aria-keyshortcuts\|aria-label\)\>"
|
||||
syn match htmlArg contained "\<\(aria-labelledby\|aria-level\|aria-live\)\>"
|
||||
syn match htmlArg contained "\<\(aria-modal\|aria-multiline\)\>"
|
||||
syn match htmlArg contained "\<\(aria-multiselectable\|aria-orientation\)\>"
|
||||
syn match htmlArg contained "\<\(aria-owns\|aria-placeholder\|aria-posinset\)\>"
|
||||
syn match htmlArg contained "\<\(aria-pressed\|aria-readonly\|aria-relevant\)\>"
|
||||
syn match htmlArg contained "\<\(aria-required\|aria-roledescription\)\>"
|
||||
syn match htmlArg contained "\<\(aria-rowcount\|aria-rowindex\|aria-rowspan\)\>"
|
||||
syn match htmlArg contained "\<\(aria-selected\|aria-setsize\|aria-sort\)\>"
|
||||
syn match htmlArg contained "\<\(aria-valuemax\|aria-valuemin\)\>"
|
||||
syn match htmlArg contained "\<\(aria-valuenow\|aria-valuetext\)\>"
|
||||
exe 'syn match htmlArg contained "\<aria-\%(' . join([
|
||||
\ 'activedescendant', 'atomic', 'autocomplete', 'busy', 'checked', 'colcount',
|
||||
\ 'colindex', 'colspan', 'controls', 'current', 'describedby', 'details',
|
||||
\ 'disabled', 'dropeffect', 'errormessage', 'expanded', 'flowto', 'grabbed',
|
||||
\ 'haspopup', 'hidden', 'invalid', 'keyshortcuts', 'label', 'labelledby', 'level',
|
||||
\ 'live', 'modal', 'multiline', 'multiselectable', 'orientation', 'owns',
|
||||
\ 'placeholder', 'posinset', 'pressed', 'readonly', 'relevant', 'required',
|
||||
\ 'roledescription', 'rowcount', 'rowindex', 'rowspan', 'selected', 'setsize',
|
||||
\ 'sort', 'valuemax', 'valuemin', 'valuenow', 'valuetext'
|
||||
\ ], '\|') . '\)\>"'
|
||||
syn keyword htmlArg contained role
|
||||
|
||||
" Netscape extensions
|
||||
@@ -139,25 +130,19 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
|
||||
" Comments (the real ones or the old netscape ones)
|
||||
if exists("html_wrong_comments")
|
||||
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
else
|
||||
" The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next >
|
||||
" Note: must stand first to get lesser :syn-priority
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
|
||||
" Normal comment opening <!-- ...>
|
||||
syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
|
||||
" Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
|
||||
syn match htmlComment "<!---\?>" contains=htmlCommentError
|
||||
" Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
|
||||
" Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
|
||||
syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
|
||||
" Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
|
||||
syn match htmlCommentNested contained "<!--[^>]"me=e-1
|
||||
syn match htmlCommentNested contained "<!--->"me=e-3
|
||||
syn match htmlCommentNested contained "<!---\?!>"me=e-4
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
" The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next >
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError keepend
|
||||
" Idem 8.2.4.42,51: Comment starts with <!-- and ends with -->
|
||||
" Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors
|
||||
" Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment
|
||||
syn region htmlComment matchgroup=htmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=htmlCommentNested,@htmlPreProc,@Spell keepend
|
||||
" Idem 8.2.4.49: nested comment is parser error, except <!--> is all right
|
||||
syn match htmlCommentNested contained "<!-->\@!"
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
endif
|
||||
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend
|
||||
|
||||
" server-parsed commands
|
||||
syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
|
||||
@@ -278,7 +263,7 @@ hi def link htmlEndTag Identifier
|
||||
hi def link htmlArg Type
|
||||
hi def link htmlTagName htmlStatement
|
||||
hi def link htmlSpecialTagName Exception
|
||||
hi def link htmlValue String
|
||||
hi def link htmlValue String
|
||||
hi def link htmlSpecialChar Special
|
||||
|
||||
if !exists("html_no_rendering")
|
||||
@@ -322,14 +307,10 @@ hi def link htmlPreProc PreProc
|
||||
hi def link htmlPreAttr String
|
||||
hi def link htmlPreProcAttrName PreProc
|
||||
hi def link htmlPreProcAttrError Error
|
||||
hi def link htmlSpecial Special
|
||||
hi def link htmlSpecialChar Special
|
||||
hi def link htmlString String
|
||||
hi def link htmlStatement Statement
|
||||
hi def link htmlComment Comment
|
||||
hi def link htmlCommentPart Comment
|
||||
hi def link htmlValue String
|
||||
hi def link htmlCommentNested htmlCommentError
|
||||
hi def link htmlCommentNested htmlError
|
||||
hi def link htmlCommentError htmlError
|
||||
hi def link htmlTagError htmlError
|
||||
hi def link htmlEvent javaScript
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
" (ss) repaired several quoting and grouping glitches
|
||||
" (ss) fixed regex parsing issue with multiple qualifiers [gi]
|
||||
" (ss) additional factoring of keywords, globals, and members
|
||||
" Last Change: 2020 May 14
|
||||
" Last Change: 2021 Mar 30
|
||||
" 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke)
|
||||
" 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder)
|
||||
|
||||
@@ -41,6 +41,7 @@ syn region javaScriptEmbed start=+${+ end=+}+ contains=@javaScriptEmbed
|
||||
|
||||
syn match javaScriptSpecialCharacter "'\\.'"
|
||||
syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
||||
syn match javaScriptNumber "-\=\<\d\+\%(_\d\+\)*\>"
|
||||
syn region javaScriptRegexpString start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline
|
||||
|
||||
syn keyword javaScriptConditional if else switch
|
||||
|
||||
177
runtime/syntax/m3build.vim
Normal file
177
runtime/syntax/m3build.vim
Normal file
@@ -0,0 +1,177 @@
|
||||
" Vim syntax file
|
||||
" Language: Modula-3 Makefile
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 April 15
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! syntax/m3quake.vim
|
||||
|
||||
" Identifiers
|
||||
syn match m3buildPredefinedVariable "\<\%(TARGET\|OS_TYPE\|BUILD_DIR\|PKG_USE\|WDROOT\)\>"
|
||||
|
||||
" Build Procedures {{{1
|
||||
" Generated from cm3/m3-sys/cm3/src/M3Build.m3
|
||||
syn keyword m3buildProcedure HasCBackend
|
||||
|
||||
" (* packages & locations *)
|
||||
syn keyword m3buildProcedure Pkg
|
||||
syn keyword m3buildProcedure override
|
||||
syn keyword m3buildProcedure path_of
|
||||
syn keyword m3buildProcedure pkg_subdir
|
||||
|
||||
" (* names *)
|
||||
syn keyword m3buildProcedure program_name
|
||||
syn keyword m3buildProcedure library_name
|
||||
|
||||
" (* calls in the generated .M3EXPORT files *)
|
||||
syn keyword m3buildProcedure _define_lib
|
||||
syn keyword m3buildProcedure _define_pgm
|
||||
syn keyword m3buildProcedure _import_template
|
||||
syn keyword m3buildProcedure _import_m3lib
|
||||
syn keyword m3buildProcedure _import_otherlib
|
||||
syn keyword m3buildProcedure _map_add_interface
|
||||
syn keyword m3buildProcedure _map_add_generic_interface
|
||||
syn keyword m3buildProcedure _map_add_module
|
||||
syn keyword m3buildProcedure _map_add_generic_module
|
||||
syn keyword m3buildProcedure _map_add_c
|
||||
syn keyword m3buildProcedure _map_add_h
|
||||
syn keyword m3buildProcedure _map_add_s
|
||||
|
||||
" (* compiler options *)
|
||||
syn keyword m3buildProcedure m3_debug
|
||||
syn keyword m3buildProcedure m3_optimize
|
||||
syn keyword m3buildProcedure build_shared
|
||||
syn keyword m3buildProcedure build_standalone
|
||||
|
||||
" (* derived files *)
|
||||
syn keyword m3buildProcedure m3_compile_only
|
||||
syn keyword m3buildProcedure m3_finish_up
|
||||
|
||||
" (* predefined system libraries *)
|
||||
syn keyword m3buildProcedure import_sys_lib
|
||||
|
||||
" (* options *)
|
||||
syn keyword m3buildProcedure m3_option
|
||||
syn keyword m3buildProcedure remove_m3_option
|
||||
|
||||
" (* deleting *)
|
||||
syn keyword m3buildProcedure deriveds
|
||||
|
||||
" (* imports *)
|
||||
syn keyword m3buildProcedure include_dir
|
||||
syn keyword m3buildProcedure include_pkg
|
||||
syn keyword m3buildProcedure import
|
||||
syn keyword m3buildProcedure import_version
|
||||
syn keyword m3buildProcedure import_obj
|
||||
syn keyword m3buildProcedure import_lib
|
||||
|
||||
" (* objects *)
|
||||
syn keyword m3buildProcedure pgm_object
|
||||
|
||||
" (* sources *)
|
||||
syn keyword m3buildProcedure source
|
||||
syn keyword m3buildProcedure pgm_source
|
||||
syn keyword m3buildProcedure interface
|
||||
syn keyword m3buildProcedure Interface
|
||||
syn keyword m3buildProcedure implementation
|
||||
syn keyword m3buildProcedure module
|
||||
syn keyword m3buildProcedure Module
|
||||
syn keyword m3buildProcedure h_source
|
||||
syn keyword m3buildProcedure c_source
|
||||
syn keyword m3buildProcedure s_source
|
||||
syn keyword m3buildProcedure ship_source
|
||||
|
||||
" (* generics *)
|
||||
syn keyword m3buildProcedure generic_interface
|
||||
syn keyword m3buildProcedure Generic_interface
|
||||
syn keyword m3buildProcedure generic_implementation
|
||||
syn keyword m3buildProcedure Generic_implementation
|
||||
syn keyword m3buildProcedure generic_module
|
||||
syn keyword m3buildProcedure Generic_module
|
||||
syn keyword m3buildProcedure build_generic_intf
|
||||
syn keyword m3buildProcedure build_generic_impl
|
||||
|
||||
" (* derived sources *)
|
||||
syn keyword m3buildProcedure derived_interface
|
||||
syn keyword m3buildProcedure derived_implementation
|
||||
syn keyword m3buildProcedure derived_c
|
||||
syn keyword m3buildProcedure derived_h
|
||||
|
||||
" (* hiding/exporting *)
|
||||
syn keyword m3buildProcedure hide_interface
|
||||
syn keyword m3buildProcedure hide_generic_interface
|
||||
syn keyword m3buildProcedure hide_generic_implementation
|
||||
syn keyword m3buildProcedure export_interface
|
||||
syn keyword m3buildProcedure export_generic_interface
|
||||
syn keyword m3buildProcedure export_generic_implementation
|
||||
|
||||
" (* templates *)
|
||||
syn keyword m3buildProcedure template
|
||||
|
||||
" (* library building *)
|
||||
syn keyword m3buildProcedure library
|
||||
syn keyword m3buildProcedure Library
|
||||
|
||||
" (* program building *)
|
||||
syn keyword m3buildProcedure program
|
||||
syn keyword m3buildProcedure Program
|
||||
syn keyword m3buildProcedure c_program
|
||||
syn keyword m3buildProcedure C_program
|
||||
|
||||
" (* man pages *)
|
||||
syn keyword m3buildProcedure manPage
|
||||
syn keyword m3buildProcedure ManPage
|
||||
|
||||
" (* emacs *)
|
||||
syn keyword m3buildProcedure Gnuemacs
|
||||
syn keyword m3buildProcedure CompiledGnuemacs
|
||||
|
||||
" (* "-find" support *)
|
||||
syn keyword m3buildProcedure find_unit
|
||||
syn keyword m3buildProcedure enum_units
|
||||
|
||||
" (* export functions *)
|
||||
syn keyword m3buildProcedure install_sources
|
||||
syn keyword m3buildProcedure install_derived
|
||||
syn keyword m3buildProcedure install_derived_link
|
||||
syn keyword m3buildProcedure install_derived_symbolic_link
|
||||
syn keyword m3buildProcedure install_derived_hard_link
|
||||
syn keyword m3buildProcedure install_link_to_derived
|
||||
syn keyword m3buildProcedure install_symbolic_link_to_derived
|
||||
syn keyword m3buildProcedure install_hard_link_to_derived
|
||||
syn keyword m3buildProcedure install_symbolic_link
|
||||
syn keyword m3buildProcedure install_file
|
||||
|
||||
" (* installation functions *)
|
||||
syn keyword m3buildProcedure BindExport
|
||||
syn keyword m3buildProcedure BinExport
|
||||
syn keyword m3buildProcedure LibdExport
|
||||
syn keyword m3buildProcedure LibExport
|
||||
syn keyword m3buildProcedure EmacsdExport
|
||||
syn keyword m3buildProcedure EmacsExport
|
||||
syn keyword m3buildProcedure DocdExport
|
||||
syn keyword m3buildProcedure DocExport
|
||||
syn keyword m3buildProcedure MandExport
|
||||
syn keyword m3buildProcedure ManExport
|
||||
syn keyword m3buildProcedure HtmlExport
|
||||
syn keyword m3buildProcedure RootExport
|
||||
syn keyword m3buildProcedure RootdExport
|
||||
|
||||
" (* misc *)
|
||||
syn keyword m3buildProcedure gen_m3exports
|
||||
syn keyword m3buildProcedure generate_tfile
|
||||
syn keyword m3buildProcedure delete_file
|
||||
syn keyword m3buildProcedure link_file
|
||||
syn keyword m3buildProcedure symbolic_link_file
|
||||
syn keyword m3buildProcedure hard_link_file
|
||||
" }}}
|
||||
|
||||
hi def link m3buildPredefinedVariable Identifier
|
||||
hi def link m3buildProcedure Function
|
||||
|
||||
let b:current_syntax = "m3build"
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
74
runtime/syntax/m3quake.vim
Normal file
74
runtime/syntax/m3quake.vim
Normal file
@@ -0,0 +1,74 @@
|
||||
" Vim syntax file
|
||||
" Language: Modula-3 Quake
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 April 15
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword m3quakeKeyword else end foreach if in is local or proc readonly
|
||||
syn keyword m3quakeKeyword return
|
||||
|
||||
" Builtin procedures {{{
|
||||
" Generated from m3-sys/m3quake/src/QMachine.m3
|
||||
syn keyword m3quakeProcedure arglist cp_if defined empty equal error escape
|
||||
syn keyword m3quakeProcedure exec cm3_exec file format include make_dir
|
||||
syn keyword m3quakeProcedure normalize path stale try_exec try_cm3_exec
|
||||
syn keyword m3quakeProcedure unlink_file write datetime date datestamp
|
||||
syn keyword m3quakeProcedure TRACE_INSTR eval_func hostname
|
||||
|
||||
syn keyword m3quakeProcedure pushd popd cd getwd
|
||||
|
||||
syn keyword m3quakeProcedure quake
|
||||
|
||||
syn keyword m3quakeProcedure q_exec q_exec_put q_exec_get
|
||||
|
||||
syn keyword m3quakeProcedure fs_exists fs_readable fs_writable fs_executable
|
||||
syn keyword m3quakeProcedure fs_isdir fs_isfile fs_contents fs_putfile
|
||||
syn keyword m3quakeProcedure fs_mkdir fs_touch fs_lsdirs fs_lsfiles fs_rmdir
|
||||
syn keyword m3quakeProcedure fs_rmfile fs_rmrec fs_cp
|
||||
|
||||
syn keyword m3quakeProcedure pn_valid pn_decompose pn_compose pn_absolute
|
||||
syn keyword m3quakeProcedure pn_prefix pn_last pn_base pn_lastbase pn_lastext
|
||||
syn keyword m3quakeProcedure pn_join pn_join2 pn_replace_ext pn_parent
|
||||
syn keyword m3quakeProcedure pn_current
|
||||
|
||||
syn keyword m3quakeProcedure len
|
||||
|
||||
syn keyword m3quakeProcedure split sub skipl skipr squeeze compress pos
|
||||
syn keyword m3quakeProcedure tcontains bool encode decode subst_chars
|
||||
syn keyword m3quakeProcedure del_chars subst subst_env add_prefix add_suffix
|
||||
" }}}
|
||||
|
||||
" Identifiers
|
||||
syn match m3quakeEnvVariable "$\h\w\+"
|
||||
|
||||
" Operators
|
||||
syn match m3quakeOperator "&"
|
||||
syn match m3quakeOperator "\<\%(contains\|not\|and\|or\)\>"
|
||||
|
||||
" Strings
|
||||
syn match m3quakeEscape "\\[\\nrtbf"]" contained display
|
||||
syn region m3quakeString start=+"+ end=+"+ contains=m3quakeEscape
|
||||
|
||||
" Comments
|
||||
syn keyword m3quakeTodo TODO FIXME XXX contained
|
||||
syn region m3quakeComment start="%" end="$" contains=m3quakeTodo,@Spell
|
||||
syn region m3quakeComment start="/\*" end="\*/" contains=m3quakeTodo,@Spell
|
||||
|
||||
" Default highlighting
|
||||
hi def link m3quakeCommand Statement
|
||||
hi def link m3quakeComment Comment
|
||||
hi def link m3quakeEnvVariable Identifier
|
||||
hi def link m3quakeEscape Special
|
||||
hi def link m3quakeKeyword Keyword
|
||||
hi def link m3quakeOperator Operator
|
||||
hi def link m3quakeProcedure Function
|
||||
hi def link m3quakeString String
|
||||
hi def link m3quakeTodo Todo
|
||||
|
||||
let b:current_syntax = "m3quake"
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
@@ -1,59 +1,96 @@
|
||||
" Vim syntax file
|
||||
" Language: Modula-3
|
||||
" Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>
|
||||
" Last Change: 2001 May 10
|
||||
" Language: Modula-3
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>
|
||||
" Last Change: 2021 Apr 08
|
||||
|
||||
" Basic things only...
|
||||
" Based on the modula 2 syntax file
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Modula-3 is case-sensitive
|
||||
" syn case ignore
|
||||
|
||||
" Modula-3 keywords
|
||||
syn keyword modula3Keyword ABS ADDRES ADR ADRSIZE AND ANY
|
||||
syn keyword modula3Keyword ARRAY AS BITS BITSIZE BOOLEAN BRANDED BY BYTESIZE
|
||||
syn keyword modula3Keyword CARDINAL CASE CEILING CHAR CONST DEC DEFINITION
|
||||
syn keyword modula3Keyword DISPOSE DIV
|
||||
syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION
|
||||
syn keyword modula3Keyword EXIT EXPORTS EXTENDED FALSE FINALLY FIRST FLOAT
|
||||
syn keyword modula3Keyword FLOOR FROM GENERIC IMPORT
|
||||
syn keyword modula3Keyword IN INC INTEGER ISTYPE LAST LOCK
|
||||
syn keyword modula3Keyword LONGREAL LOOPHOLE MAX METHOD MIN MOD MUTEX
|
||||
syn keyword modula3Keyword NARROW NEW NIL NOT NULL NUMBER OF OR ORD RAISE
|
||||
syn keyword modula3Keyword RAISES READONLY REAL RECORD REF REFANY
|
||||
syn keyword modula3Keyword RETURN ROOT
|
||||
syn keyword modula3Keyword ROUND SET SUBARRAY TEXT TRUE TRUNC TRY TYPE
|
||||
syn keyword modula3Keyword TYPECASE TYPECODE UNSAFE UNTRACED VAL VALUE VAR WITH
|
||||
syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST DEFINITION
|
||||
syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION EXIT EXPORTS FINALLY
|
||||
syn keyword modula3Keyword FROM GENERIC IMPORT LOCK METHOD OF RAISE RAISES
|
||||
syn keyword modula3Keyword READONLY RECORD REF RETURN SET TRY TYPE TYPECASE
|
||||
syn keyword modula3Keyword UNSAFE VALUE VAR WITH
|
||||
|
||||
syn match modula3keyword "\<UNTRACED\>"
|
||||
|
||||
" Special keywords, block delimiters etc
|
||||
syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN
|
||||
syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL
|
||||
syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP
|
||||
|
||||
" Comments
|
||||
syn region modula3Comment start="(\*" end="\*)"
|
||||
" Reserved identifiers
|
||||
syn keyword modula3Identifier ABS ADR ADRSIZE BITSIZE BYTESIZE CEILING DEC
|
||||
syn keyword modula3Identifier DISPOSE FIRST FLOAT FLOOR INC ISTYPE LAST
|
||||
syn keyword modula3Identifier LOOPHOLE MAX MIN NARROW NEW NUMBER ORD ROUND
|
||||
syn keyword modula3Identifier SUBARRAY TRUNC TYPECODE VAL
|
||||
|
||||
" Predefined types
|
||||
syn keyword modula3Type ADDRESS BOOLEAN CARDINAL CHAR EXTENDED INTEGER
|
||||
syn keyword modula3Type LONGCARD LONGINT LONGREAL MUTEX NULL REAL REFANY TEXT
|
||||
syn keyword modula3Type WIDECHAR
|
||||
|
||||
syn match modula3Type "\<\%(UNTRACED\s\+\)\=ROOT\>"
|
||||
|
||||
" Operators
|
||||
syn keyword modulaOperator DIV MOD IN AND OR NOT
|
||||
|
||||
if exists("modula3_operators")
|
||||
syn match modula3Operator "\^"
|
||||
syn match modula3Operator "+\|-\|\*\|/\|&"
|
||||
" TODO: need to exclude = in procedure definitions
|
||||
syn match modula3Operator "<=\|<\|>=\|>\|:\@<!=\|#"
|
||||
endif
|
||||
|
||||
" Booleans
|
||||
syn keyword modula3Boolean TRUE FALSE
|
||||
|
||||
" Nil
|
||||
syn keyword modula3Nil NIL
|
||||
|
||||
" Integers
|
||||
syn match modula3Integer "\<\d\+L\=\>"
|
||||
syn match modula3Integer "\<\d\d\=_\x\+L\=\>"
|
||||
|
||||
" Reals
|
||||
syn match modula3Real "\c\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>"
|
||||
|
||||
" String escape sequences
|
||||
syn match modula3Escape "\\['"ntrf]" contained display
|
||||
syn match modula3Escape "\\\o\{3}" contained display
|
||||
syn match modula3Escape "\\\\" contained display
|
||||
|
||||
" Characters
|
||||
syn match modula3Character "'\%([^']\|\\.\|\\\o\{3}\)'" contains=modula3Escape
|
||||
|
||||
" Strings
|
||||
syn region modula3String start=+"+ end=+"+
|
||||
syn region modula3String start=+'+ end=+'+
|
||||
syn region modula3String start=+"+ end=+"+ contains=modula3Escape
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
" Pragmas
|
||||
syn region modula3Pragma start="<\*" end="\*>"
|
||||
|
||||
" The default methods for highlighting. Can be overridden later
|
||||
hi def link modula3Keyword Statement
|
||||
hi def link modula3Block PreProc
|
||||
" Comments
|
||||
syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell
|
||||
|
||||
" Default highlighting
|
||||
hi def link modula3Block Statement
|
||||
hi def link modula3Boolean Boolean
|
||||
hi def link modula3Character Character
|
||||
hi def link modula3Comment Comment
|
||||
hi def link modula3String String
|
||||
|
||||
hi def link modula3Escape Special
|
||||
hi def link modula3Identifier Keyword
|
||||
hi def link modula3Integer Number
|
||||
hi def link modula3Keyword Statement
|
||||
hi def link modula3Nil Constant
|
||||
hi def link modula3Operator Operator
|
||||
hi def link modula3Pragma PreProc
|
||||
hi def link modula3Real Float
|
||||
hi def link modula3String String
|
||||
hi def link modula3Type Type
|
||||
|
||||
let b:current_syntax = "modula3"
|
||||
|
||||
"I prefer to use this...
|
||||
"set ai
|
||||
"vim: ts=8
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Andrii Sokolov <andriy145@gmail.com>
|
||||
" Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Contributors: Leonard König <leonard.r.koenig@gmail.com> (C string highlighting)
|
||||
" Contributors: Leonard König <leonard.r.koenig@gmail.com> (C string highlighting), Peter Stanhope <dev.rptr@gmail.com> (Add missing 64-bit mode registers)
|
||||
" Last Change: 2017 Jan 23
|
||||
" NASM Home: http://www.nasm.us/
|
||||
|
||||
@@ -240,7 +240,8 @@ syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCo
|
||||
syn match nasmGen08Register "\<[A-D][HL]\>"
|
||||
syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>"
|
||||
syn match nasmGen32Register "\<E\([A-D]X\|[DS]I\|[BS]P\)\>"
|
||||
syn match nasmGen64Register "\<R\([A-D]X\|[DS]I\|[BS]P\|[89]\|1[0-5]\|[89][WD]\|1[0-5][WD]\)\>"
|
||||
syn match nasmGen64Register "\<R\([A-D]X\|[DS]I\|[BS]P\|[89]\|1[0-5]\|[89][WDB]\|1[0-5][WDB]\)\>"
|
||||
syn match nasmExtRegister "\<\([SB]PL\|[SD]IL\)\>"
|
||||
syn match nasmSegRegister "\<[C-GS]S\>"
|
||||
syn match nasmSpcRegister "\<E\=IP\>"
|
||||
syn match nasmFpuRegister "\<ST\o\>"
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
" VIM syntax file
|
||||
" Language: nroff/groff
|
||||
" Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
|
||||
" URL: http://vorbote.wordpress.com/
|
||||
" Last Change: 2012 Feb 2
|
||||
"
|
||||
" {{{1 Acknowledgements
|
||||
"
|
||||
" ACKNOWLEDGEMENTS:
|
||||
"
|
||||
" My thanks to Jérôme Plût <Jerome.Plut@ens.fr>, who was the
|
||||
" creator and maintainer of this syntax file for several years.
|
||||
" May I be as good at it as he has been.
|
||||
" Maintainer: John Marshall <jmarshall@hey.com>
|
||||
" Previous Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
|
||||
" Previous Maintainer: Jérôme Plût <Jerome.Plut@ens.fr>
|
||||
" Last Change: 2021 Mar 28
|
||||
"
|
||||
" {{{1 Todo
|
||||
"
|
||||
@@ -31,6 +24,13 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists("nroff_is_groff")
|
||||
let b:nroff_is_groff = 1
|
||||
endif
|
||||
|
||||
syn spell toplevel
|
||||
syn case match
|
||||
|
||||
"
|
||||
" {{{1 plugin settings...
|
||||
"
|
||||
@@ -48,7 +48,7 @@ endif
|
||||
"
|
||||
setlocal paragraphs+=XP
|
||||
"
|
||||
" {{{2 Activate navigation to preporcessor sections.
|
||||
" {{{2 Activate navigation to preprocessor sections.
|
||||
"
|
||||
if exists("b:preprocs_as_sections")
|
||||
setlocal sections=EQTSPS[\ G1GS
|
||||
@@ -169,9 +169,9 @@ endif
|
||||
" <jp />
|
||||
|
||||
syn region nroffEquation start=/^\.\s*EQ\>/ end=/^\.\s*EN\>/
|
||||
syn region nroffTable start=/^\.\s*TS\>/ end=/^\.\s*TE\>/
|
||||
syn region nroffTable start=/^\.\s*TS\>/ end=/^\.\s*TE\>/ contains=@Spell
|
||||
syn region nroffPicture start=/^\.\s*PS\>/ end=/^\.\s*PE\>/
|
||||
syn region nroffRefer start=/^\.\s*\[\>/ end=/^\.\s*\]\>/
|
||||
syn region nroffRefer start=/^\.\s*\[\>/ end=/^\.\s*\]\>/ contains=@Spell
|
||||
syn region nroffGrap start=/^\.\s*G1\>/ end=/^\.\s*G2\>/
|
||||
syn region nroffGremlin start=/^\.\s*GS\>/ end=/^\.\s*GE|GF\>/
|
||||
|
||||
@@ -179,11 +179,11 @@ syn region nroffGremlin start=/^\.\s*GS\>/ end=/^\.\s*GE|GF\>/
|
||||
" ------------------------------------------------------------
|
||||
|
||||
syn region nroffIgnore start=/^[.']\s*ig/ end=/^['.]\s*\./
|
||||
syn match nroffComment /\(^[.']\s*\)\=\\".*/ contains=nroffTodo
|
||||
syn match nroffComment /^'''.*/ contains=nroffTodo
|
||||
syn match nroffComment /\(^[.']\s*\)\=\\".*/ contains=nroffTodo,@Spell
|
||||
syn match nroffComment /^'''.*/ contains=nroffTodo,@Spell
|
||||
|
||||
if exists("b:nroff_is_groff")
|
||||
syn match nroffComment "\\#.*$" contains=nroffTodo
|
||||
syn match nroffComment "\\#.*$" contains=nroffTodo,@Spell
|
||||
endif
|
||||
|
||||
syn keyword nroffTodo TODO XXX FIXME contained
|
||||
@@ -198,7 +198,7 @@ syn keyword nroffTodo TODO XXX FIXME contained
|
||||
"
|
||||
|
||||
hi def link nroffEscChar nroffSpecialChar
|
||||
hi def link nroffEscCharAr nroffSpecialChar
|
||||
hi def link nroffEscCharArg nroffSpecialChar
|
||||
hi def link nroffSpecialChar SpecialChar
|
||||
hi def link nroffSpace Delimiter
|
||||
|
||||
@@ -211,7 +211,7 @@ hi def link nroffEscPar nroffEscape
|
||||
hi def link nroffEscRegPar nroffEscape
|
||||
hi def link nroffEscArg nroffEscape
|
||||
hi def link nroffSize nroffEscape
|
||||
hi def link nroffEscape Preproc
|
||||
hi def link nroffEscape PreProc
|
||||
|
||||
hi def link nroffIgnore Comment
|
||||
hi def link nroffComment Comment
|
||||
|
||||
151
runtime/syntax/poke.vim
Normal file
151
runtime/syntax/poke.vim
Normal file
@@ -0,0 +1,151 @@
|
||||
" Copyright (C) 2021 Matthew T. Ihlenfield.
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" Vim syntax file
|
||||
" Language: Poke
|
||||
" Maintainer: Matt Ihlenfield <mtihlenfield@protonmail.com>
|
||||
" Filenames: *.pk
|
||||
" Latest Revision: 10 March 2021
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Poke statement
|
||||
syn keyword pokeStatement assert break continue return
|
||||
syn keyword pokeStatement type unit fun method nextgroup=pokeFunction skipwhite
|
||||
syn keyword pokeStatement var nextgroup=pokeVar skipWhite
|
||||
|
||||
" Identifiers
|
||||
syn match pokeVar '\h\w*' display contained
|
||||
|
||||
" User defined functions
|
||||
syn match pokeFunction '\h\w*' display contained
|
||||
|
||||
" Poke operators
|
||||
syn keyword pokeOperator in sizeof as isa unmap
|
||||
|
||||
" Conditionals
|
||||
syn keyword pokeConditional if else where
|
||||
|
||||
" Structures, unions, etc...
|
||||
syn keyword pokeStructure struct union pinned
|
||||
|
||||
" Loops
|
||||
syn keyword pokeRepeat while for
|
||||
|
||||
" Imports
|
||||
syn keyword pokeLoad load
|
||||
|
||||
" Exceptions
|
||||
syn keyword pokeException try catch until raise
|
||||
|
||||
" Exception types
|
||||
syn keyword pokeExceptionType Exception E_generic E_out_of_bounds
|
||||
syn keyword pokeExceptionType E_eof E_elem E_constraint
|
||||
syn keyword pokeExceptionType E_conv E_map_bounds E_map
|
||||
syn keyword pokeExceptionType E_div_by_zero E_no_ios E_no_return
|
||||
syn keyword pokeExceptionType E_io E_io_flags E_assert E_overflow
|
||||
|
||||
" Exception codes
|
||||
syn keyword pokeExceptionCode EC_generic EC_out_of_bounds
|
||||
syn keyword pokeExceptionCode EC_eof EC_elem EC_constraint
|
||||
syn keyword pokeExceptionCode EC_conv EC_map_bounds EC_map
|
||||
syn keyword pokeExceptionCode EC_div_by_zero EC_no_ios EC_no_return
|
||||
syn keyword pokeExceptionCode EC_io EC_io_flags EC_assert EC_overflow
|
||||
|
||||
" Poke builtin types
|
||||
syn keyword pokeBuiltinType string void int uint bit nibble
|
||||
syn keyword pokeBuiltinType byte char ushort short ulong long
|
||||
syn keyword pokeBuiltinType uint8 uint16 uint32 uint64
|
||||
syn keyword pokeBuiltinType off64 uoff64 offset
|
||||
syn keyword pokeBuiltinType Comparator POSIX_Time32 POSIX_Time64
|
||||
syn keyword pokeBuiltinType big little any
|
||||
|
||||
" Poke constants
|
||||
syn keyword pokeConstant ENDIAN_LITTLE ENDIAN_BIG
|
||||
syn keyword pokeConstant IOS_F_READ IOS_F_WRITE IOS_F_TRUNCATE IOS_F_CREATE
|
||||
syn keyword pokeConstant IOS_M_RDONLY IOS_M_WRONLY IOS_M_RDWR
|
||||
syn keyword pokeConstant load_path NULL OFFSET
|
||||
|
||||
" Poke std lib
|
||||
syn keyword pokeBuiltinFunction print printf catos stoca atoi ltos reverse
|
||||
syn keyword pokeBuiltinFunction ltrim rtrim strchr qsort crc32 alignto
|
||||
syn keyword pokeBuiltinFunction open close flush get_ios set_ios iosize
|
||||
syn keyword pokeBuiltinFunction rand get_endian set_endian strace exit
|
||||
syn keyword pokeBuiltinFunction getenv
|
||||
|
||||
" Formats
|
||||
|
||||
" Special chars
|
||||
syn match pokeSpecial "\\\([nt\\]\|\o\{1,3}\)" display contained
|
||||
|
||||
" Chars
|
||||
syn match pokeChar "'[^']*'" contains=pokeSpecial
|
||||
|
||||
" Attributes
|
||||
syn match pokeAttribute "\h\w*'\h\w"
|
||||
|
||||
" Strings
|
||||
syn region pokeString skip=+\\\\\|\\"+ start=+"+ end=+"+ contains=pokeSpecial
|
||||
|
||||
" Integer literals
|
||||
syn match pokeInteger "\<\d\+_*\d*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
|
||||
syn match pokeInteger "\<0[Xx]\x\+_*\x*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
|
||||
syn match pokeInteger "\<0[Oo]\o\+_*\o*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
|
||||
syn match pokeInteger "\<0[Bb][01]\+_*[01]*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
|
||||
|
||||
" Units
|
||||
syn keyword pokeBuiltinUnit b M B
|
||||
syn keyword pokeBuiltinUnit Kb KB Mb MB Gb GB
|
||||
syn keyword pokeBuiltinUnit Kib KiB Mib MiB Gib GiB
|
||||
|
||||
" Offsets
|
||||
syn match pokeOffset "#\h\w*" contains=pokeBuiltinUnit
|
||||
|
||||
" Comments
|
||||
syn keyword pokeCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match pokeLineComment "\/\/.*" contains=pokeCommentTodo,@Spell extend
|
||||
syn region pokeComment start="/\*" end="\*/" contains=pokeCommentTodo,@Spell fold extend
|
||||
|
||||
" Allow folding of blocks
|
||||
syn region pokeBlock start="{" end="}" transparent fold
|
||||
|
||||
" Highlight groups
|
||||
hi def link pokeBuiltinFunction Function
|
||||
hi def link pokeBuiltinType Type
|
||||
hi def link pokeBuiltinUnit Keyword
|
||||
hi def link pokeChar Character
|
||||
hi def link pokeComment Comment
|
||||
hi def link pokeCommentTodo Todo
|
||||
hi def link pokeConditional Conditional
|
||||
hi def link pokeConstant Constant
|
||||
hi def link pokeException Exception
|
||||
hi def link pokeExceptionCode Constant
|
||||
hi def link pokeExceptionType Type
|
||||
hi def link pokeFunction Function
|
||||
hi def link pokeInteger Number
|
||||
hi def link pokeLineComment Comment
|
||||
hi def link pokeLoad Include
|
||||
hi def link pokeOffset StorageClass
|
||||
hi def link pokeOperator Operator
|
||||
hi def link pokeSpecial SpecialChar
|
||||
hi def link pokeStatement Statement
|
||||
hi def link pokeString String
|
||||
hi def link pokeStructure Structure
|
||||
hi def link pokeRepeat Repeat
|
||||
hi def link pokeVar Identifier
|
||||
|
||||
let b:current_syntax = 'poke'
|
||||
182
runtime/syntax/ps1.vim
Normal file
182
runtime/syntax/ps1.vim
Normal file
@@ -0,0 +1,182 @@
|
||||
" Vim syntax file
|
||||
" Language: Windows PowerShell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2020 Nov 24
|
||||
"
|
||||
" The following settings are available for tuning syntax highlighting:
|
||||
" let ps1_nofold_blocks = 1
|
||||
" let ps1_nofold_sig = 1
|
||||
" let ps1_nofold_region = 1
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Operators contain dashes
|
||||
setlocal iskeyword+=-
|
||||
|
||||
" PowerShell doesn't care about case
|
||||
syn case ignore
|
||||
|
||||
" Sync-ing method
|
||||
syn sync minlines=100
|
||||
|
||||
" Certain tokens can't appear at the top level of the document
|
||||
syn cluster ps1NotTop contains=@ps1Comment,ps1CDocParam,ps1FunctionDeclaration
|
||||
|
||||
" Comments and special comment words
|
||||
syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK NOTE contained
|
||||
syn match ps1CDocParam /.*/ contained
|
||||
syn match ps1CommentDoc /^\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||
syn match ps1CommentDoc /#\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||
syn match ps1Comment /#.*/ contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||
syn region ps1Comment start="<#" end="#>" contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||
|
||||
" Language keywords and elements
|
||||
syn keyword ps1Conditional if else elseif switch default
|
||||
syn keyword ps1Repeat while for do until break continue foreach in
|
||||
syn match ps1Repeat /\<foreach\>/ nextgroup=ps1Block skipwhite
|
||||
syn match ps1Keyword /\<while\>/ nextgroup=ps1Block skipwhite
|
||||
syn match ps1Keyword /\<where\>/ nextgroup=ps1Block skipwhite
|
||||
|
||||
syn keyword ps1Exception begin process end exit inlinescript parallel sequence
|
||||
syn keyword ps1Keyword try catch finally throw
|
||||
syn keyword ps1Keyword return filter in trap param data dynamicparam
|
||||
syn keyword ps1Constant $true $false $null
|
||||
syn match ps1Constant +\$?+
|
||||
syn match ps1Constant +\$_+
|
||||
syn match ps1Constant +\$\$+
|
||||
syn match ps1Constant +\$^+
|
||||
|
||||
" Keywords reserved for future use
|
||||
syn keyword ps1Keyword class define from using var
|
||||
|
||||
" Function declarations
|
||||
syn keyword ps1Keyword function nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword filter nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword workflow nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword configuration nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword class nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword enum nextgroup=ps1Function skipwhite
|
||||
|
||||
" Function declarations and invocations
|
||||
syn match ps1Cmdlet /\v(add|clear|close|copy|enter|exit|find|format|get|hide|join|lock|move|new|open|optimize|pop|push|redo|remove|rename|reset|search|select|Set|show|skip|split|step|switch|undo|unlock|watch)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(connect|disconnect|read|receive|send|write)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(backup|checkpoint|compare|compress|convert|convertfrom|convertto|dismount|edit|expand|export|group|import|initialize|limit|merge|mount|out|publish|restore|save|sync|unpublish|update)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(debug|measure|ping|repair|resolve|test|trace)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(approve|assert|build|complete|confirm|deny|deploy|disable|enable|install|invoke|register|request|restart|resume|start|stop|submit|suspend|uninstall|unregister|wait)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(block|grant|protect|revoke|unblock|unprotect)(-\w+)+/ contained
|
||||
syn match ps1Cmdlet /\v(use)(-\w+)+/ contained
|
||||
|
||||
" Other functions
|
||||
syn match ps1Function /\w\+\(-\w\+\)\+/ contains=ps1Cmdlet
|
||||
|
||||
" Type declarations
|
||||
syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/
|
||||
|
||||
" Variable references
|
||||
syn match ps1ScopeModifier /\(global:\|local:\|private:\|script:\)/ contained
|
||||
syn match ps1Variable /\$\w\+\(:\w\+\)\?/ contains=ps1ScopeModifier
|
||||
syn match ps1Variable /\${\w\+\(:\?[[:alnum:]_()]\+\)\?}/ contains=ps1ScopeModifier
|
||||
|
||||
" Operators
|
||||
syn keyword ps1Operator -eq -ne -ge -gt -lt -le -like -notlike -match -notmatch -replace -split -contains -notcontains
|
||||
syn keyword ps1Operator -ieq -ine -ige -igt -ile -ilt -ilike -inotlike -imatch -inotmatch -ireplace -isplit -icontains -inotcontains
|
||||
syn keyword ps1Operator -ceq -cne -cge -cgt -clt -cle -clike -cnotlike -cmatch -cnotmatch -creplace -csplit -ccontains -cnotcontains
|
||||
syn keyword ps1Operator -in -notin
|
||||
syn keyword ps1Operator -is -isnot -as -join
|
||||
syn keyword ps1Operator -and -or -not -xor -band -bor -bnot -bxor
|
||||
syn keyword ps1Operator -f
|
||||
syn match ps1Operator /!/
|
||||
syn match ps1Operator /=/
|
||||
syn match ps1Operator /+=/
|
||||
syn match ps1Operator /-=/
|
||||
syn match ps1Operator /\*=/
|
||||
syn match ps1Operator /\/=/
|
||||
syn match ps1Operator /%=/
|
||||
syn match ps1Operator /+/
|
||||
syn match ps1Operator /-\(\s\|\d\|\.\|\$\|(\)\@=/
|
||||
syn match ps1Operator /\*/
|
||||
syn match ps1Operator /\//
|
||||
syn match ps1Operator /|/
|
||||
syn match ps1Operator /%/
|
||||
syn match ps1Operator /&/
|
||||
syn match ps1Operator /::/
|
||||
syn match ps1Operator /,/
|
||||
syn match ps1Operator /\(^\|\s\)\@<=\. \@=/
|
||||
|
||||
" Regular Strings
|
||||
" These aren't precisely correct and could use some work
|
||||
syn region ps1String start=/"/ skip=/`"/ end=/"/ contains=@ps1StringSpecial,@Spell
|
||||
syn region ps1String start=/'/ skip=/''/ end=/'/
|
||||
|
||||
" Here-Strings
|
||||
syn region ps1String start=/@"$/ end=/^"@/ contains=@ps1StringSpecial,@Spell
|
||||
syn region ps1String start=/@'$/ end=/^'@/
|
||||
|
||||
" Interpolation
|
||||
syn match ps1Escape /`./
|
||||
syn region ps1Interpolation matchgroup=ps1InterpolationDelimiter start="$(" end=")" contained contains=ALLBUT,@ps1NotTop
|
||||
syn region ps1NestedParentheses start="(" skip="\\\\\|\\)" matchgroup=ps1Interpolation end=")" transparent contained
|
||||
syn cluster ps1StringSpecial contains=ps1Escape,ps1Interpolation,ps1Variable,ps1Boolean,ps1Constant,ps1BuiltIn,@Spell
|
||||
|
||||
" Numbers
|
||||
syn match ps1Number "\(\<\|-\)\@<=\(0[xX]\x\+\|\d\+\)\([KMGTP][B]\)\=\(\>\|-\)\@="
|
||||
syn match ps1Number "\(\(\<\|-\)\@<=\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[dD]\="
|
||||
syn match ps1Number "\<\d\+[eE][-+]\=\d\+[dD]\=\>"
|
||||
syn match ps1Number "\<\d\+\([eE][-+]\=\d\+\)\=[dD]\>"
|
||||
|
||||
" Constants
|
||||
syn match ps1Boolean "$\%(true\|false\)\>"
|
||||
syn match ps1Constant /\$null\>/
|
||||
syn match ps1BuiltIn "$^\|$?\|$_\|$\$"
|
||||
syn match ps1BuiltIn "$\%(args\|error\|foreach\|home\|input\)\>"
|
||||
syn match ps1BuiltIn "$\%(match\(es\)\?\|myinvocation\|host\|lastexitcode\)\>"
|
||||
syn match ps1BuiltIn "$\%(ofs\|shellid\|stacktrace\)\>"
|
||||
|
||||
" Named Switch
|
||||
syn match ps1Label /\s-\w\+/
|
||||
|
||||
" Folding blocks
|
||||
if !exists('g:ps1_nofold_blocks')
|
||||
syn region ps1Block start=/{/ end=/}/ transparent fold
|
||||
endif
|
||||
|
||||
if !exists('g:ps1_nofold_region')
|
||||
syn region ps1Region start=/#region/ end=/#endregion/ transparent fold keepend extend
|
||||
endif
|
||||
|
||||
if !exists('g:ps1_nofold_sig')
|
||||
syn region ps1Signature start=/# SIG # Begin signature block/ end=/# SIG # End signature block/ transparent fold
|
||||
endif
|
||||
|
||||
" Setup default color highlighting
|
||||
hi def link ps1Number Number
|
||||
hi def link ps1Block Block
|
||||
hi def link ps1Region Region
|
||||
hi def link ps1Exception Exception
|
||||
hi def link ps1Constant Constant
|
||||
hi def link ps1String String
|
||||
hi def link ps1Escape SpecialChar
|
||||
hi def link ps1InterpolationDelimiter Delimiter
|
||||
hi def link ps1Conditional Conditional
|
||||
hi def link ps1Cmdlet Function
|
||||
hi def link ps1Function Identifier
|
||||
hi def link ps1Variable Identifier
|
||||
hi def link ps1Boolean Boolean
|
||||
hi def link ps1Constant Constant
|
||||
hi def link ps1BuiltIn StorageClass
|
||||
hi def link ps1Type Type
|
||||
hi def link ps1ScopeModifier StorageClass
|
||||
hi def link ps1Comment Comment
|
||||
hi def link ps1CommentTodo Todo
|
||||
hi def link ps1CommentDoc Tag
|
||||
hi def link ps1CDocParam Identifier
|
||||
hi def link ps1Operator Operator
|
||||
hi def link ps1Repeat Repeat
|
||||
hi def link ps1RepeatAndCmdlet Repeat
|
||||
hi def link ps1Keyword Keyword
|
||||
hi def link ps1KeywordAndCmdlet Keyword
|
||||
hi def link ps1Label Label
|
||||
|
||||
let b:current_syntax = "ps1"
|
||||
51
runtime/syntax/ps1xml.vim
Normal file
51
runtime/syntax/ps1xml.vim
Normal file
@@ -0,0 +1,51 @@
|
||||
" Vim syntax file
|
||||
" Language: Windows PowerShell
|
||||
" URL: https://github.com/PProvost/vim-ps1
|
||||
" Last Change: 2013 Jun 24
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:ps1xml_cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
doau syntax xml
|
||||
unlet b:current_syntax
|
||||
|
||||
syn case ignore
|
||||
syn include @ps1xmlScriptBlock <sfile>:p:h/ps1.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<Script>"
|
||||
\ matchgroup=xmlEndTag end="</Script>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<ScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</ScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<GetScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</GetScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<SetScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</SetScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
|
||||
syn cluster xmlRegionHook add=ps1xmlScriptBlock
|
||||
|
||||
let b:current_syntax = "ps1xml"
|
||||
|
||||
let &cpo = s:ps1xml_cpo_save
|
||||
unlet s:ps1xml_cpo_save
|
||||
|
||||
83
runtime/syntax/psl.vim
Normal file
83
runtime/syntax/psl.vim
Normal file
@@ -0,0 +1,83 @@
|
||||
" Vim syntax file
|
||||
" Language: Property Specification Language (PSL)
|
||||
" Maintainer: Daniel Kho <daniel.kho@logik.haus>
|
||||
" Last Changed: 2021 Apr 17 by Daniel Kho
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Read in VHDL syntax files
|
||||
runtime! syntax/vhdl.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" case is not significant
|
||||
syn case ignore
|
||||
|
||||
" Add ! character to keyword recognition.
|
||||
setlocal iskeyword+=33
|
||||
|
||||
" PSL keywords
|
||||
syn keyword pslOperator A AF AG AX
|
||||
syn keyword pslOperator E EF EG EX
|
||||
syn keyword pslOperator F G U W X X!
|
||||
syn keyword pslOperator abort always assert assume async_abort
|
||||
syn keyword pslOperator before before! before!_ before_ bit bitvector boolean
|
||||
syn keyword pslOperator clock const countones cover
|
||||
syn keyword pslOperator default
|
||||
syn keyword pslOperator ended eventually!
|
||||
syn keyword pslOperator fairness fell for forall
|
||||
syn keyword pslOperator hdltype
|
||||
syn keyword pslOperator in inf inherit isunknown
|
||||
syn keyword pslOperator mutable
|
||||
syn keyword pslOperator never next next! next_a next_a! next_e next_e! next_event next_event! next_event_a next_event_a! next_event_e next_event_e! nondet nondet_vector numeric
|
||||
syn keyword pslOperator onehot onehot0
|
||||
syn keyword pslOperator property prev
|
||||
syn keyword pslOperator report restrict restrict! rose
|
||||
syn keyword pslOperator sequence stable string strong sync_abort
|
||||
syn keyword pslOperator union until until! until!_ until_
|
||||
syn keyword pslOperator vmode vpkg vprop vunit
|
||||
syn keyword pslOperator within
|
||||
"" Common keywords with VHDL
|
||||
"syn keyword pslOperator and is not or to
|
||||
|
||||
" PSL operators
|
||||
syn match pslOperator "=>\||=>"
|
||||
syn match pslOperator "<-\|->"
|
||||
syn match pslOperator "@"
|
||||
|
||||
|
||||
"Modify the following as needed. The trade-off is performance versus functionality.
|
||||
syn sync minlines=600
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link pslSpecial Special
|
||||
hi def link pslStatement Statement
|
||||
hi def link pslCharacter Character
|
||||
hi def link pslString String
|
||||
hi def link pslVector Number
|
||||
hi def link pslBoolean Number
|
||||
hi def link pslTodo Todo
|
||||
hi def link pslFixme Fixme
|
||||
hi def link pslComment Comment
|
||||
hi def link pslNumber Number
|
||||
hi def link pslTime Number
|
||||
hi def link pslType Type
|
||||
hi def link pslOperator Operator
|
||||
hi def link pslError Error
|
||||
hi def link pslAttribute Special
|
||||
hi def link pslPreProc PreProc
|
||||
|
||||
|
||||
let b:current_syntax = "psl"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
@@ -2,10 +2,9 @@
|
||||
" Language: Ratpoison configuration/commands file ( /etc/ratpoisonrc ~/.ratpoisonrc )
|
||||
" Maintainer: Magnus Woldrich <m@japh.se>
|
||||
" URL: http://github.com/trapd00r/vim-syntax-ratpoison
|
||||
" Last Change: 2011 Apr 11
|
||||
" Last Change: 2021-04-12 13:46:04
|
||||
" Previous Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -38,7 +37,7 @@ syn keyword ratpoisonCommandArg select set setenv sfdump shrink contained
|
||||
syn keyword ratpoisonCommandArg source sselect startup_message time title contained
|
||||
syn keyword ratpoisonCommandArg tmpwm unalias undefinekey undo unmanage contained
|
||||
syn keyword ratpoisonCommandArg unsetenv verbexec version vsplit warp contained
|
||||
syn keyword ratpoisonCommandArg windows contained
|
||||
syn keyword ratpoisonCommandArg windows framefmt infofmt contained
|
||||
|
||||
syn match ratpoisonGravityArg "\<\(n\|north\)\>" contained
|
||||
syn match ratpoisonGravityArg "\<\(nw\|northwest\)\>" contained
|
||||
@@ -92,19 +91,27 @@ syn keyword ratpoisonSetArg barpadding contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg bgcolor
|
||||
syn keyword ratpoisonSetArg border contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg fgcolor
|
||||
syn keyword ratpoisonSetArg framefmt contained nextgroup=ratpoisonWinFmtArg
|
||||
syn keyword ratpoisonSetArg fwcolor
|
||||
syn keyword ratpoisonSetArg framemsgwait contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg gravity contained nextgroup=ratpoisonGravityArg
|
||||
syn keyword ratpoisonSetArg bwcolor
|
||||
syn keyword ratpoisonSetArg gravity contained nextgroup=ratpoisonGravityArg
|
||||
syn keyword ratpoisonSetArg historysize
|
||||
syn keyword ratpoisonSetArg historycompaction
|
||||
syn keyword ratpoisonSetArg historyexpansion
|
||||
syn keyword ratpoisonSetArg infofmt contained nextgroup=ratpoisonWinFmtArg
|
||||
syn keyword ratpoisonSetArg topkmap
|
||||
syn keyword ratpoisonSetArg barinpadding
|
||||
syn keyword ratpoisonSetArg font
|
||||
syn keyword ratpoisonSetArg framesels
|
||||
syn keyword ratpoisonSetArg maxundos
|
||||
syn keyword ratpoisonSetArg inputwidth contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg maxsizegravity contained nextgroup=ratpoisonGravityArg
|
||||
syn keyword ratpoisonSetArg msgwait contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg padding contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg resizeunit contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg startup_message
|
||||
syn keyword ratpoisonSetArg transgravity contained nextgroup=ratpoisonGravityArg
|
||||
syn keyword ratpoisonSetArg waitcursor contained nextgroup=ratpoisonNumberArg
|
||||
syn keyword ratpoisonSetArg winfmt contained nextgroup=ratpoisonWinFmtArg
|
||||
@@ -113,6 +120,8 @@ syn keyword ratpoisonSetArg winliststyle contained nextgroup=ratpoisonWinListArg
|
||||
syn keyword ratpoisonSetArg winname contained nextgroup=ratpoisonWinNameArg
|
||||
|
||||
syn match ratpoisonWinFmtArg "%[nstacil]" contained nextgroup=ratpoisonWinFmtArg skipwhite
|
||||
syn match ratpoisonFrameFmtArg "%[nstacil]" contained nextgroup=ratpoisonWinFmtArg skipwhite
|
||||
syn match ratpoisonInfoFmtArg "%[nstacil]" contained nextgroup=ratpoisonWinFmtArg skipwhite
|
||||
|
||||
syn match ratpoisonWinListArg "\<\(row\|column\)\>" contained
|
||||
|
||||
@@ -126,6 +135,7 @@ syn match ratpoisonDefCommand "^\s*defbgcolor\s*"
|
||||
syn match ratpoisonDefCommand "^\s*defborder\s*" nextgroup=ratpoisonNumberArg
|
||||
syn match ratpoisonDefCommand "^\s*deffgcolor\s*"
|
||||
syn match ratpoisonDefCommand "^\s*deffont\s*"
|
||||
syn match ratpoisonDefCommand "^\s*defframefmt\s*" nextgroup=ratpoisonWinFmtArg
|
||||
syn match ratpoisonDefCommand "^\s*defframesels\s*"
|
||||
syn match ratpoisonDefCommand "^\s*definputwidth\s*" nextgroup=ratpoisonNumberArg
|
||||
syn match ratpoisonDefCommand "^\s*defmaxsizegravity\s*" nextgroup=ratpoisonGravityArg
|
||||
@@ -243,14 +253,13 @@ syn match ratpoisonVoidCommand "^\s*\zsversion\ze\s*$"
|
||||
syn match ratpoisonVoidCommand "^\s*\zsvsplit\ze\s*$"
|
||||
syn match ratpoisonVoidCommand "^\s*\zswindows\ze\s*$"
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link ratpoisonBooleanArg Boolean
|
||||
hi def link ratpoisonCommandArg Keyword
|
||||
hi def link ratpoisonComment Comment
|
||||
hi def link ratpoisonDefCommand Identifier
|
||||
hi def link ratpoisonFrameFmtArg Special
|
||||
hi def link ratpoisonGravityArg Constant
|
||||
hi def link ratpoisonInfoFmtArg Special
|
||||
hi def link ratpoisonKeySeqArg Special
|
||||
hi def link ratpoisonNumberArg Number
|
||||
hi def link ratpoisonSetArg Keyword
|
||||
@@ -261,7 +270,6 @@ hi def link ratpoisonWinFmtArg Special
|
||||
hi def link ratpoisonWinNameArg Constant
|
||||
hi def link ratpoisonWinListArg Constant
|
||||
|
||||
|
||||
let b:current_syntax = "ratpoison"
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
" Vim syntax file
|
||||
" Language: OpenSSH client configuration file (ssh_config)
|
||||
" Author: David Necas (Yeti)
|
||||
" Maintainer: Dominik Fischer <d dot f dot fischer at web dot de>
|
||||
" Maintainer: Jakub Jelen <jakuje at gmail dot com>
|
||||
" Previous Maintainer: Dominik Fischer <d dot f dot fischer at web dot de>
|
||||
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Contributor: Karsten Hopp <karsten@redhat.com>
|
||||
" Contributor: Dean, Adam Kenneth <adam.ken.dean@hpe.com>
|
||||
" Last Change: 2020 Feb 12
|
||||
" Last Change: 2021 Mar 29
|
||||
" Added RemoteCommand from pull request #4809
|
||||
" Included additional keywords from Martin.
|
||||
" SSH Version: 7.4p1
|
||||
" SSH Version: 8.5p1
|
||||
"
|
||||
|
||||
" Setup
|
||||
@@ -174,6 +175,7 @@ syn keyword sshconfigKeyword HostKeyAlgorithms
|
||||
syn keyword sshconfigKeyword HostKeyAlias
|
||||
syn keyword sshconfigKeyword HostName
|
||||
syn keyword sshconfigKeyword HostbasedAuthentication
|
||||
syn keyword sshconfigKeyword HostbasedAcceptedAlgorithms
|
||||
syn keyword sshconfigKeyword HostbasedKeyTypes
|
||||
syn keyword sshconfigKeyword IPQoS
|
||||
syn keyword sshconfigKeyword IdentitiesOnly
|
||||
@@ -185,9 +187,11 @@ syn keyword sshconfigKeyword IPQoS
|
||||
syn keyword sshconfigKeyword KbdInteractiveAuthentication
|
||||
syn keyword sshconfigKeyword KbdInteractiveDevices
|
||||
syn keyword sshconfigKeyword KexAlgorithms
|
||||
syn keyword sshconfigKeyword KnownHostsCommand
|
||||
syn keyword sshconfigKeyword LocalCommand
|
||||
syn keyword sshconfigKeyword LocalForward
|
||||
syn keyword sshconfigKeyword LogLevel
|
||||
syn keyword sshconfigKeyword LogVerbose
|
||||
syn keyword sshconfigKeyword MACs
|
||||
syn keyword sshconfigKeyword Match
|
||||
syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost
|
||||
@@ -195,11 +199,13 @@ syn keyword sshconfigKeyword NumberOfPasswordPrompts
|
||||
syn keyword sshconfigKeyword PKCS11Provider
|
||||
syn keyword sshconfigKeyword PasswordAuthentication
|
||||
syn keyword sshconfigKeyword PermitLocalCommand
|
||||
syn keyword sshconfigKeyword PermitRemoteOpen
|
||||
syn keyword sshconfigKeyword Port
|
||||
syn keyword sshconfigKeyword PreferredAuthentications
|
||||
syn keyword sshconfigKeyword ProxyCommand
|
||||
syn keyword sshconfigKeyword ProxyJump
|
||||
syn keyword sshconfigKeyword ProxyUseFDPass
|
||||
syn keyword sshconfigKeyword PubkeyAcceptedAlgorithms
|
||||
syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes
|
||||
syn keyword sshconfigKeyword PubkeyAuthentication
|
||||
syn keyword sshconfigKeyword RekeyLimit
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Contributor: Karsten Hopp <karsten@redhat.com>
|
||||
" Originally: 2009-07-09
|
||||
" Last Change: 2020-10-20
|
||||
" SSH Version: 8.4p1
|
||||
" Last Change: 2021-03-29
|
||||
" SSH Version: 8.5p1
|
||||
"
|
||||
|
||||
" Setup
|
||||
@@ -195,6 +195,7 @@ syn keyword sshdconfigKeyword HostCertificate
|
||||
syn keyword sshdconfigKeyword HostKey
|
||||
syn keyword sshdconfigKeyword HostKeyAgent
|
||||
syn keyword sshdconfigKeyword HostKeyAlgorithms
|
||||
syn keyword sshdconfigKeyword HostbasedAcceptedAlgorithms
|
||||
syn keyword sshdconfigKeyword HostbasedAcceptedKeyTypes
|
||||
syn keyword sshdconfigKeyword HostbasedAuthentication
|
||||
syn keyword sshdconfigKeyword HostbasedUsesNameFromPacketOnly
|
||||
@@ -213,6 +214,7 @@ syn keyword sshdconfigKeyword KexAlgorithms
|
||||
syn keyword sshdconfigKeyword KeyRegenerationInterval
|
||||
syn keyword sshdconfigKeyword ListenAddress
|
||||
syn keyword sshdconfigKeyword LogLevel
|
||||
syn keyword sshdconfigKeyword LogVerbose
|
||||
syn keyword sshdconfigKeyword LoginGraceTime
|
||||
syn keyword sshdconfigKeyword MACs
|
||||
syn keyword sshdconfigKeyword Match
|
||||
@@ -220,6 +222,8 @@ syn keyword sshdconfigKeyword MaxAuthTries
|
||||
syn keyword sshdconfigKeyword MaxSessions
|
||||
syn keyword sshdconfigKeyword MaxStartups
|
||||
syn keyword sshdconfigKeyword PasswordAuthentication
|
||||
syn keyword sshdconfigKeyword PerSourceMaxStartups
|
||||
syn keyword sshdconfigKeyword PerSourceNetBlockSize
|
||||
syn keyword sshdconfigKeyword PermitBlacklistedKeys
|
||||
syn keyword sshdconfigKeyword PermitEmptyPasswords
|
||||
syn keyword sshdconfigKeyword PermitListen
|
||||
@@ -234,6 +238,7 @@ syn keyword sshdconfigKeyword Port
|
||||
syn keyword sshdconfigKeyword PrintLastLog
|
||||
syn keyword sshdconfigKeyword PrintMotd
|
||||
syn keyword sshdconfigKeyword Protocol
|
||||
syn keyword sshdconfigKeyword PubkeyAcceptedAlgorithms
|
||||
syn keyword sshdconfigKeyword PubkeyAcceptedKeyTypes
|
||||
syn keyword sshdconfigKeyword PubkeyAuthentication
|
||||
syn keyword sshdconfigKeyword PubkeyAuthOptions
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: sudoers(5) configuration files
|
||||
" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com )
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2018-08-18
|
||||
" Latest Revision: 2021 Mar 15
|
||||
" Recent Changes: Support for #include and #includedir.
|
||||
" Added many new options (Samuel D. Leslie)
|
||||
|
||||
@@ -26,7 +27,7 @@ syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASS
|
||||
syn keyword sudoersTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo
|
||||
syn region sudoersInclude display oneline start='#\(include\|includedir\)' end='$'
|
||||
syn region sudoersInclude display oneline start='[#@]\%(include\|includedir\)\>' end='$'
|
||||
|
||||
syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl
|
||||
syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl
|
||||
@@ -201,7 +202,7 @@ syn keyword sudoersBooleanParameter contained skipwhite skipnl
|
||||
\ shell_noargs
|
||||
\ stay_setuid
|
||||
\ sudoedit_checkdir
|
||||
\ sudoedit_fellow
|
||||
\ sudoedit_follow
|
||||
\ syslog_pid
|
||||
\ targetpw
|
||||
\ tty_tickets
|
||||
|
||||
@@ -682,7 +682,7 @@ Not: Arama dosyanın sonuna ulaştığında dosyanın başından sürecektir. Bu
|
||||
Ders 5.3'ün iki adet kopyası olduğunu görün, özgün sürümü ve kopyası.
|
||||
|
||||
NOT: Bu komutu kullanarak bir dış komutun çıktısını da dosyanın içine
|
||||
koyabilirsiniz. Örneğin :r :!ls yazmak ls komutunun vereceği çıktıyı
|
||||
koyabilirsiniz. Örneğin :r !ls yazmak ls komutunun vereceği çıktıyı
|
||||
dosyanın içinde hemen imlecin altındaki satıra koyar.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
10
src/INSTALL
10
src/INSTALL
@@ -60,8 +60,8 @@ To built Vim on Ubuntu from scratch on a clean system using git:
|
||||
% sudo apt install libxt-dev
|
||||
% make reconfig
|
||||
|
||||
Add GUI support (ignore compiler warnings):
|
||||
% sudo apt install libgtk2.0-dev
|
||||
Add GUI support:
|
||||
% sudo apt install libgtk-3-dev
|
||||
% make reconfig
|
||||
|
||||
Add Python 3 support:
|
||||
@@ -134,8 +134,12 @@ These configure arguments can be used to select which GUI to use:
|
||||
--disable-motif-check
|
||||
--disable-athena-check
|
||||
|
||||
This configure argument can be used to disable the GUI, even when the necessary
|
||||
files are found:
|
||||
--disable-gui
|
||||
|
||||
--enable-gui defaults to "auto", so it will automatically look for a GUI (in
|
||||
the order of GTK, Motif, then Athena). If one is found, then is uses it and
|
||||
the order of GTK, Motif, then Athena). If one is found, then it is used and
|
||||
does not proceed to check any of the remaining ones. Otherwise, it moves on
|
||||
to the next one.
|
||||
|
||||
|
||||
@@ -1,64 +1,83 @@
|
||||
INSTALLmac.txt - Installation of Vim on Macintosh
|
||||
INSTALLmac.txt - Installation of Vim on Apple MacOS
|
||||
|
||||
This file contains instructions for compiling Vim. If you already have an
|
||||
executable version of Vim, you don't need this.
|
||||
|
||||
First, make sure you've installed Xcode or CommandLineTools. If not, open a
|
||||
terminal and do
|
||||
MacOS Classic is no longer supported. If you really want it use Vim 6.4.
|
||||
Only '/' is supported as path separator.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Prerequisites
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Make sure you've installed Xcode and CommandLineTools. You can download Xcode
|
||||
from the Mac App Store, for free.
|
||||
|
||||
To check for CommandLineTools open a terminal and do:
|
||||
|
||||
$ make --version
|
||||
|
||||
A window pops up instructing you to install the developer tools.
|
||||
If not installed yet a window pops up instructing you to install the developer
|
||||
tools.
|
||||
|
||||
If you don't have the source yet, best is to use git (which you need to
|
||||
install first), see http://www.vim.org/git.php
|
||||
Or you can download and unpack the Unix tar archive, see
|
||||
http://www.vim.org/download.php
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Summary
|
||||
Build and install the terminal version.
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
1 MacOS X
|
||||
1.1. Terminal version
|
||||
1.2. X (Athena, GTK, Motif) or plain text.
|
||||
|
||||
MacOS Classic is no longer supported. If you really want it use Vim 6.4.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
1 MacOS X
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
1.0 Considerations
|
||||
|
||||
Only '/' is supported as path separator.
|
||||
|
||||
1.1 Terminal version (default)
|
||||
|
||||
You can compile vim with the standard Unix routine:
|
||||
cd .../src
|
||||
You can compile vim with the standard Unix routine:
|
||||
cd vim/src
|
||||
make
|
||||
make test
|
||||
sudo make install
|
||||
|
||||
You need at least Xcode 1.5.
|
||||
If you get an error "glibtool: command not found" search on stackoverflow for
|
||||
mac-osx-where-can-i-download-glibtool.
|
||||
|
||||
To overrule the architecture do this before running make:
|
||||
With Homebrew, run:
|
||||
|
||||
./configure --with-mac-arch=intel
|
||||
or
|
||||
./configure --with-mac-arch=ppc
|
||||
brew install libtool
|
||||
|
||||
To build libtool from source:
|
||||
|
||||
1. Download the source code from https://www.gnu.org/software/libtool/.
|
||||
|
||||
2. Run these commands from the root of the source code directory:
|
||||
|
||||
./configure --program-prefix=g
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
1.2 X-Windows
|
||||
----------------------------------------------------------------------------
|
||||
Build and install the GUI version with X-Windows
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
You must explicitly tell configure to use a GUI.
|
||||
First, install XQuartz, which you can download from https://www.xquartz.org.
|
||||
|
||||
cd .../src
|
||||
./configure --disable-darwin --enable-gui=gtk2
|
||||
make; make install
|
||||
To tell configure to use a GUI you can edit the Makefile and uncomment these
|
||||
two lines (remove the # at the start of the line):
|
||||
|
||||
NOTE: The following GUI options are possible (but might not work):
|
||||
no (for terminal only), motif, athena, nextaw
|
||||
gtk, gtk2, gnome, gnome2,
|
||||
CONF_OPT_GUI = --enable-gui=athena
|
||||
CONF_OPT_DARWIN = --disable-darwin
|
||||
|
||||
NOTE: You need to first install XFree86 and XDarwin.
|
||||
Please visit http://www.XDarwin.org
|
||||
Do "make distclean" to start with a clean slate.
|
||||
Then build as with the terminal version above.
|
||||
Instead of "athena" you can try "gtk2" but you probably need to install GTK
|
||||
first.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Notes
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Mac-specific configure options are explained in the Makefile:
|
||||
--disable-darwin
|
||||
--with-mac-arch
|
||||
|
||||
------------------------------------------------------
|
||||
|
||||
33
src/auto/configure
vendored
33
src/auto/configure
vendored
@@ -13918,6 +13918,35 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.uptime" >&5
|
||||
$as_echo_n "checking for sysinfo.uptime... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysinfo.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct sysinfo sinfo;
|
||||
long ut;
|
||||
|
||||
(void)sysinfo(&sinfo);
|
||||
ut = sinfo.uptime;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO_UPTIME 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysconf" >&5
|
||||
$as_echo_n "checking for sysconf... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -14877,8 +14906,8 @@ $as_echo "no" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5
|
||||
$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
|
||||
if test "$gccmajor" -gt "3"; then
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
|
||||
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'`
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
|
||||
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
|
||||
@@ -1336,7 +1336,7 @@ do_doautocmd(
|
||||
void
|
||||
ex_doautoall(exarg_T *eap)
|
||||
{
|
||||
int retval;
|
||||
int retval = OK;
|
||||
aco_save_T aco;
|
||||
buf_T *buf;
|
||||
bufref_T bufref;
|
||||
@@ -1353,7 +1353,8 @@ ex_doautoall(exarg_T *eap)
|
||||
*/
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
{
|
||||
if (buf->b_ml.ml_mfp != NULL)
|
||||
// Only do loaded buffers and skip the current buffer, it's done last.
|
||||
if (buf->b_ml.ml_mfp != NULL && buf != curbuf)
|
||||
{
|
||||
// find a window for this buffer and save some values
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
@@ -1363,22 +1364,31 @@ ex_doautoall(exarg_T *eap)
|
||||
retval = do_doautocmd(arg, FALSE, &did_aucmd);
|
||||
|
||||
if (call_do_modelines && did_aucmd)
|
||||
{
|
||||
// Execute the modeline settings, but don't set window-local
|
||||
// options if we are using the current window for another
|
||||
// buffer.
|
||||
do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
|
||||
}
|
||||
|
||||
// restore the current window
|
||||
aucmd_restbuf(&aco);
|
||||
|
||||
// stop if there is some error or buffer was deleted
|
||||
if (retval == FAIL || !bufref_valid(&bufref))
|
||||
{
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Execute autocommands for the current buffer last.
|
||||
if (retval == OK)
|
||||
{
|
||||
do_doautocmd(arg, FALSE, &did_aucmd);
|
||||
if (call_do_modelines && did_aucmd)
|
||||
do_modelines(0);
|
||||
}
|
||||
|
||||
check_cursor(); // just in case lines got deleted
|
||||
}
|
||||
|
||||
@@ -2106,14 +2116,16 @@ apply_autocmds_group(
|
||||
ap->last = FALSE;
|
||||
ap->last = TRUE;
|
||||
|
||||
// make sure cursor and topline are valid
|
||||
check_lnums(TRUE);
|
||||
if (nesting == 1)
|
||||
// make sure cursor and topline are valid
|
||||
check_lnums(TRUE);
|
||||
|
||||
do_cmdline(NULL, getnextac, (void *)&patcmd,
|
||||
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
|
||||
|
||||
// restore cursor and topline, unless they were changed
|
||||
reset_lnums();
|
||||
if (nesting == 1)
|
||||
// restore cursor and topline, unless they were changed
|
||||
reset_lnums();
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (eap != NULL)
|
||||
@@ -2166,12 +2178,14 @@ apply_autocmds_group(
|
||||
while (au_pending_free_buf != NULL)
|
||||
{
|
||||
buf_T *b = au_pending_free_buf->b_next;
|
||||
|
||||
vim_free(au_pending_free_buf);
|
||||
au_pending_free_buf = b;
|
||||
}
|
||||
while (au_pending_free_win != NULL)
|
||||
{
|
||||
win_T *w = au_pending_free_win->w_next;
|
||||
|
||||
vim_free(au_pending_free_win);
|
||||
au_pending_free_win = w;
|
||||
}
|
||||
|
||||
160
src/blob.c
160
src/blob.c
@@ -125,13 +125,33 @@ blob_get(blob_T *b, int idx)
|
||||
}
|
||||
|
||||
/*
|
||||
* Store one byte "c" in blob "b" at "idx".
|
||||
* Store one byte "byte" in blob "blob" at "idx".
|
||||
* Caller must make sure that "idx" is valid.
|
||||
*/
|
||||
void
|
||||
blob_set(blob_T *b, int idx, char_u c)
|
||||
blob_set(blob_T *blob, int idx, int byte)
|
||||
{
|
||||
((char_u*)b->bv_ga.ga_data)[idx] = c;
|
||||
((char_u*)blob->bv_ga.ga_data)[idx] = byte;
|
||||
}
|
||||
|
||||
/*
|
||||
* Store one byte "byte" in blob "blob" at "idx".
|
||||
* Append one byte if needed.
|
||||
*/
|
||||
void
|
||||
blob_set_append(blob_T *blob, int idx, int byte)
|
||||
{
|
||||
garray_T *gap = &blob->bv_ga;
|
||||
|
||||
// Allow for appending a byte. Setting a byte beyond
|
||||
// the end is an error otherwise.
|
||||
if (idx < gap->ga_len
|
||||
|| (idx == gap->ga_len && ga_grow(gap, 1) == OK))
|
||||
{
|
||||
blob_set(blob, idx, byte);
|
||||
if (idx == gap->ga_len)
|
||||
++gap->ga_len;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -259,6 +279,135 @@ failed:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
blob_slice_or_index(
|
||||
blob_T *blob,
|
||||
int is_range,
|
||||
varnumber_T n1,
|
||||
varnumber_T n2,
|
||||
int exclusive,
|
||||
typval_T *rettv)
|
||||
{
|
||||
long len = blob_len(blob);
|
||||
|
||||
if (is_range)
|
||||
{
|
||||
// The resulting variable is a sub-blob. If the indexes
|
||||
// are out of range the result is empty.
|
||||
if (n1 < 0)
|
||||
{
|
||||
n1 = len + n1;
|
||||
if (n1 < 0)
|
||||
n1 = 0;
|
||||
}
|
||||
if (n2 < 0)
|
||||
n2 = len + n2;
|
||||
else if (n2 >= len)
|
||||
n2 = len - (exclusive ? 0 : 1);
|
||||
if (exclusive)
|
||||
--n2;
|
||||
if (n1 >= len || n2 < 0 || n1 > n2)
|
||||
{
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
blob_T *new_blob = blob_alloc();
|
||||
long i;
|
||||
|
||||
if (new_blob != NULL)
|
||||
{
|
||||
if (ga_grow(&new_blob->bv_ga, n2 - n1 + 1) == FAIL)
|
||||
{
|
||||
blob_free(new_blob);
|
||||
return FAIL;
|
||||
}
|
||||
new_blob->bv_ga.ga_len = n2 - n1 + 1;
|
||||
for (i = n1; i <= n2; i++)
|
||||
blob_set(new_blob, i - n1, blob_get(blob, i));
|
||||
|
||||
clear_tv(rettv);
|
||||
rettv_blob_set(rettv, new_blob);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The resulting variable is a byte value.
|
||||
// If the index is too big or negative that is an error.
|
||||
if (n1 < 0)
|
||||
n1 = len + n1;
|
||||
if (n1 < len && n1 >= 0)
|
||||
{
|
||||
int v = blob_get(blob, n1);
|
||||
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
rettv->vval.v_number = v;
|
||||
}
|
||||
else
|
||||
{
|
||||
semsg(_(e_blobidx), n1);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if "n1"- is a valid index for a blobl with length "bloblen".
|
||||
*/
|
||||
int
|
||||
check_blob_index(long bloblen, varnumber_T n1, int quiet)
|
||||
{
|
||||
if (n1 < 0 || n1 > bloblen)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), n1);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if "n1"-"n2" is a valid range for a blob with length "bloblen".
|
||||
*/
|
||||
int
|
||||
check_blob_range(long bloblen, varnumber_T n1, varnumber_T n2, int quiet)
|
||||
{
|
||||
if (n2 < 0 || n2 >= bloblen || n2 < n1)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), n2);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set bytes "n1" to "n2" (inclusive) in "dest" to the value of "src".
|
||||
* Caller must make sure "src" is a blob.
|
||||
* Returns FAIL if the number of bytes does not match.
|
||||
*/
|
||||
int
|
||||
blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
|
||||
{
|
||||
int il, ir;
|
||||
|
||||
if (n2 - n1 + 1 != blob_len(src->vval.v_blob))
|
||||
{
|
||||
emsg(_("E972: Blob value does not have the right number of bytes"));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
ir = 0;
|
||||
for (il = n1; il <= n2; il++)
|
||||
blob_set(dest, il, blob_get(src->vval.v_blob, ir++));
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* "remove({blob})" function
|
||||
*/
|
||||
@@ -295,7 +444,7 @@ blob_remove(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
blob_T *blob;
|
||||
|
||||
// Remove range of items, return list with values.
|
||||
// Remove range of items, return blob with values.
|
||||
end = (long)tv_get_number_chk(&argvars[2], &error);
|
||||
if (error)
|
||||
return;
|
||||
@@ -323,7 +472,8 @@ blob_remove(typval_T *argvars, typval_T *rettv)
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = blob;
|
||||
|
||||
mch_memmove(p + idx, p + end + 1, (size_t)(len - end));
|
||||
if (len - end - 1 > 0)
|
||||
mch_memmove(p + idx, p + end + 1, (size_t)(len - end - 1));
|
||||
b->bv_ga.ga_len -= end - idx + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4883,6 +4883,11 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
// Don't open a file in restricted mode.
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
if (in_vim9script()
|
||||
&& (check_for_string_arg(argvars, 0) == FAIL
|
||||
|| check_for_string_arg(argvars, 1) == FAIL))
|
||||
return;
|
||||
|
||||
fname = tv_get_string(&argvars[0]);
|
||||
if (argvars[1].v_type == VAR_STRING)
|
||||
opt = tv_get_string_buf(&argvars[1], buf);
|
||||
|
||||
@@ -834,6 +834,16 @@ vim_isIDc(int c)
|
||||
return (c > 0 && c < 0x100 && (g_chartab[c] & CT_ID_CHAR));
|
||||
}
|
||||
|
||||
/*
|
||||
* Like vim_isIDc() but not using the 'isident' option: letters, numbers and
|
||||
* underscore.
|
||||
*/
|
||||
int
|
||||
vim_isNormalIDc(int c)
|
||||
{
|
||||
return ASCII_ISALNUM(c) || c == '_';
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if 'c' is a keyword character: Letters and characters from
|
||||
* 'iskeyword' option for the current buffer.
|
||||
@@ -2005,7 +2015,8 @@ hex2nr(int c)
|
||||
return c - '0';
|
||||
}
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(PROTO) || defined(FEAT_AUTOSHELLDIR)
|
||||
/*
|
||||
* Convert two hex characters to a byte.
|
||||
* Return -1 if one of the characters is not hex.
|
||||
|
||||
@@ -1020,8 +1020,9 @@ set_one_cmd_context(
|
||||
p = cmd;
|
||||
while (ASCII_ISALPHA(*p) || *p == '*') // Allow * wild card
|
||||
++p;
|
||||
// a user command may contain digits
|
||||
if (ASCII_ISUPPER(cmd[0]))
|
||||
// A user command may contain digits.
|
||||
// Include "9" for "vim9*" commands; "vim9cmd" and "vim9script".
|
||||
if (ASCII_ISUPPER(cmd[0]) || STRNCMP("vim9", cmd, 4) == 0)
|
||||
while (ASCII_ISALNUM(*p) || *p == '*')
|
||||
++p;
|
||||
// for python 3.x: ":py3*" commands completion
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
#undef HAVE_SYSCTL
|
||||
#undef HAVE_SYSINFO
|
||||
#undef HAVE_SYSINFO_MEM_UNIT
|
||||
#undef HAVE_SYSINFO_UPTIME
|
||||
#undef HAVE_TGETENT
|
||||
#undef HAVE_TOWLOWER
|
||||
#undef HAVE_TOWUPPER
|
||||
|
||||
@@ -4095,6 +4095,20 @@ AC_TRY_COMPILE(
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT),
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
dnl struct sysinfo may have the uptime field or not
|
||||
AC_MSG_CHECKING(for sysinfo.uptime)
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/sysinfo.h>],
|
||||
[ struct sysinfo sinfo;
|
||||
long ut;
|
||||
|
||||
(void)sysinfo(&sinfo);
|
||||
ut = sinfo.uptime;
|
||||
],
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_UPTIME),
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
dnl sysconf() may exist but not support what we want to use
|
||||
AC_MSG_CHECKING(for sysconf)
|
||||
AC_TRY_COMPILE(
|
||||
@@ -4470,8 +4484,8 @@ if test "$GCC" = yes; then
|
||||
dnl And undefine it first to avoid a warning.
|
||||
AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
|
||||
if test "$gccmajor" -gt "3"; then
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
|
||||
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'`
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
|
||||
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'`
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
@@ -1034,7 +1034,7 @@ win_line(
|
||||
p_extra_free = alloc(MAX_MCO * fdc + 1);
|
||||
if (p_extra_free != NULL)
|
||||
{
|
||||
n_extra = fill_foldcolumn(p_extra_free, wp,
|
||||
n_extra = (int)fill_foldcolumn(p_extra_free, wp,
|
||||
FALSE, lnum);
|
||||
p_extra_free[n_extra] = NUL;
|
||||
p_extra = p_extra_free;
|
||||
|
||||
@@ -297,7 +297,9 @@ update_screen(int type_arg)
|
||||
// Remove the cursor before starting to do anything, because
|
||||
// scrolling may make it difficult to redraw the text under
|
||||
// it.
|
||||
if (gui.in_use && wp == curwin)
|
||||
// Also remove the cursor if it needs to be hidden due to an
|
||||
// ongoing cursor-less sleep.
|
||||
if (gui.in_use && (wp == curwin || cursor_is_sleeping()))
|
||||
{
|
||||
gui_cursor_col = gui.cursor_col;
|
||||
gui_cursor_row = gui.cursor_row;
|
||||
@@ -306,7 +308,6 @@ update_screen(int type_arg)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
win_update(wp);
|
||||
}
|
||||
|
||||
@@ -377,6 +378,20 @@ update_screen(int type_arg)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the row for drawing the statusline and the ruler of window "wp".
|
||||
*/
|
||||
int
|
||||
statusline_row(win_T *wp)
|
||||
{
|
||||
#if defined(FEAT_PROP_POPUP)
|
||||
// If the window is really zero height the winbar isn't displayed.
|
||||
if (wp->w_frame->fr_height == wp->w_status_height && !popup_is_popup(wp))
|
||||
return wp->w_winrow;
|
||||
#endif
|
||||
return W_WINROW(wp) + wp->w_height;
|
||||
}
|
||||
|
||||
/*
|
||||
* Redraw the status line of window wp.
|
||||
*
|
||||
@@ -401,6 +416,8 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
||||
return;
|
||||
busy = TRUE;
|
||||
|
||||
row = statusline_row(wp);
|
||||
|
||||
wp->w_redr_status = FALSE;
|
||||
if (wp->w_status_height == 0)
|
||||
{
|
||||
@@ -500,7 +517,6 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
||||
len = this_ru_col - 1;
|
||||
}
|
||||
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
screen_puts(p, row, wp->w_wincol, attr);
|
||||
screen_fill(row, row + 1, len + wp->w_wincol,
|
||||
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);
|
||||
@@ -524,8 +540,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
else
|
||||
fillchar = fillchar_vsep(&attr);
|
||||
screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
|
||||
attr);
|
||||
screen_putchar(fillchar, row, W_ENDCOL(wp), attr);
|
||||
}
|
||||
busy = FALSE;
|
||||
}
|
||||
@@ -680,7 +695,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
|
||||
cursor_off();
|
||||
if (wp->w_status_height)
|
||||
{
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
row = statusline_row(wp);
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
off = wp->w_wincol;
|
||||
width = wp->w_width;
|
||||
@@ -1468,8 +1483,13 @@ win_update(win_T *wp)
|
||||
wp->w_lines_valid = 0;
|
||||
}
|
||||
|
||||
// Window is zero-height: nothing to draw.
|
||||
if (wp->w_height + WINBAR_HEIGHT(wp) == 0)
|
||||
// Window frame is zero-height: nothing to draw.
|
||||
if (wp->w_height + WINBAR_HEIGHT(wp) == 0
|
||||
|| (wp->w_frame->fr_height == wp->w_status_height
|
||||
#if defined(FEAT_PROP_POPUP)
|
||||
&& !popup_is_popup(wp)
|
||||
#endif
|
||||
))
|
||||
{
|
||||
wp->w_redr_type = 0;
|
||||
return;
|
||||
|
||||
36
src/errors.h
36
src/errors.h
@@ -373,3 +373,39 @@ EXTERN char e_argument_name_shadows_existing_variable_str[]
|
||||
INIT(= N_("E1167: Argument name shadows existing variable: %s"));
|
||||
EXTERN char e_argument_already_declared_in_script_str[]
|
||||
INIT(= N_("E1168: Argument already declared in the script: %s"));
|
||||
EXTERN char e_import_as_name_not_supported_here[]
|
||||
INIT(= N_("E1169: 'import * as {name}' not supported here"));
|
||||
EXTERN char e_cannot_use_hash_curly_to_start_comment[]
|
||||
INIT(= N_("E1170: Cannot use #{ to start a comment"));
|
||||
EXTERN char e_missing_end_block[]
|
||||
INIT(= N_("E1171: Missing } after inline function"));
|
||||
EXTERN char e_cannot_use_default_values_in_lambda[]
|
||||
INIT(= N_("E1172: Cannot use default values in a lambda"));
|
||||
EXTERN char e_text_found_after_enddef_str[]
|
||||
INIT(= N_("E1173: Text found after enddef: %s"));
|
||||
EXTERN char e_string_required_for_argument_nr[]
|
||||
INIT(= N_("E1174: String required for argument %d"));
|
||||
EXTERN char e_non_empty_string_required_for_argument_nr[]
|
||||
INIT(= N_("E1175: Non-empty string required for argument %d"));
|
||||
EXTERN char e_misplaced_command_modifier[]
|
||||
INIT(= N_("E1176: Misplaced command modifier"));
|
||||
EXTERN char e_for_loop_on_str_not_supported[]
|
||||
INIT(= N_("E1177: For loop on %s not supported"));
|
||||
EXTERN char e_cannot_lock_unlock_local_variable[]
|
||||
INIT(= N_("E1178: Cannot lock or unlock a local variable"));
|
||||
EXTERN char e_failed_to_extract_pwd_from_str_check_your_shell_config[]
|
||||
INIT(= N_("E1179: Failed to extract PWD from %s, check your shell's config related to OSC 7"));
|
||||
EXTERN char e_variable_arguments_type_must_be_list_str[]
|
||||
INIT(= N_("E1180: Variable arguments type must be a list: %s"));
|
||||
EXTERN char e_cannot_use_underscore_here[]
|
||||
INIT(= N_("E1181: Cannot use an underscore here"));
|
||||
EXTERN char e_blob_required[]
|
||||
INIT(= N_("E1182: Blob required"));
|
||||
EXTERN char e_cannot_use_range_with_assignment_operator_str[]
|
||||
INIT(= N_("E1183: Cannot use a range with an assignment operator: %s"));
|
||||
EXTERN char e_blob_not_set[]
|
||||
INIT(= N_("E1184: Blob not set"));
|
||||
EXTERN char e_cannot_nest_redir[]
|
||||
INIT(= N_("E1185: Cannot nest :redir"));
|
||||
EXTERN char e_missing_redir_end[]
|
||||
INIT(= N_("E1185: Missing :redir END"));
|
||||
|
||||
283
src/eval.c
283
src/eval.c
@@ -41,6 +41,8 @@ typedef struct
|
||||
list_T *fi_list; // list being used
|
||||
int fi_bi; // index of blob
|
||||
blob_T *fi_blob; // blob being used
|
||||
char_u *fi_string; // copy of string being used
|
||||
int fi_byte_idx; // byte index in fi_string
|
||||
} forinfo_T;
|
||||
|
||||
static int tv_op(typval_T *tv1, typval_T *tv2, char_u *op);
|
||||
@@ -1173,12 +1175,8 @@ get_lval(
|
||||
lp->ll_n1 = (long)tv_get_number(&var1);
|
||||
clear_tv(&var1);
|
||||
|
||||
if (lp->ll_n1 < 0
|
||||
|| lp->ll_n1 > bloblen
|
||||
|| (lp->ll_range && lp->ll_n1 == bloblen))
|
||||
if (check_blob_index(bloblen, lp->ll_n1, quiet) == FAIL)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), lp->ll_n1);
|
||||
clear_tv(&var2);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1186,14 +1184,9 @@ get_lval(
|
||||
{
|
||||
lp->ll_n2 = (long)tv_get_number(&var2);
|
||||
clear_tv(&var2);
|
||||
if (lp->ll_n2 < 0
|
||||
|| lp->ll_n2 >= bloblen
|
||||
|| lp->ll_n2 < lp->ll_n1)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), lp->ll_n2);
|
||||
if (check_blob_range(bloblen, lp->ll_n1, lp->ll_n2, quiet)
|
||||
== FAIL)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
lp->ll_blob = lp->ll_tv->vval.v_blob;
|
||||
lp->ll_tv = NULL;
|
||||
@@ -1317,50 +1310,26 @@ set_var_lval(
|
||||
|
||||
if (lp->ll_range && rettv->v_type == VAR_BLOB)
|
||||
{
|
||||
int il, ir;
|
||||
|
||||
if (lp->ll_empty2)
|
||||
lp->ll_n2 = blob_len(lp->ll_blob) - 1;
|
||||
|
||||
if (lp->ll_n2 - lp->ll_n1 + 1 != blob_len(rettv->vval.v_blob))
|
||||
{
|
||||
emsg(_("E972: Blob value does not have the right number of bytes"));
|
||||
if (blob_set_range(lp->ll_blob, lp->ll_n1, lp->ll_n2,
|
||||
rettv) == FAIL)
|
||||
return;
|
||||
}
|
||||
if (lp->ll_empty2)
|
||||
lp->ll_n2 = blob_len(lp->ll_blob);
|
||||
|
||||
ir = 0;
|
||||
for (il = lp->ll_n1; il <= lp->ll_n2; il++)
|
||||
blob_set(lp->ll_blob, il,
|
||||
blob_get(rettv->vval.v_blob, ir++));
|
||||
}
|
||||
else
|
||||
{
|
||||
val = (int)tv_get_number_chk(rettv, &error);
|
||||
if (!error)
|
||||
{
|
||||
garray_T *gap = &lp->ll_blob->bv_ga;
|
||||
|
||||
// Allow for appending a byte. Setting a byte beyond
|
||||
// the end is an error otherwise.
|
||||
if (lp->ll_n1 < gap->ga_len
|
||||
|| (lp->ll_n1 == gap->ga_len
|
||||
&& ga_grow(&lp->ll_blob->bv_ga, 1) == OK))
|
||||
{
|
||||
blob_set(lp->ll_blob, lp->ll_n1, val);
|
||||
if (lp->ll_n1 == gap->ga_len)
|
||||
++gap->ga_len;
|
||||
}
|
||||
// error for invalid range was already given in get_lval()
|
||||
}
|
||||
blob_set_append(lp->ll_blob, lp->ll_n1, val);
|
||||
}
|
||||
}
|
||||
else if (op != NULL && *op != '=')
|
||||
{
|
||||
typval_T tv;
|
||||
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_(e_cannot_mod));
|
||||
*endp = cc;
|
||||
@@ -1370,7 +1339,7 @@ set_var_lval(
|
||||
// handle +=, -=, *=, /=, %= and .=
|
||||
di = NULL;
|
||||
if (eval_variable(lp->ll_name, (int)STRLEN(lp->ll_name),
|
||||
&tv, &di, TRUE, FALSE) == OK)
|
||||
&tv, &di, EVAL_VAR_VERBOSE) == OK)
|
||||
{
|
||||
if ((di == NULL
|
||||
|| (!var_check_ro(di->di_flags, lp->ll_name, FALSE)
|
||||
@@ -1399,7 +1368,8 @@ set_var_lval(
|
||||
listitem_T *ll_li = lp->ll_li;
|
||||
int ll_n1 = lp->ll_n1;
|
||||
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a range"));
|
||||
return;
|
||||
@@ -1458,7 +1428,8 @@ set_var_lval(
|
||||
/*
|
||||
* Assign to a List or Dictionary item.
|
||||
*/
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a list or dict"));
|
||||
return;
|
||||
@@ -1472,7 +1443,7 @@ set_var_lval(
|
||||
{
|
||||
if (op != NULL && *op != '=')
|
||||
{
|
||||
semsg(_(e_letwrong), op);
|
||||
semsg(_(e_dictkey), lp->ll_newkey);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1738,6 +1709,14 @@ eval_for_line(
|
||||
}
|
||||
clear_tv(&tv);
|
||||
}
|
||||
else if (tv.v_type == VAR_STRING)
|
||||
{
|
||||
fi->fi_byte_idx = 0;
|
||||
fi->fi_string = tv.vval.v_string;
|
||||
tv.vval.v_string = NULL;
|
||||
if (fi->fi_string == NULL)
|
||||
fi->fi_string = vim_strsave((char_u *)"");
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg(_(e_listreq));
|
||||
@@ -1776,7 +1755,9 @@ next_for_item(void *fi_void, char_u *arg)
|
||||
{
|
||||
forinfo_T *fi = (forinfo_T *)fi_void;
|
||||
int result;
|
||||
int flag = in_vim9script() ? ASSIGN_DECL : 0;
|
||||
int flag = ASSIGN_FOR_LOOP | (in_vim9script()
|
||||
? (ASSIGN_FINAL | ASSIGN_DECL | ASSIGN_NO_MEMBER_TYPE)
|
||||
: 0);
|
||||
listitem_T *item;
|
||||
|
||||
if (fi->fi_blob != NULL)
|
||||
@@ -1790,7 +1771,25 @@ next_for_item(void *fi_void, char_u *arg)
|
||||
tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi);
|
||||
++fi->fi_bi;
|
||||
return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
|
||||
fi->fi_varcount, flag, NULL) == OK;
|
||||
fi->fi_varcount, flag, NULL) == OK;
|
||||
}
|
||||
|
||||
if (fi->fi_string != NULL)
|
||||
{
|
||||
typval_T tv;
|
||||
int len;
|
||||
|
||||
len = mb_ptr2len(fi->fi_string + fi->fi_byte_idx);
|
||||
if (len == 0)
|
||||
return FALSE;
|
||||
tv.v_type = VAR_STRING;
|
||||
tv.v_lock = VAR_FIXED;
|
||||
tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len);
|
||||
fi->fi_byte_idx += len;
|
||||
result = ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
|
||||
fi->fi_varcount, flag, NULL) == OK;
|
||||
vim_free(tv.vval.v_string);
|
||||
return result;
|
||||
}
|
||||
|
||||
item = fi->fi_lw.lw_item;
|
||||
@@ -1800,7 +1799,7 @@ next_for_item(void *fi_void, char_u *arg)
|
||||
{
|
||||
fi->fi_lw.lw_item = item->li_next;
|
||||
result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon,
|
||||
fi->fi_varcount, flag, NULL) == OK);
|
||||
fi->fi_varcount, flag, NULL) == OK);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1813,13 +1812,17 @@ free_for_info(void *fi_void)
|
||||
{
|
||||
forinfo_T *fi = (forinfo_T *)fi_void;
|
||||
|
||||
if (fi != NULL && fi->fi_list != NULL)
|
||||
if (fi == NULL)
|
||||
return;
|
||||
if (fi->fi_list != NULL)
|
||||
{
|
||||
list_rem_watch(fi->fi_list, &fi->fi_lw);
|
||||
list_unref(fi->fi_list);
|
||||
}
|
||||
if (fi != NULL && fi->fi_blob != NULL)
|
||||
else if (fi->fi_blob != NULL)
|
||||
blob_unref(fi->fi_blob);
|
||||
else
|
||||
vim_free(fi->fi_string);
|
||||
vim_free(fi);
|
||||
}
|
||||
|
||||
@@ -2179,8 +2182,8 @@ clear_evalarg(evalarg_T *evalarg, exarg_T *eap)
|
||||
evalarg->eval_tofree = NULL;
|
||||
}
|
||||
|
||||
vim_free(evalarg->eval_tofree_lambda);
|
||||
evalarg->eval_tofree_lambda = NULL;
|
||||
VIM_CLEAR(evalarg->eval_tofree_cmdline);
|
||||
VIM_CLEAR(evalarg->eval_tofree_lambda);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2228,7 +2231,8 @@ eval0(
|
||||
if (!aborting()
|
||||
&& did_emsg == did_emsg_before
|
||||
&& called_emsg == called_emsg_before
|
||||
&& (flags & EVAL_CONSTANT) == 0)
|
||||
&& (flags & EVAL_CONSTANT) == 0
|
||||
&& (!in_vim9script() || !vim9_bad_comment(p)))
|
||||
semsg(_(e_invexpr2), arg);
|
||||
|
||||
// Some of the expression may not have been consumed. Do not check for
|
||||
@@ -2297,7 +2301,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
{
|
||||
if (evaluate && vim9script && !VIM_ISWHITE(p[-1]))
|
||||
{
|
||||
error_white_both(p, 1);
|
||||
error_white_both(p, op_falsy ? 2 : 1);
|
||||
clear_tv(rettv);
|
||||
return FAIL;
|
||||
}
|
||||
@@ -2328,7 +2332,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
++*arg;
|
||||
if (evaluate && vim9script && !IS_WHITE_OR_NUL((*arg)[1]))
|
||||
{
|
||||
error_white_both(p, 1);
|
||||
error_white_both(p, op_falsy ? 2 : 1);
|
||||
clear_tv(rettv);
|
||||
return FAIL;
|
||||
}
|
||||
@@ -2741,7 +2745,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
*/
|
||||
if (evaluate && vim9script && !IS_WHITE_OR_NUL(p[len]))
|
||||
{
|
||||
error_white_both(p, 1);
|
||||
error_white_both(p, len);
|
||||
clear_tv(rettv);
|
||||
return FAIL;
|
||||
}
|
||||
@@ -2975,10 +2979,12 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
n1 = tv_get_number_chk(rettv, &error);
|
||||
if (error)
|
||||
{
|
||||
// This can only happen for "list + non-list". For
|
||||
// "non-list + ..." or "something - ...", we returned
|
||||
// before evaluating the 2nd operand.
|
||||
// This can only happen for "list + non-list" or
|
||||
// "blob + non-blob". For "non-list + ..." or
|
||||
// "something - ...", we returned before evaluating the
|
||||
// 2nd operand.
|
||||
clear_tv(rettv);
|
||||
clear_tv(&var2);
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
@@ -3362,7 +3368,11 @@ eval7(
|
||||
/*
|
||||
* Dictionary: #{key: val, key: val}
|
||||
*/
|
||||
case '#': if (!in_vim9script() && (*arg)[1] == '{')
|
||||
case '#': if (in_vim9script())
|
||||
{
|
||||
ret = vim9_bad_comment(*arg) ? FAIL : NOTDONE;
|
||||
}
|
||||
else if ((*arg)[1] == '{')
|
||||
{
|
||||
++*arg;
|
||||
ret = eval_dict(arg, rettv, evalarg, TRUE);
|
||||
@@ -3401,9 +3411,16 @@ eval7(
|
||||
case '@': ++*arg;
|
||||
if (evaluate)
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = get_reg_contents(**arg,
|
||||
GREG_EXPR_SRC);
|
||||
if (in_vim9script() && IS_WHITE_OR_NUL(**arg))
|
||||
semsg(_(e_syntax_error_at_str), *arg);
|
||||
else if (in_vim9script() && !valid_yank_reg(**arg, FALSE))
|
||||
emsg_invreg(**arg);
|
||||
else
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = get_reg_contents(**arg,
|
||||
GREG_EXPR_SRC);
|
||||
}
|
||||
}
|
||||
if (**arg != NUL)
|
||||
++*arg;
|
||||
@@ -3468,7 +3485,12 @@ eval7(
|
||||
{
|
||||
int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
|
||||
|
||||
if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(')
|
||||
if (evaluate && in_vim9script() && len == 1 && *s == '_')
|
||||
{
|
||||
emsg(_(e_cannot_use_underscore_here));
|
||||
ret = FAIL;
|
||||
}
|
||||
else if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(')
|
||||
{
|
||||
// "name(..." recursive!
|
||||
*arg = skipwhite(*arg);
|
||||
@@ -3500,7 +3522,8 @@ eval7(
|
||||
ret = OK;
|
||||
}
|
||||
else
|
||||
ret = eval_variable(s, len, rettv, NULL, TRUE, FALSE);
|
||||
ret = eval_variable(s, len, rettv, NULL,
|
||||
EVAL_VAR_VERBOSE + EVAL_VAR_IMPORT);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4109,68 +4132,8 @@ eval_index_inner(
|
||||
break;
|
||||
|
||||
case VAR_BLOB:
|
||||
len = blob_len(rettv->vval.v_blob);
|
||||
if (is_range)
|
||||
{
|
||||
// The resulting variable is a sub-blob. If the indexes
|
||||
// are out of range the result is empty.
|
||||
if (n1 < 0)
|
||||
{
|
||||
n1 = len + n1;
|
||||
if (n1 < 0)
|
||||
n1 = 0;
|
||||
}
|
||||
if (n2 < 0)
|
||||
n2 = len + n2;
|
||||
else if (n2 >= len)
|
||||
n2 = len - (exclusive ? 0 : 1);
|
||||
if (exclusive)
|
||||
--n2;
|
||||
if (n1 >= len || n2 < 0 || n1 > n2)
|
||||
{
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
blob_T *blob = blob_alloc();
|
||||
long i;
|
||||
|
||||
if (blob != NULL)
|
||||
{
|
||||
if (ga_grow(&blob->bv_ga, n2 - n1 + 1) == FAIL)
|
||||
{
|
||||
blob_free(blob);
|
||||
return FAIL;
|
||||
}
|
||||
blob->bv_ga.ga_len = n2 - n1 + 1;
|
||||
for (i = n1; i <= n2; i++)
|
||||
blob_set(blob, i - n1,
|
||||
blob_get(rettv->vval.v_blob, i));
|
||||
|
||||
clear_tv(rettv);
|
||||
rettv_blob_set(rettv, blob);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The resulting variable is a byte value.
|
||||
// If the index is too big or negative that is an error.
|
||||
if (n1 < 0)
|
||||
n1 = len + n1;
|
||||
if (n1 < len && n1 >= 0)
|
||||
{
|
||||
int v = blob_get(rettv->vval.v_blob, n1);
|
||||
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
rettv->vval.v_number = v;
|
||||
}
|
||||
else
|
||||
semsg(_(e_blobidx), n1);
|
||||
}
|
||||
blob_slice_or_index(rettv->vval.v_blob, is_range, n1, n2,
|
||||
exclusive, rettv);
|
||||
break;
|
||||
|
||||
case VAR_LIST:
|
||||
@@ -5260,6 +5223,9 @@ var2fpos(
|
||||
return &pos;
|
||||
}
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(varp, 0) == FAIL)
|
||||
return NULL;
|
||||
|
||||
name = tv_get_string_chk(varp);
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@@ -5760,6 +5726,63 @@ handle_subscript(
|
||||
check_white = FALSE;
|
||||
}
|
||||
|
||||
if (rettv->v_type == VAR_ANY)
|
||||
{
|
||||
char_u *exp_name;
|
||||
int cc;
|
||||
int idx;
|
||||
ufunc_T *ufunc;
|
||||
type_T *type;
|
||||
|
||||
// Found script from "import * as {name}", script item name must
|
||||
// follow.
|
||||
if (**arg != '.')
|
||||
{
|
||||
if (verbose)
|
||||
semsg(_(e_expected_str_but_got_str), "'.'", *arg);
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
++*arg;
|
||||
if (IS_WHITE_OR_NUL(**arg))
|
||||
{
|
||||
if (verbose)
|
||||
emsg(_(e_no_white_space_allowed_after_dot));
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
// isolate the name
|
||||
exp_name = *arg;
|
||||
while (eval_isnamec(**arg))
|
||||
++*arg;
|
||||
cc = **arg;
|
||||
**arg = NUL;
|
||||
|
||||
idx = find_exported(rettv->vval.v_number, exp_name, &ufunc, &type,
|
||||
evalarg->eval_cctx, verbose);
|
||||
**arg = cc;
|
||||
*arg = skipwhite(*arg);
|
||||
|
||||
if (idx < 0 && ufunc == NULL)
|
||||
{
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
if (idx >= 0)
|
||||
{
|
||||
scriptitem_T *si = SCRIPT_ITEM(rettv->vval.v_number);
|
||||
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx;
|
||||
|
||||
copy_tv(sv->sv_tv, rettv);
|
||||
}
|
||||
else
|
||||
{
|
||||
rettv->v_type = VAR_FUNC;
|
||||
rettv->vval.v_string = vim_strsave(ufunc->uf_name);
|
||||
}
|
||||
}
|
||||
|
||||
if ((**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC
|
||||
|| rettv->v_type == VAR_PARTIAL))
|
||||
&& (!check_white || !VIM_ISWHITE(*(*arg - 1))))
|
||||
@@ -6054,6 +6077,7 @@ get_echo_attr(void)
|
||||
* ":execute expr1 ..." execute the result of an expression.
|
||||
* ":echomsg expr1 ..." Print a message
|
||||
* ":echoerr expr1 ..." Print an error
|
||||
* ":echoconsole expr1 ..." Print a message on stdout
|
||||
* Each gets spaces around each argument and a newline at the end for
|
||||
* echo commands
|
||||
*/
|
||||
@@ -6131,6 +6155,11 @@ ex_execute(exarg_T *eap)
|
||||
msg_attr(ga.ga_data, echo_attr);
|
||||
out_flush();
|
||||
}
|
||||
else if (eap->cmdidx == CMD_echoconsole)
|
||||
{
|
||||
ui_write(ga.ga_data, (int)STRLEN(ga.ga_data), TRUE);
|
||||
ui_write((char_u *)"\r\n", 2, TRUE);
|
||||
}
|
||||
else if (eap->cmdidx == CMD_echoerr)
|
||||
{
|
||||
int save_did_emsg = did_emsg;
|
||||
|
||||
@@ -88,6 +88,8 @@ find_buffer(typval_T *avar)
|
||||
|
||||
if (avar->v_type == VAR_NUMBER)
|
||||
buf = buflist_findnr((int)avar->vval.v_number);
|
||||
else if (in_vim9script() && check_for_string_arg(avar, 0) == FAIL)
|
||||
return NULL;
|
||||
else if (avar->v_type == VAR_STRING && avar->vval.v_string != NULL)
|
||||
{
|
||||
buf = buflist_findname_exp(avar->vval.v_string);
|
||||
|
||||
@@ -223,6 +223,7 @@ static void f_str2float(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
static void f_str2list(typval_T *argvars, typval_T *rettv);
|
||||
static void f_str2nr(typval_T *argvars, typval_T *rettv);
|
||||
static void f_strcharlen(typval_T *argvars, typval_T *rettv);
|
||||
static void f_strchars(typval_T *argvars, typval_T *rettv);
|
||||
static void f_strgetchar(typval_T *argvars, typval_T *rettv);
|
||||
static void f_stridx(typval_T *argvars, typval_T *rettv);
|
||||
@@ -738,6 +739,8 @@ static funcentry_T global_functions[] =
|
||||
ret_number_bool, f_assert_inrange},
|
||||
{"assert_match", 2, 3, FEARG_2, NULL,
|
||||
ret_number_bool, f_assert_match},
|
||||
{"assert_nobeep", 1, 2, FEARG_1, NULL,
|
||||
ret_number_bool, f_assert_nobeep},
|
||||
{"assert_notequal", 2, 3, FEARG_2, NULL,
|
||||
ret_number_bool, f_assert_notequal},
|
||||
{"assert_notmatch", 2, 3, FEARG_2, NULL,
|
||||
@@ -1021,7 +1024,7 @@ static funcentry_T global_functions[] =
|
||||
{"getcwd", 0, 2, FEARG_1, NULL,
|
||||
ret_string, f_getcwd},
|
||||
{"getenv", 1, 1, FEARG_1, NULL,
|
||||
ret_string, f_getenv},
|
||||
ret_any, f_getenv},
|
||||
{"getfontname", 0, 1, 0, NULL,
|
||||
ret_string, f_getfontname},
|
||||
{"getfperm", 1, 1, FEARG_1, NULL,
|
||||
@@ -1572,7 +1575,9 @@ static funcentry_T global_functions[] =
|
||||
ret_list_number, f_str2list},
|
||||
{"str2nr", 1, 3, FEARG_1, arg3_string_nr_bool,
|
||||
ret_number, f_str2nr},
|
||||
{"strcharpart", 2, 3, FEARG_1, NULL,
|
||||
{"strcharlen", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_strcharlen},
|
||||
{"strcharpart", 2, 4, FEARG_1, NULL,
|
||||
ret_string, f_strcharpart},
|
||||
{"strchars", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_strchars},
|
||||
@@ -2320,8 +2325,12 @@ f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
}
|
||||
else
|
||||
{
|
||||
char_u *mesg = tv_get_string_chk(&argvars[0]);
|
||||
char_u *mesg;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
mesg = tv_get_string_chk(&argvars[0]);
|
||||
if (mesg != NULL)
|
||||
// empty string removes the balloon
|
||||
post_balloon(balloonEval, *mesg == NUL ? NULL : mesg, NULL);
|
||||
@@ -2335,8 +2344,11 @@ f_balloon_split(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
if (rettv_list_alloc(rettv) == OK)
|
||||
{
|
||||
char_u *msg = tv_get_string_chk(&argvars[0]);
|
||||
char_u *msg;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
msg = tv_get_string_chk(&argvars[0]);
|
||||
if (msg != NULL)
|
||||
{
|
||||
pumitem_T *array;
|
||||
@@ -2511,6 +2523,8 @@ f_changenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_char2nr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
if (has_mbyte)
|
||||
{
|
||||
int utf8 = 0;
|
||||
@@ -2675,11 +2689,16 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
char_u *typestr;
|
||||
int error = FALSE;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
message = tv_get_string_chk(&argvars[0]);
|
||||
if (message == NULL)
|
||||
error = TRUE;
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 1) == FAIL)
|
||||
return;
|
||||
buttons = tv_get_string_buf_chk(&argvars[1], buf);
|
||||
if (buttons == NULL)
|
||||
error = TRUE;
|
||||
@@ -2688,6 +2707,8 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
def = (int)tv_get_number_chk(&argvars[2], &error);
|
||||
if (argvars[3].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 3) == FAIL)
|
||||
return;
|
||||
typestr = tv_get_string_buf_chk(&argvars[3], buf2);
|
||||
if (typestr == NULL)
|
||||
error = TRUE;
|
||||
@@ -7899,7 +7920,7 @@ f_screenstring(typval_T *argvars, typval_T *rettv)
|
||||
c = ScreenLines[off];
|
||||
buflen += mb_char2bytes(c, buf);
|
||||
|
||||
if (enc_utf8)
|
||||
if (enc_utf8 && ScreenLinesUC[off] != 0)
|
||||
for (i = 0; i < Screen_mco && ScreenLinesC[i][off] != 0; ++i)
|
||||
buflen += mb_char2bytes(ScreenLinesC[i][off], buf + buflen);
|
||||
|
||||
@@ -9236,31 +9257,45 @@ f_strlen(typval_T *argvars, typval_T *rettv)
|
||||
tv_get_string(&argvars[0])));
|
||||
}
|
||||
|
||||
static void
|
||||
strchar_common(typval_T *argvars, typval_T *rettv, int skipcc)
|
||||
{
|
||||
char_u *s = tv_get_string(&argvars[0]);
|
||||
varnumber_T len = 0;
|
||||
int (*func_mb_ptr2char_adv)(char_u **pp);
|
||||
|
||||
func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv;
|
||||
while (*s != NUL)
|
||||
{
|
||||
func_mb_ptr2char_adv(&s);
|
||||
++len;
|
||||
}
|
||||
rettv->vval.v_number = len;
|
||||
}
|
||||
|
||||
/*
|
||||
* "strcharlen()" function
|
||||
*/
|
||||
static void
|
||||
f_strcharlen(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
strchar_common(argvars, rettv, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* "strchars()" function
|
||||
*/
|
||||
static void
|
||||
f_strchars(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *s = tv_get_string(&argvars[0]);
|
||||
varnumber_T skipcc = FALSE;
|
||||
varnumber_T len = 0;
|
||||
int (*func_mb_ptr2char_adv)(char_u **pp);
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
skipcc = tv_get_bool(&argvars[1]);
|
||||
if (skipcc < 0 || skipcc > 1)
|
||||
semsg(_(e_using_number_as_bool_nr), skipcc);
|
||||
else
|
||||
{
|
||||
func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv;
|
||||
while (*s != NUL)
|
||||
{
|
||||
func_mb_ptr2char_adv(&s);
|
||||
++len;
|
||||
}
|
||||
rettv->vval.v_number = len;
|
||||
}
|
||||
strchar_common(argvars, rettv, skipcc);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9299,6 +9334,7 @@ f_strcharpart(typval_T *argvars, typval_T *rettv)
|
||||
int nchar;
|
||||
int nbyte = 0;
|
||||
int charlen;
|
||||
int skipcc = FALSE;
|
||||
int len = 0;
|
||||
int slen;
|
||||
int error = FALSE;
|
||||
@@ -9309,10 +9345,24 @@ f_strcharpart(typval_T *argvars, typval_T *rettv)
|
||||
nchar = (int)tv_get_number_chk(&argvars[1], &error);
|
||||
if (!error)
|
||||
{
|
||||
if (argvars[2].v_type != VAR_UNKNOWN
|
||||
&& argvars[3].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
skipcc = tv_get_bool(&argvars[3]);
|
||||
if (skipcc < 0 || skipcc > 1)
|
||||
{
|
||||
semsg(_(e_using_number_as_bool_nr), skipcc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (nchar > 0)
|
||||
while (nchar > 0 && nbyte < slen)
|
||||
{
|
||||
nbyte += MB_CPTR2LEN(p + nbyte);
|
||||
if (skipcc)
|
||||
nbyte += mb_ptr2len(p + nbyte);
|
||||
else
|
||||
nbyte += MB_CPTR2LEN(p + nbyte);
|
||||
--nchar;
|
||||
}
|
||||
else
|
||||
@@ -9327,7 +9377,12 @@ f_strcharpart(typval_T *argvars, typval_T *rettv)
|
||||
if (off < 0)
|
||||
len += 1;
|
||||
else
|
||||
len += MB_CPTR2LEN(p + off);
|
||||
{
|
||||
if (skipcc)
|
||||
len += mb_ptr2len(p + off);
|
||||
else
|
||||
len += MB_CPTR2LEN(p + off);
|
||||
}
|
||||
--charlen;
|
||||
}
|
||||
}
|
||||
|
||||
199
src/evalvars.c
199
src/evalvars.c
@@ -319,7 +319,8 @@ garbage_collect_scriptvars(int copyID)
|
||||
{
|
||||
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx;
|
||||
|
||||
abort = abort || set_ref_in_item(sv->sv_tv, copyID, NULL, NULL);
|
||||
if (sv->sv_name != NULL)
|
||||
abort = abort || set_ref_in_item(sv->sv_tv, copyID, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,8 +789,11 @@ ex_let(exarg_T *eap)
|
||||
{
|
||||
if (vim9script)
|
||||
{
|
||||
// Vim9 declaration ":var name: type"
|
||||
arg = vim9_declare_scriptvar(eap, arg);
|
||||
if (!ends_excmd2(eap->cmd, skipwhite(argend)))
|
||||
semsg(_(e_trailing_arg), argend);
|
||||
else
|
||||
// Vim9 declaration ":var name: type"
|
||||
arg = vim9_declare_scriptvar(eap, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -966,8 +970,8 @@ ex_let_vars(
|
||||
{
|
||||
arg = skipwhite(arg + 1);
|
||||
++var_idx;
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE, flags, (char_u *)",;]",
|
||||
op, var_idx);
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE,
|
||||
flags | ASSIGN_UNPACK, (char_u *)",;]", op, var_idx);
|
||||
item = item->li_next;
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -992,8 +996,8 @@ ex_let_vars(
|
||||
l->lv_refcount = 1;
|
||||
++var_idx;
|
||||
|
||||
arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, flags,
|
||||
(char_u *)"]", op, var_idx);
|
||||
arg = ex_let_one(skipwhite(arg + 1), <v, FALSE,
|
||||
flags | ASSIGN_UNPACK, (char_u *)"]", op, var_idx);
|
||||
clear_tv(<v);
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -1218,7 +1222,8 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
|
||||
arg = skipwhite(arg);
|
||||
if (tofree != NULL)
|
||||
name = tofree;
|
||||
if (eval_variable(name, len, &tv, NULL, TRUE, FALSE) == FAIL)
|
||||
if (eval_variable(name, len, &tv, NULL,
|
||||
EVAL_VAR_VERBOSE) == FAIL)
|
||||
error = TRUE;
|
||||
else
|
||||
{
|
||||
@@ -1310,7 +1315,8 @@ ex_let_one(
|
||||
// ":let $VAR = expr": Set environment variable.
|
||||
if (*arg == '$')
|
||||
{
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_("E996: Cannot lock an environment variable"));
|
||||
return NULL;
|
||||
@@ -1360,9 +1366,11 @@ ex_let_one(
|
||||
// ":let &option = expr": Set option value.
|
||||
// ":let &l:option = expr": Set local option value.
|
||||
// ":let &g:option = expr": Set global option value.
|
||||
// ":for &ts in range(8)": Set option value for for loop
|
||||
else if (*arg == '&')
|
||||
{
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_(e_const_option));
|
||||
return NULL;
|
||||
@@ -1461,7 +1469,8 @@ ex_let_one(
|
||||
// ":let @r = expr": Set register contents.
|
||||
else if (*arg == '@')
|
||||
{
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a register"));
|
||||
return NULL;
|
||||
@@ -1514,7 +1523,7 @@ ex_let_one(
|
||||
else
|
||||
{
|
||||
set_var_lval(&lv, p, tv, copy, flags, op, var_idx);
|
||||
arg_end = p;
|
||||
arg_end = lv.ll_name_end;
|
||||
}
|
||||
}
|
||||
clear_lval(&lv);
|
||||
@@ -2538,6 +2547,8 @@ set_cmdarg(exarg_T *eap, char_u *oldarg)
|
||||
|
||||
/*
|
||||
* Get the value of internal variable "name".
|
||||
* If "flags" has EVAL_VAR_IMPORT may return a VAR_ANY with v_number set to the
|
||||
* imported script ID.
|
||||
* Return OK or FAIL. If OK is returned "rettv" must be cleared.
|
||||
*/
|
||||
int
|
||||
@@ -2546,12 +2557,11 @@ eval_variable(
|
||||
int len, // length of "name"
|
||||
typval_T *rettv, // NULL when only checking existence
|
||||
dictitem_T **dip, // non-NULL when typval's dict item is needed
|
||||
int verbose, // may give error message
|
||||
int no_autoload) // do not use script autoloading
|
||||
int flags) // EVAL_VAR_ flags
|
||||
{
|
||||
int ret = OK;
|
||||
typval_T *tv = NULL;
|
||||
int foundFunc = FALSE;
|
||||
int found = FALSE;
|
||||
dictitem_T *v;
|
||||
int cc;
|
||||
|
||||
@@ -2560,7 +2570,7 @@ eval_variable(
|
||||
name[len] = NUL;
|
||||
|
||||
// Check for user-defined variables.
|
||||
v = find_var(name, NULL, no_autoload);
|
||||
v = find_var(name, NULL, flags & EVAL_VAR_NOAUTOLOAD);
|
||||
if (v != NULL)
|
||||
{
|
||||
tv = &v->di_tv;
|
||||
@@ -2580,7 +2590,7 @@ eval_variable(
|
||||
{
|
||||
if (import->imp_funcname != NULL)
|
||||
{
|
||||
foundFunc = TRUE;
|
||||
found = TRUE;
|
||||
if (rettv != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_FUNC;
|
||||
@@ -2589,8 +2599,21 @@ eval_variable(
|
||||
}
|
||||
else if (import->imp_flags & IMP_FLAGS_STAR)
|
||||
{
|
||||
emsg("Sorry, 'import * as X' not implemented yet");
|
||||
ret = FAIL;
|
||||
if ((flags & EVAL_VAR_IMPORT) == 0)
|
||||
{
|
||||
if (flags & EVAL_VAR_VERBOSE)
|
||||
emsg(_(e_import_as_name_not_supported_here));
|
||||
ret = FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rettv != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_ANY;
|
||||
rettv->vval.v_number = import->imp_sid;
|
||||
}
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2606,7 +2629,7 @@ eval_variable(
|
||||
|
||||
if (ufunc != NULL)
|
||||
{
|
||||
foundFunc = TRUE;
|
||||
found = TRUE;
|
||||
if (rettv != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_FUNC;
|
||||
@@ -2616,11 +2639,11 @@ eval_variable(
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundFunc)
|
||||
if (!found)
|
||||
{
|
||||
if (tv == NULL)
|
||||
{
|
||||
if (rettv != NULL && verbose)
|
||||
if (rettv != NULL && (flags & EVAL_VAR_VERBOSE))
|
||||
semsg(_(e_undefined_variable_str), name);
|
||||
ret = FAIL;
|
||||
}
|
||||
@@ -2639,6 +2662,12 @@ eval_variable(
|
||||
if (tv->vval.v_list != NULL)
|
||||
++tv->vval.v_list->lv_refcount;
|
||||
}
|
||||
else if (tv->v_type == VAR_BLOB && tv->vval.v_blob == NULL)
|
||||
{
|
||||
tv->vval.v_blob = blob_alloc();
|
||||
if (tv->vval.v_blob != NULL)
|
||||
++tv->vval.v_blob->bv_refcount;
|
||||
}
|
||||
copy_tv(tv, rettv);
|
||||
}
|
||||
}
|
||||
@@ -2789,12 +2818,15 @@ get_script_local_ht(void)
|
||||
|
||||
/*
|
||||
* Look for "name[len]" in script-local variables and functions.
|
||||
* When "cmd" is TRUE it must look like a command, a function must be followed
|
||||
* by "(" or "->".
|
||||
* Return OK when found, FAIL when not found.
|
||||
*/
|
||||
int
|
||||
lookup_scriptitem(
|
||||
char_u *name,
|
||||
size_t len,
|
||||
int cmd,
|
||||
cctx_T *dummy UNUSED)
|
||||
{
|
||||
hashtab_T *ht = get_script_local_ht();
|
||||
@@ -2829,19 +2861,26 @@ lookup_scriptitem(
|
||||
if (p != buffer)
|
||||
vim_free(p);
|
||||
|
||||
// Find a function, so that a following "->" works.
|
||||
// When used as a command require "(" or "->" to follow, "Cmd" is a user
|
||||
// command while "Cmd()" is a function call.
|
||||
if (res != OK)
|
||||
{
|
||||
// Find a function, so that a following "->" works. Skip "g:" before a
|
||||
// function name.
|
||||
// Do not check for an internal function, since it might also be a
|
||||
// valid command, such as ":split" versuse "split()".
|
||||
if (name[0] == 'g' && name[1] == ':')
|
||||
p = skipwhite(name + len);
|
||||
|
||||
if (!cmd || name[len] == '(' || (p[0] == '-' && p[1] == '>'))
|
||||
{
|
||||
is_global = TRUE;
|
||||
fname = name + 2;
|
||||
// Do not check for an internal function, since it might also be a
|
||||
// valid command, such as ":split" versus "split()".
|
||||
// Skip "g:" before a function name.
|
||||
if (name[0] == 'g' && name[1] == ':')
|
||||
{
|
||||
is_global = TRUE;
|
||||
fname = name + 2;
|
||||
}
|
||||
if (find_func(fname, is_global, NULL) != NULL)
|
||||
res = OK;
|
||||
}
|
||||
if (find_func(fname, is_global, NULL) != NULL)
|
||||
res = OK;
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -3129,7 +3168,7 @@ set_var_const(
|
||||
type_T *type,
|
||||
typval_T *tv_arg,
|
||||
int copy, // make copy of value in "tv"
|
||||
int flags, // ASSIGN_CONST, ASSIGN_FINAL, etc.
|
||||
int flags_arg, // ASSIGN_CONST, ASSIGN_FINAL, etc.
|
||||
int var_idx) // index for ":let [a, b] = list"
|
||||
{
|
||||
typval_T *tv = tv_arg;
|
||||
@@ -3139,6 +3178,8 @@ set_var_const(
|
||||
hashtab_T *ht;
|
||||
int is_script_local;
|
||||
int vim9script = in_vim9script();
|
||||
int var_in_vim9script;
|
||||
int flags = flags_arg;
|
||||
|
||||
ht = find_var_ht(name, &varname);
|
||||
if (ht == NULL || *varname == NUL)
|
||||
@@ -3157,6 +3198,19 @@ set_var_const(
|
||||
vim9_declare_error(name);
|
||||
goto failed;
|
||||
}
|
||||
if ((flags & ASSIGN_FOR_LOOP) && name[1] == ':'
|
||||
&& vim_strchr((char_u *)"gwbt", name[0]) != NULL)
|
||||
// Do not make g:var, w:var, b:var or t:var final.
|
||||
flags &= ~ASSIGN_FINAL;
|
||||
|
||||
var_in_vim9script = is_script_local && current_script_is_vim9();
|
||||
if (var_in_vim9script && name[0] == '_' && name[1] == NUL)
|
||||
{
|
||||
// For "[a, _] = list" the underscore is ignored.
|
||||
if ((flags & ASSIGN_UNPACK) == 0)
|
||||
emsg(_(e_cannot_use_underscore_here));
|
||||
goto failed;
|
||||
}
|
||||
|
||||
di = find_var_in_ht(ht, 0, varname, TRUE);
|
||||
|
||||
@@ -3182,22 +3236,24 @@ set_var_const(
|
||||
// Item already exists. Allowed to replace when reloading.
|
||||
if ((di->di_flags & DI_FLAGS_RELOAD) == 0)
|
||||
{
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_(e_cannot_mod));
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (is_script_local && vim9script)
|
||||
if (is_script_local && vim9script
|
||||
&& (flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (var_in_vim9script)
|
||||
{
|
||||
where_T where;
|
||||
|
||||
if ((flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
// check the type and adjust to bool if needed
|
||||
where.wt_index = var_idx;
|
||||
where.wt_variable = TRUE;
|
||||
@@ -3215,8 +3271,9 @@ set_var_const(
|
||||
|
||||
// A Vim9 script-local variable is also present in sn_all_vars and
|
||||
// sn_var_vals. It may set "type" from "tv".
|
||||
if (is_script_local && vim9script)
|
||||
update_vim9_script_var(FALSE, di, flags, tv, &type);
|
||||
if (var_in_vim9script)
|
||||
update_vim9_script_var(FALSE, di, flags, tv, &type,
|
||||
(flags & ASSIGN_NO_MEMBER_TYPE) == 0);
|
||||
}
|
||||
|
||||
// existing variable, need to clear the value
|
||||
@@ -3272,14 +3329,14 @@ set_var_const(
|
||||
{
|
||||
// Item not found, check if a function already exists.
|
||||
if (is_script_local && (flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0
|
||||
&& lookup_scriptitem(name, STRLEN(name), NULL) == OK)
|
||||
&& lookup_scriptitem(name, STRLEN(name), FALSE, NULL) == OK)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
// add a new variable
|
||||
if (vim9script && is_script_local && (flags & ASSIGN_NO_DECL))
|
||||
if (var_in_vim9script && (flags & ASSIGN_NO_DECL))
|
||||
{
|
||||
semsg(_(e_unknown_variable_str), name);
|
||||
goto failed;
|
||||
@@ -3313,8 +3370,9 @@ set_var_const(
|
||||
|
||||
// A Vim9 script-local variable is also added to sn_all_vars and
|
||||
// sn_var_vals. It may set "type" from "tv".
|
||||
if (is_script_local && vim9script)
|
||||
update_vim9_script_var(TRUE, di, flags, tv, &type);
|
||||
if (var_in_vim9script)
|
||||
update_vim9_script_var(TRUE, di, flags, tv, &type,
|
||||
(flags & ASSIGN_NO_MEMBER_TYPE) == 0);
|
||||
}
|
||||
|
||||
if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT)
|
||||
@@ -3424,8 +3482,10 @@ var_wrong_func_name(
|
||||
char_u *name, // points to start of variable name
|
||||
int new_var) // TRUE when creating the variable
|
||||
{
|
||||
// Allow for w: b: s: and t:.
|
||||
if (!(vim_strchr((char_u *)"wbst", name[0]) != NULL && name[1] == ':')
|
||||
// Allow for w: b: s: and t:. In Vim9 script s: is not allowed, because
|
||||
// the name can be used without the s: prefix.
|
||||
if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL
|
||||
|| (!in_vim9script() && name[0] == 's')) && name[1] == ':')
|
||||
&& !ASCII_ISUPPER((name[0] != NUL && name[1] == ':')
|
||||
? name[2] : name[0]))
|
||||
{
|
||||
@@ -3694,7 +3754,8 @@ var_exists(char_u *var)
|
||||
{
|
||||
if (tofree != NULL)
|
||||
name = tofree;
|
||||
n = (eval_variable(name, len, &tv, NULL, FALSE, TRUE) == OK);
|
||||
n = (eval_variable(name, len, &tv, NULL,
|
||||
EVAL_VAR_NOAUTOLOAD + EVAL_VAR_IMPORT) == OK);
|
||||
if (n)
|
||||
{
|
||||
// handle d.key, l[idx], f(expr)
|
||||
@@ -3717,6 +3778,27 @@ static garray_T redir_ga; // only valid when redir_lval is not NULL
|
||||
static char_u *redir_endp = NULL;
|
||||
static char_u *redir_varname = NULL;
|
||||
|
||||
int
|
||||
alloc_redir_lval(void)
|
||||
{
|
||||
redir_lval = ALLOC_CLEAR_ONE(lval_T);
|
||||
if (redir_lval == NULL)
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
void
|
||||
clear_redir_lval(void)
|
||||
{
|
||||
VIM_CLEAR(redir_lval);
|
||||
}
|
||||
|
||||
void
|
||||
init_redir_ga(void)
|
||||
{
|
||||
ga_init2(&redir_ga, (int)sizeof(char), 500);
|
||||
}
|
||||
|
||||
/*
|
||||
* Start recording command output to a variable
|
||||
* When "append" is TRUE append to an existing variable.
|
||||
@@ -3740,15 +3822,14 @@ var_redir_start(char_u *name, int append)
|
||||
if (redir_varname == NULL)
|
||||
return FAIL;
|
||||
|
||||
redir_lval = ALLOC_CLEAR_ONE(lval_T);
|
||||
if (redir_lval == NULL)
|
||||
if (alloc_redir_lval() == FAIL)
|
||||
{
|
||||
var_redir_stop();
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// The output is stored in growarray "redir_ga" until redirection ends.
|
||||
ga_init2(&redir_ga, (int)sizeof(char), 500);
|
||||
init_redir_ga();
|
||||
|
||||
// Parse the variable name (can be a dict or list entry).
|
||||
redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, 0,
|
||||
@@ -3860,6 +3941,20 @@ var_redir_stop(void)
|
||||
VIM_CLEAR(redir_varname);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the collected redirected text and clear redir_ga.
|
||||
*/
|
||||
char_u *
|
||||
get_clear_redir_ga(void)
|
||||
{
|
||||
char_u *res;
|
||||
|
||||
ga_append(&redir_ga, NUL); // Append the trailing NUL.
|
||||
res = redir_ga.ga_data;
|
||||
redir_ga.ga_data = NULL;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* "gettabvar()" function
|
||||
*/
|
||||
|
||||
@@ -1007,18 +1007,25 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
win_T *wp;
|
||||
int winnr = 1;
|
||||
int i;
|
||||
int winnr;
|
||||
garray_T ga;
|
||||
char_u buf[50];
|
||||
|
||||
ga_init2(&ga, (int)sizeof(char), 70);
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
|
||||
// Do this twice to handle some window layouts properly.
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
sprintf((char *)buf, ":%dresize %d|", winnr, wp->w_height);
|
||||
ga_concat(&ga, buf);
|
||||
sprintf((char *)buf, "vert :%dresize %d|", winnr, wp->w_width);
|
||||
ga_concat(&ga, buf);
|
||||
++winnr;
|
||||
winnr = 1;
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
sprintf((char *)buf, ":%dresize %d|", winnr, wp->w_height);
|
||||
ga_concat(&ga, buf);
|
||||
sprintf((char *)buf, "vert :%dresize %d|", winnr, wp->w_width);
|
||||
ga_concat(&ga, buf);
|
||||
++winnr;
|
||||
}
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
|
||||
|
||||
@@ -10,27 +10,27 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* c */ 43,
|
||||
/* d */ 109,
|
||||
/* e */ 134,
|
||||
/* f */ 157,
|
||||
/* g */ 174,
|
||||
/* h */ 180,
|
||||
/* i */ 189,
|
||||
/* j */ 208,
|
||||
/* k */ 210,
|
||||
/* l */ 215,
|
||||
/* m */ 277,
|
||||
/* n */ 295,
|
||||
/* o */ 315,
|
||||
/* p */ 327,
|
||||
/* q */ 366,
|
||||
/* r */ 369,
|
||||
/* s */ 389,
|
||||
/* t */ 458,
|
||||
/* u */ 503,
|
||||
/* v */ 514,
|
||||
/* w */ 535,
|
||||
/* x */ 549,
|
||||
/* y */ 559,
|
||||
/* z */ 560
|
||||
/* f */ 158,
|
||||
/* g */ 175,
|
||||
/* h */ 181,
|
||||
/* i */ 190,
|
||||
/* j */ 209,
|
||||
/* k */ 211,
|
||||
/* l */ 216,
|
||||
/* m */ 278,
|
||||
/* n */ 296,
|
||||
/* o */ 316,
|
||||
/* p */ 328,
|
||||
/* q */ 367,
|
||||
/* r */ 370,
|
||||
/* s */ 390,
|
||||
/* t */ 459,
|
||||
/* u */ 504,
|
||||
/* v */ 515,
|
||||
/* w */ 536,
|
||||
/* x */ 550,
|
||||
/* y */ 560,
|
||||
/* z */ 561
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -45,7 +45,7 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* b */ { 2, 0, 0, 5, 6, 8, 0, 0, 0, 0, 0, 9, 10, 11, 12, 13, 0, 14, 0, 0, 0, 0, 23, 0, 0, 0 },
|
||||
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 37, 40, 46, 56, 58, 59, 60, 0, 62, 0, 65, 0, 0, 0 },
|
||||
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 0, 19, 0, 0, 20, 0, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 17, 0, 18, 0, 0 },
|
||||
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 11, 0, 0, 0, 0, 0, 0, 0, 18, 0, 19, 0, 0 },
|
||||
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* g */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 4, 5, 0, 0, 0, 0 },
|
||||
/* h */ { 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 575;
|
||||
static const int command_count = 576;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user