Compare commits

...

165 Commits

Author SHA1 Message Date
Shougo Matsushita
9f860a14c3 patch 9.1.0883: message history cleanup is missing some tests
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: #16078

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-24 13:48:05 +01:00
matveyt
a01148d2cb runtime(doc): Expand docs on :! vs. :term
fixes: #16071
closes: #16089

Signed-off-by: matveyt <matthewtarasov@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 14:19:58 +01:00
GuyBrush
d7745acbd8 runtime(netrw): Fixing powershell execution issues on Windows
closes: #16094

Signed-off-by: GuyBrush <miguel.barro@live.com>
2024-11-23 14:13:10 +01:00
John Marriott
5e6ea92b2c patch 9.1.0882: too many strlen() calls in insexpand.c
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: #16095

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 14:01:57 +01:00
Chris White
991603cc04 patch 9.1.0881: GUI: message dialog may not get focus
Problem:  GUI: message dialog may not get focus
Solution: add window manager hint to give focus to the dialog
          (Chris White)

Tell the window manager that message dialogs should be given focus when
the user switches from another application back to Vim.  This can
happen, e.g., when the user has a file open in Vim and then edits it
in another program.

fixes: #172
closes: #16100

Signed-off-by: Chris White <christopher.white@crowdstrike.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 13:35:43 +01:00
Christian Brabandt
cacfccf803 runtime(netrw): update netrw's decompress logic
Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: #16099
closes: #16104

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 13:28:01 +01:00
nisbet-hubbard
4dd6c22ebe runtime(apache): Update syntax keyword definition
closes: #16105

Signed-off-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 13:14:47 +01:00
Antonio Giovanni Colombo
9c69453f0e runtime(misc): add Italian LICENSE and (top-level) README file
related: #16061

Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 23:13:46 +01:00
Turiiya
c8dfcfc53b patch 9.1.0880: filetype: C3 files are not recognized
Problem:  filetype: C3 files are not recognized
Solution: detect '*.c3*' files as c3 filetype (Turiiya)

closes: #16087

Signed-off-by: Turiiya <34311583+ttytm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 23:05:21 +01:00
Christian Brabandt
cb34507b5f runtime(doc): add helptag for :HelpToc command
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 23:02:57 +01:00
Christian Brabandt
fa41a3ed1e git: ignore re-formatting commit v9.1.0879 for blame
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:58:40 +01:00
Luca Saccarola
3cf094edaf patch 9.1.0879: source is not consistently formatted
Problem:  source is not consistently formatted
Solution: reformat sign.c and sound.c
          (Luca Saccarola)

closes: #16019

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:55:13 +01:00
Luca Saccarola
8bc4d25abe Add clang-format config file
This is used in preparation to enable automatic code-formatting in the
following commits.  For now let's just add a clang-format config file,
formatting of source files will follow.

related: #16019

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:54:34 +01:00
Konfekt
4927daef60 runtime(compiler): fix escaping of arguments passed to :CompilerSet
See newly added help entry referring to option-backslash

closes: #16084

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:41:14 +01:00
Ubaldo Tiberi
ae1c8b790b patch 9.1.0878: termdebug: cannot enable DEBUG mode
Problem:  termdebug: cannot enable DEBUG mode
Solution: Allow to specify DEBUG mode (Ubaldo Tiberi)

closes: #16080

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:32:30 +01:00
Ubaldo Tiberi
b5c1557323 patch 9.1.0877: tests: missing test for termdebug + decimal signs
Problem:  tests: missing test for termdebug + decimal signs
Solution: Add a termdebug test (Ubaldo Tiberi)

closes: #16081

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 21:10:24 +01:00
Wu, Zhenyu
e2c27ca8ef patch 9.1.0876: filetype: openCL files are not recognized
Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: #15825

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 21:03:09 +01:00
Luca Saccarola
a13bd294ab patch 9.1.0875: filetype: hyprlang detection can be improved
Problem:  filetype: hyprlang detection can be improved
Solution: detect '/hypr/*.conf' files as hyprlang filetype,
          include basic syntax highlighting (Luca Saccarola)

fixes: #15875
closes: #16064

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 20:43:52 +01:00
Kirill Morozov
fdac54d7bb patch 9.1.0874: filetype: karel files are not detected
Problem:  filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
          include syntax and filetype plugin
          (Kirill Morozov)

closes: #16075

Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 20:36:22 +01:00
rhysd
9a65a8c270 CI: join codecov array flags, instead of accessing it directly
closes: #16082

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 13:46:17 +01:00
Wu, Zhenyu
a87462a498 patch 9.1.0873: filetype: Vivado files are not recognized
Problem:  filetype: Vivado files are not recognized
Solution: detect '*.mss' files as 'mss' filetype
          (Wu, Zhenyu)

references:
https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS

closes: #15907

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-18 21:36:31 +01:00
Christian Brabandt
a15dfc2d41 patch 9.1.0872: No test for W23 message
Problem:  No test for W23 message
Solution: Check for W23 message when accessing the clipboard fails
          (after v9.1.0868)

closes: #16076

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-18 21:20:54 +01:00
mikoto2000
a73dfc2f55 patch 9.1.0871: getcellpixels() can be further improved
Problem:  getcellpixels() can be further improved
Solution: Fix floating point exception, implement getcellpixels() in the
          UI (mikoto2000)

closes: #16059

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-18 21:12:21 +01:00
John Marriott
bd4614f43d patch 9.1.0870: too many strlen() calls in eval.c
Problem:  too many strlen() calls in eval.c
Solution: Refactor eval.c to remove calls to STRLEN()
          (John Marriott)

closes: #16066

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-18 20:26:13 +01:00
dependabot[bot]
ba9e1570d2 CI: Bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

closes: #16079

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-18 19:05:53 +01:00
Christian Brabandt
9848face74 patch 9.1.0869: Problem: curswant not set on gm in folded line
Problem:  curswant not set on gm in folded line
          (citizenmatt)
Solution: in a folded line, call update_curswant_force()

fixes: #11596
closes: #11994
closes: #15398

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-17 16:18:00 +01:00
Christian Brabandt
8b94afc207 patch 9.1.0868: the warning about missing clipboard can be improved
Problem:  the warning about missing clipboard can be improved
          (after v9.1.0852)
Solution: use different warnings depending on whether or not clipboard
          support is included in Vim, update related documentation

Improve the Warnings about missing clipboard registers

- Make it translatable
- Use a different warning, when clipboard support was not compiled in
- add a reference to :h W24
- explain in more detail the error message

closes: #16069

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-17 16:07:50 +01:00
Christian Brabandt
deda23f850 runtime(doc): Makefile does not clean up all temporary files
Also remove (automatically generated) tags-* (made by make vimtags) and
vim-stylesheet.css (which is produced by vim2html.pl).

related: #16061

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-16 12:47:06 +01:00
glepnir
5c66e23c62 patch 9.1.0867: ins_compl_add() has too many args
Problem:  ins_compl_add() has too many args
Solution: refactor it and use an int array instead of 2 separate int
          args (glepnir)

closes: #16062

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-15 19:58:27 +01:00
Luca Saccarola
54996ecda0 editorconfig: don't trim trailing whitespaces in runtime/doc
closes: #16058

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-15 19:54:45 +01:00
Christian Brabandt
ba0b458570 translation(am): Remove duplicate keys in desktop files
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-15 15:59:52 +01:00
Christian Brabandt
232a77e80a runtime(doc): update helptags
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-15 15:47:33 +01:00
Christian Brabandt
7e4b861da9 runtime(filetype): remove duplicated *.org file pattern
related: #16054

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-15 15:46:27 +01:00
Christian Brabandt
7c3b65eb3e runtime(cfg): only consider leading // as starting a comment
fixes: #16051

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 23:22:31 +01:00
Wu, Zhenyu
bc32bbddcf patch 9.1.0866: filetype: LLVM IR files are not recognized
Problem:  filetype: LLVM IR files are not recognized
Solution: detect '*.ll' files either as lifelines or llvm filetype
          (Wu, Zhenyu)

closes: #15824

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:55:36 +01:00
Luca Saccarola
0684800c85 patch 9.1.0865: filetype: org files are not recognized
Problem:  filetype: org files are not recognized
Solution: detect '*.org' files as 'org' filetype,
          include filetype and syntax plugin
          (Luca Saccarola)

closes: #16054

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:44:14 +01:00
Shougo Matsushita
4bd9b2b246 patch 9.1.0864: message history is fixed to 200
Problem:  message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
          value to 500 (Shougo Matsushita)

closes: #16048

Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:34:24 +01:00
mikoto2000
de094dcd6f patch 9.1.0863: getcellpixels() can be further improved
Problem:  getcellpixels() can be further improved
Solution: improve it further, add more tests
          (mikoto2000)

closes: #16047

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:13:48 +01:00
Lukas Zapletal
0acd3abfad runtime(sh): better function support for bash/zsh in indent script
closes: #16052

Signed-off-by: Lukas Zapletal <lzap+git@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:52:44 +01:00
Konfekt
460799d885 runtime(netrw): small fixes to netrw#BrowseX
- do not enter dir in Netrw on opening
- double quotes after start cause error on Windows

See @chrisbra 's comments at
[0]

[0]: ff82e7a9db (diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279)

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:42:27 +01:00
Luca Saccarola
437bc13ea1 patch 9.1.0862: 'wildmenu' not enabled by default in nocp mode
Problem:  'wildmenu' not enabled by default in nocp mode
Solution: promote the default Vim value to true, it has been enabled
          in defaults.vim anyhow, so remove it there (Luca Saccarola)

closes: #16055

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:21:17 +01:00
Christian Brabandt
8b97ca66cf runtime(doc): update how to report issues for mac Vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:13:34 +01:00
Christian Brabandt
dbf231a4b7 runtime(doc): mention option-backslash at :h CompilerSet
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 20:28:43 +01:00
D. Ben Knoble
c4208da0f4 runtime(compiler): include a Java Maven compiler plugin
@Konfekt suggested adding this [1]; I confirmed that both source
repositories have permissive licenses [2], [3] that permit copying the
code (at least where the compiler scripts are concerned).

[1]: 570b1006fd
[2]: https://github.com/JalaiAmitahl/maven-compiler.vim
[3]: https://github.com/mikelue/vim-maven-plugin/issues/13

closes: #16041

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 19:51:29 +01:00
D. Ben Knoble
8e013b1421 runtime(racket): update Racket runtime files
This brings the included Racket runtime files to commit c41bc5a (indent
for[*]/lists with accumulator clause correctly, 2024-11-12) of
https://github.com/benknoble/vim-racket.

Note that not all files from that repository are included.

closes: #16046

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 19:45:38 +01:00
Christian Brabandt
9b05326afd runtime(doc): improve indentation in examples for netrw-handler
related: #16043

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 17:14:39 +01:00
Christian Brabandt
8b96858996 runtime(doc): improve examples for netrw-handler functions
fixes: #16043

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 15:38:33 +01:00
Serhii Khoma
5ca8f223f0 runtime(idris2): include filetype,indent+syntax plugins for (L)Idris2 + ipkg
closes: #15993

Co-authored-by: Christian Clason <ch.clason+github@icloud.com>
Signed-off-by: Serhii Khoma <srghma@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 21:52:20 +01:00
Christian Brabandt
f18987caa5 runtime(doc): clarify the use of filters and external commands
related: #16044

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 21:38:22 +01:00
Yegappan Lakshmanan
e798446362 patch 9.1.0861: Vim9: no runtime check for object member access of any var
Problem:  Vim9: no runtime check for object member access of any var
          (after: 9.1.0850)
Solution: Add runtime type compatibility check for object member
          accessed using a any variable (Yegappan Lakshmanan).

closes: #16037

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 21:03:00 +01:00
Konfekt
210c49bbe8 runtime(compiler): update pylint linter
closes: #16039

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 20:48:31 +01:00
Yee Cheng Chin
24078e39cd patch 9.1.0860: tests: mouse_shape tests use hard code sleep value
Problem:  tests: mouse_shape tests use hard code sleep value
          (Bram Moolenaar)
Solution: Use WaitForAssert() instead (Yee Cheng Chin)

related: #12157
closes: #16042

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 20:26:48 +01:00
GuyBrush
13a6605ddf patch 9.1.0859: several problems with the GLVS plugin
Problem:  several problems with the GLVS plugin
Solution: fix issues, add regression tests, require at least Vim 9.1
          (GuyBrush)

closes: #16036

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 20:23:41 +01:00
Christian Brabandt
002ccbfac4 patch 9.1.0858: Coverity complains about dead code
Problem:  Coverity complains about dead code
          (after v9.1.0852)
Solution: adjust #ifdef FEAT_CLIPBOARD

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 20:10:58 +01:00
Lennart00
129a8446d2 runtime(tar): Update tar.vim to support permissions
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.

The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact

This requirs the temporary directory to be created earlier.

closes: #7379

Signed-off-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 22:39:30 +01:00
DungSaga
4b9fa95712 patch 9.1.0857: xxd: --- is incorrectly recognized as end-of-options
Problem:  xxd: --- is incorrectly recognized as end-of-options
Solution: improve xxds end-of-option parser (DungSaga)

closes: #9285

Signed-off-by: DungSaga <dungsaga@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 22:19:50 +01:00
Yee Cheng Chin
a1b654ff36 patch 9.1.0856: mouseshape might be wrong on r and gr
Problem:  mouseshape might be wrong on r and gr
Solution: call update_mousesape(-1) immediately
          (Yee Cheng Chin)

Currently, when entering the "pretend" or single character replace modes
using `r` or `gr`, the mouse cursor doesn't immediately update until you
have re-focused the window or moved the mouse. This is because it's not
calling `update_mouseshape(-1)` immediately, so the cursor will only be
updated when it's called by other functions like `gui_mouse_focus`.

To fix this, just make sure we call this `update_mouseshape(-1)`. It's
what we do when entering Insert or Replace modes for example.

I noticed this when trying to figure out why MacVim CI is failing in
`Test_mouse_shape_after_cancelling_gr` (introduced in #12110), but I
think that test is only passing in Vim GTK CI by accident, since this
issue happens there too. I think the window captured focus after the
mouse `gr` call which triggers a mouse shape change but it probably
would have failed under other circumstances.

fixes: #14660
closes: #12157

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 21:57:27 +01:00
nwounkn
2e48567007 patch 9.1.0855: setting 'cmdheight' may cause hit-enter-prompt
Problem:  setting 'cmdheight' may cause hit-enter-prompt and echo output
          to be missing
Solution: Before cleaning the cmdline, check the need_wait_return flag
          (nwounkn)

closes: #13432

Signed-off-by: nwounkn <nwounkn@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 21:48:30 +01:00
Luca Saccarola
feea1b444e Add an .editorconfig file to repository
This commit tries to use an editorconfig file to ensure the same
settings across editors while contributing to the vim repository.

The rules are based of the guidelines defined in
`runtime/doc/develop.txt`.

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 21:37:40 +01:00
mikoto2000
1083cae709 patch 9.1.0854: cannot get terminal cell size
Problem:  cannot get terminal cell size
Solution: add getcellpixels() function to return xpixel * ypixel
          cell size on terminal Unix (mikoto2000)

closes: #16004

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 21:24:14 +01:00
Jonathan Lopez
6fbf63de86 patch 9.1.0853: filetype: kubernetes config file not recognized
Problem:  filetype: kubernetes config file not recognized
Solution: detect '/.kube/config' file as yaml filetype
          (Jonathan Lopez)

closes: #11076

Signed-off-by: Jonathan Lopez <jonathanglopez@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 21:03:31 +01:00
Christian Brabandt
45e0704d96 patch 9.1.0852: No warning when X11 registers are not available
Problem:  No warning when X11 registers are not available
          (delvh)
Solution: Output W23 once when connection to X11 clipboard/selection
          is not possible, mention in the documentation, that register 0
          will be used instead

Vim silently uses the 0 register, when clipboard or selection register * or +
are not available. This might be a bit unexpected for the user.

So let's just warn once when this happens.

fixes: #14768
closes: #16013

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 20:52:55 +01:00
John Marriott
e7a1bbf210 patch 9.1.0851: too many strlen() calls in getchar.c
Problem:  too many strlen() calls in getchar.c
Solution: refactor code and reduce strlen() calls
          (John Marriott)

closes: #16017

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 20:40:33 +01:00
Yegappan Lakshmanan
56d45f1b66 patch 9.1.0850: Vim9: cannot access nested object inside objects
Problem:  Vim9: cannot access nested object inside objects
          (lifepillar, 91khr, mawkish)
Solution: Add support for accessing an object member using a "any"
          variable type (Yegappan Lakshmanan)

fixes: #11822
fixes: #12024
fixes: #12196
fixes: #12198
closes: #16029

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 20:01:06 +01:00
Christian Brabandt
622f6f5b9a runtime(tex): extra Number highlighting causes issues
So let's revert "runtime(tex): add Number highlighting to syntax file"

This (partly) reverts commits 8e6b5034f3 and 6065755a39

fixes: #16030

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 08:50:24 +01:00
Doug Kearns
7724d621f2 runtime(vim): Fix indent after :silent! function
See 35699f1749 (commitcomment-148816912)

closes: #16009

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:36:28 +01:00
zeertzjq
7c5152826f patch 9.1.0849: there are a few typos in the source
Problem:  there are a few typos in the source.
Solution: Correct typos (zeertzjq).

closes: #16026

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:26:12 +01:00
Christian Brabandt
5b63b236a0 runtime(netrw): directory symlink not resolved in tree view
closes: #16020

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:22:34 +01:00
Christian Brabandt
18defabaeb runtime(doc): add a table of supported Operating Systems
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:10:42 +01:00
Christian Brabandt
6065755a39 runtime(tex): update Last Change header in syntax script
related: #11271

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 14:10:52 +01:00
zeertzjq
060107cbc4 runtime(doc): fix typo in g:termdebug_config
closes: #16023

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 14:10:00 +01:00
Doug Kearns
bbe5252c2c runtime(vim): Update base-syntax, improve :normal highlighting
Fix command name termination, match bang, and allow a line-continued
argument.

closes: #15358

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 19:11:25 +01:00
amarakon
8e6b5034f3 runtime(tex): add Number highlighting to syntax file
closes: #11271

Signed-off-by: amarakon <amar.al-zubaidi45@tutanota.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 18:59:31 +01:00
h-east
624bb83619 runtime(doc): Tweak documentation style a bit
closes: #11419

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 18:37:32 +01:00
zeertzjq
50732c7ba6 patch 9.1.0848: if_lua: v:false/v:true are not evaluated to boolean
Problem:  if_lua: v:false/v:true are not evaluated to boolean
Solution: Use lua_pushboolean() instead of lua_pushinteger().
          (zeertzjq)

fixes: #15994
closes: #11419

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 18:31:08 +01:00
Dani Dickstein
a14c457cad runtime(dune): use :setl instead of :set in ftplugin
closes: #11419

Signed-off-by: Dani Dickstein <daniel.dickstein@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 11:53:54 +01:00
Ella Moss
5e7f43b6ac runtime(termdebug): allow to use decimal signs
closes: #16011

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Ella Moss <ella.moss@utah.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 11:32:15 +01:00
Antonio Giovanni Colombo
815c822aaf translation(it): Updated Italian vimtutor
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-08 18:53:56 +01:00
Konfekt
0f60fbf679 runtime(compiler): improve cppcheck
Properly escape the values for makeprg according to the :set rules

closes: #16014

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-08 18:51:52 +01:00
Christian Brabandt
07c9ab8c05 git: git-blame-ignore-revs shown as an error on Github
So let's move the comment above the actual revision.

related:
8854244587 (commitcomment-148723832)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-08 12:45:58 +01:00
Christian Brabandt
28d3941ede patch 9.1.0847: tests: test_popupwin fails because of updated help file
Problem:  tests: test_popupwin fails because of updated main help file
Solution: normalize Last Change header in test_popup_setbuf screendumps

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 23:05:57 +01:00
Yee Cheng Chin
d91124f926 patch 9.1.0846: debug symbols for xxd are not cleaned in Makefile
Problem:  debug symbols for xxd are not cleaned in Makefile
Solution: remove  xxd.dSYM in xxds Makefile, call xxd clean target from
          main Makefile (Yee Cheng Chin)

Remove xxd.dSYM folder when calling `make clean`. On macOS, when
compiling with debug info, clang will generate a "dSYM" folder that
contains debug symbols for the executable because unlike Linux, the
DWARF data is not embedded in the executable itself.

closes: #16010

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 22:11:06 +01:00
Duke
39f52a6249 runtime(structurizr): Update structurizr syntax
closes: #16003

Signed-off-by: Duke <emersonalmeidax@gmail.com>
Signed-off-by: Bastian Venthur <venthur@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 22:05:32 +01:00
Ron Aaron
6e410c9112 runtime(8th): updated 8th syntax
closes: #16005

Signed-off-by: Ron Aaron <ron@aaron-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:59:44 +01:00
h-east
c9e8640476 runtime(doc): Add pi_tutor.txt to help TOC
closes: #16006

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:53:45 +01:00
Konfekt
6d9a145d71 runtime(compiler): add mypy and ruff compiler; update pylint linter
mypy and ruff come from
https://github.com/Konfekt/vim-compilers/tree/master/compiler and the
former was added by @pbnj-dragon

closes: #16007

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:40:22 +01:00
Tom Benham
64a536d4fa runtime(netrw): fix several bugs in netrw tree listing
fixes: #5630
fixes: #9807
fixes: #14623
closes: #15996

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:31:49 +01:00
Christian Brabandt
a063b22b3b runtime(netrw): prevent polluting the search history
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 14:31:09 +01:00
Aliaksei Budavei
715a58fda6 patch 9.1.0845: vimtutor shell script can be improved
Problem:  vimtutor shell script can be improved
Solution: further improve the vimtutor shell script
          (Aliaksei Budavei)

- Rewrite the script usage note.
- Reconcile the usage help output with the manual page entry
  that describes the implementation in that:
  * a language code argument can be used alone or with its
    option key, e.g. "vimtutor -l nl" or "vimtutor nl";
  * a chapter number argument cannot be used without its
    option key, e.g. "vimtutor -c 2".
- Accept only chapters 1 or 2 as valid chapter arguments.
- Double-quote instances of shell parameter expansion where
  neither pathname expansion nor field splitting is desired.
- Prefer "$(foo)" to "`foo`" for command substitution.
- Follow a single indentation style (see the modeline).

closes: #15992

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 21:58:53 +01:00
Ben Jackson
ea19e7856b patch 9.1.0844: if_python: no way to pass local vars to python
Problem:  if_python: no way to pass local vars to python
Solution: Add locals argument to py3eval(), pyeval() and pyxeval()
          (Ben Jackson)

fixes: #8573
closes: #10594

Signed-off-by: Ben Jackson <puremourning@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 21:53:07 +01:00
John Marriott
fd1a838d36 patch 9.1.0843: too many strlen() calls in undo.c
Problem:  too many strlen() calls in undo.c
Solution: refactor code and remove strlen() calls, update test_undo.vim
          and close remaining open swap files (John Marriott)

closes: #15995

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 21:39:15 +01:00
Yee Cheng Chin
39cd9061b1 runtime(doc): update default value for fillchars option
closes: #15998

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 20:20:57 +01:00
Enno
3780c11267 runtime(compiler): fix typo in cppcheck compiler plugin
closes: #16002

Signed-off-by: Enno <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 20:14:49 +01:00
Christian Brabandt
5ccac75d96 runtime(doc): simplify vimtutor manpage a bit more
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 21:03:17 +01:00
Matteo Landi
59834ba6df runtime(matchparen): Add matchparen_disable_cursor_hl config option
Set the "matchparen_disable_cursor_hl" config variable to disable
highlighting the cursor with the MatchParen highlighting group.

closes: #15984

Signed-off-by: Matteo Landi <matteo@matteolandi.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 20:46:54 +01:00
Jonas Sortie Termansen
8bb5eaf019 patch 9.1.0842: not checking for the sync() systemcall
Problem:  not checking for the sync() systemcall
Solution: check for sync in configure script, fix related #ifdefs
          (Jonas Termansen)

It's better to check for features directly rather than maintaining a
denylist of operating systems without them.

closes: #15985

Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 20:36:41 +01:00
Yee Cheng Chin
cef8ab2c75 patch 9.1.0841: tests: still preferring python2 over python3
Problem:  tests: still preferring python2 over python3
Solution: prefer Python 3 when picking a Python program in Vim tests,
          by checking for the more specific python version first and
          only when python3 not found, check for the python binary
          (Yee Cheng Chin)

Most OSes have Python 3 mapped to `python3` instead of `python`. Vim
tests should prioritize using that instead of Python 2 in case that is
still installed on the host system.

closes: #15986

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 20:26:47 +01:00
Serhii Khoma
c04bc64ba6 patch 9.1.0840: filetype: idris2 files are not recognized
Problem:  filetype: idris2 files are not recognized
Solution: detect '*.idr' files as idris2, '*.lidr' files as lidris2
          and '*.ipkg' files as ipkg filetype (Serhii Khoma)

closes: #15987

Signed-off-by: Serhii Khoma <srghma@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 20:14:43 +01:00
Riley Bruins
93f65a4ab8 patch 9.1.0839: filetype: leo files are not recognized
Problem:  filetype: leo files are not recognized
Solution: detect '*.leo' files as leo filetype, include
          a filetype plugin (Riley Bruins)

References:
https://github.com/ProvableHQ/leo

closes: #15988

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 19:58:45 +01:00
Riley Bruins
19bc76c929 runtime(cook): include cook filetype plugin
References:
https://github.com/cooklang/spec?tab=readme-ov-file#comments

closes: #15989

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 19:50:47 +01:00
James McCoy
9dadfe7a52 runtime(debversions): Update Debian versions
- Move mantic to unsupported
- Reorder names to maintain alphabetic order
- Bump date to submit upstream

closes: #15991

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 19:48:37 +01:00
Aliaksei Budavei
09cc8c92d1 patch 9.1.0838: vimtutor is bash-specific
Problem:  vimtutor is bash-specific (after 17c71daf83)
Solution: port back to POSIX sh (Aliaksei Budavei).

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 19:43:22 +01:00
Christian Brabandt
ac2bb9dfea runtime(doc): add help specific modeline to pi_tutor.txt
related: #6414

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-04 19:37:24 +01:00
Christian Brabandt
c39c0230c4 Filelist: vimtutor chapter 2 is missing in Filelist
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 21:22:08 +01:00
Jonas Sortie Termansen
2cf145b78b patch 9.1.0837: cross-compiling has some issues
Problem:  Cross-compiling to good modern operating systems is difficult as
          configure assumes obscure bugs are present by default. However,
          most core autoconf-based packages today assume features work
          when in doubt, making cross-compilation easier.
Solution: Assume features work by default and continue to issue a warning
          with the appropriate cache variable. This solution shifts the
          burden onto the users of rare buggy operating systems and
          makes cross-compilation work out of the box for everyone else.

The vim_cv_terminfo test was accidentally negated, where the yes case
was in the error handler, leading to false positives if the test program
failed to compile.

Split the timer_create detection into two phases: First locating the
the library containing timer_create, and then another check to check
if timer_create works to properly support cross-compilation.

Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 20:58:21 +01:00
Paul Desmond Parker
17c71daf83 runtime(vimtutor): Add a second chapter
fixes: #5719
closes: #5729

Signed-off-by: Paul Desmond Parker <pauldesmondparker@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 20:54:32 +01:00
Yegappan Lakshmanan
a54816b884 patch 9.1.0836: The vimtutor can be improved
Problem:  the vimtutor can be improved
Solution: port and include the interactive vimtutor plugin from Neovim
          (by Felipe Morales) (Yegappan Lakshmanan)

closes: #6414

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-03 11:01:10 +01:00
zeertzjq
6eda269600 patch 9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu'
Problem:  :setglobal doesn't work properly for 'ffu' and 'tsrfu' when
          the local value is set (after v9.1.0831)
Solution: Check os_flags instead of buffer option variable (zeertzjq).

closes: #15980

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 09:23:33 +01:00
Aliaksei Budavei
ca6231b8a6 patch 9.1.0834: tests: 2html test fails
Problem:  tests: 2html test fails (after b256221e83)
Solution: Adjust testdir/samples/Test_tohtml_basic.c.html
          (Aliaksei Budavei)

closes: #15981

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 09:19:14 +01:00
Aliaksei Budavei
9fd5d9674f patch 9.1.0833: CI: recent ASAN changes do not work for indent tests
Problem:  CI: recent ASAN changes do not work for indent tests
Solution: Move code to runtime/indent/testdir/runtest.vim
          (Aliaksei Budavei)

closes: #15981

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 09:15:35 +01:00
zeertzjq
46dcd84d24 patch 9.1.0832: :set doesn't work for 'cot' and 'bkc' after :setlocal
Problem:  :set doesn't work for 'cot' and 'bkc' after :setlocal.
Solution: clear the local flags when using :set (zeertzjq).

closes: #15981

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 09:10:50 +01:00
Christian Brabandt
6081c17890 runtime(doc): update help-toc description
related: #10446

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-03 09:06:10 +01:00
Max Bernstein
b256221e83 runtime(2html): Make links use color scheme colors in TOhtml
The browser-default dark blue/purple colors don't fit in with most color
schemes and also are unreadable if the color scheme has a dark
background.

closes: #10191

Signed-off-by: Max Bernstein <tekknolagi@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 18:48:53 +01:00
Yegappan Lakshmanan
a13f3a4f5d patch 9.1.0831: 'findexpr' can't be used as lambad or Funcref
Problem:  'findexpr' can't be used for lambads
          (Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
          (Yegappan Lakshmanan)

related: #15905
closes: #15976

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 18:43:42 +01:00
Christian Brabandt
0b8176dff2 Filelist: include helptoc package
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 18:20:30 +01:00
lagygoill
b3ec5643cd runtime(doc): include a TOC Vim9 plugin
closes: #10446

See :h help-TOC

Signed-off-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 17:58:33 +01:00
Christian Brabandt
29ce419076 Filelist: ignore .git-blame-ignore-revs
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:49:57 +01:00
glepnir
bc10be7a40 patch 9.1.0830: using wrong highlight group for spaces for popupmenu
Problem:  using wrong highlight group for spaces for popupmenu
Solution: use original attribute instead of combined attributed
          (glepnir)

closes: #15978

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:45:01 +01:00
Yinzuo Jiang
d181bafd0b runtime(typst): synchronize updates from the upstream typst.vim
2 commits included from the upstream:

- 2a4a0e0662
- 50e89f4811

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:35:46 +01:00
Christian Brabandt
8854244587 git: ignore reformatting commit for git-blame (after v9.1.0829)
See:
https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile

Enable this using the following command in your copy:
git config blame.ignoreRevsFile .git-blame-ignore-revs

Github should pick it up automatically

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:29:55 +01:00
Luca Saccarola
8ce738de3f patch 9.1.0829: Vim source code uses a mix of tabs and spaces
Problem:  Vim source code uses a mix of tabs and spaces
Solution: Expand tabs in sound.c, this is an experiment
          (Luca Saccarola)

closes: #15969

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:22:45 +01:00
John Marriott
8d4477ef22 patch 9.1.0828: string_T struct could be used more often
Problem:  string_T struct could be used more often
Solution: Refactor code and make use of string_T struct
          for key-value pairs, reformat overlong lines
          (John Marriott)

closes: #15975

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:11:58 +01:00
Aliaksei Budavei
f1d83c4c71 patch 9.1.0827: CI: tests can be improved
Problem:  CI: tests can be improved
Solution: collect failed indent tests, raise timeout for search()
          functions when using ASAN/Valgrind (Aliaksei Budavei)

ASan-instrumented Vim builds tend to run slower (x2) than
non-instrumented Vim builds and occasionally make indent
tests fail when "search*()" functions time out and give up
further execution.

Reference:
https://github.com/google/sanitizers/wiki/AddressSanitizer

closes: #15974

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 15:51:14 +01:00
S. B. Tam
a95d6a3d64 runtime(doc): remove stray sentence in pi_netrw.txt
closes: #15971

Signed-off-by: S. B. Tam <cpplearner@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 15:48:54 +01:00
Riley Bruins
84b5b1c660 patch 9.1.0826: filetype: sway files are not recognized
Problem:  filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
          a filetype plugin (Riley Bruins)

References:
 https://github.com/FuelLabs/sway.

Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types

closes: #15973

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 15:44:43 +01:00
Ernesto Elsäßer
26113e5ae3 runtime(doc): Include netrw-gp in TOC
closes: #7627

Signed-off-by: Ernesto Elsäßer <ernesto.elsaesser@me.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-01 23:17:03 +01:00
Christian Brabandt
b5e7da1f27 runtime(doc): mention 'iskeyword' at :h charclass()
fixes: #15965

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-01 09:33:00 +01:00
Christian Brabandt
15f69de263 runtime(doc): update help tags
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 11:08:40 +01:00
John Marriott
69f85c6506 patch 9.1.0825: compile error for non-diff builds
Problem:  compile error for non-diff builds
          (after v9.1.0822)
Solution: Add #ifdef FEAT_DIFF (John Marriott)

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:54:10 +01:00
Tom Benham
4d618006ec runtime(netrw): fix E874 when browsing remote directory which contains ~ character
closes: #15964

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:47:23 +01:00
Luca Saccarola
55adc5b46a runtime(doc): update coding style documentation
closes: #15939

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-10-31 10:28:40 +01:00
Simon Quigley
6be21b937d runtime(debversions): Add plucky (25.04) as Ubuntu release name
closes: #15882

Signed-off-by: Simon Quigley <tsimonq2@ubuntu.com>
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:18:05 +01:00
John Marriott
79f6ffd388 patch 9.1.0824: too many strlen() calls in register.c
Problem:  too many strlen() calls in register.c
Solution: refactor code, add string_T struct to keep track
          of string lengths (John Marriott)

closes: #15952

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:09:04 +01:00
Xudong Zheng
a68bd6f089 patch 9.1.0823: filetype: Zephyr overlay files not recognized
Problem:  filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
          include syntax tests for DTS files
          (Xudong Zheng)

Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html

closes: #15963

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 09:32:25 +01:00
Yee Cheng Chin
d52fb2fabd runtime(doc): Clean up minor formatting issues for builtin functions
closes: #15966

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 09:25:09 +01:00
Christian Brabandt
8b0fa7a565 runtime(netrw): make :Launch/Open autoloadable
fixes: #15959
closes: #15962

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 09:21:23 +01:00
Christian Brabandt
9f32069b8c runtime(netrw): fix regression with x mapping on Cygwin
related: #13687

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:37:06 +01:00
Christian Brabandt
aa2ce6f580 runtime(netrw): fix filetype detection for remote files
fixes: #15961

while at it, remove the Decho comments in the s:NetrwOptionsRestore()
function

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:27:03 +01:00
Christian Brabandt
05a40e07c2 patch 9.1.0822: topline might be changed in diff mode unexpectedly
Problem:  topline might be changed in diff mode unexpectedly
          (Jaehwang Jung)
Solution: do not re-calculate topline, when using line() func
          in diff mode.

fixes: #15812
closes: #15950

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-29 20:29:04 +01:00
Christian Brabandt
203c7225f5 CI: huge linux builds should also run syntax & indent tests
closes: #15960

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-29 20:27:34 +01:00
zeertzjq
20e045f781 patch 9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument
Problem:  'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).

closes: #15934

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 22:05:26 +01:00
Milly
baab7c0865 patch 9.1.0820: tests: Mac OS tests are too flaky
Problem:  tests: Mac OS tests are too flaky
Solution: Increase max test timeout to 25 minutes,
          allow up to 10 retries on Mac OS runners,
          refactor runtest.vim (Milly).

closes: #15940

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 21:56:50 +01:00
John M Devin
1e2007e643 runtime(awk): Highlight more awk comments in syntax script
closes: #15944

Signed-off-by: John M Devin <john.m.devin@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 21:46:09 +01:00
Christian Brabandt
d69ffbe4bc runtime(netrw): add missing change for s:redir()
Somehow, that change got lost in commit 70197885

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 21:24:47 +01:00
Yegappan Lakshmanan
bdac2ef6fe patch 9.1.0819: tests: using findexpr and imported func not tested
Problem:  tests: need a test for findexpr and vim9 imported func
Solution: Add a test for 'findexpr' and Vim9 imported script
          (Yegappan Lakshmanan)

closes: #15954

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 21:01:28 +01:00
Enno
70197885a8 runtime(netrw): improve netrw's open-handling further
closes: #15956

Signed-off-by: Enno <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 20:47:25 +01:00
Christian Brabandt
7c96776729 runtime(netrw): fix syntax error in netrwPlugin.vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 07:03:24 +01:00
Konfekt
3d7e567ea7 runtime(netrw): simplify gx file handling
It did not work very well, at least on Debian 12, and I am not sure Git
Bash and WSL, for example, were taken care of as maintenance stalled.

The whole logic was somewhat convoluted with some parts repeatedly invoking
failed commands.

The file handling was outdated, for example, nowadays Netscape is rarely
used, and also opinionated, for example mainly Microsoft Paint and Gimp for
Image files.

Instead, let's use (xdg-)open and similar commands on other systems
which respects the user's preferences.

closes: #15721

Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 22:16:49 +01:00
Yegappan Lakshmanan
a04003a929 patch 9.1.0818: some global functions are only used in single files
Problem:  some global functions are only used in single files
Solution: refactor code slightly and make some more functions static
          (Yegappan Lakshmanan)

closes: #15951

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 21:54:11 +01:00
Peter Wolf
8f1d09828a patch 9.1.0817: termdebug: cannot evaluate expr in a popup
Problem:  termdebug: cannot evaluate expr in a popup
Solution: enhance termdebug plugin and allow to evaluate expressions in
          a popup window, add a unit test (Peter Wolf).

fixes: #15877
closes: #15933

Signed-off-by: Peter Wolf <pwolf2310@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 21:51:14 +01:00
Christian Brabandt
2abec431e1 runtime(defaults): Detect putty terminal and switch to dark background
Vim tries to determine the default background and checks for $TERM
and even checks for the "putty" value. But unfortunately, putty by
default uses "xterm" as $TERM value and as such Vim uses a "light"
background.

So use a TermResponse autocommand to set the background for putty back
to dark.

Note: this only works on non-tiny builds and when defaults.vim is in
use.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 21:36:09 +01:00
Christian Brabandt
ce35ee8986 patch 9.1.0816: tests: not clear what tests cause asan failures
Problem:  tests: not clear what tests cause asan failures
Solution: append testname to $ASAN_OPTIONS

Mention what test causes ASAN failures by appending the testname
to log_path in $ASAN_OPTIONS/$UBSAN_OPTIONS. This assumes 'log_path' is
always the last sub-option in $ASAN_OPTIONS.

While at it, also make the CI run with `-O0` instead of `-O1` when ASAN
is enable since this causes line numbers to disappear.

closes: #15927

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 21:15:50 +01:00
Yegappan Lakshmanan
912fbaf6e8 runtime(doc): Remove some completed items from todo.txt
closes: #15949

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 20:46:42 +01:00
zeertzjq
91d26aa338 patch 9.1.0815: "above" virtual text causes wrong 'colorcolumn' position
Problem:  "above" virtual text causes wrong 'colorcolumn' position.
          (@matrdr)
Solution: Use the number of cells instead of bytes for vcol_off_tp.
          (zeertzjq)

fixes: #15946
closes: #15948

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 19:24:53 +01:00
Christian Brabandt
de79f9129a runtime(syntax-tests): tiny vim fails because of line-continuation
Problem:  tiny vim fails because of line-continuation, although
          the test script should be skipped for non-eval builds of Vim.
Solution: :set cpo&vim

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-24 23:03:10 +02:00
zeertzjq
fdf135a052 patch 9.1.0814: mapset() may remove unrelated mapping
Problem:  mapset() may remove unrelated mapping whose {rhs} matches the
          restored mapping's {lhs}.
Solution: only match by {lhs} when unmapping for mapset() (zeertzjq).

closes: #15935

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-24 21:43:43 +02:00
Milly
118072862b patch 9.1.0813: no error handling with setglobal and number types
Problem:  no error handling with setglobal and number types
Solution: validate values when using :setglobal with number option types
          (Milly)

closes: #15928

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-23 21:42:41 +02:00
Christian Brabandt
d0809869d6 patch 9.1.0812: Coverity warns about dereferencing NULL ptr
Problem:  Coverity warns about dereferencing NULL ptr
          in check_colorcolumn()
Solution: verify that wp is not null before accessing it

related: #15914

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-23 21:32:31 +02:00
Yegappan Lakshmanan
2f6efaccfd patch 9.1.0811: :find expansion does not consider 'findexpr'
Problem:  :find expansion does not consider 'findexpr'
Solution: Support expanding :find command argument using 'findexpr'
          (Yegappan Lakshmanan)

closes: #15929

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-23 21:06:10 +02:00
Yegappan Lakshmanan
aeb1c97db5 patch 9.1.0810: cannot easily adjust the |:find| command
Problem:  cannot easily adjust the |:find| command
Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan)

closes: #15901
closes: #15905

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 23:42:20 +02:00
Wu, Zhenyu
626b6ab486 patch 9.1.0809: filetype: petalinux config files not recognized
Problem:  filetype: petalinux config files not recognized
Solution: detect 'project-spec/*.conf' files as bitbake filetype
          (Wu, Zhenyu)

References:
https://www.amd.com/en/products/software/adaptive-socs-and-fpgas/embedded-software/petalinux-sdk.html

closes: #15926

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 23:23:56 +02:00
Milly
6d5f4a0bed patch 9.1.0808: Terminal scrollback doesn't shrink when decreasing 'termwinscroll'
Problem:  Terminal scrollback doesn't shrink when reducing
          'termwinscroll'
Solution: Check if option value was decreased (Milly).

closes: #15904

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 23:17:45 +02:00
zeertzjq
3e5bbb8e11 patch 9.1.0807: tests: having 'nolist' in modelines isn't always desired
Problem:  tests: having 'nolist' in modelines isn't always desired
Solution: remove 'nolist' from modeline (zeertzjq)

closes: #15910

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 23:11:27 +02:00
Milly
b38700ac81 patch 9.1.0806: tests: no error check when setting global 'briopt'
Problem:  tests: no error check when setting global 'briopt'
Solution: also parse and check global 'briopt' value (Milly)

closes: #15911

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 22:59:39 +02:00
Milly
231480f975 patch 9.1.0805: tests: minor issues in gen_opt_test.vim
Problem:  tests: minor issues in gen_opt_test.vim
Solution: fix restore value for 'undolevels', fix comment, fix
          wrong cpo value, add equality test for global-local options on
          switchback (Milly).

closes: #15913

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 22:53:01 +02:00
271 changed files with 13429 additions and 4732 deletions

View File

@@ -22,9 +22,10 @@ freebsd_task:
- chown -R cirrus:cirrus .
- sudo -u cirrus make test
on_failure:
screendump_artifacts:
test_artifacts:
name: "Cirrus-CI-freebsd-failed-tests"
path: |
runtime/indent/testdir/*.fail
runtime/syntax/testdir/failed/*
src/testdir/failed/*
type: application/octet-stream

254
.clang-format Normal file
View File

@@ -0,0 +1,254 @@
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseColons: false
AlignEscapedNewlines: DontAlign
AlignOperands: Align
AlignTrailingComments:
Kind: Leave
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: AllDefinitions
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
KeepEmptyLinesAtEOF: false
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 4
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 1000000000
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PPIndentWidth: 1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: false
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SkipMacroDefinitionBody: false
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: c++03
TabWidth: 8
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
# Taken from:
# git grep '^#define *FOR_*' src | cut -d':' -f2 | grep -o '[A-Z]*_.*(' \
# | tr -d '(' | LC_ALL=C sort -u
ForEachMacros:
- 'FOR_ALL_AUTOCMD_PATTERNS'
- 'FOR_ALL_BUFFERS'
- 'FOR_ALL_BUFS_FROM_LAST'
- 'FOR_ALL_BUF_WININFO'
- 'FOR_ALL_CHANNELS'
- 'FOR_ALL_CHILD_MENUS'
- 'FOR_ALL_DIFFBLOCKS_IN_TAB'
- 'FOR_ALL_FRAMES'
- 'FOR_ALL_HASHTAB_ITEMS'
- 'FOR_ALL_JOBS'
- 'FOR_ALL_LIST_ITEMS'
- 'FOR_ALL_MENUS'
- 'FOR_ALL_NODE_SIBLINGS'
- 'FOR_ALL_POPUPWINS'
- 'FOR_ALL_POPUPWINS_IN_TAB'
- 'FOR_ALL_QFL_ITEMS'
- 'FOR_ALL_SIGNS'
- 'FOR_ALL_SIGNS_IN_BUF'
- 'FOR_ALL_SPELL_LANGS'
- 'FOR_ALL_SYNSTATES'
- 'FOR_ALL_TABPAGES'
- 'FOR_ALL_TAB_WINDOWS'
- 'FOR_ALL_TERMS'
- 'FOR_ALL_TIMERS'
- 'FOR_ALL_WATCHERS'
- 'FOR_ALL_WINDOWS'
- 'FOR_ALL_WINDOWS_IN_TAB'
...

25
.editorconfig Normal file
View File

@@ -0,0 +1,25 @@
# https://spec.editorconfig.org/#supported-pairs
root = true
[*]
indent_style = tab
tab_width = 8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{c,h,proto}]
indent_size = 4
[*.{md,yml,sh,bat}]
# This will become the default after we migrate the codebase
indent_style = space
indent_size = 2
[*.md]
# Markdown uses trailing whitespaces to do an hard line break
# https://spec.commonmark.org/0.31.2/#hard-line-breaks
trim_trailing_whitespace = false
[runtime/doc/**.txt]
# It can mess up some documentation by trying to strip trailing whitespaces
trim_trailing_whitespace = false

12
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,12 @@
# When making commits that are strictly formatting/style changes, add the
# commit hash here, so git blame can ignore the change. See docs for more details:
#
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile
#
# Run this command to always ignore formatting commits in git blame
# git config blame.ignoreRevsFile .git-blame-ignore-revs
# Patch v9.1.0829 expanded tabs to spaces in sound.c
8ce738de3fd7192fa6274730594305cde780074c
# Patch v9.1.0879 reformated sound.c and sign.c
3cf094edaff815141d9941b8dba52b9e77d8dfc1

8
.github/MAINTAINERS vendored
View File

@@ -128,6 +128,7 @@ runtime/ftplugin/chatito.vim @ObserverOfTime
runtime/ftplugin/chicken.vim @evhan
runtime/ftplugin/clojure.vim @axvr
runtime/ftplugin/cmakecache.vim @ribru17
runtime/ftplugin/cook.vim @ribru17
runtime/ftplugin/cs.vim @nickspoons
runtime/ftplugin/csh.vim @dkearns
runtime/ftplugin/css.vim @dkearns
@@ -201,6 +202,7 @@ runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo
runtime/ftplugin/kivy.vim @ribru17
runtime/ftplugin/kotlin.vim @udalov
runtime/ftplugin/ldapconf.vim @ribru17
runtime/ftplugin/leo.vim @ribru17
runtime/ftplugin/less.vim @genoma
runtime/ftplugin/lex.vim @ribru17
runtime/ftplugin/liquid.vim @tpope
@@ -215,6 +217,7 @@ runtime/ftplugin/meson.vim @Liambeguin
runtime/ftplugin/modula2.vim @dkearns
runtime/ftplugin/modula3.vim @dkearns
runtime/ftplugin/mojo.vim @ribru17
runtime/ftplugin/mss.vim @Freed-Wu
runtime/ftplugin/nginx.vim @chr4
runtime/ftplugin/nim.vim @ribru17
runtime/ftplugin/nroff.vim @a-vrma
@@ -222,6 +225,7 @@ runtime/ftplugin/nsis.vim @k-takata
runtime/ftplugin/nu.vim @mrcjkb
runtime/ftplugin/octave.vim @dkearns
runtime/ftplugin/ondir.vim @jparise
runtime/ftplugin/opencl.vim @Freed-Wu
runtime/ftplugin/openvpn.vim @ObserverOfTime
runtime/ftplugin/pascal.vim @dkearns
runtime/ftplugin/pbtxt.vim @lakshayg
@@ -263,6 +267,7 @@ runtime/ftplugin/squirrel.vim @ribru17
runtime/ftplugin/ssa.vim @ObserverOfTime
runtime/ftplugin/sshdconfig.vim @jiangyinzuo
runtime/ftplugin/svelte.vim @igorlfs
runtime/ftplugin/sway.vim @ribru17
runtime/ftplugin/swayconfig.vim @jamespeapen
runtime/ftplugin/systemverilog.vim @Kocha
runtime/ftplugin/swig.vim @jmarrec
@@ -488,6 +493,7 @@ runtime/syntax/json.vim @vito-c
runtime/syntax/jsonc.vim @izhakjakov
runtime/syntax/julia.vim @carlobaldassi
runtime/syntax/jq.vim @vito-c
runtime/syntax/karel.vim @kirillmorozov
runtime/syntax/kconfig.vim @chrisbra
runtime/syntax/kivy.vim @prophittcorey
runtime/syntax/kotlin.vim @udalov
@@ -513,6 +519,7 @@ runtime/syntax/modula2/opt/iso.vim @trijezdci
runtime/syntax/modula2/opt/pim.vim @trijezdci
runtime/syntax/modula2/opt/r10.vim @trijezdci
runtime/syntax/modula3.vim @dkearns
runtime/syntax/mss.vim @Freed-Wu
runtime/syntax/n1ql.vim @pr3d4t0r
runtime/syntax/nginx.vim @chr4
runtime/syntax/ninja.vim @nico
@@ -520,6 +527,7 @@ runtime/syntax/nix.vim @equill
runtime/syntax/nroff.vim @jmarshall
runtime/syntax/nsis.vim @k-takata
runtime/syntax/ondir.vim @jparise
runtime/syntax/opencl.vim @Freed-Wu
runtime/syntax/openvpn.vim @ObserverOfTime
runtime/syntax/pacmanlog.vim @rpigott
runtime/syntax/pascal.vim @dkearns

View File

@@ -1,5 +1,5 @@
name: 'screendump'
description: "Upload failed screendump tests"
name: 'test_artifacts'
description: "Upload failed test artifacts"
runs:
using: "composite"
steps:
@@ -12,6 +12,7 @@ runs:
# A file, directory or wildcard pattern that describes what
# to upload.
path: |
${{ github.workspace }}/runtime/indent/testdir/*.fail
${{ github.workspace }}/runtime/syntax/testdir/failed/*
${{ github.workspace }}/src/testdir/failed/*
# The desired behavior if no files are found using the

View File

@@ -171,7 +171,7 @@ jobs:
normal)
;;
huge)
echo "TEST=scripttests test_libvterm"
echo "TEST=scripttests test_libvterm indenttest syntaxtest"
INTERFACE=${{ matrix.interface || 'yes' }}
if ${{ matrix.python3 == 'stable-abi' }}; then
PYTHON3_CONFOPT="--with-python3-stable-abi=3.8"
@@ -194,9 +194,9 @@ jobs:
echo "TEST=unittests"
fi
if ${{ contains(matrix.extra, 'asan') }}; then
echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
echo "SANITIZER_CFLAGS=-g -O0 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
echo "ASAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/asan"
echo "UBSAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/ubsan"
echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
fi
if ${{ contains(matrix.extra, 'vimtags') }}; then
@@ -268,11 +268,11 @@ jobs:
- name: Test
timeout-minutes: 25
run: |
do_test() { sg audio "sg $(id -gn) '$*'"; }
do_test() { echo "$*"; sg audio "sg $(id -gn) '$*'"; }
do_test make ${SHADOWOPT} ${TEST}
- if: ${{ !cancelled() }}
uses: ./.github/actions/screendump
uses: ./.github/actions/test_artifacts
- name: Vim tags
if: contains(matrix.extra, 'vimtags')
@@ -295,15 +295,16 @@ jobs:
- name: Codecov
timeout-minutes: 20
if: matrix.coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ join(matrix.extra, '-') }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: ASan logs
if: contains(matrix.extra, 'asan') && !cancelled()
run: |
for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
echo "$f"
asan_symbolize -l "$f"
false # in order to fail a job
done
@@ -388,12 +389,12 @@ jobs:
brew install diffutils
- name: Test
timeout-minutes: 20
timeout-minutes: 25
run: |
make ${TEST}
- if: ${{ !cancelled() }}
uses: ./.github/actions/screendump
uses: ./.github/actions/test_artifacts
windows:
runs-on: windows-2022
@@ -703,7 +704,7 @@ jobs:
)
- if: ${{ !cancelled() }}
uses: ./.github/actions/screendump
uses: ./.github/actions/test_artifacts
- name: Generate gcov files
if: matrix.coverage
@@ -715,7 +716,7 @@ jobs:
- name: Codecov
timeout-minutes: 20
if: matrix.coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
directory: src
flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}

View File

@@ -5,18 +5,21 @@
SRC_ALL = \
.cirrus.yml \
.gitattributes \
.git-blame-ignore-revs \
.github/MAINTAINERS \
.github/ISSUE_TEMPLATE/bug_report.yml \
.github/ISSUE_TEMPLATE/feature_request.md \
.github/workflows/ci.yml \
.github/workflows/codeql-analysis.yml \
.github/actions/screendump/action.yml \
.github/workflows/coverity.yml \
.github/actions/test_artifacts/action.yml \
.github/dependabot.yml \
.gitignore \
.hgignore \
.appveyor.yml \
.clang-format \
.codecov.yml \
.editorconfig \
ci/appveyor.bat \
ci/config.mk*.sed \
ci/if_ver*.vim \
@@ -704,6 +707,8 @@ RT_ALL = \
README_VIM9.md \
LICENSE \
CONTRIBUTING.md \
lang/LICENSE.itx \
lang/README.itx \
runtime/bugreport.vim \
runtime/doc/*.awk \
runtime/doc/*.pl \
@@ -761,7 +766,13 @@ RT_ALL = \
runtime/tools/[a-z]*[a-z0-9] \
runtime/tutor/README.txt \
runtime/tutor/tutor \
runtime/tutor/en/vim-01-beginner.tutor \
runtime/tutor/en/vim-01-beginner.tutor.json \
runtime/tutor/tutor.tutor \
runtime/tutor/tutor.tutor.json \
runtime/tutor/tutor.vim \
runtime/tutor/tutor2 \
runtime/tutor/tutor2.utf-8 \
runtime/vimrc_example.vim \
runtime/pack/dist/opt/cfilter/plugin/cfilter.vim \
runtime/pack/dist/opt/comment/plugin/comment.vim \
@@ -783,6 +794,8 @@ RT_ALL = \
runtime/pack/dist/opt/editorconfig/doc/editorconfig.txt \
runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \
runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \
runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \
runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \
runtime/pack/dist/opt/justify/plugin/justify.vim \
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
runtime/pack/dist/opt/matchit/doc/matchit.txt \

99
lang/LICENSE.itx Normal file
View File

@@ -0,0 +1,99 @@
LICENZA VIM
Nota: Agli effetti legali ha valore non la seguente traduzione italiana, ma
l'originale inglese su cui è basata. È alla versione inglese che si fa
riferimento qui sotto quando si parla di "questa licenza" (NdT).
I) Non ci sono restrizioni alla distribuzione di copie non modificate di Vim,
alla condizione che esse includano il testo di questa licenza. Si possono
anche distribuire parti non modificate di Vim, sempre senza restrizioni,
alla condizione che esse includano il testo di questa licenza. È anche
consentito includere programmi eseguibili da voi preparati a partire dai
file sorgenti Vim non modificati, più i vostri esempi di utilizzo e i
vostri script Vim.
II) È consentito distribuire una versione modificata (o estesa) di Vim,
contenente programmi eseguibile e/o codice sorgente, quando siano
rispettare le seguenti quattro condizioni:
1) Il testo di questa licenza deve essere incluso senza modifiche.
2) La versione modificata di Vim dev'essere distribuita in una della
seguenti cinque maniere:
a) Se voi personalmente modificate a Vim, dovete descrivere
chiaramente nella distribuzione come è possibile mettersi in
contatto con voi. Quando il manutentore vi chiede (in qualsiasi
forma) una copia della versione modificata di Vim da voi
distribuita, dovete rendere disponibili le vostre modifiche,
compreso il codice sorgente, al manutentore, senza alcuna spesa.
Il manutentore si riserva il diritto di includere le vostre
modifiche nella versione ufficiale di Vim. Quel che il manutentore
potrà fare con le vostre modifiche e sotto quale licenza esse
verranno distribuite può essere oggetto di negoziazione. Se non c'è
stata alcuna negoziazione, questa licenza, o una versione successiva
della stessa è anche applicabile alle vostre modifiche.
I manutentori correnti sono elencati qui:
https://github.com/orgs/vim/people.
Se dovessero cambiare, ne sarò dato annuncio nei luoghi appropriati
(verosimilmente vim.sf.net, www.vim.org e/o comp.editors). Quando
sia completamente impossibile contattare il manutentore, l'obbligo
di spedirgli le vostre modifiche viene meno. Una volta che il
manutentore abbia confermato di aver ricevuto le vostre modifiche,
non sarà necessario spedirle ulteriormente.
b) Se avete ricevuto un Vim modificato che era stato distribuito come
descritto al punto a) potete ulteriormente distribuirlo senza
modificarlo, come menzionato al punto I). Se fate ulteriori
modifiche, il testo al punto a) si applica a queste modifiche.
c) Includete tutte le modifiche, compreso il codice sorgente, con ogni
copia del Vim modificato da voi distribuito. Questo può essere
fatto sotto forma dell'output di un comando "diff", che contenga
anche il contesto [ossia anche le linee non modificate di sorgente
che vengono prima o dopo le modifiche - NdT]. Potete scegliere
quale licenza volete utilizzare per il nuovo codice sorgente che voi
aggiungere. Le modifiche e la relativa licenza non devono impedire
a terze parti di apportare le loro proprie modifiche a Vim.
d) Quando avete un Vim modificato che comprende modifiche quali quelle
menzionate al punto c), potete distribuirlo senza il codice sorgente
che descrive le modifiche, se le seguenti tre condizioni sono
soddisfatte:
- La licenza applicabile alle modifiche vi consente di distribuire
le modifiche al manutentore Vim senza alcun costo o restrizione, e
permette al manutentore Vim di includere le modifiche nella
versione ufficiale di Vim senza alcun costo o restrizione.
- Le modifiche da voi fatte sono conservate per almeno tre anni,
dopo che avrete distribuito per l'ultima volta il Vim modificato
corrispondente alle modifiche stesse. Quando il manutentore o
qualcuno a cui voi avete distribuito il Vim modificato vi chiede
(in qualsiasi forma) le modifiche, entro il periodo qui indicato,
dovete fargliele avere.
- Dovete descrivere chiaramente nella distribuzione come è possibile
mettersi in contatto con voi. Questa informazione di contatto
deve rimanere valida per almeno tre anni dopo l'ultima data di
distribuzione della corrispondente modifica di Vim, oppure il più
a lungo possibile.
e) Quando al GNU General Public License (GPL) si applica alle
modifiche, potete distribuire il Vim modificato sotto la versione 2
della licenza GNU GPL versione 2 o una qualsiasi versione successiva
della stessa licenza.
3) Un messaggio deve essere aggiunto, almeno all'output del comando
":version" e nella schermata introduttiva, in modo che l'utilizzatore
del Vim modificato sia in grado di comprendere cosa è stato modificato.
Quando si distribuisca come menzionato al punto 2)e) l'aggiunta del
messaggio è richiesta solo se ciò non conduca a conflitti con la
licenza usata per le modifiche.
4) L'informazione di contatto, richiesta ai punto 2)a) e 2)d) non deve
essere rimossa o modificata, tranne che per il fatto che la persona
stessa può apportare delle correzioni.
III) Se distribuite una versione modificata di Vim, siete incoraggiati a
utilizzare la licenza Vim per le vostre modifiche, e a mettere le
modifiche a disposizione del manutentore, compreso il codice sorgente.
Il modo preferito in cui fare questo è tramite e-mail o caricando
i file su un server ed inviandone l'indirizzo (URL) tramite e-mail.
Se il numero di modifiche è piccolo (per esempio, una modifica a un
Makefile) inviare tramite email l'output del comando diff con contesto
può essere sufficiente. L'indirizzo e-mail da utilizzare è
<maintainer@vim.org>
IV) Non è consentito rimuovere questa licenza dalla distribuzione dei codici
sorgente Vim, anche in parte, o da una versione di Vim modificata.
Potete usare questa licenza per precedenti versioni di Vim, invece della
licenza con cui esse sono state distribuite, a vostra scelta.

167
lang/README.itx Normal file
View File

@@ -0,0 +1,167 @@
README.txt per la versione 9.1 di Vim: VI Migliorato.
COS'È VIM?
Vim è una versione migliorata del classico programma di videoscrittura UNIX
Vi. Molte nuove funzionalità sono state aggiunte: la possibilità di avere
multipli annullamenti di comando, l'evidenziazione sintattica, una storia dei
comandi immessi, file di aiuto facilmente consultabili, controlli ortografici,
completamento di nomi di file, operazioni su blocchi di dati, un linguaggio di
script, etc. È anche disponibile una versione grafica (GUI). Tuttavia è
possibile lavorare come se si stesse usando il Vi "classico". Chi avesse Vi
"sulle dita" si troverà a suo agio. Vedere il file "runtime/doc/vi_diff.txt"
[in inglese] per dettagli sulle differenze di Vim rispetto a Vi.
Questo editor è molto utile per modificare programmi e altri file di testo.
Tutti i comandi sono immessi usando i tasti presenti sulla tastiera, in modo
che chi è in grado di digitare usando tutte e dieci le dita può lavorare molto
velocemente. Inoltre, i tasti funzione possono essere mappati per inserire
comandi dell'utente, ed è possibile usare il mouse.
Vim è disponibile in ambiente MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS e
in quasi tutte le varianti di Unix. L'adattamento a nuovi sistemi operativi
non dovrebbe essere molto difficile.
Precedenti versioni di Vim funzionano in ambiente MS-DOS, MS-Windows
95/98/Me/NT/2000/XP/Vista, Amiga DOS, Atari MiNT, BeOS, RISC OS e OS/2.
Tali versioni non sono più supportate.
DISTRIBUZIONE
Spesso è possibile usare il vostro Gestore applicazioni preferito per
installare Vim. Negli ambienti Mac e Linux una versione base di Vim è inclusa
nel sistema operativo, ma può ancora essere necessario installare Vim se si
desiderano funzionalità ulteriori.
Ci sono distribuzioni separate di Vim per gli ambienti Unix, PC, Amiga e per
qualche altro sistema operativo. Questo file README.txt è contenuto nelle
directory che contengono i file usati da Vim in fase di esecuzione. Nelle
stesse directory sono presente la documentazione, i file usati per
l'evidenziazione sintattica e altri file usati da Vim in fase di esecuzione.
Per installare Vim occorre ottenere un archivio che contiene solo i file
eseguibili, o un archivio che permette di compilare Vim a partire dai file
sorgente. Quale alternativa preferire dipende dal sistema su cui si vuole
usare Vim, e dal preferire (o meno) di compilarlo direttamente a partire dai
file sorgente. Consultate "https://www.vim.org/download.php" per una
panoramica delle distribuzioni correntemente disponibili.
Alcuni siti da cui ottenere l'ultima versione di Vim:
* Consultare la repository git in github: https://github.com/vim/vim.
* Procurarsi il codice sorgente come archivio https://github.com/vim/vim/tags.
* Ottenere un file per installare Vim in ambiente Windows dalla repository
vim-win32-installer:
https://github.com/vim/vim-win32-installer/releases.
COMPILARE VIM
Se si è ottenuta una distribuzione di file eseguibili di Vim non è necessario
compilarlo. Se si è ottenuta una distribuzione di file sorgente, tutto ciò
che serve per compilare Vim è nella directory "src". Vedere src/INSTALL per
come procedere.
INSTALLAZIONE
Vedere uno dei file elencati più sotto per istruzioni riguardo a uno specifico
sistema operativo. Tali file sono (nella repository git) nella directory
READMEdir oppure nella directory principale se si scompatta un archivio:
README_ami.txt Amiga
README_unix.txt Unix
README_dos.txt MS-DOS e MS-Windows
README_mac.txt Macintosh
README_haiku.txt Haiku
README_vms.txt VMS
Esistono altri file README_*.txt, a seconda della distribuzione in uso.
DOCUMENTAZIONE
Esiste un corso di introduzione a Vim per principianti, della durata di circa
un'ora. Normalmente si può accedervi tramite il comando "vimtutor". Vedere
":help tutor" per ulteriori informazioni.
Ma la cosa migliore è usare la documentazione disponibile in una sessione di
Vim, tramite il comando ":help". Se ancora non si ha a disposizione Vim, si
può leggere il file "runtime/doc/help.txt". Questo file contiene puntatori
agli altri file che costituiscono la documentazione.
All'interno della documentazione esiste anche uno User Manual (manuale utente)
che si legge come un libro ed è raccomandato per imparare a usare Vim.
Vedere ":help user-manual". Il manuale utente è stato interamente tradotto in
italiano, ed è disponibile, vedere:
https://www.vim.org/translations.php
COPIE
Vim è un Charityware (ossia eventuali offerte per il suo utilizzo vanno a
un'attività caritativa). Vim può essere usato e copiato liberamente, senza
limitazioni, ma è incoraggiata un'offerta a favore di orfani ugandesi. Si
prega di leggere il file "runtime/doc/uganda.txt" per dettagli su come fare
(il file si può visualizzare digitando ":help uganda" all'interno di Vim).
Sommario della licenza: Non ci sono restrizioni nell'uso e nella distribuzione
di una copia non modificata di Vim. Parti di Vim possono anche essere
distribuite, ma il testo della licenza va sempre incluso. Per versioni
modificate di Vim, valgono alcune limitazioni. La licenza di Vim è
compatibile con la licenza GPL, è possibile compilare Vim utilizzando librerie
con licenza GPL e distribuirlo.
SPONSORIZZAZIONI
Correggere errori e aggiungere nuove funzionalità richiede tempo e fatica.
Per mostrare la vostra stima per quest'attività e per fornire motivazioni
agli sviluppatori perché continuino a lavorare su Vim, siete invitati a
fare una donazione.
Le somme donate saranno usate principalmente per aiutare dei bambini in
Uganda. Vedere "runtime/doc/uganda.txt". Allo stesso tempo, le donazioni
aumentano la motivazione del gruppo di sviluppo a continuare a lavorare su
Vim!
Informazioni più aggiornate sulla sponsorizzazione, possono essere trovate
sul sito Internet di Vim:
https://www.vim.org/sponsor/
CONTRIBUIRE
Chi vuole contribuire a rendere Vim ancora migliore, può consultare
il file CONTRIBUTING.md (in inglese).
INFORMAZIONE
Se il vostro sistema operativo è macOS, potete usare MacVim:
https://macvim.org
Le ultime notizie riguardo a Vim si possono trovare sulla pagina Internet di
Vim:
https://www.vim.org/
Se avete problemi, è possibile consultare la documentazione Vim e i
suggerimenti su come utilizzarlo:
https://www.vim.org/docs.php
https://vim.fandom.com/wiki/Vim_Tips_Wiki
Se avete ancora problemi o qualsiasi altra richiesta, è possibile usare una
delle mailing list per discuterne con utenti e sviluppatori di Vim:
https://www.vim.org/maillist.php
Se nient'altro funziona, potete riferire direttamente i problemi incontrati
alla mailing list degli sviluppatori, vim-dev:
<vim-dev@vim.org>
AUTORE PRINCIPALE
La maggior parte di Vim è stata creata da Bram Moolenaar <Bram@vim.org>,
vedere ":help Bram-Moolenaar"
Spedire tutti gli altri commenti, modifiche al codice sorgente, fiori e
suggerimenti alla mailing list vim-dev:
<vim-dev@vim.org>

View File

@@ -144,6 +144,14 @@ export def FTcfg()
endif
enddef
export def FTcl()
if join(getline(1, 4), '') =~ '/\*'
setf opencl
else
setf lisp
endif
enddef
export def FTcls()
if exists("g:filetype_cls")
exe "setf " .. g:filetype_cls
@@ -169,6 +177,14 @@ export def FTcls()
endif
enddef
export def FTll()
if getline(1) =~ ';\|\<source_filename\>\|\<target\>'
setf llvm
else
setf lifelines
endif
enddef
export def FTlpc()
if exists("g:lpc_syntax_for_c")
var lnum = 1

View File

@@ -2,10 +2,11 @@ vim9script
# Language: Vim script
# Maintainer: github user lacygoill
# Last Change: 2023 Jun 29
# Last Change: 2024 Nov 08
#
# Includes Changes from Vim:
# Includes changes from The Vim Project:
# - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
# - 2024 Nov 08: Fix indent after :silent! function (D. Kearns via #16009)
# NOTE: Whenever you change the code, make sure the tests are still passing:
#
@@ -295,7 +296,7 @@ patterns = []
endfor
}
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@='
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]!\=\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@='
# STARTS_CURLY_BLOCK {{{3

View File

@@ -11,6 +11,7 @@
" 2024 Sep 23 by Vim Project: runtime dir selection fix (#15722)
" autoloading search path fix
" substitution of hardcoded commands with global variables
" 2024 Nov 12 by Vim Project: fix problems on Windows (#16036)
" }}}
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@@ -27,9 +28,9 @@ if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
if v:version < 702
if v:version < 901
echohl WarningMsg
echo "***warning*** this version of GetLatestVimScripts needs vim 7.2"
echo "***warning*** this version of GetLatestVimScripts needs vim 9.1"
echohl Normal
finish
endif
@@ -57,6 +58,9 @@ endif
if !exists("g:GetLatestVimScripts_wget")
if executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl.exe")
" enforce extension: windows powershell desktop version has a curl alias that hides curl.exe
let g:GetLatestVimScripts_wget= "curl.exe"
elseif executable("curl")
let g:GetLatestVimScripts_wget= "curl"
else
@@ -69,7 +73,7 @@ endif
if !exists("g:GetLatestVimScripts_options")
if g:GetLatestVimScripts_wget == "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget == "curl"
elseif g:GetLatestVimScripts_wget =~ "curl"
let g:GetLatestVimScripts_options= "-s -o"
else
let g:GetLatestVimScripts_options= ""
@@ -121,11 +125,14 @@ if g:GetLatestVimScripts_allowautoinstall
let s:dotvim= s:is_windows ? "vimfiles" : ".vim"
if !exists("g:GetLatestVimScripts_mv")
if s:is_windows && &shell !~ '\cbash\|pwsh\|powershell'
if &shell =~? '\<pwsh\>\|\<powershell\>'
let g:GetLatestVimScripts_mv= "move -Force"
elseif s:is_windows && &shell =~? '\<cmd\>'
" windows (but not cygwin/bash)
let g:GetLatestVimScripts_mv= "move"
let g:GetLatestVimScripts_mv= "move /Y"
else
" unix
" unix or cygwin bash/zsh
" 'mv' overrides existing files without asking
let g:GetLatestVimScripts_mv= "mv"
endif
endif
@@ -160,12 +167,6 @@ fun! getscript#GetLatestVimScripts()
return
endif
" insure that fnameescape() is available
if !exists("*fnameescape")
echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)"
return
endif
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
@@ -377,7 +378,16 @@ fun! s:GetOneScript(...)
let t_ti= &t_ti
let t_te= &t_te
let rs = &rs
let ssl = &ssl
set t_ti= t_te= nors
" avoid issues with shellescape() on Windows
if s:is_windows && &shell =~? '\<cmd\>'
set noshellslash
endif
" restore valures afterwards
defer execute("let @a = rega | let &t_ti = t_ti | let &t_te = t_te | let &rs = rs | let &ssl = ssl")
" put current line on top-of-screen and interpret it into
" a script identifier : used to obtain webpage
@@ -394,7 +404,6 @@ fun! s:GetOneScript(...)
else
let curline = getline(".")
if curline =~ '^\s*#'
let @a= rega
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
@@ -429,7 +438,6 @@ fun! s:GetOneScript(...)
" plugin author protection from downloading his/her own scripts atop their latest work
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
let @a= rega
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
@@ -497,7 +505,6 @@ fun! s:GetOneScript(...)
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
let @a= rega
return
endif
" call Decho('found "Click on the package to download"')
@@ -513,7 +520,6 @@ fun! s:GetOneScript(...)
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
let @a= rega
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
@@ -547,11 +553,11 @@ fun! s:GetOneScript(...)
" call Decho(".downloading new <".sname.">")
echomsg ".downloading new <".sname.">"
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|q")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|q
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw!
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr).latestsrcid
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr).latestsrcid
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)
endif
" --------------------------------------------------------------------------
@@ -654,8 +660,8 @@ fun! s:GetOneScript(...)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
endif
if tgtdir != "plugin"
" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir
endif
" helptags step
@@ -680,13 +686,7 @@ fun! s:GetOneScript(...)
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
endif
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let @a = rega
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
" call Dret("GetOneScript")
endfun

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
" URL: https://github.com/benknoble/vim-racket
" Last Change: 2023 Sep 22
" Last Change: 2024 Nov 12
vim9script
def MakePatternFromLiterals(xs: list<string>): string
@@ -170,7 +170,7 @@ def PosLT(left: dict<any>, right: dict<any>): bool
enddef
def IsForFold(word: string): bool
return ['for/fold', 'for/foldr', 'for*/fold', 'for*/foldr']->index(word) >= 0
return ['for/fold', 'for/foldr', 'for/lists', 'for*/fold', 'for*/foldr', 'for*/lists']->index(word) >= 0
enddef
def IsSecondForm(blnum: number, bcol: number, vlnum: number): bool
@@ -209,5 +209,5 @@ def IsSecondForm(blnum: number, bcol: number, vlnum: number): bool
endwhile
# assert_report(printf('forms seen pre-return: %d', forms_seen))
return forms_seen == 2 || (forms_seen == 1 && !empty(stack))
return (forms_seen == 2 && empty(stack)) || (forms_seen == 1 && !empty(stack))
enddef

View File

@@ -1,6 +1,6 @@
" tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION
" Date: Nov 14, 2023
" Date: Nov 11, 2024
" Version: 32b (with modifications from the Vim Project)
" Maintainer: This runtime file is looking for a new maintainer.
" Former Maintainer: Charles E Campbell
@@ -23,7 +23,7 @@
if &cp || exists("g:loaded_tar")
finish
endif
let g:loaded_tar= "v32a"
let g:loaded_tar= "v32b"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of tar needs vim 7.2"
@@ -41,7 +41,7 @@ if !exists("g:tar_browseoptions")
let g:tar_browseoptions= "Ptf"
endif
if !exists("g:tar_readoptions")
let g:tar_readoptions= "OPxf"
let g:tar_readoptions= "pPxf"
endif
if !exists("g:tar_cmd")
let g:tar_cmd= "tar"
@@ -80,7 +80,7 @@ if !exists("g:tar_copycmd")
let g:tar_copycmd= g:netrw_localcopycmd
endif
if !exists("g:tar_extractcmd")
let g:tar_extractcmd= "tar -xf"
let g:tar_extractcmd= "tar -pxf"
endif
" set up shell quoting character
@@ -294,6 +294,41 @@ fun! tar#Read(fname,mode)
set report=10
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','')
" changing the directory to the temporary earlier to allow tar to extract the file with permissions intact
if !exists("*mkdir")
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
let &report= repkeep
return
endif
let curdir= getcwd()
let tmpdir= tempname()
let b:curdir= tmpdir
let b:tmpdir= curdir
if tmpdir =~ '\.'
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
endif
call mkdir(tmpdir,"p")
" attempt to change to the indicated directory
try
exe "cd ".fnameescape(tmpdir)
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
let &report= repkeep
return
endtry
" place temporary files under .../_ZIPVIM_/
if isdirectory("_ZIPVIM_")
call s:Rmdir("_ZIPVIM_")
endif
call mkdir("_ZIPVIM_")
cd _ZIPVIM_
if has("win32unix") && executable("cygpath")
" assuming cygwin
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
@@ -332,9 +367,10 @@ fun! tar#Read(fname,mode)
if tarfile =~# '\.bz2$'
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif tarfile =~# '\.\(gz\)$'
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)'
if has("unix") && executable("file")
let filekind= system("file ".shellescape(tarfile,1))
@@ -343,20 +379,27 @@ fun! tar#Read(fname,mode)
endif
if filekind =~ "bzip2"
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif filekind =~ "XZ"
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif filekind =~ "Zstandard"
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
else
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
endif
elseif tarfile =~# '\.lrp$'
exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif tarfile =~# '\.lzma$'
exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif tarfile =~# '\.\(xz\|txz\)$'
exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
else
if tarfile =~ '^\s*-'
" A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
@@ -364,6 +407,16 @@ fun! tar#Read(fname,mode)
endif
" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp)
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
endif
redraw!
if v:shell_error != 0
cd ..
call s:Rmdir("_ZIPVIM_")
exe "cd ".fnameescape(curdir)
echohl Error | echo "***error*** (tar#Read) sorry, unable to open or extract ".tarfile." with ".fname | echohl None
endif
if doro
@@ -388,6 +441,10 @@ fun! tar#Write(fname)
" call Dfunc("tar#Write(fname<".a:fname.">) b:tarfile<".b:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
let repkeep= &report
set report=10
" temporary buffer variable workaround because too fucking tired. but it works now
let curdir= b:curdir
let tmpdir= b:tmpdir
if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-'
redraw!
@@ -404,44 +461,6 @@ fun! tar#Write(fname)
" call Dret("tar#Write")
return
endif
if !exists("*mkdir")
redraw!
" call Decho("***error*** (tar#Write) sorry, mkdir() doesn't work on your system")
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
let &report= repkeep
" call Dret("tar#Write")
return
endif
let curdir= getcwd()
let tmpdir= tempname()
" call Decho("orig tempname<".tmpdir.">")
if tmpdir =~ '\.'
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
endif
" call Decho("tmpdir<".tmpdir.">")
call mkdir(tmpdir,"p")
" attempt to change to the indicated directory
try
exe "cd ".fnameescape(tmpdir)
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
" call Decho("***error*** (tar#Write) cannot cd to temporary directory")
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
let &report= repkeep
" call Dret("tar#Write")
return
endtry
" call Decho("current directory now: ".getcwd())
" place temporary files under .../_ZIPVIM_/
if isdirectory("_ZIPVIM_")
call s:Rmdir("_ZIPVIM_")
endif
call mkdir("_ZIPVIM_")
cd _ZIPVIM_
" call Decho("current directory now: ".getcwd())
let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','')

219
runtime/autoload/tutor.vim Normal file
View File

@@ -0,0 +1,219 @@
" vim: fdm=marker et ts=4 sw=4
" Setup: {{{1
function! tutor#SetupVim()
if !exists('g:did_load_ftplugin') || g:did_load_ftplugin != 1
filetype plugin on
endif
if has('syntax')
if !exists('g:syntax_on') || g:syntax_on == 0
syntax on
endif
endif
endfunction
" Loads metadata file, if available
function! tutor#LoadMetadata()
let b:tutor_metadata = json_decode(join(readfile(expand('%').'.json'), "\n"))
endfunction
" Mappings: {{{1
function! tutor#SetNormalMappings()
nnoremap <silent> <buffer> <CR> :call tutor#FollowLink(0)<cr>
nnoremap <silent> <buffer> <2-LeftMouse> :call tutor#MouseDoubleClick()<cr>
nnoremap <buffer> >> :call tutor#InjectCommand()<cr>
endfunction
function! tutor#MouseDoubleClick()
if foldclosed(line('.')) > -1
normal! zo
else
if match(getline('.'), '^#\{1,} ') > -1
silent normal! zc
else
call tutor#FollowLink(0)
endif
endif
endfunction
function! tutor#InjectCommand()
let l:cmd = substitute(getline('.'), '^\s*', '', '')
exe l:cmd
redraw | echohl WarningMsg | echon "tutor: ran" | echohl None | echon " " | echohl Statement | echon l:cmd
endfunction
function! tutor#FollowLink(force)
let l:stack_s = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), '')
if l:stack_s =~# 'tutorLink'
let l:link_start = searchpairpos('\[', '', ')', 'nbcW')
let l:link_end = searchpairpos('\[', '', ')', 'ncW')
if l:link_start[0] == l:link_end[0]
let l:linkData = getline(l:link_start[0])[l:link_start[1]-1:l:link_end[1]-1]
else
return
endif
let l:target = matchstr(l:linkData, '(\@<=.*)\@=')
if a:force != 1 && match(l:target, '\*.\+\*') > -1
call cursor(l:link_start[0], l:link_end[1])
call search(l:target, '')
normal! ^
elseif a:force != 1 && match(l:target, '^@tutor:') > -1
let l:tutor = matchstr(l:target, '@tutor:\zs.*')
exe "Tutor ".l:tutor
else
exe "help ".l:target
endif
endif
endfunction
" Folding And Info: {{{1
function! tutor#TutorFolds()
if getline(v:lnum) =~# '^#\{1,6}'
return ">". len(matchstr(getline(v:lnum), '^#\{1,6}'))
else
return "="
endif
endfunction
" Marks: {{{1
function! tutor#ApplyMarks()
hi! link tutorExpect Special
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
let b:tutor_sign_id = 1
for expct in keys(b:tutor_metadata['expect'])
let lnum = eval(expct)
call matchaddpos('tutorExpect', [lnum])
call tutor#CheckLine(lnum)
endfor
endif
endfunction
function! tutor#ApplyMarksOnChanged()
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
let lnum = line('.')
if index(keys(b:tutor_metadata['expect']), string(lnum)) > -1
call tutor#CheckLine(lnum)
endif
endif
endfunction
function! tutor#CheckLine(line)
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
let bufn = bufnr('%')
let ctext = getline(a:line)
if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)]
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn
else
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorbad buffer=".bufn
endif
let b:tutor_sign_id+=1
endif
endfunction
" Tutor Cmd: {{{1
function! s:Locale()
if exists('v:lang') && v:lang =~ '\a\a'
let l:lang = v:lang
elseif $LC_ALL =~ '\a\a'
let l:lang = $LC_ALL
elseif $LANG =~ '\a\a'
let l:lang = $LANG
else
let l:lang = 'en_US'
endif
return split(l:lang, '_')
endfunction
function! s:GlobPath(lp, pat)
if version >= 704 && has('patch279')
return globpath(a:lp, a:pat, 1, 1)
else
return split(globpath(a:lp, a:pat, 1), '\n')
endif
endfunction
function! s:Sort(a, b)
let mod_a = fnamemodify(a:a, ':t')
let mod_b = fnamemodify(a:b, ':t')
if mod_a == mod_b
let retval = 0
elseif mod_a > mod_b
if match(mod_a, '^vim-') > -1 && match(mod_b, '^vim-') == -1
let retval = -1
else
let retval = 1
endif
else
if match(mod_b, '^vim-') > -1 && match(mod_a, '^vim-') == -1
let retval = 1
else
let retval = -1
endif
endif
return retval
endfunction
function! s:GlobTutorials(name)
" search for tutorials:
" 1. non-localized
let l:tutors = s:GlobPath(&rtp, 'tutor/'.a:name.'.tutor')
" 2. localized for current locale
let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.s:Locale()[0].'/'.a:name.'.tutor')
" 3. fallback to 'en'
if len(l:locale_tutors) == 0
let l:locale_tutors = s:GlobPath(&rtp, 'tutor/en/'.a:name.'.tutor')
endif
call extend(l:tutors, l:locale_tutors)
return uniq(sort(l:tutors, 's:Sort'), 's:Sort')
endfunction
function! tutor#TutorCmd(tutor_name)
if match(a:tutor_name, '[[:space:]]') > 0
echom "Only one argument accepted (check spaces)"
return
endif
if a:tutor_name == ''
let l:tutor_name = 'vim-01-beginner.tutor'
else
let l:tutor_name = a:tutor_name
endif
if match(l:tutor_name, '\.tutor$') > 0
let l:tutor_name = fnamemodify(l:tutor_name, ':r')
endif
let l:tutors = s:GlobTutorials(l:tutor_name)
if len(l:tutors) == 0
echom "No tutorial with that name found"
return
endif
if len(l:tutors) == 1
let l:to_open = l:tutors[0]
else
let l:idx = 0
let l:candidates = ['Several tutorials with that name found. Select one:']
for candidate in map(copy(l:tutors),
\'fnamemodify(v:val, ":h:h:t")."/".s:Locale()[0]."/".fnamemodify(v:val, ":t")')
let l:idx += 1
call add(l:candidates, l:idx.'. '.candidate)
endfor
let l:tutor_to_open = inputlist(l:candidates)
let l:to_open = l:tutors[l:tutor_to_open-1]
endif
call tutor#SetupVim()
exe "edit ".l:to_open
endfunction
function! tutor#TutorCmdComplete(lead,line,pos)
let l:tutors = s:GlobTutorials('*')
let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort'))
return join(l:names, "\n")
endfunction

View File

@@ -1,6 +1,6 @@
" Language: Typst
" Maintainer: Gregory Anders
" Last Change: 2024 Oct 21
" Last Change: 2024 Nov 02
" Based on: https://github.com/kaarmu/typst.vim
function! typst#indentexpr() abort
@@ -18,6 +18,9 @@ function! typst#indentexpr() abort
" Use last indent for block comments
if l:synname == 'typstCommentBlock'
return l:ind
" do not change the indents of bullet lists
elseif l:synname == 'typstMarkupBulletList'
return indent(a:lnum)
endif
if l:pline =~ '\v[{[(]\s*$'

View File

@@ -1,15 +1,13 @@
" vim compiler file
" Compiler: cppcheck (C++ static checker)
" Maintainer: Vincent B. (twinside@free.fr)
" Last Change: 2024 oct 17 by @Konfekt
" Last Change: 2024 Nov 19 by @Konfekt
if exists("cppcheck")
finish
endif
if exists("current_compiler") | finish | endif
let current_compiler = "cppcheck"
let s:cpo_save = &cpo
set cpo-=C
set cpo&vim
let s:slash = has('win32')? '\' : '/'
@@ -27,7 +25,7 @@ let &l:makeprg = 'cppcheck --quiet'
\ (filereadable('compile_commands.json') ? '--project=compile_commands.json' :
\ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] :
\ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I')))))
silent CompilerSet makeprg
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
CompilerSet errorformat=
\%f:%l:%c:\ %tarning:\ %m,

View File

@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Groff
" Maintainer: Konfekt
" Last Change: 2024 Sep 8
" Last Change: 2024 Nov 19
"
" Expects output file extension, say `:make html` or `:make pdf`.
" Supported devices as of Sept 2024 are: (x)html, pdf, ps, dvi, lj4, lbp ...
@@ -30,7 +30,7 @@ execute 'CompilerSet makeprg=groff'..escape(
\ ' '..s:groff_compiler_lang()..
\ ' -K'..get(b:, 'groff_compiler_encoding', get(g:, 'groff_compiler_encoding', 'utf8'))..
\ ' '..get(b:, 'groff_compiler_args', get(g:, 'groff_compiler_args', ''))..
\ ' -mom -T$* -- %:S > %:r:S.$*', ' ')
\ ' -mom -T$* -- %:S > %:r:S.$*', ' \|"')
" From Gavin Freeborn's https://github.com/Gavinok/vim-troff under Vim License
" https://github.com/Gavinok/vim-troff/blob/91017b1423caa80aba541c997909a4f810edd275/compiler/troff.vim#L39
CompilerSet errorformat=%o:<standard\ input>\ (%f):%l:%m,

View File

@@ -0,0 +1,40 @@
" Vim compiler file
" Compiler: Maven
" Maintainer: D. Ben Knoble <ben.knoble+vim@gmail.com>
" Maintainer: Konfekt
" Original Source: https://github.com/JalaiAmitahl/maven-compiler.vim/blob/master/compiler/mvn.vim
" (Copyright Dan Taylor, distributed under the same terms as LICENSE)
" Original Source: https://github.com/mikelue/vim-maven-plugin/blob/master/compiler/maven.vim
" (distributed under same terms as LICENSE per
" https://github.com/mikelue/vim-maven-plugin/issues/13)
" Last Change: 2024 Nov 12
if exists("current_compiler")
finish
endif
let current_compiler = "maven"
CompilerSet makeprg=mvn\ --batch-mode
" Error message for POM
CompilerSet errorformat=[FATAL]\ Non-parseable\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%#,
CompilerSet errorformat+=[%tRROR]\ Malformed\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%#
" Java related build messages
CompilerSet errorformat+=[%tARNING]\ %f:[%l\\,%c]\ %m
CompilerSet errorformat+=[%tRROR]\ %f:[%l\\,%c]\ %m
CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:[%l\\,%c]\ %m,%Z
CompilerSet errorformat+=%A%f:[%l\\,%c]\ %m,%Z
" jUnit related build messages
CompilerSet errorformat+=%+E\ \ %#test%m,%Z
CompilerSet errorformat+=%+E[ERROR]\ Please\ refer\ to\ %f\ for\ the\ individual\ test\ results.
" Message from JUnit 5(5.3.X), TestNG(6.14.X), JMockit(1.43), and AssertJ(3.11.X)
CompilerSet errorformat+=%+E%>[ERROR]\ %.%\\+Time\ elapsed:%.%\\+<<<\ FAILURE!,
CompilerSet errorformat+=%+E%>[ERROR]\ %.%\\+Time\ elapsed:%.%\\+<<<\ ERROR!,
CompilerSet errorformat+=%+Z%\\s%#at\ %f(%\\f%\\+:%l),
CompilerSet errorformat+=%+C%.%#
" Misc message removal
CompilerSet errorformat+=%-G[INFO]\ %.%#,
CompilerSet errorformat+=%-G[debug]\ %.%#

19
runtime/compiler/mypy.vim Normal file
View File

@@ -0,0 +1,19 @@
" Vim compiler file
" Compiler: Mypy (Python static checker)
" Maintainer: @Konfekt
" Last Change: 2024 Nov 19
if exists("current_compiler") | finish | endif
let current_compiler = "mypy"
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=mypy
let &l:makeprg = 'mypy --show-column-numbers '
\ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports'))
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Pandoc
" Maintainer: Konfekt
" Last Change: 2024 Sep 8
" Last Change: 2024 Nov 19
"
" Expects output file extension, say `:make html` or `:make pdf`.
" Passes additional arguments to pandoc, say `:make html --self-contained`.
@@ -56,7 +56,7 @@ execute 'CompilerSet makeprg=pandoc'..escape(
\ ' '..s:PandocLang()..
\ ' --from='..s:PandocFiletype(&filetype)..
\ ' '..get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', ''))..
\ ' --output %:r:S.$* -- %:S', ' ')
\ ' --output %:r:S.$* -- %:S', ' \|"')
CompilerSet errorformat=\"%f\",\ line\ %l:\ %m
let &cpo = s:keepcpo

View File

@@ -3,8 +3,9 @@
" URL: https://github.com/PProvost/vim-ps1
" Contributors: Enno Nagel
" Last Change: 2024 Mar 29
" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg)
" 2024 Apr 03 by the Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
if exists("current_compiler")
finish
@@ -49,7 +50,7 @@ let s:makeprg = g:ps1_makeprg_cmd .. ' %:p:S'
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
" + FullyQualifiedErrorId : CommandNotFoundException
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ')
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"')
" Showing error in context with underlining.
CompilerSet errorformat=%+G+%m

View File

@@ -1,13 +1,21 @@
" Vim compiler file
" Compiler: Pylint for Python
" Maintainer: Daniel Moch <daniel@danielmoch.com>
" Last Change: 2016 May 20
" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
" Compiler: Pylint for Python
" Maintainer: Daniel Moch <daniel@danielmoch.com>
" Last Change: 2024 Nov 07 by The Vim Project (added params variable)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
if exists("current_compiler")
finish
endif
if exists("current_compiler") | finish | endif
let current_compiler = "pylint"
CompilerSet makeprg=pylint\ --output-format=text\ --msg-template=\"{path}:{line}:{column}:{C}:\ [{symbol}]\ {msg}\"\ --reports=no
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=ruff
let &l:makeprg = 'pylint ' .
\ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' .
\ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0'))
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

20
runtime/compiler/ruff.vim Normal file
View File

@@ -0,0 +1,20 @@
" Vim compiler file
" Compiler: Ruff (Python linter)
" Maintainer: @pbnj-dragon
" Last Change: 2024 Nov 07
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
if exists("current_compiler") | finish | endif
let current_compiler = "ruff"
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=ruff
let &l:makeprg= 'ruff check --output-format=concise '
\ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview'))
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -3,8 +3,9 @@
" Maintainer: Artem Chuprina <ran@ran.pp.ru>
" Contributors: Enno Nagel
" Last Change: 2024 Mar 29
" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg)
" 2024 Apr 03 by the Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
if exists("current_compiler")
finish
@@ -27,7 +28,7 @@ if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
let current_compiler = "latex"
endif
let s:makeprg=current_compiler .. ' -interaction=nonstopmode'
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ')
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"')
else
let current_compiler = 'make'
endif

View File

@@ -1,7 +1,7 @@
" The default vimrc file.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last change: 2023 Aug 10
" Last Change: 2024 Nov 14
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
"
" This is loaded if no vimrc file was found.
@@ -39,7 +39,6 @@ set backspace=indent,eol,start
set history=200 " keep 200 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
@@ -107,14 +106,19 @@ if 1
" (happens when dropping a file on gvim), for a commit or rebase message
" (likely a different one than last time), and when using xxd(1) to filter
" and edit binary files (it transforms input files back and forth, causing
" them to have dual nature, so to speak)
" them to have dual nature, so to speak) or when running the new tutor
autocmd BufReadPost *
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1
\ | execute "normal! g`\""
\ | endif
" Set the default background for putty to dark. Putty usually sets the
" $TERM to xterm and by default it starts with a dark background which
" makes syntax highlighting often hard to read with bg=light
" undo this using: ":au! vimStartup TermResponse"
autocmd TermResponse * if v:termresponse == "\e[>0;136;0c" | set bg=dark | endif
augroup END
" Quite a few people accidentally type "q:" instead of ":q" and get confused

View File

@@ -75,6 +75,7 @@ DOCS = \
pi_paren.txt \
pi_spec.txt \
pi_tar.txt \
pi_tutor.txt \
pi_vimball.txt \
pi_zip.txt \
popup.txt \
@@ -228,6 +229,7 @@ HTMLS = \
pi_paren.html \
pi_spec.html \
pi_tar.html \
pi_tutor.html \
pi_vimball.html \
pi_zip.html \
popup.html \

View File

@@ -10,7 +10,7 @@
# TODO: to think about what to use instead of awk. PowerShell?
#AWK =
# Correct the following line for the where executeable file vim is installed.
# Correct the following line for the where executable file vim is installed.
# Please do not put the path in quotes.
VIMPROG = D:\Programs\Vim\vim91\vim.exe

View File

@@ -93,7 +93,7 @@ test_urls:
$(VIMPROG) --clean -S test_urls.vim
clean:
-rm -f doctags *.html tags.ref
-rm -f doctags *.html tags.ref tags-* vim-stylesheet.css
# These files are in the extra archive, skip if not present

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.1. Last change: 2024 Aug 18
*autocmd.txt* For Vim version 9.1. Last change: 2024 Oct 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1254,10 +1254,19 @@ TerminalWinOpen Just after a terminal buffer was created, with
TermResponse After the response to |t_RV| is received from
the terminal. The value of |v:termresponse|
can be used to do things depending on the
terminal version. Note that this event may be
triggered halfway executing another event,
especially if file I/O, a shell command or
anything else that takes time is involved.
terminal version.
This is used in |defaults.vim| to detect
putty terminal and set a dark background: >
au TermResponse *
\ if v:termresponse == "\e[>0;136;0c"
\ set bg=dark
\ endif
<
Note: that this event may be triggered halfway
executing another event, especially if file
I/O, a shell command or anything else that
takes time is involved.
*TermResponseAll*
TermResponseAll After the response to |t_RV|, |t_RC|, |t_RS|,
|t_RB|, |t_RF|, or |t_u7| are received from

View File

@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 16
*builtin.txt* For Vim version 9.1. Last change: 2024 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -222,6 +222,7 @@ getbufline({buf}, {lnum} [, {end}])
getbufoneline({buf}, {lnum}) String line {lnum} of buffer {buf}
getbufvar({buf}, {varname} [, {def}])
any variable {varname} in buffer {buf}
getcellpixels() List get character cell pixel size
getcellwidths() List get character cell width overrides
getchangelist([{buf}]) List list of change list items
getchar([{expr}]) Number or String
@@ -467,9 +468,9 @@ prop_type_get({name} [, {props}])
prop_type_list([{props}]) List get list of property types
pum_getpos() Dict position and size of pum if visible
pumvisible() Number whether popup menu is visible
py3eval({expr}) any evaluate |python3| expression
pyeval({expr}) any evaluate |Python| expression
pyxeval({expr}) any evaluate |python_x| expression
py3eval({expr} [, {locals}]) any evaluate |python3| expression
pyeval({expr} [, {locals}]) any evaluate |Python| expression
pyxeval({expr} [, {locals}]) any evaluate |python_x| expression
rand([{expr}]) Number get pseudo-random number
range({expr} [, {max} [, {stride}]])
List items from {expr} to {max}
@@ -1625,7 +1626,7 @@ charclass({string}) *charclass()*
The character class is one of:
0 blank
1 punctuation
2 word character
2 word character (depends on 'iskeyword')
3 emoji
other specific Unicode class
The class is used in patterns and word motions.
@@ -3786,6 +3787,20 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()*
Return type: any, depending on {varname}
getcellpixels() *getcellpixels()*
Returns a |List| of terminal cell pixel size.
List format is [xpixels, ypixels].
Only works on Unix (terminal and gVim) and Windows (gVim only).
Returns [] on other systems or on failure.
Note that there could be variations across different terminals.
On macOS, system Terminal.app returns sizes in points (before
Retina scaling), whereas third-party terminals return raw pixel
sizes (post Retina scaling).
Return type: list<any>
getcellwidths() *getcellwidths()*
Returns a |List| of cell widths of character ranges overridden
by |setcellwidths()|. The format is equal to the argument of
@@ -4836,7 +4851,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()*
<
Return type: list<string>
<
getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()*
Same as |getregion()|, but returns a list of positions
describing the buffer text segments bound by {pos1} and
@@ -4893,6 +4908,7 @@ getregtype([{regname}]) *getregtype()*
<
Return type: |String|
getscriptinfo([{opts}]) *getscriptinfo()*
Returns a |List| with information about all the sourced Vim
scripts in the order they were sourced, like what
@@ -5202,7 +5218,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()*
on {list}
glob2regpat({string}) *glob2regpat()*
glob2regpat({string}) *glob2regpat()*
Convert a file pattern, as used by glob(), into a search
pattern. The result can be used to match with a string that
is a file name. E.g. >
@@ -5655,7 +5671,7 @@ iconv({string}, {from}, {to}) *iconv()*
Return type: |String|
id({item}) *id()*
id({item}) *id()*
The result is a unique String associated with the {item} and
not with the {item}'s contents. It is only valid while the
{item} exists and is referenced. It is valid only in the
@@ -7080,7 +7096,7 @@ matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}])
Return type: list<dict<any>> or list<any>
matchdelete({id} [, {win}) *matchdelete()* *E802* *E803*
matchdelete({id} [, {win}) *matchdelete()* *E802* *E803*
Deletes a match with ID {id} previously defined by |matchadd()|
or one of the |:match| commands. Returns 0 if successful,
otherwise -1. See example for |matchadd()|. All matches can
@@ -8126,9 +8142,14 @@ pumvisible() *pumvisible()*
Return type: |Number|
py3eval({expr}) *py3eval()*
py3eval({expr} [, {locals}]) *py3eval()*
Evaluate Python expression {expr} and return its result
converted to Vim data structures.
If a {locals} |Dictionary| is given, it defines set of local
variables available in the expression. The keys are variable
names and the values are the variable values. |Dictionary| and
|List| values are referenced, and may be updated by the
expression (as if |python-bindeval| was used).
Numbers and strings are returned as they are (strings are
copied though, Unicode strings are additionally converted to
'encoding').
@@ -8140,15 +8161,17 @@ py3eval({expr}) *py3eval()*
Can also be used as a |method|: >
GetExpr()->py3eval()
'b",".join(l)'->py3eval({'l': ['a', 'b', 'c']})
<
Return type: any, depending on {expr}
{only available when compiled with the |+python3| feature}
*E858* *E859*
pyeval({expr}) *pyeval()*
pyeval({expr} [, {locals}]) *pyeval()*
Evaluate Python expression {expr} and return its result
converted to Vim data structures.
For {locals} see |py3eval()|.
Numbers and strings are returned as they are (strings are
copied though).
Lists are represented as Vim |List| type.
@@ -8164,9 +8187,10 @@ pyeval({expr}) *pyeval()*
{only available when compiled with the |+python| feature}
pyxeval({expr}) *pyxeval()*
pyxeval({expr} [, {locals}]) *pyxeval()*
Evaluate Python expression {expr} and return its result
converted to Vim data structures.
For {locals} see |py3eval()|.
Uses Python 2 or 3, see |python_x| and 'pyxversion'.
See also: |pyeval()|, |py3eval()|

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 9.1. Last change: 2024 Oct 07
*change.txt* For Vim version 9.1. Last change: 2024 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -586,6 +586,8 @@ comment (starting with '"') after the `:!` command.
program {filter} (for {Visual} see |Visual-mode|).
:{range}![!]{filter} [!][arg] *:range!*
For executing external commands see |:!|
Filter {range} lines through the external program
{filter}. Vim replaces the optional bangs with the
latest given command and appends the optional [arg].

View File

@@ -1,4 +1,4 @@
*develop.txt* For Vim version 9.1. Last change: 2024 May 11
*develop.txt* For Vim version 9.1. Last change: 2024 Nov 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -157,6 +157,7 @@ VIM IS... NOT *design-not*
being less consistent over all platforms. But functional GUI features are
welcomed.
==============================================================================
2. Coding style *coding-style*
@@ -165,23 +166,30 @@ stick to these rules, to keep the sources readable and maintainable.
This list is not complete. Look in the source code for more examples.
The code repository contains an editorconfig file, that can be used together
with the distributed editorconfig plugin |editorconfig-install| to ensure the
recommended style is followed.
MAKING CHANGES *style-changes*
The basic steps to make changes to the code:
1. Get the code from github. That makes it easier to keep your changed
version in sync with the main code base (it may be a while before your
changes will be included). You do need to spend some time learning git,
it's not the most user friendly tool.
changes will be included).
2. Adjust the documentation. Doing this first gives you an impression of how
your changes affect the user.
3. Make the source code changes.
4. Check ../doc/todo.txt if the change affects any listed item.
5. Make a patch with "git diff". You can also create a pull request on
github, but it's the diff that matters.
6. Make a note about what changed, preferably mentioning the problem and the
5. Add a test to src/testdir to verify the new behaviour and ensure it won't
regress in the future.
6. Make a patch with "git diff".
7. Make a note about what changed, preferably mentioning the problem and the
solution. Send an email to the |vim-dev| maillist with an explanation and
include the diff. Or create a pull request on github.
include the diff.
For any non-trivial change, please always create a pull request on github,
since this triggers the test suite.
C COMPILER *style-compiler* *ANSI-C* *C89* *C99*
@@ -191,52 +199,234 @@ Later standards, such as C99, are not widely supported, or at least not 100%
supported. Therefore we use only some of the C99 features and explicitly
disallow some (this will gradually be adjusted over time).
Please don't make changes everywhere to use the C99 features, it causes merge
problems for existing patches. Only use them for new and changed code.
Comments ~
Traditionally Vim uses /* comments */. We intend to keep it that way
for file and function headers and larger blocks of code, E.g.:
/*
* The "foo" argument does something useful.
* Return OK or FAIL.
*/
For new code or lines of code that change, it is preferred to use // comments.
Especially when it comes after code:
int some_var; // single line comment useful here
Enums ~
The last item in an enum may have a trailing comma. C89 didn't allow this.
Types ~
"long long" is allowed and can be expected to be 64 bits. Use %lld in printf
formats. Also "long long unsigned" with %llu.
Declarations ~
Now that the minimal supported compiler is MSVC 2015 declarations do not need
to be at the start of a block. However, it is often a good idea to do this
anyway.
Declaration of the for loop variable inside the loop is recommended:
for (int i = 0; i < len; ++i)
Since this is clearly an advantage we'll use this more often.
Not to be used ~
Features not to be used ~
These C99 features are not to be used, because not enough compilers support
them:
- Variable length arrays (even in C11 this is an optional feature).
- _Bool and _Complex types.
- C99 _Bool and _Complex types.
- "inline" (it's hardly ever needed, let the optimizer do its work)
- flexible array members: Not supported by HP-UX C compiler (John Marriott)
USE OF COMMON FUNCTIONS *style-functions*
COMMENTS *style-comments*
Try to avoid putting multiline comments inside a function body: if the
function is so complex that you need to separately comment parts of it, you
should probably rethink the structure of the function.
For file headers and function descriptions use: >
/*
* Description
*/
<
For everything else use: >
// comment
<
INDENTATION *style-indentation*
We use 4 space to indent the code. If you are using Vim to edit the source,
you don't need to do anything due to the |modeline|.
For other editors an `.editorconfig` is provided at the root of the repo.
DECLARATIONS *style-declarations*
Declare, when possible, `for` loop variables in the guard:
OK: >
for (int i = 0; i < len; ++i)
<
Wrong: >
int i;
for (i = 0; i < len; ++i)
<
Always declare a variable with a default value:
OK: >
int n = 0;
int *ptr = NULL;
<
Wrong: >
int n;
int *ptr;
<
BRACES *style-braces*
All curly braces must be returned onto a new line:
OK: >
if (cond)
{
cmd;
cmd;
}
else
{
cmd;
cmd;
}
<
Wrong: >
if (cond) {
cmd;
cmd;
} else {
cmd;
cmd;
}
<
OK: >
while (cond)
{
cmd;
}
<
Wrong: >
while (cond) {
cmd;
}
<
When a block has one line, including comments, the braces can be left out.
OK: >
if (cond)
cmd;
else
cmd;
<
Wrong: >
if (cond)
/*
* comment
*/
cmd;
else
cmd;
<
When an `if`/`else` has braces on one block, the other should have it too.
OK: >
if (cond)
{
cmd;
}
else
{
cmd;
cmd;
}
<
Wrong: >
if (cond)
cmd;
else
{
cmd;
cmd;
}
if (cond)
{
cmd;
cmd;
}
else
cmd;
<
OK: >
while (cond)
cmd;
<
Wrong:
>
while (cond)
if (cond)
cmd;
<
TYPES *style-types*
Use descriptive types. You can find a list of them in the src/structs.h file
and probably in a typedef in the file you are working on.
Note that all custom types are postfixed with "_T"
OK: >
int is_valid_line_number(linenr_T lnum);
<
Wrong: >
int is_valid_line_number(unsigned long lnum);
<
SPACES AND PUNCTUATION *style-spaces*
No space between a function name and the bracket:
OK: func(arg);
Wrong: func (arg);
Do use a space after `if`, `while`, `switch`, etc.
OK: if (arg) for (;;)
Wrong: if(arg) for(;;)
Use a space after a comma or semicolon:
OK: func(arg1, arg2); for (i = 0; i < 2; ++i)
Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
Use a space before and after '=', '+', '/', etc.
Wrong: var=a*5;
OK: var = a * 5;
Use empty lines to group similar actions together.
OK: >
msg_puts_title(_("\n--- Signs ---"));
msg_putchar('\n');
if (rbuf == NULL)
buf = firstbuf;
else
buf = rbuf;
while (buf != NULL && !got_int)
<
Wrong: >
msg_puts_title(_("\n--- Signs ---"));
msg_putchar('\n');
if (rbuf == NULL)
buf = firstbuf;
else
buf = rbuf;
while (buf != NULL && !got_int)
<
FUNCTIONS *style-functions*
Use function declarations with the return type on a separate indented line.
OK: >
int
function_name(int arg1, int arg2)
{
}
<
Wrong: >
int function_name(int arg1, int arg2)
{
}
<
Give meaningful names to function parameters.
USE OF COMMON FUNCTIONS *style-common-functions*
Some functions that are common to use, have a special Vim version. Always
consider using the Vim version, because they were introduced with a reason.
@@ -311,27 +501,30 @@ get_env_value() Linux system function
VARIOUS *style-various*
Typedef'ed names should end in "_T": >
typedef int some_T;
Define'ed names should be uppercase: >
Define'd names should be uppercase: >
#define SOME_THING
<
Features always start with "FEAT_": >
#define FEAT_FOO
<
Don't use '\"', some compilers can't handle it. '"' works fine.
Don't use:
Don't use: >
#if HAVE_SOME
<
Some compilers can't handle that and complain that "HAVE_SOME" is not defined.
Use
Use >
#ifdef HAVE_SOME
or
<
or >
#if defined(HAVE_SOME)
<
STYLE *style-examples*
General rule: One statement per line.
One statement per line.
Wrong: if (cond) a = 1;
@@ -349,101 +542,6 @@ OK: do
a = 1;
while (cond);
Wrong: if (cond) {
cmd;
cmd;
} else {
cmd;
cmd;
}
OK: if (cond)
{
cmd;
cmd;
}
else
{
cmd;
cmd;
}
When a block has one line the braces can be left out. When an if/else has
braces on one block, it usually looks better when the other block also has
braces:
OK: if (cond)
cmd;
else
cmd;
OK: if (cond)
{
cmd;
}
else
{
cmd;
cmd;
}
Use ANSI (new style) function declarations with the return type on a separate
indented line.
Wrong: int function_name(int arg1, int arg2)
OK: /*
* Explanation of what this function is used for.
*
* Return value explanation.
*/
int
function_name(
int arg1, // short comment about arg1
int arg2) // short comment about arg2
{
int local; // comment about local
local = arg1 * arg2;
SPACES AND PUNCTUATION *style-spaces*
No space between a function name and the bracket:
Wrong: func (arg);
OK: func(arg);
Do use a space after if, while, switch, etc.
Wrong: if(arg) for(;;)
OK: if (arg) for (;;)
Use a space after a comma and semicolon:
Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
OK: func(arg1, arg2); for (i = 0; i < 2; ++i)
Use a space before and after '=', '+', '/', etc.
Wrong: var=a*5;
OK: var = a * 5;
In general: Use empty lines to group lines of code together. Put a comment
just above the group of lines. This makes it easier to quickly see what is
being done.
OK: /* Prepare for building the table. */
get_first_item();
table_idx = 0;
/* Build the table */
while (has_item())
table[table_idx++] = next_item();
/* Finish up. */
cleanup_items();
generate_hash(table);
==============================================================================
3. Design decisions *design-decisions*

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.1. Last change: 2024 Jul 28
*eval.txt* For Vim version 9.1. Last change: 2024 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2026,6 +2026,7 @@ v:cmdbang Set like v:cmdarg for a file read/write command. When a "!"
was used the value is 1, otherwise it is 0. Note that this
can only be used in autocommands. For user commands |<bang>|
can be used.
*v:collate* *collate-variable*
v:collate The current locale setting for collation order of the runtime
environment. This allows Vim scripts to be aware of the

View File

@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 9.1. Last change: 2024 Oct 21
*filetype.txt* For Vim version 9.1. Last change: 2024 Nov 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -667,6 +667,19 @@ HARE *ft-hare*
Since the text for this plugin is rather long it has been put in a separate
file: |ft_hare.txt|.
IDRIS2 *ft-idris2-plugin*
By default the following options are set: >
setlocal shiftwidth=2 tabstop=2 expandtab
setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
setlocal commentstring=--\ %s
setlocal wildignore+=*.ibc
To use tabs instead of spaces for indentation, set the following variable
in your vimrc: >
let g:idris2#allow_tabchar = 1
JAVA *ft-java-plugin*
@@ -830,6 +843,12 @@ To enable folding use this: >
let g:markdown_recommended_style = 0
ORG *ft-org-plugin*
To enable folding use this: >
let g:org_folding = 1
<
PDF *ft-pdf-plugin*
Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating
@@ -946,8 +965,8 @@ To enable: >
let g:typst_folding = 1
<
*g:typst_foldnested*
When |TRUE| the Typst filetype plugin will fold nested heading under their parents
(default: |TRUE|)
When |TRUE| the Typst filetype plugin will fold nested heading under their
parents. (default: |TRUE|)
To disable: >
let g:typst_foldnested = 0

View File

@@ -1,4 +1,4 @@
*gui.txt* For Vim version 9.1. Last change: 2024 Jul 17
*gui.txt* For Vim version 9.1. Last change: 2024 Nov 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -474,6 +474,8 @@ When the "unnamed" string is included in the 'clipboard' option, the unnamed
register is the same as the "* register. Thus you can yank to and paste the
selection without prepending "* to commands.
See also |W23| and |W24|.
==============================================================================
5. Menus *menus*

View File

@@ -1,4 +1,4 @@
*gui_x11.txt* For Vim version 9.1. Last change: 2024 Apr 22
*gui_x11.txt* For Vim version 9.1. Last change: 2024 Nov 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -708,6 +708,33 @@ Examples: (assuming the default option values)
Note that the text in the "+ register remains available when making a Visual
selection, which makes other text available in the "* register. That allows
overwriting selected text.
*W23*
When you are yanking into the "* or "+ register and Vim cannot establish a
connection to the X11 selection (or clipboard), it will use register 0 and
output a warning:
Warning: Clipboard register not available, using register 0 ~
*W24*
Vim comes in different flavors, from a tiny build, that just tries to be
compatible to original Vi, to enhanced builds which include many improvements
(like a GUI). However, on servers and embedded systems, Vim is typically
compiled without clipboard support, since this feature requires X11 libraries
to be present. Check the ":version" output for the flag |+clipboard| or
-clipboard. The former means clipboard support is present while the latter
means your Vim does not contain clipboard support.
In the case when you are trying to access the "* or "+ register and Vim has
no clipboard support, you will see this warning:
Warning: Clipboard register not available. See :h W24~
If you have a vim with no clipboard support but would like to use the
clipboard, try to install a more enhanced Vim package like vim-enhanced or
vim-gtk3 (the gui packages usually also come with a terminal Vim that has
clipboard support included).
*x11-cut-buffer*
There are, by default, 8 cut-buffers: CUT_BUFFER0 to CUT_BUFFER7. Vim only
uses CUT_BUFFER0, which is the one that xterm uses by default.

View File

@@ -1,4 +1,4 @@
*help.txt* For Vim version 9.1. Last change: 2024 May 27
*help.txt* For Vim version 9.1. Last change: 2024 Nov 07
VIM - main help file
k
@@ -232,6 +232,7 @@ Standard plugins ~
|pi_paren.txt| Highlight matching parens
|pi_spec.txt| Filetype plugin to work with rpm spec files
|pi_tar.txt| Tar file explorer
|pi_tutor.txt| Interactive tutorial for Vim
|pi_vimball.txt| Create a self-installing Vim script
|pi_zip.txt| Zip archive explorer

View File

@@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 9.1. Last change: 2024 Apr 10
*helphelp.txt* For Vim version 9.1. Last change: 2024 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -246,6 +246,62 @@ command: >
To rebuild the help tags in the runtime directory
(requires write permission there): >
:helptags $VIMRUNTIME/doc
<
*:HelpToc* *help-TOC* *help-toc-install*
If you want to access an interactive table of contents, from any position in
the file, you can use the helptoc plugin. Load the plugin with: >
packadd helptoc
Then you can use the `:HelpToc` command to open a popup menu.
The latter supports the following normal commands: >
key | effect
----+---------------------------------------------------------
j | select next entry
k | select previous entry
J | same as j, and jump to corresponding line in main buffer
K | same as k, and jump to corresponding line in main buffer
c | select nearest entry from cursor position in main buffer
g | select first entry
G | select last entry
H | collapse one level
L | expand one level
p | print current entry on command-line
P | same as p but automatically, whenever selection changes
| press multiple times to toggle feature on/off
q | quit menu
z | redraw menu with current entry at center
+ | increase width of popup menu
- | decrease width of popup menu
? | show/hide a help window
/ | search for pattern
<C-D> | scroll down half a page
<C-U> | scroll up half a page
<PageUp> | scroll down a whole page
<PageDown> | scroll up a whole page
<Home> | select first entry
<End> | select last entry
The plugin can also provide a table of contents in man pages, markdown files,
and terminal buffers. In the latter, the entries will be the past executed
shell commands. To find those, the following pattern is used: >
^\w\+@\w\+:\f\+\$\s
This is meant to match a default bash prompt. If it doesn't match your prompt,
you can change the regex with the `shell_prompt` key from the `g:helptoc`
dictionary variable: >
let g:helptoc = {'shell_prompt': 'regex matching your shell prompt'}
Tip: After inserting a pattern to look for with the `/` command, if you press
<Esc> instead of <CR>, you can then get more context for each remaining entry
by pressing `J` or `K`.
==============================================================================
2. Translated help files *help-translated*

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 9.1. Last change: 2024 May 16
*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 09
VIM REFERENCE MANUAL by Paul Moore
@@ -201,6 +201,10 @@ vim.eval(str) *python-eval*
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~
NOTE: In Vim9 script, local variables in def functions are not visible
to python evaluations. To pass local variables to python evaluations,
use the {locals} dict when calling |py3eval()| and friends.
vim.bindeval(str) *python-bindeval*
Like |python-eval|, but returns special objects described in
|python-bindeval-objects|. These python objects let you modify (|List|
@@ -741,6 +745,10 @@ To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
functions to evaluate Python expressions and pass their values to Vim script.
|pyxeval()| is also available.
You can inject local variables into the evaluation using the optional {locals}
dict. This can be particularly useful in vim9script where vim.eval
|python-eval| will not find locals in a def func.
The Python value "None" is converted to v:none.
==============================================================================

View File

@@ -1,4 +1,4 @@
*indent.txt* For Vim version 9.1. Last change: 2024 Oct 05
*indent.txt* For Vim version 9.1. Last change: 2024 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -813,6 +813,38 @@ Detail:
: GetCSSIndent() else
<!-- --> : -1
IDRIS2 *ft-idris2-indent*
Idris 2 indentation can be configured with several variables that control the
indentation level for different language constructs:
The "g:idris2_indent_if" variable controls the indentation of `then` and `else`
blocks after `if` statements. Defaults to 3.
The "g:idris2_indent_case" variable controls the indentation of patterns in
`case` expressions. Defaults to 5.
The "g:idris2_indent_let" variable controls the indentation after `let`
bindings. Defaults to 4.
The "g:idris2_indent_rewrite" variable controls the indentation after `rewrite`
expressions. Defaults to 8.
The "g:idris2_indent_where" variable controls the indentation of `where`
blocks. Defaults to 6.
The "g:idris2_indent_do" variable controls the indentation in `do` blocks.
Defaults to 3.
Example configuration: >
let g:idris2_indent_if = 2
let g:idris2_indent_case = 4
let g:idris2_indent_let = 4
let g:idris2_indent_rewrite = 8
let g:idris2_indent_where = 6
let g:idris2_indent_do = 3
<
MATLAB *ft-matlab-indent* *matlab-indent* *matlab-indenting*

View File

@@ -1,4 +1,4 @@
*message.txt* For Vim version 9.1. Last change: 2024 Mar 13
*message.txt* For Vim version 9.1. Last change: 2024 Nov 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,7 +29,7 @@ depends on the 'shortmess' option.
Clear messages, keeping only the {count} most
recent ones.
The number of remembered messages is fixed at 200.
The number of remembered messages is determined by the 'msghistory' option.
*g<*
The "g<" command can be used to see the last page of previous command output.

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2024 Oct 22
*options.txt* For Vim version 9.1. Last change: 2024 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -439,10 +439,11 @@ Note: In the future more global options can be made |global-local|. Using
":setlocal" on a global option might work differently then.
*option-value-function*
Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
a function name or a function reference or a lambda function. When using a
lambda it will be converted to the name, e.g. "<lambda>123". Examples:
Some options ('completefunc', 'findfunc', 'imactivatefunc', 'imstatusfunc',
'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc')
are set to a function name or a function reference or a lambda function. When
using a lambda it will be converted to the name, e.g. "<lambda>123".
Examples:
>
set opfunc=MyOpFunc
set opfunc=function('MyOpFunc')
@@ -3514,7 +3515,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Only alphanumeric characters, '-' and '_' can be used.
*'fillchars'* *'fcs'*
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~")
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@")
global or local to window |global-local|
Characters to fill the statuslines, vertical separators and special
lines in the window.
@@ -3552,6 +3553,56 @@ A jump table for the options with a short description can be found at |Q_op|.
eob EndOfBuffer |hl-EndOfBuffer|
lastline NonText |hl-NonText|
*'findfunc'* *'ffu'* *E1514*
'findfunc' 'ffu' string (default empty)
global or local to buffer |global-local|
{not available when compiled without the |+eval|
feature}
Function that is called to obtain the filename(s) for the |:find|
command. When this option is empty, the internal |file-searching|
mechanism is used.
The value can be the name of a function, a |lambda| or a |Funcref|.
See |option-value-function| for more information.
The function is called with two arguments. The first argument is a
|String| and is the |:find| command argument. The second argument is
a |Boolean| and is set to |v:true| when the function is called to get
a List of command-line completion matches for the |:find| command.
The function should return a List of strings.
The function is called only once per |:find| command invocation.
The function can process all the directories specified in 'path'.
If a match is found, the function should return a |List| containing
one or more file names. If a match is not found, the function
should return an empty List.
If any errors are encountered during the function invocation, an
empty List is used as the return value.
It is not allowed to change text or jump to another window while
executing the 'findfunc' |textlock|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
Examples:
>
" Use glob()
func FindFuncGlob(cmdarg, cmdcomplete)
let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg
return glob(pat, v:false, v:true)
endfunc
set findfunc=FindFuncGlob
" Use the 'git ls-files' output
func FindGitFiles(cmdarg, cmdcomplete)
let fnames = systemlist('git ls-files')
return fnames->filter('v:val =~? a:cmdarg')
endfunc
set findfunc=FindGitFiles
<
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
'fixendofline' 'fixeol' boolean (default on)
local to buffer
@@ -4389,7 +4440,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global
A history of ":" commands, and a history of previous search patterns
is remembered. This option decides how many entries may be stored in
each of these histories (see |cmdline-editing|).
each of these histories (see |cmdline-editing| and 'msghistory' for
the number of messages to remember).
The maximum value is 10000.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
@@ -5866,6 +5918,14 @@ A jump table for the options with a short description can be found at |Q_op|.
time in msec between two mouse clicks for the second click to be
recognized as a multi click.
*'msghistory'* *'mhi'*
'msghistory' 'mhi' number (default 500)
global
Determines how many entries are remembered in the |:messages| history.
The maximum value is 10000.
Setting it to zero clears the message history.
*'mzquantum'* *'mzq'*
'mzquantum' 'mzq' number (default 100)
global
@@ -9379,7 +9439,7 @@ A jump table for the options with a short description can be found at |Q_op|.
happens when there are special characters.
*'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'*
'wildmenu' 'wmnu' boolean (default off, set in |defaults.vim|)
'wildmenu' 'wmnu' boolean (default on)
global
When 'wildmenu' is on, command-line completion operates in an enhanced
mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,

View File

@@ -1,4 +1,4 @@
*os_mac.txt* For Vim version 9.1. Last change: 2019 Apr 21
*os_mac.txt* For Vim version 9.1. Last change: 2024 Nov 14
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -118,9 +118,13 @@ Shift-Control-2.
When reporting any Mac specific bug or feature change, please use the vim-mac
maillist |vim-mac|. However, you need to be subscribed. An alternative is to
send a message to the current MacVim maintainers:
report issues either directly at the Vim github repository:
mac@vim.org
https://github.com/vim/vim/issues
or for MacVim specific issues, you may report those over here:
https://github.com/macvim-dev/macvim/issues
==============================================================================
7. Compiling Vim *mac-compile*

View File

@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 9.1. Last change: 2024 Jun 18
*pattern.txt* For Vim version 9.1. Last change: 2024 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -164,7 +164,7 @@ or auto suspended with nohlsearch plugin. See |nohlsearch-install|.
When 'shortmess' does not include the "S" flag, Vim will automatically show an
index, on which the cursor is. This can look like this: >
index, on which the cursor is. This can look like this: >
[1/5] Cursor is on first of 5 matches.
[1/>99] Cursor is on first of more than 99 matches.
@@ -757,7 +757,7 @@ overview.
\([a-z]\+\)\zs,\1 ",abc" in "abc,abc"
\@123<=
Like "\@<=" but only look back 123 bytes. This avoids trying lots
Like "\@<=" but only look back 123 bytes. This avoids trying lots
of matches that are known to fail and make executing the pattern very
slow. Example, check if there is a "<" just before "span":
/<\@1<=span
@@ -783,7 +783,7 @@ overview.
\(\/\/.*\)\@<!in "in" which is not after "//"
\@123<!
Like "\@<!" but only look back 123 bytes. This avoids trying lots of
Like "\@<!" but only look back 123 bytes. This avoids trying lots of
matches that are known to fail and make executing the pattern very
slow.
@@ -907,7 +907,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
inside the Visual area put it at the start and just before the end of
the pattern, e.g.: >
/\%Vfoo.*ba\%Vr
< This also works if only "foo bar" was Visually selected. This: >
< This also works if only "foo bar" was Visually selected. This: >
/\%Vfoo.*bar\%V
< would match "foo bar" if the Visual selection continues after the "r".
Only works for the current buffer.
@@ -1014,7 +1014,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
< To match all characters after the current virtual column (where the
cursor is): >
/\%>.v.*
< Column 17 is not included, because this is a |/zero-width| match. To
< Column 17 is not included, because this is a |/zero-width| match. To
include the column use: >
/^.*\%17v.
< This command does the same thing, but also matches when there is no
@@ -1138,11 +1138,11 @@ x A single character, with no special meaning, matches itself
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
- If two characters in the sequence are separated by '-', this is
shorthand for the full list of ASCII characters between them. E.g.,
"[0-9]" matches any decimal digit. If the starting character exceeds
the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters
"[0-9]" matches any decimal digit. If the starting character exceeds
the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters
can be used, but the character values must not be more than 256 apart
in the old regexp engine. For example, searching by [\u3000-\u4000]
after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
in the old regexp engine. For example, searching by [\u3000-\u4000]
after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
- A character class expression is evaluated to the set of characters
belonging to that character class. The following character classes
are supported:
@@ -1208,7 +1208,7 @@ x A single character, with no special meaning, matches itself
any character that's not in "^]-\bdertnoUux". "[\xyz]" matches '\',
'x', 'y' and 'z'. It's better to use "\\" though, future expansions
may use other characters after '\'.
- Omitting the trailing ] is not considered an error. "[]" works like
- Omitting the trailing ] is not considered an error. "[]" works like
"[]]", it matches the ']' character.
- The following translations are accepted when the 'l' flag is not
included in 'cpoptions':
@@ -1444,14 +1444,14 @@ Finally, these constructs are unique to Perl:
display you may get unexpected results. That is because Vim
looks for a match in the line where redrawing starts.
Also see |matcharg()| and |getmatches()|. The former returns
Also see |matcharg()| and |getmatches()|. The former returns
the highlight group and pattern of a previous |:match|
command. The latter returns a list with highlight groups and
patterns defined by both |matchadd()| and |:match|.
Highlighting matches using |:match| are limited to three
matches (aside from |:match|, |:2match| and |:3match| are
available). |matchadd()| does not have this limitation and in
available). |matchadd()| does not have this limitation and in
addition makes it possible to prioritize matches.
Another example, which highlights all characters in virtual
@@ -1480,7 +1480,7 @@ Finally, these constructs are unique to Perl:
with the lowest number has priority if several match at the
same position. It uses the match id 3.
The ":3match" command is used by (Vim < 9.0.2054) |matchparen|
plugin. You are suggested to use ":match" for manual matching
plugin. You are suggested to use ":match" for manual matching
and ":2match" for another plugin or even better make use of
the more flexible |matchadd()| (and similar) functions instead.
@@ -1489,10 +1489,10 @@ Finally, these constructs are unique to Perl:
Fuzzy matching refers to matching strings using a non-exact search string.
Fuzzy matching will match a string, if all the characters in the search string
are present anywhere in the string in the same order. Case is ignored. In a
are present anywhere in the string in the same order. Case is ignored. In a
matched string, other characters can be present between two consecutive
characters in the search string. If the search string has multiple words, then
each word is matched separately. So the words in the search string can be
characters in the search string. If the search string has multiple words, then
each word is matched separately. So the words in the search string can be
present in any order in a string.
Fuzzy matching assigns a score for each matched string based on the following
@@ -1511,8 +1511,8 @@ will match the strings "GetPattern", "PatternGet", "getPattern", "patGetter",
"getSomePattern", "MatchpatternGet" etc.
The functions |matchfuzzy()| and |matchfuzzypos()| can be used to fuzzy search
a string in a List of strings. The matchfuzzy() function returns a List of
matching strings. The matchfuzzypos() functions returns the List of matches,
a string in a List of strings. The matchfuzzy() function returns a List of
matching strings. The matchfuzzypos() functions returns the List of matches,
the matching positions and the fuzzy match scores.
The "f" flag of `:vimgrep` enables fuzzy matching.

View File

@@ -1,14 +1,13 @@
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Oct 21
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 23
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
------------------------------------------------
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
(remove NOSPAM from Campbell's email first)
Original Author: Charles E. Campbell
Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
The VIM LICENSE applies to the files in this package, including
netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
netrw.vim, pi_netrw.txt, netrwSettings.vim, and
syntax/netrw.vim. Like anything else that's free, netrw.vim and its
associated files are provided *as is* and comes with no warranty of
any kind, either expressed or implied. No guarantees of
@@ -54,9 +53,10 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
Browsing With A Horizontally Split Window...........|netrw-o|
Browsing With A New Tab.............................|netrw-t|
Browsing With A Vertically Split Window.............|netrw-v|
Change File Permission..............................|netrw-gp|
Change Listing Style.(thin wide long tree)..........|netrw-i|
Change Listing Style (thin wide long tree)..........|netrw-i|
Changing To A Bookmarked Directory..................|netrw-gb|
Quick hide/unhide of dot-files......................|netrw-gh|
Changing local-only File Permission.................|netrw-gp|
Changing To A Predecessor Directory.................|netrw-u|
Changing To A Successor Directory...................|netrw-U|
Customizing Browsing With A Special Handler.........|netrw-x|
@@ -1469,48 +1469,106 @@ With either form of the command, netrw will first ask for confirmation
that the removal is in fact what you want to do. If netrw doesn't have
permission to remove a file, it will issue an error message.
*netrw-gx*
CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
best seen with a special handler (ie. a tool provided with your computer's
operating system). Netrw allows one to invoke such special handlers by: >
operating system). Netrw allows one to invoke such special handlers by:
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
< (latter not available if the |g:netrw_nogx| variable exists)
* hitting gx with the cursor atop the file path or alternatively x
in a netrw buffer; the former can be disabled by defining the
|g:netrw_nogx| variable
* when in command line, typing :Open <path>, see |:Open| below.
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
view files. Examples of useful settings (place into your <.vimrc>): >
:let g:netrw_browsex_viewer= "kfmclient exec"
< or >
:let g:netrw_browsex_viewer= "xdg-open"
<
If the viewer you wish to use does not support handling of a remote URL
directory, set |g:netrw_browsex_support_remote| to 0.
* for Windows 32 or 64, the URL and FileProtocolHandler dlls are used.
* for Gnome (with gnome-open): gnome-open is used.
* for KDE (with kfmclient) : kfmclient is used
* for Mac OS X : open is used.
The gx mapping extends to all buffers; apply "gx" while atop a word and netrw
will apply a special handler to it (like "x" works when in a netrw buffer).
One may also use visual mode (see |visual-start|) to select the text that the
special handler will use. Normally gx uses expand("<cfile>") to pick up the
text under the cursor; one may change what |expand()| uses via the
special handler will use. Normally gx checks for a close-by URL or file name
to pick up the text under the cursor; one may change what |expand()| uses via the
|g:netrw_gx| variable (options include "<cword>", "<cWORD>"). Note that
expand("<cfile>") depends on the |'isfname'| setting. Alternatively, one may
select the text to be used by gx by making a visual selection (see
|visual-block|) and then pressing gx.
The selection function can be adapted for each filetype by adding a function
`Netrw_get_URL_<filetype>`, where <filetype> is given by the 'filetype'.
The function should return the URL or file name to be used by gx, and will
fall back to the default behavior if it returns an empty string.
For example, special handlers for links Markdown and HTML are
" make gx work on concealed links regardless of exact cursor position: >
function Netrw_get_URL_markdown()
" markdown URL such as [link text](http://ya.ru 'yandex search')
try
let save_view = winsaveview()
if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
return matchstr(getline('.')[col('.')-1:],
\ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)')
endif
return ''
finally
call winrestview(save_view)
endtry
endfunction
function Netrw_get_URL_html()
" HTML URL such as <a href='http://www.python.org'>Python is here</a>
" <a href="http://www.python.org"/>
try
let save_view = winsaveview()
if searchpair('<a\s\+href=', '', '\%(</a>\|/>\)\zs', 'cbW', '', line('.')) > 0
return matchstr(getline('.')[col('.') - 1 : ],
\ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>')
endif
return ''
finally
call winrestview(save_view)
endtry
endfunction
<
Other than a file path, the text under the cursor may be a URL. Netrw uses
by default the following regular expression to determine if the text under the
cursor is a URL:
>
:let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}'
<
Associated setting variables:
|g:netrw_gx| control how gx picks up the text under the cursor
|g:netrw_nogx| prevent gx map while editing
|g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages
OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
view files.
If the viewer you wish to use does not support handling of a remote URL
directory, set |g:netrw_browsex_support_remote| to 0.
* otherwise:
* for Windows : explorer.exe is used
* for Mac OS X : open is used.
* for Linux : xdg-open is used.
To open a path (or URL) <path> by the appropriate handler, type >
:Open <path>
<
No escaping, neither for the shell nor for Vim's command-line, is needed.
To launch a specific application <app> <args>, often <args> being <path> >
:Launch <app> <args>.
Since <args> can be arbitrarily complex, in particular contain many file
paths, the escaping is left to the user.
If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see
|netrw-noload|), then you can use >
:call netrw#Launch('<app> <args>')
:call netrw#Open('<path>')
<
*netrw-curdir*
DELETING BOOKMARKS *netrw-mB* {{{2
@@ -2600,10 +2658,34 @@ your browsing preferences. (see also: |netrw-settings|)
netrw last saw |g:netrw_cursor| >= 5 or when
netrw was initially run.
*g:netrw_decompress* = { ".gz" : "gunzip" ,
".bz2" : "bunzip2" ,
".zip" : "unzip" ,
".tar" : "tar -xf"}
*g:netrw_decompress* = { '.lz4': 'lz4 -d',
'.lzo': 'lzop -d',
'.lz': 'lzip -dk',
'.7z': '7za x',
'.001': '7za x',
'.tar.bz': 'tar -xvjf',
'.tar.bz2': 'tar -xvjf',
'.tbz': 'tar -xvjf',
'.tbz2': 'tar -xvjf',
'.tar.gz': 'tar -xvzf',
'.tgz': 'tar -xvzf',
'.tar.zst': 'tar --use-compress-program=unzstd -xvf',
'.tzst': 'tar --use-compress-program=unzstd -xvf',
'.tar': 'tar -xvf',
'.zip': 'unzip',
'.bz': 'bunzip2 -k',
'.bz2': 'bunzip2 -k',
'.gz': 'gunzip -k',
'.lzma': 'unlzma -T0 -k',
'.xz': 'unxz -T0 -k',
'.zst': 'zstd -T0 -d',
'.Z': 'uncompress -k',
'.rar': 'unrar x -ad',
'.tar.lzma': 'tar --lzma -xvf',
'.tlz': 'tar --lzma -xvf',
'.tar.xz': 'tar -xvJf',
'.txz': 'tar -xvJf'}
A dictionary mapping suffices to
decompression programs.

View File

@@ -1,4 +1,4 @@
*pi_paren.txt* For Vim version 9.1. Last change: 2013 May 08
*pi_paren.txt* For Vim version 9.1. Last change: 2024 Nov 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -10,6 +10,7 @@ The functionality mentioned here is a |standard-plugin|.
This plugin is only available if 'compatible' is not set.
You can avoid loading this plugin by setting the "loaded_matchparen" variable: >
:let loaded_matchparen = 1
The plugin installs CursorMoved, CursorMovedI and WinEnter autocommands to
@@ -29,6 +30,16 @@ the ":highlight" command. Example: >
:hi MatchParen ctermbg=blue guibg=lightblue
By default the plugin will highlight both the paren under the cursor and the
matching one using the |hl-MatchParen| highlighting group. This may result in
the cursor briefly disappearing from the screen as the MatchParen colors take
over the cursor highlight. To prevent this from happening and have the plugin
only highlight the matching paren and not the one under the cursor
(effectively leaving the cursor style unchanged), you can set the
"matchparen_disable_cursor_hl" variable: >
:let matchparen_disable_cursor_hl = 1
The characters to be matched come from the 'matchpairs' option. You can
change the value to highlight different matches. Note that not everything is
possible. For example, you can't highlight single or double quotes, because
@@ -46,10 +57,10 @@ are:
closed folds.
- 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay
in a long line with syntax highlighting.
- A timeout of 300 msec (60 msec in Insert mode). This can be changed with the
g:matchparen_timeout and g:matchparen_insert_timeout variables and their
buffer-local equivalents b:matchparen_timeout and
b:matchparen_insert_timeout.
- A timeout of 300 msec (60 msec in Insert mode). This can be changed with
the "g:matchparen_timeout" and "g:matchparen_insert_timeout" variables and
their buffer-local equivalents "b:matchparen_timeout" and
"b:matchparen_insert_timeout".
If you would like the |%| command to work better, the matchit plugin can be
used, see |matchit-install|. This plugin also helps to skip matches in

52
runtime/doc/pi_tutor.txt Normal file
View File

@@ -0,0 +1,52 @@
*pi_tutor.txt* For Vim version 9.1. Last change: 2024 Nov 09
INTERACTIVE TUTORIALS FOR VIM *vim-tutor-mode*
vim-tutor-mode provides a system to follow and create interactive tutorials
for vim and third party plugins. It replaces the venerable `vimtutor` system.
=============================================================================
1. Usage *vim-tutor-usage*
vim-tutor-mode tutorials are hypertext documents, they have rich text and
contain links. To stand out from the rest of the text, links are underlined.
You can follow them by placing the cursor over them and pressing <Enter>, or
by double-clicking them.
1.1 Commands
------------
*:Tutor*
:Tutor {tutorial} Opens a tutorial. Command-line completion for
{tutorial} is provided, the candidates are a list of
'.tutor' files found in the 'tutor/' folder in
the 'runtimepath'. Tutorials prefixed with 'vim-'
will always be shown first.
If no {tutorial} is provided, the command starts the
'vim-01-beginner' tutorial, which is equivalent to
Vim's `vimtutor`.
=============================================================================
2. Creating tutorials *vim-tutor-create*
Writing vim-tutor-mode tutorials is easy. For an overview of the format used,
please consult the 'tutor.tutor' file: >
:Tutor tutor
<
New tutorials must be placed in the 'tutor/' folder in the 'runtimepath'
to be detected by the :Tutor command.
It is recommended to use a less formal style when writing tutorials than in
regular documentation (unless the content requires it).
=============================================================================
3. Contributing
Development of the plugin is done over at github [1]. Feel free to report
issues and make suggestions.
[1]: https://github.com/fmoralesc/vim-tutor-mode
=============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 9.1. Last change: 2024 Oct 05
*quickfix.txt* For Vim version 9.1. Last change: 2024 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -361,7 +361,7 @@ processing a quickfix or location list command, it will be aborted.
Example: >
:g/mypattern/caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")
<
*:lad* *:addd* *:laddexpr*
*:lad* *:ladd* *:laddexpr*
:lad[dexpr] {expr} Same as ":caddexpr", except the location list for the
current window is used instead of the quickfix list.
@@ -1405,6 +1405,32 @@ being checked. To disable this set g:perl_compiler_force_warnings to a zero
value. For example: >
let g:perl_compiler_force_warnings = 0
MYPY TYPE CHECKER *compiler-mypy*
Commonly used compiler options can be added to 'makeprg' by setting the
b/g:mypy_makeprg_params variable. For example: >
let b:mypy_makeprg_params = "--warn-unused-ignores"
The global default is "--strict --ignore-missing-imports".
RUFF LINTER *compiler-ruff*
Commonly used compiler options can be added to 'makeprg' by setting the
b/g:ruff_makeprg_params variable. For example: >
let b:ruff_makeprg_params = "--max-line-length "..&textwidth
The global default is "--preview".
PYLINT LINTER *compiler-pylint*
Commonly used compiler options can be added to 'makeprg' by setting the
b/g:pylint_makeprg_params variable. For example: >
let b:pylint_makeprg_params = "--max-line-length "..&textwidth
The global default is "--jobs=0" to use (almost) all cores.
PYUNIT COMPILER *compiler-pyunit*

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 9.1. Last change: 2024 Mar 03
*quickref.txt* For Vim version 9.1. Last change: 2024 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -707,6 +707,7 @@ Short explanation of each option: *option-list*
'fileignorecase' 'fic' ignore case when using file names
'filetype' 'ft' type of file, used for autocommands
'fillchars' 'fcs' characters to use for displaying special items
'findfunc' 'ffu' function to be called for the |:find| command
'fixendofline' 'fixeol' make sure last line in file has <EOL>
'fkmap' 'fk' obsolete option for Farsi
'foldclose' 'fcl' close a fold when the cursor leaves it

View File

@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2024 Oct 22
*syntax.txt* For Vim version 9.1. Last change: 2024 Nov 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1679,20 +1679,20 @@ on" command in your .vimrc file.
When you edit an existing Fortran file, the syntax script will assume free
source form if the fortran_free_source variable has been set, and assumes
fixed source form if the fortran_fixed_source variable has been set. Suppose
neither of these variables have been set. In that case, the syntax script attempts to
determine which source form has been used by examining the file extension
using conventions common to the ifort, gfortran, Cray, NAG, and PathScale
compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for
free-source). No default is used for the .fpp and .ftn file extensions because
different compilers treat them differently. If none of this works, then the
script examines the first five columns of the first 500 lines of your file. If
no signs of free source form are detected, then the file is assumed to be in
fixed source form. The algorithm should work in the vast majority of cases.
In some cases, such as a file that begins with 500 or more full-line comments,
the script may incorrectly decide that the code is in fixed form. If that
happens, just add a non-comment statement beginning anywhere in the first five
columns of the first twenty-five lines, save (:w), and then reload (:e!) the
file.
neither of these variables have been set. In that case, the syntax script
attempts to determine which source form has been used by examining the file
extension using conventions common to the ifort, gfortran, Cray, NAG, and
PathScale compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08
for free-source). No default is used for the .fpp and .ftn file extensions
because different compilers treat them differently. If none of this works,
then the script examines the first five columns of the first 500 lines of your
file. If no signs of free source form are detected, then the file is assumed
to be in fixed source form. The algorithm should work in the vast majority of
cases. In some cases, such as a file that begins with 500 or more full-line
comments, the script may incorrectly decide that the code is in fixed form.
If that happens, just add a non-comment statement beginning anywhere in the
first five columns of the first twenty-five lines, save (:w), and then reload
(:e!) the file.
Vendor extensions ~
Fixed-form Fortran requires a maximum line length of 72 characters but the
@@ -2226,9 +2226,9 @@ define the vim variable 'lace_case_insensitive' in your startup file: >
LF (LFRC) *lf.vim* *ft-lf-syntax* *g:lf_shell_syntax*
*b:lf_shell_syntax*
For the lf file manager configuration files (lfrc) the shell commands
syntax highlighting can be changed globally and per buffer by setting
a different 'include' command search pattern using these variables:
For the lf file manager configuration files (lfrc) the shell commands syntax
highlighting can be changed globally and per buffer by setting a different
'include' command search pattern using these variables: >
let g:lf_shell_syntax = "syntax/dosbatch.vim"
let b:lf_shell_syntax = "syntax/zsh.vim"
@@ -2538,9 +2538,10 @@ set "msql_minlines" to the value you desire. Example: >
:let msql_minlines = 200
NEOMUTT *neomutt.vim* *ft-neomuttrc-syntax* *ft-neomuttlog-syntax*
NEOMUTT *neomutt.vim* *ft-neomuttrc-syntax*
*ft-neomuttlog-syntax*
To disable the default NeoMutt log colors >
To disable the default NeoMutt log colors: >
:let g:neolog_disable_default_colors = 1
@@ -2669,7 +2670,7 @@ To specify elements that should not be concealed, set the following variable: >
:let g:pandoc#syntax#conceal#blacklist = []
This is a list of the rules wich can be used here:
This is a list of the rules which can be used here:
- titleblock
- image
@@ -2710,9 +2711,9 @@ specified. Default = 1 >
:let g:pandoc#syntax#codeblocks#embeds#use = 1
For specify what languages and using what syntax files to highlight embeds. This is a
list of language names. When the language pandoc and vim use don't match, you
can use the "PANDOC=VIM" syntax. For example: >
For specify what languages and using what syntax files to highlight embeds.
This is a list of language names. When the language pandoc and vim use don't
match, you can use the "PANDOC=VIM" syntax. For example: >
:let g:pandoc#syntax#codeblocks#embeds#langs = ["ruby", "bash=sh"]
@@ -3922,7 +3923,7 @@ set "tf_minlines" to the value you desire. Example: >
:let tf_minlines = your choice
<
TYPESCRIPT *typescript.vim* *ft-typescript-syntax*
*typescriptreact.vim* *ft-typescriptreact-syntax*
*typescriptreact.vim* *ft-typescriptreact-syntax*
There is one option to control the TypeScript syntax highlighting.
@@ -5309,9 +5310,9 @@ of colors by using the `:colorscheme` command, for example: >
This is basically the same as >
:echo g:colors_name
< In case g:colors_name has not been defined :colo will
output "default". Its palette is defined in the file
output "default". Its palette is defined in the file
"$VIMRUNTIME/syntax/syncolor.vim" and is based on
legacy versions of peachpuff and desert. When compiled
legacy versions of peachpuff and desert. When compiled
without the |+eval| feature it will output "unknown".
:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath'
@@ -5721,8 +5722,8 @@ guisp={color-name} *highlight-guisp*
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
<
If you are authoring a color scheme and use the same hexadecimal value
repeatedly, you can define a (lower case) name for it in |v:colornames|.
For example: >
repeatedly, you can define a (lower case) name for it in
|v:colornames|. For example: >
# provide a default value for this color but allow the user to
# override it.

View File

@@ -269,6 +269,7 @@ $quote eval.txt /*$quote*
'fex' options.txt /*'fex'*
'ff' options.txt /*'ff'*
'ffs' options.txt /*'ffs'*
'ffu' options.txt /*'ffu'*
'fic' options.txt /*'fic'*
'fileencoding' options.txt /*'fileencoding'*
'fileencodings' options.txt /*'fileencodings'*
@@ -277,6 +278,7 @@ $quote eval.txt /*$quote*
'fileignorecase' options.txt /*'fileignorecase'*
'filetype' options.txt /*'filetype'*
'fillchars' options.txt /*'fillchars'*
'findfunc' options.txt /*'findfunc'*
'fixendofline' options.txt /*'fixendofline'*
'fixeol' options.txt /*'fixeol'*
'fk' options.txt /*'fk'*
@@ -499,6 +501,7 @@ $quote eval.txt /*$quote*
'mesg' vi_diff.txt /*'mesg'*
'mfd' options.txt /*'mfd'*
'mh' options.txt /*'mh'*
'mhi' options.txt /*'mhi'*
'mis' options.txt /*'mis'*
'mkspellmem' options.txt /*'mkspellmem'*
'ml' options.txt /*'ml'*
@@ -529,6 +532,7 @@ $quote eval.txt /*$quote*
'mousetime' options.txt /*'mousetime'*
'mp' options.txt /*'mp'*
'mps' options.txt /*'mps'*
'msghistory' options.txt /*'msghistory'*
'msm' options.txt /*'msm'*
'mzq' options.txt /*'mzq'*
'mzquantum' options.txt /*'mzquantum'*
@@ -2123,10 +2127,12 @@ $quote eval.txt /*$quote*
:GnatFind ft_ada.txt /*:GnatFind*
:GnatPretty ft_ada.txt /*:GnatPretty*
:GnatTags ft_ada.txt /*:GnatTags*
:HelpToc helphelp.txt /*:HelpToc*
:Hexplore pi_netrw.txt /*:Hexplore*
:LP pi_logipat.txt /*:LP*
:LPE pi_logipat.txt /*:LPE*
:LPF pi_logipat.txt /*:LPF*
:Launch pi_netrw.txt /*:Launch*
:Lexplore pi_netrw.txt /*:Lexplore*
:Lfilter quickfix.txt /*:Lfilter*
:LogiPat pi_logipat.txt /*:LogiPat*
@@ -2144,6 +2150,7 @@ $quote eval.txt /*$quote*
:Ntree pi_netrw.txt /*:Ntree*
:Nw pi_netrw.txt /*:Nw*
:Nwrite pi_netrw.txt /*:Nwrite*
:Open pi_netrw.txt /*:Open*
:Over terminal.txt /*:Over*
:P various.txt /*:P*
:Pexplore pi_netrw.txt /*:Pexplore*
@@ -2173,6 +2180,7 @@ $quote eval.txt /*$quote*
:Termdebug terminal.txt /*:Termdebug*
:TermdebugCommand terminal.txt /*:TermdebugCommand*
:Texplore pi_netrw.txt /*:Texplore*
:Tutor pi_tutor.txt /*:Tutor*
:Until terminal.txt /*:Until*
:Up terminal.txt /*:Up*
:UseVimball pi_vimball.txt /*:UseVimball*
@@ -2211,7 +2219,6 @@ $quote eval.txt /*$quote*
:abo windows.txt /*:abo*
:aboveleft windows.txt /*:aboveleft*
:abstract vim9class.txt /*:abstract*
:addd quickfix.txt /*:addd*
:al windows.txt /*:al*
:all windows.txt /*:all*
:am gui.txt /*:am*
@@ -2731,6 +2738,7 @@ $quote eval.txt /*$quote*
:lab quickfix.txt /*:lab*
:labove quickfix.txt /*:labove*
:lad quickfix.txt /*:lad*
:ladd quickfix.txt /*:ladd*
:laddb quickfix.txt /*:laddb*
:laddbuffer quickfix.txt /*:laddbuffer*
:laddexpr quickfix.txt /*:laddexpr*
@@ -4572,6 +4580,7 @@ E1510 change.txt /*E1510*
E1511 options.txt /*E1511*
E1512 options.txt /*E1512*
E1513 message.txt /*E1513*
E1514 options.txt /*E1514*
E152 helphelp.txt /*E152*
E153 helphelp.txt /*E153*
E154 helphelp.txt /*E154*
@@ -5812,6 +5821,8 @@ W19 autocmd.txt /*W19*
W20 if_pyth.txt /*W20*
W21 if_pyth.txt /*W21*
W22 userfunc.txt /*W22*
W23 gui_x11.txt /*W23*
W24 gui_x11.txt /*W24*
WORD motion.txt /*WORD*
WSL os_win32.txt /*WSL*
WWW intro.txt /*WWW*
@@ -6554,9 +6565,12 @@ compiler-hpada ft_ada.txt /*compiler-hpada*
compiler-javac quickfix.txt /*compiler-javac*
compiler-make quickfix.txt /*compiler-make*
compiler-manx quickfix.txt /*compiler-manx*
compiler-mypy quickfix.txt /*compiler-mypy*
compiler-pandoc quickfix.txt /*compiler-pandoc*
compiler-perl quickfix.txt /*compiler-perl*
compiler-pylint quickfix.txt /*compiler-pylint*
compiler-pyunit quickfix.txt /*compiler-pyunit*
compiler-ruff quickfix.txt /*compiler-ruff*
compiler-select quickfix.txt /*compiler-select*
compiler-tex quickfix.txt /*compiler-tex*
compiler-typst quickfix.txt /*compiler-typst*
@@ -7323,6 +7337,8 @@ ft-html-omni insert.txt /*ft-html-omni*
ft-html-syntax syntax.txt /*ft-html-syntax*
ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax*
ft-ia64-syntax syntax.txt /*ft-ia64-syntax*
ft-idris2-indent indent.txt /*ft-idris2-indent*
ft-idris2-plugin filetype.txt /*ft-idris2-plugin*
ft-inform-syntax syntax.txt /*ft-inform-syntax*
ft-java-plugin filetype.txt /*ft-java-plugin*
ft-java-syntax syntax.txt /*ft-java-syntax*
@@ -7370,6 +7386,7 @@ ft-neomuttlog-syntax syntax.txt /*ft-neomuttlog-syntax*
ft-neomuttrc-syntax syntax.txt /*ft-neomuttrc-syntax*
ft-nroff-syntax syntax.txt /*ft-nroff-syntax*
ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax*
ft-org-plugin filetype.txt /*ft-org-plugin*
ft-pandoc-syntax syntax.txt /*ft-pandoc-syntax*
ft-papp-syntax syntax.txt /*ft-papp-syntax*
ft-pascal-syntax syntax.txt /*ft-pascal-syntax*
@@ -7828,6 +7845,7 @@ getbufinfo() builtin.txt /*getbufinfo()*
getbufline() builtin.txt /*getbufline()*
getbufoneline() builtin.txt /*getbufoneline()*
getbufvar() builtin.txt /*getbufvar()*
getcellpixels() builtin.txt /*getcellpixels()*
getcellwidths() builtin.txt /*getcellwidths()*
getchangelist() builtin.txt /*getchangelist()*
getchar() builtin.txt /*getchar()*
@@ -8056,11 +8074,13 @@ hasmapto() builtin.txt /*hasmapto()*
hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt*
help helphelp.txt /*help*
help-TOC helphelp.txt /*help-TOC*
help-buffer-options helphelp.txt /*help-buffer-options*
help-context help.txt /*help-context*
help-curwin tips.txt /*help-curwin*
help-summary usr_02.txt /*help-summary*
help-tags tags 1
help-toc-install helphelp.txt /*help-toc-install*
help-translated helphelp.txt /*help-translated*
help-writing helphelp.txt /*help-writing*
help-xterm-window helphelp.txt /*help-xterm-window*
@@ -9271,6 +9291,7 @@ o_CTRL-V motion.txt /*o_CTRL-V*
o_V motion.txt /*o_V*
o_object-select motion.txt /*o_object-select*
o_v motion.txt /*o_v*
obj-var-type-any vim9class.txt /*obj-var-type-any*
object vim9class.txt /*object*
object-const-variable vim9class.txt /*object-const-variable*
object-empty() vim9class.txt /*object-empty()*
@@ -9320,6 +9341,7 @@ options.txt options.txt /*options.txt*
optwin options.txt /*optwin*
or() builtin.txt /*or()*
oracle ft_sql.txt /*oracle*
os-support vi_diff.txt /*os-support*
os2 os_os2.txt /*os2*
os390 os_390.txt /*os390*
os_390.txt os_390.txt /*os_390.txt*
@@ -9431,6 +9453,7 @@ pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_paren.txt pi_paren.txt /*pi_paren.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt*
pi_tar.txt pi_tar.txt /*pi_tar.txt*
pi_tutor.txt pi_tutor.txt /*pi_tutor.txt*
pi_vimball.txt pi_vimball.txt /*pi_vimball.txt*
pi_zip.txt pi_zip.txt /*pi_zip.txt*
pkzip options.txt /*pkzip*
@@ -10230,12 +10253,18 @@ strstr() builtin.txt /*strstr()*
strtrans() builtin.txt /*strtrans()*
strutf16len() builtin.txt /*strutf16len()*
strwidth() builtin.txt /*strwidth()*
style-braces develop.txt /*style-braces*
style-changes develop.txt /*style-changes*
style-comments develop.txt /*style-comments*
style-common-functions develop.txt /*style-common-functions*
style-compiler develop.txt /*style-compiler*
style-declarations develop.txt /*style-declarations*
style-examples develop.txt /*style-examples*
style-functions develop.txt /*style-functions*
style-indentation develop.txt /*style-indentation*
style-names develop.txt /*style-names*
style-spaces develop.txt /*style-spaces*
style-types develop.txt /*style-types*
style-various develop.txt /*style-various*
sub-menu-priority gui.txt /*sub-menu-priority*
sub-replace-\= change.txt /*sub-replace-\\=*
@@ -10614,6 +10643,7 @@ template autocmd.txt /*template*
tempname() builtin.txt /*tempname()*
term++close terminal.txt /*term++close*
term++open terminal.txt /*term++open*
term++shell terminal.txt /*term++shell*
term-dependent-settings term.txt /*term-dependent-settings*
term-list syntax.txt /*term-list*
term.txt term.txt /*term.txt*
@@ -10660,7 +10690,9 @@ termdebug-starting terminal.txt /*termdebug-starting*
termdebug-stepping terminal.txt /*termdebug-stepping*
termdebug-timeout terminal.txt /*termdebug-timeout*
termdebug-variables terminal.txt /*termdebug-variables*
termdebug_contributing terminal.txt /*termdebug_contributing*
termdebug_disasm_window terminal.txt /*termdebug_disasm_window*
termdebug_evaluate_in_popup terminal.txt /*termdebug_evaluate_in_popup*
termdebug_map_K terminal.txt /*termdebug_map_K*
termdebug_map_minus terminal.txt /*termdebug_map_minus*
termdebug_map_plus terminal.txt /*termdebug_map_plus*
@@ -10692,6 +10724,7 @@ terminal-job-index index.txt /*terminal-job-index*
terminal-key-codes term.txt /*terminal-key-codes*
terminal-mouse term.txt /*terminal-mouse*
terminal-ms-windows terminal.txt /*terminal-ms-windows*
terminal-nospecial terminal.txt /*terminal-nospecial*
terminal-options term.txt /*terminal-options*
terminal-output-codes term.txt /*terminal-output-codes*
terminal-resizing terminal.txt /*terminal-resizing*
@@ -11230,6 +11263,9 @@ vim-script-intro usr_41.txt /*vim-script-intro*
vim-script-library eval.txt /*vim-script-library*
vim-security intro.txt /*vim-security*
vim-shebang various.txt /*vim-shebang*
vim-tutor-create pi_tutor.txt /*vim-tutor-create*
vim-tutor-mode pi_tutor.txt /*vim-tutor-mode*
vim-tutor-usage pi_tutor.txt /*vim-tutor-usage*
vim-use intro.txt /*vim-use*
vim-variable eval.txt /*vim-variable*
vim.b if_lua.txt /*vim.b*

View File

@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.1. Last change: 2024 Jul 28
*terminal.txt* For Vim version 9.1. Last change: 2024 Nov 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -197,6 +197,13 @@ Command syntax ~
if [command] is NONE no job is started, the pty of the
terminal can be used by a command like gdb.
*terminal-nospecial*
Vim itself only recognizes |cmdline-special|
characters inside [command]. Everything else will be
passed untouched. When needed to expand wildcards,
environment variables or other shell specials consider
|term++shell| option.
If [command] is missing the default behavior is to
close the terminal when the shell exits. This can be
changed with the ++noclose argument.
@@ -241,10 +248,16 @@ Command syntax ~
no window will be used.
++norestore Do not include this terminal window
in a session file.
*term++shell*
++shell Instead of executing {command}
directly, use a shell, like with
`:!command` *E279*
{only works on Unix and MS-Windows}
The resulting command will look like
'shell' 'shellcmdflag' [command]
Other options related to `:!command`
have no effect.
++kill={how} When trying to close the terminal
window kill the job with {how}. See
|term_setkill()| for the values.
@@ -1537,6 +1550,7 @@ If there is no g:termdebug_config you can use: >
<
However, the latter form will be deprecated in future releases.
Mappings ~
The termdebug plugin enables a few default mappings. All those mappings
are reset to their original values once the termdebug session concludes.
@@ -1591,6 +1605,7 @@ If the current window has enough horizontal space, it will be vertically split
and the Var window will be shown side by side with the source code window (and
the height options won't be used).
Communication ~
*termdebug-communication*
There is another, hidden, buffer, which is used for Vim to communicate with
@@ -1675,18 +1690,23 @@ If there is no g:termdebug_config you can use: >
However, the latter form will be deprecated in future releases.
Change default signs ~
*termdebug_signs*
Termdebug uses the hex number of the breakpoint ID in the signcolumn to
represent breakpoints. if it is greater than "0xFF", then it will be displayed
represent breakpoints. If it is greater than "0xFF", then it will be displayed
as "F+", due to we really only have two screen cells for the sign.
You may also use decimal breakpoint signs instead, in which case IDs greater
than 99 will be displayed as "9+".
If you want to customize the breakpoint signs: >
If you want to customize the breakpoint signs to show `>>` in the signcolumn: >
let g:termdebug_config['sign'] = '>>'
If there is no g:terminal_config yet you can use: >
If you would like to use decimal (base 10) breakpoint signs: >
let g:termdebug_config['sign_decimal'] = 1
If the variable g:termdebug_config does not yet exist, you can use: >
let g:termdebug_config = {'sign': '>>'}
After this, breakpoints will be displayed as `>>` in the signcolumn.
Likewise, to enable decimal signs: >
let g:termdebug_config = {'sign_decimal': 1}
Window toolbar ~
@@ -1716,4 +1736,37 @@ Set the wide value to 1 to use a vertical split without ever changing
'columns'. This is useful when the terminal can't be resized by Vim.
Evaluate in Popup Window at Cursor ~
*termdebug_evaluate_in_popup*
By default |:Evaluate| will simply echo its output. For larger entities this
might become difficult to read or even truncated.
Alternatively, the evaluation result may be output into a popup window at the
current cursor position: >
let g:termdebug_config['evaluate_in_popup'] = v:true
This can also be used in a "one-shot" manner: >
func OnCursorHold()
let g:termdebug_config['evaluate_in_popup'] = v:true
:Evaluate
let g:termdebug_config['evaluate_in_popup'] = v:false
endfunc
<
Contributing ~
*termdebug_contributing*
Contributions for termdebug improvements are welcome.
However, it is fairly common that during the development process you need some
mechanisms like `echo` statements (or similar) to help you in your job.
For this reason, you can set: >
let g:termdebug_config['debug'] = true
<
This sets the `DEBUG` variable to `true` in the source code that you can use
within the source code. An example of its usage follows: >
if exists('g:termdebug_loaded')
if DEBUG
Echoerr('Termdebug already loaded.')
endif
finish
endif
<
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.1. Last change: 2024 Sep 29
*todo.txt* For Vim version 9.1. Last change: 2024 Oct 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -55,32 +55,17 @@ When a help item can't be found, then open 'helpfile'. Search for the tag in
that file and gtive E149 only when not found. Helps for a tiny Vim installed
without all the help files.
SpellCap highlight not updated - PR #12428
Virtual text problems:
- If 'list' is on, 'below' virtual text which includes 1 or 2 characters are
gone (Issue #12028)
- Virtual text aligned "above": Wrong indentation when using tabs (Issue
#12232)
- Virtual text to the right of the line that isn't visible doesn't cause the
'extends' character to show in 'list' mode. #12478
- Virtual text to the right of the line that fits exactly on screen causes
that line and all lines below it not to be displayed (Issue #12213)
- Window screen gets wrong when a virtual text is placed on 'above' or
'below' on an empty line (Issue #11959)
- truncated Virtual text below an empty line causes display error #12493
When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be
highlighted. (van-de-bugger, 2018 Jan 23, #2576)
Improve profiling by caching matching functions: PR #12192
With 'smoothscroll' set and "lastline" in 'display', moving the cursor to a
wrapping line that makes the display scroll up may scroll much more than
needed, thus jump-scrolling. (part of issue 12411)
Implement foreach() PR #12166
Errors when running tests with valgrind:
- test_codestyle.vim: e.g.:
command line..script /home/mool/vim/vim91/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 6: keycode_check.vim: space before tab: Expected 0 but got 7
@@ -117,7 +102,6 @@ Upcoming larger works:
Further Vim9 improvements:
- Classes and Interfaces. See |vim9-classes|
- Cannot use class type of itself in the method (Issue #12369)
- Getting member of variable with "any" type should be handled at runtime.
Remove temporary solution from #12096 / patch 9.0.1375.
- "obj.Method()" does not always work in a compiled function, assumes "obj"
@@ -127,9 +111,6 @@ Further Vim9 improvements:
Possibly issue #11981 can be fixed at the same time (has two examples).
- Forward declaration of a class? E.g. for Clone() function.
Email lifepillar 2023 Mar 26
- When "Meta" is a class, is "const MetaAlias = Meta" allowed? It should
either work or given an error. Possibly give an error now and implement it
later (using a typedef). #12006
- how about lock/unlock?
- For chaining, allow using the class name as type for function return
value.
@@ -147,7 +128,7 @@ Further Vim9 improvements:
has(featureName), len(someString)
- Implement as part of an expression: ++expr, --expr, expr++, expr--.
- The use of the literal value "null" and the type specific "null_xxx"
values is confusing (#13458, #11770).
values is confusing (#13433, #11770).
Information missing in terminfo:
- Codes used for focus gained and lost termcodes are hard-coded in
@@ -225,8 +206,6 @@ Popup windows:
positioned? PopupNew? Could be used to set some options or move it out of
the way. (#5737)
However, it may also cause trouble, changing the popup of another plugin.
- Width is not computed correctly when minwidth and maxwidth are &columns
and padding and a scrollbar are used. (#6676)
- Should popup_getoptions() also return the mask? #7774
- Add a way to use popup_menu() synchronously: instead of invoking the
callback, return the choice. (Ben Jackson, #6534)
@@ -296,8 +275,6 @@ Terminal emulator window:
- Use CTRL-W CTRL-K to enter a digraph? #5371
- When Vim runs in the terminal and changes the title, the statusline needs to
be redrawn.
- GUI: When using ":set go+=!" a system() call causes the hit-enter prompt.
(#3327)
- Allow for specifying the directory, with ++cwd={dir}.
- When pasting should call vterm_keyboard_start_paste(), e.g. when using
K_MIDDLEMOUSE, calling insert_reg().
@@ -323,9 +300,6 @@ Cursor is after the end of the line: #12137.
Crash when a variable is removed while listing variables (Issue #11435)
Autoconf: must use autoconf 2.69, later version generates lots of warnings
- try using autoconf 2.71 and fix all "obsolete" warnings #11322
Problem with Visual highlight when 'linebreak' and 'showbreak' are set.
#11272
@@ -343,8 +317,6 @@ Support dark mode for MS-Windows: #12282
Remote command escapes single quote with backslash, should be doubling the
single quote in vim_strsave_escaped_ext() #12202.
PR to add custom and customlist completion types. #12228
Can deref_func_name() and deref_function_name() be merged?
Using :global with a pattern containing \zs doesn't use the line where \zs

View File

@@ -1,4 +1,4 @@
*undo.txt* For Vim version 9.1. Last change: 2024 Sep 29
*undo.txt* For Vim version 9.1. Last change: 2024 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -183,7 +183,7 @@ g- Go to older text state. With a count repeat that many
g+ Go to newer text state. With a count repeat that many
times.
*:lat* *:later*
:lat[er] {count} Go to newer text state {count} times.
:lat[er] {count} Go to newer text state {count} times.
:lat[er] {N}s Go to newer text state about {N} seconds later.
:lat[er] {N}m Go to newer text state about {N} minutes later.
:lat[er] {N}h Go to newer text state about {N} hours later.

View File

@@ -1,4 +1,4 @@
*usr_01.txt* For Vim version 9.1. Last change: 2024 May 11
*usr_01.txt* For Vim version 9.1. Last change: 2024 Nov 03
VIM USER MANUAL - by Bram Moolenaar
@@ -107,6 +107,8 @@ For more info see |vimrc| and |compatible-default|.
==============================================================================
*01.3* Using the Vim tutor *tutor* *vimtutor*
For the interactive tutor, see |vim-tutor-mode|
Instead of reading the text (boring!) you can use the vimtutor to learn your
first Vim commands. This is a 30-minute tutorial that teaches the most basic
Vim functionality hands-on.
@@ -118,8 +120,11 @@ On Unix, if Vim has been properly installed, you can start it from the shell:
On MS-Windows you can find it in the Program/Vim menu. Or execute
vimtutor.bat in the $VIMRUNTIME directory.
This will make a copy of the tutor file, so that you can edit it without
the risk of damaging the original.
This will make a copy of chapter 1 tutor file, so that you can edit it without
the risk of damaging the original. To continue with chapter 2, you can use
the following command: >
vimtutor -c 2
<
There are a few translated versions of the tutor. To find out if yours is
available, use the two-letter language code. For French: >

View File

@@ -1,4 +1,4 @@
*usr_10.txt* For Vim version 9.1. Last change: 2019 Nov 22
*usr_10.txt* For Vim version 9.1. Last change: 2024 Nov 12
VIM USER MANUAL - by Bram Moolenaar
@@ -736,6 +736,11 @@ The "!!" command filters the current line through a filter. In Unix the "date"
command prints the current time and date. "!!date<Enter>" replaces the current
line with the output of "date". This is useful to add a timestamp to a file.
Note: There is a difference between "!cmd" (e.g. using it without any file
range) and "{range}!cmd". While the former will simply execute the external
command and Vim will show the output, the latter will filter {range}lines
through the filter and replace that range by the result of the filter command.
See |:!| and |:range!| for details.
WHEN IT DOESN'T WORK

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 9.1. Last change: 2024 Oct 05
*usr_41.txt* For Vim version 9.1. Last change: 2024 Nov 11
VIM USER MANUAL - by Bram Moolenaar
@@ -778,6 +778,7 @@ String manipulation: *string-functions*
strdisplaywidth() size of string when displayed, deals with tabs
setcellwidths() set character cell width overrides
getcellwidths() get character cell width overrides
getcellpixels() get character cell pixel size
reverse() reverse the order of characters in a string
substitute() substitute a pattern match with a string
submatch() get a specific match in ":s" and substitute()
@@ -1394,6 +1395,7 @@ Various: *various-functions*
did_filetype() check if a FileType autocommand was used
diff() diff two Lists of strings
eventhandler() check if invoked by an event handler
getcellpixels() get List of cell pixel size
getpid() get process ID of Vim
getscriptinfo() get list of sourced vim scripts
getimstatus() check if IME status is active

View File

@@ -1,4 +1,4 @@
*usr_51.txt* For Vim version 9.1. Last change: 2024 Apr 04
*usr_51.txt* For Vim version 9.1. Last change: 2024 Nov 13
VIM USER MANUAL - by Bram Moolenaar
@@ -656,6 +656,8 @@ an example: >
CompilerSet errorformat& " use the default 'errorformat'
CompilerSet makeprg=nmake
Note: arguments need to be escaped according to |option-backslash|.
When you write a compiler plugin for the Vim distribution or for a system-wide
runtime directory, use the mechanism mentioned above. When
"current_compiler" was already set by a user plugin nothing will be done.

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 9.1. Last change: 2024 Oct 05
*various.txt* For Vim version 9.1. Last change: 2024 Nov 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -254,7 +254,19 @@ g8 Print the hex values of the bytes used in the
*:!cmd* *:!*
:!{cmd} Execute {cmd} with the shell. See also the 'shell'
and 'shelltype' option.
and 'shelltype' option. For the filter command, see
|:range!|.
Vim builds command line using options 'shell', 'shcf',
'sxq' and 'shq' in the following order:
`&sh &shcf &sxq &shq {cmd} &shq &sxq`
So setting both 'sxq' and 'shq' is possible but rarely
useful. Additional escaping inside `{cmd}` may also
be due to 'sxe' option.
Also, all |cmdline-special| characters in {cmd} are
replaced by Vim before passing them to shell.
*E34*
Any '!' in {cmd} is replaced with the previous
external command (see also 'cpoptions'). But not when
@@ -305,7 +317,10 @@ g8 Print the hex values of the bytes used in the
CTRL-L or ":redraw!" if the command did display
something. However, this depends on what the |t_ti|
and |t_te| termcap entries are set to.
Also see |shell-window|.
Hint: use |:terminal| command if you want to run {cmd}
in Vim window. `:term ++shell ++close {cmd}` could
serve as close approximation to what `:!{cmd}` does.
*:!!*
:!! Repeat last ":!{cmd}".

View File

@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2024 Oct 14
*version9.txt* For Vim version 9.1. Last change: 2024 Nov 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -31790,7 +31790,7 @@ Changed ~
- The features |++builtin_terms|, |+cmdline_info|, |+cmdwin|, |+file_in_path|,
|+float|, |+path_extra|, |+textobjects|, |+wildignore| and |+wildmenu| are
available in all the builds.
- Support for Windows-XP is dropped.
- Support for Windows-XP is dropped (starting with v9.0.0496)
- Support for VisVim is removed.
- The "small" and "big" builds are dropped in favor of "tiny" and "huge"
builds.
@@ -41600,6 +41600,13 @@ Changed~
- |:keeppatterns| preserves the last substitute pattern when used with |:s|
- |setqflist()| and |setloclist()| can optionally try to preserve the current
selection in the quickfix list with the "u" action.
- the putty terminal is detected using an |TermResponse| autocommand in
|defaults.vim| and Vim switches to a dark background
- the |help-TOC| package is included to ease navigating the documentation.
- an interactive tutor plugin has been included |vim-tutor-mode|, can be
started via |:Tutor|
- improve the |vimtutor| and add a second chapter for more advanced tips
- allow to pass local Vim script variables to python interpreter |py3eval()|
*added-9.2*
Added ~
@@ -41614,6 +41621,7 @@ Functions: ~
|foreach()| apply function to List items
|getcmdcomplpat()| Shell command line completion
|getcmdprompt()| get prompt for input()/confirm()
|getcellpixels()| get List of terminal cell pixel size
|getregion()| get a region of text from a buffer
|getregionpos()| get a list of positions for a region
|id()| get unique identifier for a Dict, List, Object,
@@ -41649,6 +41657,9 @@ Options: ~
'completeitemalign' Order of |complete-items| in Insert mode completion
popup
'findfunc' Vim function to obtain the results for a |:find|
command
'msghistory' Max number of messages to remember
'winfixbuf' Keep buffer focused in a window
'tabclose' Which tab page to focus after closing a tab page
't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420)

View File

@@ -1,4 +1,4 @@
*vi_diff.txt* For Vim version 9.1. Last change: 2024 Oct 05
*vi_diff.txt* For Vim version 9.1. Last change: 2024 Nov 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,6 +21,7 @@ is missing something or because Posix is beside the mark).
6. Supported Vi features |vi-features|
7. Command-line arguments |cmdline-arguments|
8. POSIX compliance |posix-compliance|
9. Supported Operating Systems |os-support|
==============================================================================
1. Simulated command *simulated-command*
@@ -1361,5 +1362,37 @@ These are remarks about running the POSIX test suite:
1 instead of 2.
- ex test 534 fails because .exrc isn't read in silent mode.
==============================================================================
9. Supported Operating systems *os-support*
Vim tries to support some old operating systems, however support for older
operating systems might be dropped if maintenance becomes a burden or can no
longer be verified.
Here is the status of some operating systems. Note fully supported means,
support is verified as part of the CI test suite.
System | Status:~
--------------------------------+-----------------------------------------
Amiga (OS4, AROS & MorphOS): | still supported (?)
Haiku: | still supported (?)
Linux: | fully supported (on maintained versions)
Mac OS: | fully supported up until v10.6 (?)
MS-Windows 7, 8, 10, 11: | fully supported
UNIX: | supported (on maintained versions)
OpenVMS: | supported
QNX: | still supported (?)
zOS/OS390: | still supported (?)
The following operating systems are no longer supported:
System | Status:~
--------------------------------+-----------------------------------------
Atari MiNT | support was dropped with v8.2.1215
BeOS: | support was dropped with v8.2.0849
MS-DOS: | support was dropped with v7.4.1399
MS-Windows XP and Vista: | support was dropped with v9.0.0496
OS/2 | support was dropped with v7.4.1008
RISC OS: | support was dropped with v7.3.0187
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*vim9class.txt* For Vim version 9.1. Last change: 2024 Apr 13
*vim9class.txt* For Vim version 9.1. Last change: 2024 Nov 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -873,6 +873,33 @@ Note that the method name must start with "new". If there is no method called
"new()" then the default constructor is added, even though there are other
constructor methods.
Using variable type "any" for an Object~
*obj-var-type-any*
You can use a variable declared with type "any" to hold an object. e.g.
>
vim9script
class A
var n = 10
def Get(): number
return this.n
enddef
endclass
def Fn(o: any)
echo o.n
echo o.Get()
enddef
var a = A.new()
Fn(a)
<
In this example, Vim cannot determine the type of the parameter "o" for
function Fn() at compile time. It can be either a |Dict| or an |Object|
value. Therefore, at runtime, when the type is known, the object member
variable and method are looked up. This process is not efficient, so it is
recommended to use a more specific type whenever possible for better
efficiency.
Compiling methods in a Class ~
*class-compile*
The |:defcompile| command can be used to compile all the class and object

View File

@@ -1,61 +1,106 @@
.TH VIMTUTOR 1 "12 agosto 2024"
.TH VIMTUTOR 1 "04 novembre 2024"
.SH NOME
vimtutor \- Un breve corso introduttivo a Vim
.SH SINTASSI
.br
.B vimtutor [\-g] [lingua]
.B vimtutor [\-l | \-\-language ISO639] [\-c | \-\-chapter NUMERO] [\-g | \-\-gui] [ISO639]
.br
.B vimtutor [\-h | \-\-help]
.br
.B vimtutor [\-\-list]
.SH DESCRIZIONE
.B Vimtutor
inizia il
.B Vim
tutor (un breve corso introduttivo a Vim).
Viene utilizzata una copia del file di lavoro, che può così essere modificato
a piacere senza alterare il file usato come modello.
.PP
Il comando
.B Vimtutor
è utile a chi voglia imparare i primi comandi di
.B Vim
.
.PP
L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la
versione GUI di vim è disponibile; altrimenti viene utilizzato vim.
.PP
L'argomento opzionale [lingua] è l'abbreviazione di due lettere del nome
.B Vim.
L'argomento opzionale [language] specifica l'abbreviazione di due lettere del nome
di una lingua, per esempio "it" oppure "es".
Se l'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
del computer.
Se la versione in tale lingua del "tutor" non è disponibile,
verrà usata la versione inglese.
.PP
.B Vimtutor
utilizza delle copie dei file originali, non c'è pericolo di danneggiare
i file stessi.
.PP
.B Vim
è sempre iniziato in Modo compatibile con Vi.
.SH OPZIONI
.TP
.BR \-l ", " \-\-language =\fIISO639\fR
Imposta il codice di due o tre lettere che designa la lingua.
P.es., 'it', 'es', 'bar'.
Il default è il linguaggio locale, se una traduzione è disponibile,
altrimenti viene utilizzato il testo originale in inglese.
.TP
.BR \-c ", " \-\-chapter =\fINUMBER\fR
Imposta il numero del capitolo. Il default è il capitolo uno.
.TP
.BR \-g ", " \-\-gui
Inizia
.B vimtutor
nella versione GUI di vim, se disponibile, altrimenti viene usata la versione console.
.TP
.BR \-h ", " \-\-help
Visualizza le informazioni relative all'uso del comando.
.TP
.BR \-\-list
Visualizza capitoli e lingue disponibili.
.SH ESEMPI
Per iniziare
.B vimtutor
in tedesco, dal capitolo uno:
.PP
.nf
.RS
vimtutor de
.RE
.fi
.PP
In inglese, dal capitolo due:
.PP
.nf
.RS
vimtutor -c2
.RE
.fi
.PP
Comandi nel formato esteso per usare il linguaggio bavarese, nella GUI, dal capitolo uno:
.PP
.nf
.RS
vimtutor --language bar --chapter 1 --gui
.RE
.fi
.SH FILE
.TP 15
/usr/local/lib/vim/vim??/tutor/tutor[.lingua]
I file di testo per
I file di testo per il capitolo uno di
.B Vimtutor
.
.br
.I vim??
è il numero di versione corto, p.es., vim91 per indicare
.B Vim 9.1.
.TP 15
/usr/local/share/vim/vim??/tutor/tutor2[.lingua]
I file di testo per il capitolo due di
.B Vimtutor.
.TP 15
/usr/local/share/vim/vim??/tutor/tutor.vim
Lo script di Vim usato per copiare il file di testo
.B Vimtutor
.
.B Vimtutor.
.SH AUTORE
Il corso introduttivo
.B Vimtutor
è stato scritto in origine per Vi da Michael C. Pierce e Robert K. Ware,
Colorado School of Mines, usando idee fornite da Charles Smith,
Colorado State University.
E-mail: bware@mines.colorado.edu (non più valido).
.br
È stato modificato per
.B E-mail: bware@mines.colorado.edu (non più valido).
.PP
.B Vimtutor
è stato modificato per
.B Vim
da Bram Moolenaar.
.PP
Per i nomi dei traduttori, vedere i file nelle rispettive lingue.
.SH VEDERE ANCHE
vim(1)

View File

@@ -1,61 +1,106 @@
.TH VIMTUTOR 1 "12 agosto 2024"
.TH VIMTUTOR 1 "04 novembre 2024"
.SH NOME
vimtutor \- Un breve corso introduttivo a Vim
.SH SINTASSI
.br
.B vimtutor [\-g] [lingua]
.B vimtutor [\-l | \-\-language ISO639] [\-c | \-\-chapter NUMERO] [\-g | \-\-gui] [ISO639]
.br
.B vimtutor [\-h | \-\-help]
.br
.B vimtutor [\-\-list]
.SH DESCRIZIONE
.B Vimtutor
inizia il
.B Vim
tutor (un breve corso introduttivo a Vim).
Viene utilizzata una copia del file di lavoro, che può così essere modificato
a piacere senza alterare il file usato come modello.
.PP
Il comando
.B Vimtutor
è utile a chi voglia imparare i primi comandi di
.B Vim
.
.PP
L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la
versione GUI di vim è disponibile; altrimenti viene utilizzato vim.
.PP
L'argomento opzionale [lingua] è l'abbreviazione di due lettere del nome
.B Vim.
L'argomento opzionale [language] specifica l'abbreviazione di due lettere del nome
di una lingua, per esempio "it" oppure "es".
Se l'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
del computer.
Se la versione in tale lingua del "tutor" non è disponibile,
verrà usata la versione inglese.
.PP
.B Vimtutor
utilizza delle copie dei file originali, non c'è pericolo di danneggiare
i file stessi.
.PP
.B Vim
è sempre iniziato in Modo compatibile con Vi.
.SH OPZIONI
.TP
.BR \-l ", " \-\-language =\fIISO639\fR
Imposta il codice di due o tre lettere che designa la lingua.
P.es., 'it', 'es', 'bar'.
Il default è il linguaggio locale, se una traduzione è disponibile,
altrimenti viene utilizzato il testo originale in inglese.
.TP
.BR \-c ", " \-\-chapter =\fINUMBER\fR
Imposta il numero del capitolo. Il default è il capitolo uno.
.TP
.BR \-g ", " \-\-gui
Inizia
.B vimtutor
nella versione GUI di vim, se disponibile, altrimenti viene usata la versione console.
.TP
.BR \-h ", " \-\-help
Visualizza le informazioni relative all'uso del comando.
.TP
.BR \-\-list
Visualizza capitoli e lingue disponibili.
.SH ESEMPI
Per iniziare
.B vimtutor
in tedesco, dal capitolo uno:
.PP
.nf
.RS
vimtutor de
.RE
.fi
.PP
In inglese, dal capitolo due:
.PP
.nf
.RS
vimtutor -c2
.RE
.fi
.PP
Comandi nel formato esteso per usare il linguaggio bavarese, nella GUI, dal capitolo uno:
.PP
.nf
.RS
vimtutor --language bar --chapter 1 --gui
.RE
.fi
.SH FILE
.TP 15
/usr/local/lib/vim/vim??/tutor/tutor[.lingua]
I file di testo per
I file di testo per il capitolo uno di
.B Vimtutor
.
.br
.I vim??
è il numero di versione corto, p.es., vim91 per indicare
.B Vim 9.1.
.TP 15
/usr/local/share/vim/vim??/tutor/tutor2[.lingua]
I file di testo per il capitolo due di
.B Vimtutor.
.TP 15
/usr/local/share/vim/vim??/tutor/tutor.vim
Lo script di Vim usato per copiare il file di testo
.B Vimtutor
.
.B Vimtutor.
.SH AUTORE
Il corso introduttivo
.B Vimtutor
è stato scritto in origine per Vi da Michael C. Pierce e Robert K. Ware,
Colorado School of Mines, usando idee fornite da Charles Smith,
Colorado State University.
E-mail: bware@mines.colorado.edu (non più valido).
.br
È stato modificato per
.B E-mail: bware@mines.colorado.edu (non più valido).
.PP
.B Vimtutor
è stato modificato per
.B Vim
da Bram Moolenaar.
.PP
Per i nomi dei traduttori, vedere i file nelle rispettive lingue.
.SH VEDERE ANCHE
vim(1)

View File

@@ -1,61 +1,105 @@
.TH VIMTUTOR 1 "2024 August 12"
.TH VIMTUTOR 1 "2024 November 04"
.SH NAME
vimtutor \- the Vim tutor
.SH SYNOPSIS
.br
.B vimtutor [\-g] [language]
.B vimtutor [\-l | \-\-language ISO639] [\-c | \-\-chapter NUMBER] [\-g | \-\-gui] [ISO639]
.br
.B vimtutor [\-h | \-\-help]
.br
.B vimtutor [\-\-list]
.SH DESCRIPTION
.B Vimtutor
starts the
.B Vim
tutor.
It copies the tutor file first, so that it can be modified without changing
the original file.
.PP
The
.B Vimtutor
is useful for people that want to learn their first
.B Vim
commands.
.PP
The optional argument \-g starts vimtutor with gvim rather than vim, if the
GUI version of Vim is available, or falls back to vim if gvim is not found.
.PP
The optional [language] argument is the two-letter name of a language, like
"it" or "es".
If the [language] argument is missing, the language of the current locale will
be used.
If a tutor in this language is available, it will be used.
Otherwise the English version will be used.
.PP
.B Vimtutor
only opens temporary copies of the original tutor files, there is no danger of overwriting the lessons.
.PP
.B Vim
is always started in Vi compatible mode.
is always started in
.B Vi
compatible mode.
.SH OPTIONS
.TP
.BR \-l ", " \-\-language =\fIISO639\fR
Set the two or three letter language code. E.g. 'it', 'es', 'bar'. Defaults to language of locale if available, else to English.
.TP
.BR \-c ", " \-\-chapter =\fINUMBER\fR
Set the chapter number. Defaults to chapter one.
.TP
.BR \-g ", " \-\-gui
Start
.B vimtutor
in the GUI version of vim if available, otherwise fallback to console vim.
.TP
.BR \-h ", " \-\-help
Display usage information.
.TP
.BR \-\-list
Display chapters and languages.
.SH EXAMPLES
To start
.B vimtutor
in German on chapter one:
.PP
.nf
.RS
vimtutor de
.RE
.fi
.PP
In English on chapter two:
.PP
.nf
.RS
vimtutor -c2
.RE
.fi
.PP
Longform command for Bavarian in the GUI on chapter one:
.PP
.nf
.RS
vimtutor --language bar --chapter 1 --gui
.RE
.fi
.SH FILES
.TP 15
/usr/local/share/vim/vim??/tutor/tutor[.language]
The
.B Vimtutor
text file(s).
.br
.I vim??
is short version number, like vim91 for
.B Vim 9.1
chapter one text file(s).
.TP 15
/usr/local/share/vim/vim??/tutor/tutor2[.language]
The
.B Vimtutor
chapter two text file(s).
.TP 15
/usr/local/share/vim/vim??/tutor/tutor.vim
The Vim script used to copy the
The
.B Vim
script used to copy the
.B Vimtutor
text file.
.SH AUTHOR
The
.B Vimtutor
was originally written for Vi by Michael C. Pierce and Robert K. Ware,
Colorado School of Mines using ideas supplied by Charles Smith,
Colorado State University.
E-mail: bware@mines.colorado.edu (now invalid).
.br
It was modified for
.B The Vi Tutorial
was originally written for Vi by Michael C. Pierce and Robert K. Ware, Colorado School of Mines using ideas supplied by Charles Smith, Colorado State University.
.B E-mail: bware@mines.colorado.edu (now invalid).
.PP
Modified for
.B Vim
by Bram Moolenaar.
For the names of the translators see the tutor files.
.PP
Translation contributors are listed in the tutor files.
.SH SEE ALSO
vim(1)

View File

@@ -1,51 +1,78 @@
VIMTUTOR(1) General Commands Manual VIMTUTOR(1)
NAME
vimtutor - the Vim tutor
SYNOPSIS
vimtutor [-g] [language]
vimtutor [-l | --language ISO639] [-c | --chapter NUMBER] [-g | --gui]
[ISO639]
vimtutor [-h | --help]
vimtutor [--list]
DESCRIPTION
Vimtutor starts the Vim tutor. It copies the tutor file first, so that
it can be modified without changing the original file.
Vimtutor starts the Vim tutor.
The Vimtutor is useful for people that want to learn their first Vim
commands.
commands. The optional [language] argument is the two-letter name of a
language, like "it" or "es".
The optional argument -g starts vimtutor with gvim rather than vim, if
the GUI version of Vim is available, or falls back to vim if gvim is
not found.
The optional [language] argument is the two-letter name of a language,
like "it" or "es". If the [language] argument is missing, the language
of the current locale will be used. If a tutor in this language is
available, it will be used. Otherwise the English version will be
used.
Vimtutor only opens temporary copies of the original tutor files, there
is no danger of overwriting the lessons.
Vim is always started in Vi compatible mode.
OPTIONS
-l, --language=ISO639
Set the two or three letter language code. E.g. 'it', 'es',
'bar'. Defaults to language of locale if available, else to Eng
lish.
-c, --chapter=NUMBER
Set the chapter number. Defaults to chapter one.
-g, --gui
Start vimtutor in the GUI version of vim if available, otherwise
fallback to console vim.
-h, --help
Display usage information.
--list Display chapters and languages.
EXAMPLES
To start vimtutor in German on chapter one:
vimtutor de
In English on chapter two:
vimtutor -c2
Longform command for Bavarian in the GUI on chapter one:
vimtutor --language bar --chapter 1 --gui
FILES
/usr/local/share/vim/vim??/tutor/tutor[.language]
The Vimtutor text file(s).
vim?? is short version number, like vim91 for Vim 9.1
The Vimtutor chapter one text file(s).
/usr/local/share/vim/vim??/tutor/tutor2[.language]
The Vimtutor chapter two text file(s).
/usr/local/share/vim/vim??/tutor/tutor.vim
The Vim script used to copy the Vimtutor text file.
AUTHOR
The Vimtutor was originally written for Vi by Michael C. Pierce and
Robert K. Ware, Colorado School of Mines using ideas supplied by
Charles Smith, Colorado State University. E-mail: bware@mines.col
The Vi Tutorial was originally written for Vi by Michael C. Pierce and
Robert K. Ware, Colorado School of Mines using ideas supplied by
Charles Smith, Colorado State University. E-mail: bware@mines.col
orado.edu (now invalid).
It was modified for Vim by Bram Moolenaar. For the names of the trans
lators see the tutor files.
Modified for Vim by Bram Moolenaar.
Translation contributors are listed in the tutor files.
SEE ALSO
vim(1)
2024 August 12 VIMTUTOR(1)
2024 November 04 VIMTUTOR(1)

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2024 May 31
" Last Change: 2024 Nov 19
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Listen very carefully, I will say this only once
@@ -283,7 +283,7 @@ au BufNewFile,BufRead *.blade.php setf blade
au BufNewFile,BufRead *.bl setf blank
" Bitbake
au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake
au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf,*/project-spec/configs/*.conf setf bitbake
" Blkid cache file
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
@@ -311,6 +311,9 @@ au BufNewFile,BufRead */.bundle/config setf yaml
au BufNewFile,BufRead *.c call dist#ft#FTlpc()
au BufNewFile,BufRead *.lpc,*.ulpc setf lpc
" C3
au BufNewFile,BufRead *.c3,*.c3i,*.c3t setf c3
" Cairo
au BufNewFile,BufRead *.cairo setf cairo
@@ -754,8 +757,12 @@ au BufNewFile,BufRead *.dsl
" DTD (Document Type Definition for XML)
au BufNewFile,BufRead *.dtd setf dtd
" DTS/DSTI/DTSO (device tree files)
au BufNewFile,BufRead *.dts,*.dtsi,*.dtso,*.its,*.keymap setf dts
" Devicetree (.its for U-Boot Flattened Image Trees, .keymap for ZMK keymap, and
" .overlay for Zephyr overlay)
au BufNewFile,BufRead *.dts,*.dtsi,*.dtso setf dts
au BufNewFile,BufRead *.its setf dts
au BufNewFile,BufRead *.keymap setf dts
au BufNewFile,BufRead *.overlay setf dts
" Earthfile
au BufNewFile,BufRead Earthfile setf earthfile
@@ -1095,8 +1102,8 @@ au BufRead,BufNewFile *.hurl setf hurl
" Hyper Builder
au BufNewFile,BufRead *.hb setf hb
" Hyprlang
au BufNewFile,BufRead hypr\(land\|paper\|idle\|lock\).conf setf hyprlang
" Hyprland Configuration language
au BufNewFile,BufRead */hypr/*.conf,hypr\(land\|paper\|idle\|lock\).conf setf hyprlang
" Httest
au BufNewFile,BufRead *.htt,*.htb setf httest
@@ -1129,6 +1136,10 @@ au BufNewFile,BufRead indent.pro call dist#ft#ProtoCheck('indent')
" IDL (Interactive Data Language), Prolog, Cproto or zsh module C
au BufNewFile,BufRead *.pro call dist#ft#ProtoCheck('idlang')
" Idris2
au BufNewFile,BufRead *.idr setf idris2
au BufNewFile,BufRead *.lidr setf lidris2
" Indent RC
au BufNewFile,BufRead indentrc setf indent
@@ -1148,6 +1159,9 @@ au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2
" Ipfilter
au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter
" Ipkg for Idris 2 language
au BufNewFile,BufRead *.ipkg setf ipkg
" Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
@@ -1251,6 +1265,12 @@ au BufNewFile,BufRead *.jl setf julia
" Just
au BufNewFile,BufRead [jJ]ustfile,.justfile,*.just setf just
" KAREL
au BufNewFile,BufRead *.kl setf karel
if has("fname_case")
au BufNewFile,BufRead *.KL setf karel
endif
" KDL
au BufNewFile,BufRead *.kdl setf kdl
@@ -1321,6 +1341,9 @@ au BufRead,BufNewFile *.ldg,*.ledger,*.journal setf ledger
" lf configuration (lfrc)
au BufNewFile,BufRead lfrc setf lf
" Leo
au BufNewFile,BufRead *.leo setf leo
" Less
au BufNewFile,BufRead *.less setf less
@@ -1337,7 +1360,7 @@ au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors
au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
" Lifelines (or Lex for C++!)
au BufNewFile,BufRead *.ll setf lifelines
au BufNewFile,BufRead *.ll call dist#ft#FTll()
" Lilo: Linux loader
au BufNewFile,BufRead lilo.conf setf lilo
@@ -1345,14 +1368,17 @@ au BufNewFile,BufRead lilo.conf setf lilo
" Lilypond
au BufNewFile,BufRead *.ly,*.ily setf lilypond
" Lisp (*.el = ELisp, *.cl = Common Lisp)
" Lisp (*.el = ELisp)
" *.jl was removed, it's also used for Julia, better skip than guess wrong.
if has("fname_case")
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,*.L,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.L,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp
else
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp
endif
" *.cl = Common Lisp or OpenCL
au BufNewFile,BufRead *.cl call dist#ft#FTcl()
" SBCL implementation of Common Lisp
au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
@@ -1709,7 +1735,7 @@ au BufNewFile,BufRead *.scad setf openscad
" Oracle config file
au BufNewFile,BufRead *.ora setf ora
" Org
" Org (Emacs' org-mode)
au BufNewFile,BufRead *.org,*.org_archive setf org
" Packet filter conf
@@ -2426,6 +2452,9 @@ au BufNewFile,BufRead *.sml setf sml
" Sratus VOS command macro
au BufNewFile,BufRead *.cm setf voscm
" Sway (programming language)
au BufNewFile,BufRead *.sw setf sway
" Swift
au BufNewFile,BufRead *.swift,*.swiftinterface setf swift
au BufNewFile,BufRead *.swift.gyb setf swiftgyb
@@ -2582,6 +2611,9 @@ au BufNewFile,BufReadPost *.tsscl setf tsscl
" TSV Files
au BufNewFile,BufRead *.tsv setf tsv
" Tutor mode
au BufNewFile,BufReadPost *.tutor setf tutor
" TWIG files
au BufNewFile,BufReadPost *.twig setf twig
@@ -2820,6 +2852,7 @@ au BufNewFile,BufRead */etc/xinetd.conf setf xinetd
" Xilinx Vivado/Vitis project files and block design files
au BufNewFile,BufRead *.xpr,*.xpfm,*.spfm,*.bxml,*.mmi setf xml
au BufNewFile,BufRead *.bd,*.bda,*.xci setf json
au BufNewFile,BufRead *.mss setf mss
" XS Perl extension interface language
au BufNewFile,BufRead *.xs setf xs
@@ -2899,6 +2932,7 @@ au BufNewFile,BufRead *.y call dist#ft#FTy()
" Yaml
au BufNewFile,BufRead *.yaml,*.yml,*.eyaml setf yaml
au BufNewFile,BufRead */.kube/config setf yaml
" Raml
au BufNewFile,BufRead *.raml setf raml

13
runtime/ftplugin/cook.vim Normal file
View File

@@ -0,0 +1,13 @@
" Vim filetype plugin
" Language: Cooklang
" Maintainer: Riley Bruins <ribru17@gmail.com>
" Last Change: 2024 Nov 03
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setl comments=:-- commentstring=--\ %s
let b:undo_ftplugin = 'setl com< cms<'

View File

@@ -6,13 +6,14 @@
" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
" 2018 Nov 03 - Added commentstring (Markus Mottl)
" 2017 Sep 06 - Initial version (Etienne Millon)
" 2024 Nov 09 - use setl instead of :set
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin=1
set lisp
setl lisp
" Comment string
setl commentstring=;\ %s

View File

@@ -0,0 +1,34 @@
" Vim ftplugin file
" Language: Idris 2
" Last Change: 2024 Nov 05
" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma <srghma@gmail.com>
" License: Vim (see :h license)
" Repository: https://github.com/ShinKage/idris2-nvim
"
" Based on ftplugin/idris2.vim from https://github.com/edwinb/idris2-vim
if exists("b:did_ftplugin")
finish
endif
setlocal shiftwidth=2
setlocal tabstop=2
" Set g:idris2#allow_tabchar = 1 to use tabs instead of spaces
if exists('g:idris2#allow_tabchar') && g:idris2#allow_tabchar != 0
setlocal noexpandtab
else
setlocal expandtab
endif
setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
setlocal commentstring=--\ %s
" makes ? a part of a word, e.g. for named holes `vzipWith f [] [] = ?vzipWith_rhs_3`, uncomment if want to reenable
" setlocal iskeyword+=?
setlocal wildignore+=*.ibc
let b:undo_ftplugin = "setlocal shiftwidth< tabstop< expandtab< comments< commentstring< iskeyword< wildignore<"
let b:did_ftplugin = 1

19
runtime/ftplugin/ipkg.vim Normal file
View File

@@ -0,0 +1,19 @@
" Vim ftplugin file
" Language: Ipkg
" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma <srghma@gmail.com>
" Last Change: 2024 Nov 05
" Author: ShinKage
" License: Vim (see :h license)
" Repository: https://github.com/ShinKage/idris2-nvim
if exists("b:did_ftplugin")
finish
endif
setlocal comments=:--
setlocal commentstring=--\ %s
setlocal wildignore+=*.ibc
let b:undo_ftplugin = "setlocal shiftwidth< tabstop< expandtab< comments< commentstring< iskeyword< wildignore<"
let b:did_ftplugin = 1

View File

@@ -0,0 +1,16 @@
" Vim filetype plugin file
" Language: KAREL
" Last Change: 2024-11-18
" Maintainer: Kirill Morozov <kirill@robotix.pro>
" Credits: Patrick Meiser-Knosowski for the initial implementation.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal comments=:--
setlocal commentstring=--\ %s
setlocal suffixesadd+=.kl,.KL
let b:undo_ftplugin = "setlocal com< cms< sua<"

13
runtime/ftplugin/leo.vim Normal file
View File

@@ -0,0 +1,13 @@
" Vim filetype plugin
" Language: Leo
" Maintainer: Riley Bruins <ribru17@gmail.com>
" Last Change: 2024 Nov 03
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setl comments=:// commentstring=//\ %s
let b:undo_ftplugin = 'setl com< cms<'

12
runtime/ftplugin/llvm.vim Normal file
View File

@@ -0,0 +1,12 @@
" Vim filetype plugin file
" Language: LLVM IR
" Last Change: 2024 Oct 22
" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
setl comments=:;
setl commentstring=;\ %s
let b:undo_ftplugin = "setl commentstring< comments<"

16
runtime/ftplugin/mss.vim Normal file
View File

@@ -0,0 +1,16 @@
" Vim filetype plugin file
" Language: Vivado mss file
" Last Change: 2024 Oct 22
" Document: https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS
" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal comments=b:#,fb:-
setlocal commentstring=#\ %s
let b:match_words = '\<BEGIN\>:\<END\>'
let b:undo_ftplugin = "setl com< cms< | unlet b:match_words"

View File

@@ -0,0 +1,12 @@
" Vim filetype plugin file
" Language: OpenCL
" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
" Last Change: 2024 Nov 19
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
setlocal commentstring=/*\ %s\ */ define& include&
let b:undo_ftplugin = "setl commentstring< comments<"

37
runtime/ftplugin/org.vim Normal file
View File

@@ -0,0 +1,37 @@
" Vim filetype plugin file
" Language: Org
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
" Last Change: 2024 Nov 14
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
else
let b:undo_ftplugin = "setl cms< com< fo< flp<"
endif
setl commentstring=#\ %s
setl comments=fb:*,fb:-,fb:+,b:#,b:\:
setl formatoptions+=nql
setl formatlistpat=^\\s*\\(\\(\\d\\|\\a\\)\\+[.)]\\|[+-]\\)\\s\\+
function OrgFoldExpr()
let l:depth = match(getline(v:lnum), '\(^\*\+\)\@<=\( .*$\)\@=')
if l:depth > 0 && synIDattr(synID(v:lnum, 1, 1), 'name') =~# '\m^orgHeadline'
return ">" . l:depth
endif
return "="
endfunction
if has("folding") && get(g:, 'org_folding', 0)
setl foldexpr=OrgFoldExpr()
setl foldmethod=expr
let b:undo_ftplugin .= "|setl foldexpr< foldmethod<"
endif
" vim: ts=8 sts=2 sw=2 et

View File

@@ -3,7 +3,7 @@
" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
" Previous Maintainer: Will Langstroth <will@langstroth.com>
" URL: https://github.com/benknoble/vim-racket
" Last Change: 2024 May 28
" Last Change: 2024 Jun 01
if exists("b:did_ftplugin")
finish
@@ -16,19 +16,20 @@ set cpo&vim
" quick hack to allow adding values
setlocal iskeyword=@,!,#-',*-:,<-Z,a-z,~,_,94
setlocal shiftwidth=2 softtabstop=2
" Enable auto begin new comment line when continuing from an old comment line
setlocal comments=:;;;;,:;;;,:;;,:;
setlocal formatoptions+=r
"setlocal commentstring=;;\ %s
setlocal commentstring=#\|\ %s\ \|#
setlocal commentstring=;;\ %s
setlocal formatprg=raco\ fmt
" Undo our settings when the filetype changes away from Racket
" (this should be amended if settings/mappings are added above!)
let b:undo_ftplugin =
\ "setlocal iskeyword< lispwords< lisp< comments< formatoptions< formatprg<"
\ "setlocal iskeyword< shiftwidth< softtabstop< comments< formatoptions< formatprg<"
\. " | setlocal commentstring<"
if !exists("no_plugin_maps") && !exists("no_racket_maps")

15
runtime/ftplugin/sway.vim Normal file
View File

@@ -0,0 +1,15 @@
" Vim filetype plugin
" Language: Sway
" Maintainer: Riley Bruins <ribru17@gmail.com>
" Last Change: 2024 Nov 01
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setl commentstring=//\ %s
" From Rust comments
setl comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
let b:undo_ftplugin = 'setl com< cms<'

View File

@@ -0,0 +1,45 @@
" vim: fdm=marker
" Base: {{{1
call tutor#SetupVim()
" Buffer Settings: {{{1
setlocal noreadonly
if !exists('g:tutor_debug') || g:tutor_debug == 0
setlocal buftype=nofile
setlocal concealcursor+=inv
setlocal conceallevel=2
else
setlocal buftype=
setlocal concealcursor&
setlocal conceallevel=0
endif
setlocal noundofile
setlocal keywordprg=:help
setlocal iskeyword=@,-,_
" The user will have to enable the folds himself, but we provide the foldexpr
" function.
setlocal foldmethod=manual
setlocal foldexpr=tutor#TutorFolds()
setlocal foldlevel=4
" Load metadata if it exists: {{{1
if filereadable(expand('%').'.json')
call tutor#LoadMetadata()
endif
" Mappings: {{{1
call tutor#SetNormalMappings()
" Checks: {{{1
sign define tutorok text=texthl=tutorOK
sign define tutorbad text=texthl=tutorX
if !exists('g:tutor_debug') || g:tutor_debug == 0
call tutor#ApplyMarks()
autocmd! TextChanged,TextChangedI <buffer> call tutor#ApplyMarksOnChanged()
endif

View File

@@ -11,6 +11,7 @@ VIMRUNTIME = ..
# If a test fails a testdir/*.fail file will be written.
test:
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim
@echo "INDENT TESTS: DONE"
clean testclean:

183
runtime/indent/idris2.vim Normal file
View File

@@ -0,0 +1,183 @@
" Vim indent file
" Language: Idris 2
" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma <srghma@gmail.com>
" Author: raichoo <raichoo@googlemail.com>
" Last Change: 2024 Nov 05
" License: Vim (see :h license)
" Repository: https://github.com/ShinKage/idris2-nvim
"
" indentation for idris (idris-lang.org)
"
" Based on haskell indentation by motemen <motemen@gmail.com>
"
" Indentation configuration variables:
"
" g:idris2_indent_if (default: 3)
" Controls indentation after 'if' statements
" Example:
" if condition
" >>>then expr
" >>>else expr
"
" g:idris2_indent_case (default: 5)
" Controls indentation of case expressions
" Example:
" case x of
" >>>>>Left y => ...
" >>>>>Right z => ...
"
" g:idris2_indent_let (default: 4)
" Controls indentation after 'let' bindings
" Example:
" let x = expr in
" >>>>body
"
" g:idris2_indent_rewrite (default: 8)
" Controls indentation after 'rewrite' expressions
" Example:
" rewrite proof in
" >>>>>>>>expr
"
" g:idris2_indent_where (default: 6)
" Controls indentation of 'where' blocks
" Example:
" function args
" >>>>>>where helper = expr
"
" g:idris2_indent_do (default: 3)
" Controls indentation in 'do' blocks
" Example:
" do x <- action
" >>>y <- action
"
" Example configuration in .vimrc:
" let g:idris2_indent_if = 2
if exists('b:did_indent')
finish
endif
setlocal indentexpr=GetIdrisIndent()
setlocal indentkeys=!^F,o,O,}
let b:did_indent = 1
let b:undo_indent = "setlocal indentexpr< indentkeys<"
" we want to use line continuations (\) BEGINNING
let s:cpo_save = &cpo
set cpo&vim
" Define defaults for indent configuration
let s:indent_defaults = {
\ 'idris2_indent_if': 3,
\ 'idris2_indent_case': 5,
\ 'idris2_indent_let': 4,
\ 'idris2_indent_rewrite': 8,
\ 'idris2_indent_where': 6,
\ 'idris2_indent_do': 3
\ }
" we want to use line continuations (\) END
let &cpo = s:cpo_save
unlet s:cpo_save
" Set up indent settings with user overrides
for [key, default] in items(s:indent_defaults)
let varname = 'g:' . key
if !exists(varname)
execute 'let' varname '=' default
endif
endfor
if exists("*GetIdrisIndent")
finish
endif
function! GetIdrisIndent()
let prevline = getline(v:lnum - 1)
if prevline =~ '\s\+(\s*.\+\s\+:\s\+.\+\s*)\s\+->\s*$'
return match(prevline, '(')
elseif prevline =~ '\s\+{\s*.\+\s\+:\s\+.\+\s*}\s\+->\s*$'
return match(prevline, '{')
endif
if prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
let s = match(prevline, '[:=]')
if s > 0
return s + 2
else
return match(prevline, '\S')
endif
endif
if prevline =~ '[{([][^})\]]\+$'
return match(prevline, '[{([]')
endif
if prevline =~ '\<let\>\s\+.\+\<in\>\s*$'
return match(prevline, '\<let\>') + g:idris2_indent_let
endif
if prevline =~ '\<rewrite\>\s\+.\+\<in\>\s*$'
return match(prevline, '\<rewrite\>') + g:idris2_indent_rewrite
endif
if prevline !~ '\<else\>'
let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')
if s > 0
return s
endif
let s = match(prevline, '\<if\>')
if s > 0
return s + g:idris2_indent_if
endif
endif
if prevline =~ '\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
return match(prevline, '\S') + &shiftwidth
endif
if prevline =~ '\<where\>\s\+\S\+.*$'
return match(prevline, '\<where\>') + g:idris2_indent_where
endif
if prevline =~ '\<do\>\s\+\S\+.*$'
return match(prevline, '\<do\>') + g:idris2_indent_do
endif
if prevline =~ '^\s*\<\(co\)\?data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
return match(prevline, '=')
endif
if prevline =~ '\<with\>\s\+([^)]*)\s*$'
return match(prevline, '\S') + &shiftwidth
endif
if prevline =~ '\<case\>\s\+.\+\<of\>\s*$'
return match(prevline, '\<case\>') + g:idris2_indent_case
endif
if prevline =~ '^\s*\(\<namespace\>\|\<\(co\)\?data\>\)\s\+\S\+\s*$'
return match(prevline, '\(\<namespace\>\|\<\(co\)\?data\>\)') + &shiftwidth
endif
if prevline =~ '^\s*\(\<using\>\|\<parameters\>\)\s*([^(]*)\s*$'
return match(prevline, '\(\<using\>\|\<parameters\>\)') + &shiftwidth
endif
if prevline =~ '^\s*\<mutual\>\s*$'
return match(prevline, '\<mutual\>') + &shiftwidth
endif
let line = getline(v:lnum)
if (line =~ '^\s*}\s*' && prevline !~ '^\s*;')
return match(prevline, '\S') - &shiftwidth
endif
return match(prevline, '\S')
endfunction
" vim:et:sw=2:sts=2

View File

@@ -3,7 +3,7 @@
" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
" Previous Maintainer: Will Langstroth <will@langstroth.com>
" URL: https://github.com/benknoble/vim-racket
" Last Change: 2024 Jan 31
" Last Change: 2024 Nov 12
if exists("b:did_indent")
finish
@@ -21,6 +21,7 @@ setlocal lispwords+=λ
setlocal lispwords+=with-handlers
setlocal lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse
setlocal lispwords+=define-for-syntax,define-syntax-parser,define-syntax-parse-rule,define-syntax-class,define-splicing-syntax-class
setlocal lispwords+=syntax/loc,quasisyntax/loc
setlocal lispwords+=define-syntax-parameter,syntax-parameterize
setlocal lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig
setlocal lispwords+=define-opt/c,define-syntax-rule
@@ -30,6 +31,11 @@ setlocal lispwords+=with-input-from-file,with-output-to-file
setlocal lispwords+=begin,begin0
setlocal lispwords+=place
setlocal lispwords+=cond
" Racket style indents if like a function application:
" (if test
" then
" else)
setlocal lispwords-=if
" Racket OOP
" TODO missing a lot of define-like forms here (e.g., define/augment, etc.)
@@ -50,6 +56,7 @@ setlocal lispwords+=for/set,for*/set
setlocal lispwords+=for/first,for*/first
setlocal lispwords+=for/last,for*/last
setlocal lispwords+=for/stream,for*/stream
setlocal lispwords+=for/lists,for*/lists
setlocal lispwords+=match,match*,match/values,define/match,match-lambda,match-lambda*,match-lambda**
setlocal lispwords+=match-let,match-let*,match-let-values,match-let*-values
@@ -66,4 +73,7 @@ setlocal lispwords+=if-view,case-view,cond-view,list-view,dyn-view
setlocal lispwords+=case/dep
setlocal lispwords+=define/obs
" rackunit
setlocal lispwords+=define-simple-check,define-binary-check,define-check,with-check-info
let b:undo_indent = "setlocal lisp< ai< si< lw<" .. (has('vim9script') ? ' indentexpr< lispoptions<' : '')

View File

@@ -7,6 +7,8 @@
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog:
" 20241411 - Detect dash character in function keyword for
" bash mode (issue #16049)
" 20190726 - Correctly skip if keywords in syntax comments
" (issue #17)
" 20190603 - Do not indent in zsh filetypes with an `if` in comments
@@ -195,7 +197,9 @@ endfunction
function! s:is_function_definition(line)
return a:line =~ '^\s*\<\k\+\>\s*()\s*{' ||
\ a:line =~ '^\s*{' ||
\ a:line =~ '^\s*function\s*\k\+\s*\%(()\)\?\s*{'
\ a:line =~ '^\s*function\s*\k\+\s*\%(()\)\?\s*{' ||
\ ((&ft is# 'zsh' || s:is_bash()) &&
\ a:line =~ '^\s*function\s*\S\+\s*\%(()\)\?\s*{' )
endfunction
function! s:is_array(line)

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# vim: set ft=bash sw=2 noet:
# START_INDENT
a = 10
b = 20
function add() {
c = $((a + b))
}
function print {
# do nothing
}
if [[ $c -ge 15 ]];
then
print("ok")
else
print("not ok")
fi
# END_INDENT

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# vim: set ft=bash sw=2 noet:
# START_INDENT
a = 10
b = 20
function add() {
c = $((a + b))
}
function print {
# do nothing
}
if [[ $c -ge 15 ]];
then
print("ok")
else
print("not ok")
fi
# END_INDENT

View File

@@ -14,6 +14,19 @@ set modeline
set debug=throw
set nomore
" Remember the directory where we started.
let indentDir = getcwd()
cd ../../src/testdir
" Needed for ValgrindOrAsan().
source shared.vim
exe 'cd ' .. fnameescape(indentDir)
if ValgrindOrAsan()
let g:vim_indent = {"searchpair_timeout": 1024}
let g:python_indent = {"searchpair_timeout": 1024}
endif
au! SwapExists * call HandleSwapExists()
func HandleSwapExists()
" Ignore finding a swap file for the test input and output, the user might be

View File

@@ -951,3 +951,12 @@ endenum
call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
call prop_type_delete('indent_after_literal_dict')
" END_INDENT
" START_INDENT
silent function Foo()
return 42
endfunction
silent! function Bar()
return 42
endfunction
" END_INDENT

View File

@@ -951,3 +951,12 @@ endenum
call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
call prop_type_delete('indent_after_literal_dict')
" END_INDENT
" START_INDENT
silent function Foo()
return 42
endfunction
silent! function Bar()
return 42
endfunction
" END_INDENT

View File

@@ -749,6 +749,8 @@ call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show se
call <SID>BinOptionG("terse", &terse)
call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
call <SID>OptionG("shm", &shm)
call <SID>AddOption("msghistory", gettext("how many messages are remembered"))
call append("$", " \tset mhi=" . &mhi)
call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))
let &sc = s:old_sc
call <SID>BinOptionG("sc", &sc)

View File

@@ -0,0 +1,940 @@
vim9script noclear
# Config {{{1
const SHELL_PROMPT: string = g:
->get('helptoc', {})
->get('shell_prompt', '^\w\+@\w\+:\f\+\$\s')
# Init {{{1
const HELP_TEXT: list<string> =<< trim END
normal commands in help window
──────────────────────────────
? hide this help window
<C-J> scroll down one line
<C-K> scroll up one line
normal commands in TOC menu
───────────────────────────
j select next entry
k select previous entry
J same as j, and jump to corresponding line in main buffer
K same as k, and jump to corresponding line in main buffer
c select nearest entry from cursor position in main buffer
g select first entry
G select last entry
H collapse one level
L expand one level
p print selected entry on command-line
P same as p but automatically, whenever selection changes
press multiple times to toggle feature on/off
q quit menu
z redraw menu with selected entry at center
+ increase width of popup menu
- decrease width of popup menu
/ look for given text with fuzzy algorithm
? show help window
<C-D> scroll down half a page
<C-U> scroll up half a page
<PageUp> scroll down a whole page
<PageDown> scroll up a whole page
<Home> select first entry
<End> select last entry
title meaning
─────────────
example: 12/34 (5/6)
broken down:
12 index of selected entry
34 index of last entry
5 index of deepest level currently visible
6 index of maximum possible level
tip
───
after inserting a pattern to look for with the / command,
if you press <Esc> instead of <CR>, you can then get
more context for each remaining entry by pressing J or K
END
const MATCH_ENTRY: dict<dict<func: bool>> = {
help: {},
man: {
1: (line: string, _): bool => line =~ '^\S',
2: (line: string, _): bool => line =~ '^\%( \{3\}\)\=\S',
3: (line: string, _): bool => line =~ '^\s\+\(\%(+\|-\)\S\+,\s\+\)*\%(+\|-\)\S\+',
},
markdown: {
1: (line: string, nextline: string): bool =>
(line =~ '^#[^#]' || nextline =~ '^=\+$') && line =~ '\w',
2: (line: string, nextline: string): bool =>
(line =~ '^##[^#]' || nextline =~ '^-\+$') && line =~ '\w',
3: (line: string, _): bool => line =~ '^###[^#]',
4: (line: string, _): bool => line =~ '^####[^#]',
5: (line: string, _): bool => line =~ '^#####[^#]',
6: (line: string, _): bool => line =~ '^######[^#]',
},
terminal: {
1: (line: string, _): bool => line =~ SHELL_PROMPT,
}
}
const HELP_RULERS: dict<string> = {
'=': '^=\{40,}$',
'-': '^-\{40,}',
}
const HELP_RULER: string = HELP_RULERS->values()->join('\|')
# the regex is copied from the help syntax plugin
const HELP_TAG: string = '\*[#-)!+-~]\+\*\%(\s\|$\)\@='
# Adapted from `$VIMRUNTIME/syntax/help.vim`.{{{
#
# The original regex is:
#
# ^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\)
#
# Allowing a space or a hyphen at the start can give false positives, and is
# useless, so we don't allow them.
#}}}
const HELP_HEADLINE: string = '^\C[A-Z.][-A-Z0-9 .()_]*\%(\s\+\*+\@!\|$\)'
# ^--^
# To prevent some false positives under `:help feature-list`.
var lvls: dict<number>
def InitHelpLvls()
lvls = {
'*01.1*': 0,
'1.': 0,
'1.2': 0,
'1.2.3': 0,
'header ~': 0,
HEADLINE: 0,
tag: 0,
}
enddef
const AUGROUP: string = 'HelpToc'
var fuzzy_entries: list<dict<any>>
var help_winid: number
var print_entry: bool
var selected_entry_match: number
# Interface {{{1
export def Open() #{{{2
var type: string = GetType()
if !MATCH_ENTRY->has_key(type)
return
endif
if type == 'terminal' && win_gettype() == 'popup'
# trying to deal with a popup menu on top of a popup terminal seems
# too tricky for now
echomsg 'does not work in a popup window; only in a regular window'
return
endif
# invalidate the cache if the buffer's contents has changed
if exists('b:toc') && &filetype != 'man'
if b:toc.changedtick != b:changedtick
# in a terminal buffer, `b:changedtick` does not change
|| type == 'terminal' && line('$') > b:toc.linecount
unlet! b:toc
endif
endif
if !exists('b:toc')
SetToc()
endif
var winpos: list<number> = winnr()->win_screenpos()
var height: number = winheight(0) - 2
var width: number = winwidth(0)
b:toc.width = b:toc.width ?? width / 3
# the popup needs enough space to display the help message in its title
if b:toc.width < 30
b:toc.width = 30
endif
# Is `popup_menu()` OK with a list of dictionaries?{{{
#
# Yes, see `:help popup_create-arguments`.
# Although, it expects dictionaries with the keys `text` and `props`.
# But we use dictionaries with the keys `text` and `lnum`.
# IOW, we abuse the feature which lets us use text properties in a popup.
#}}}
var winid: number = GetTocEntries()
->popup_menu({
line: winpos[0],
col: winpos[1] + width - 1,
pos: 'topright',
scrollbar: false,
highlight: type == 'terminal' ? 'Terminal' : 'Normal',
border: [],
borderchars: ['─', '│', '─', '│', '┌', '┐', '┘', '└'],
minheight: height,
maxheight: height,
minwidth: b:toc.width,
maxwidth: b:toc.width,
filter: Filter,
callback: Callback,
})
Win_execute(winid, [$'ownsyntax {&filetype}', '&l:conceallevel = 3'])
# In a help file, we might reduce some noisy tags to a trailing asterisk.
# Hide those.
if type == 'help'
matchadd('Conceal', '\*$', 0, -1, {window: winid})
endif
SelectNearestEntryFromCursor(winid)
# can't set the title before jumping to the relevant line, otherwise the
# indicator in the title might be wrong
SetTitle(winid)
enddef
#}}}1
# Core {{{1
def SetToc() #{{{2
var toc: dict<any> = {entries: []}
var type: string = GetType()
toc.changedtick = b:changedtick
if !toc->has_key('width')
toc.width = 0
endif
# We cache the toc in `b:toc` to get better performance.{{{
#
# Without caching, when we press `H`, `L`, `H`, `L`, ... quickly for a few
# seconds, there is some lag if we then try to move with `j` and `k`.
# This can only be perceived in big man pages like with `:Man ffmpeg-all`.
#}}}
b:toc = toc
if type == 'help'
SetTocHelp()
return
endif
if type == 'terminal'
b:toc.linecount = line('$')
endif
var curline: string = getline(1)
var nextline: string
var lvl_and_test: list<list<any>> = MATCH_ENTRY
->get(type, {})
->items()
->sort((l: list<any>, ll: list<any>): number => l[0]->str2nr() - ll[0]->str2nr())
for lnum: number in range(1, line('$'))
nextline = getline(lnum + 1)
for [lvl: string, IsEntry: func: bool] in lvl_and_test
if IsEntry(curline, nextline)
b:toc.entries->add({
lnum: lnum,
lvl: lvl->str2nr(),
text: curline,
})
break
endif
endfor
curline = nextline
endfor
InitMaxAndCurLvl()
enddef
def SetTocHelp() #{{{2
var main_ruler: string
for line: string in getline(1, '$')
if line =~ HELP_RULER
main_ruler = line =~ '=' ? HELP_RULERS['='] : HELP_RULERS['-']
break
endif
endfor
var prevline: string
var curline: string = getline(1)
var nextline: string
var in_list: bool
var last_numbered_entry: number
InitHelpLvls()
for lnum: number in range(1, line('$'))
nextline = getline(lnum + 1)
if main_ruler != '' && curline =~ main_ruler
last_numbered_entry = 0
# The information gathered in `lvls` might not be applicable to all
# the main sections of a help file. Let's reset it whenever we find
# a ruler.
InitHelpLvls()
endif
# Do not assume that a list ends on an empty line.
# See the list at `:help gdb` for a counter-example.
if in_list
&& curline !~ '^\d\+.\s'
&& curline !~ '^\s*$'
&& curline !~ '^[< \t]'
in_list = false
endif
if prevline =~ '^\d\+\.\s'
&& curline !~ '^\s*$'
&& curline !~ $'^\s*{HELP_TAG}'
in_list = true
endif
# 1.
if prevline =~ '^\d\+\.\s'
# let's assume that the start of a main entry is always followed by an
# empty line, or a line starting with a tag
&& (curline =~ '^>\=\s*$' || curline =~ $'^\s*{HELP_TAG}')
# ignore a numbered line in a list
&& !in_list
var current_numbered_entry: number = prevline
->matchstr('^\d\+\ze\.\s')
->str2nr()
if current_numbered_entry > last_numbered_entry
AddEntryInTocHelp('1.', lnum - 1, prevline)
last_numbered_entry = prevline
->matchstr('^\d\+\ze\.\s')
->str2nr()
endif
endif
# 1.2
if curline =~ '^\d\+\.\d\+\s'
if curline =~ $'\%({HELP_TAG}\s*\|\~\)$'
|| (prevline =~ $'^\s*{HELP_TAG}' || nextline =~ $'^\s*{HELP_TAG}')
|| (prevline =~ HELP_RULER || nextline =~ HELP_RULER)
|| (prevline =~ '^\s*$' && nextline =~ '^\s*$')
AddEntryInTocHelp('1.2', lnum, curline)
endif
# 1.2.3
elseif curline =~ '^\s\=\d\+\.\d\+\.\d\+\s'
AddEntryInTocHelp('1.2.3', lnum, curline)
endif
# HEADLINE
if curline =~ HELP_HEADLINE
&& curline !~ '^CTRL-'
&& prevline->IsSpecialHelpLine()
&& (nextline->IsSpecialHelpLine() || nextline =~ '^\s*(\|^\t\|^N[oO][tT][eE]:')
AddEntryInTocHelp('HEADLINE', lnum, curline)
endif
# header ~
if curline =~ '\~$'
&& curline =~ '\w'
&& curline !~ '^[ \t<]\|\t\|---+---\|^NOTE:'
&& curline !~ '^\d\+\.\%(\d\+\%(\.\d\+\)\=\)\=\s'
&& prevline !~ $'^\s*{HELP_TAG}'
&& prevline !~ '\~$'
&& nextline !~ '\~$'
AddEntryInTocHelp('header ~', lnum, curline)
endif
# *some_tag*
if curline =~ HELP_TAG
AddEntryInTocHelp('tag', lnum, curline)
endif
# In the Vim user manual, a main section is a special case.{{{
#
# It's not a simple numbered section:
#
# 01.1
#
# It's used as a tag:
#
# *01.1* Two manuals
# ^ ^
#}}}
if prevline =~ main_ruler && curline =~ '^\*\d\+\.\d\+\*'
AddEntryInTocHelp('*01.1*', lnum, curline)
endif
[prevline, curline] = [curline, nextline]
endfor
# let's ignore the tag on the first line (not really interesting)
if b:toc.entries->get(0, {})->get('lnum') == 1
b:toc.entries->remove(0)
endif
# let's also ignore anything before the first `1.` line
var i: number = b:toc.entries
->copy()
->map((_, entry: dict<any>) => entry.text)
->match('^\s*1\.\s')
if i > 0
b:toc.entries->remove(0, i - 1)
endif
InitMaxAndCurLvl()
# set level of tag entries to the deepest level
var has_tag: bool = b:toc.entries
->copy()
->map((_, entry: dict<any>) => entry.text)
->match(HELP_TAG) >= 0
if has_tag
++b:toc.maxlvl
endif
b:toc.entries
->map((_, entry: dict<any>) => entry.lvl == 0
? entry->extend({lvl: b:toc.maxlvl})
: entry)
# fix indentation
var min_lvl: number = b:toc.entries
->copy()
->map((_, entry: dict<any>) => entry.lvl)
->min()
for entry: dict<any> in b:toc.entries
entry.text = entry.text
->substitute('^\s*', () => repeat(' ', (entry.lvl - min_lvl) * 3), '')
endfor
enddef
def AddEntryInTocHelp(type: string, lnum: number, line: string) #{{{2
# don't add a duplicate entry
if lnum == b:toc.entries->get(-1, {})->get('lnum')
# For a numbered line containing a tag, *do* add an entry.
# But only for its numbered prefix, not for its tag.
# The former is the line's most meaningful representation.
if b:toc.entries->get(-1, {})->get('type') == 'tag'
b:toc.entries->remove(-1)
else
return
endif
endif
var text: string = line
if type == 'tag'
var tags: list<string>
text->substitute(HELP_TAG, () => !!tags->add(submatch(0)), 'g')
text = tags
# we ignore errors and warnings because those are meaningless in
# a TOC where no context is available
->filter((_, tag: string) => tag !~ '\*[EW]\d\+\*')
->join()
if text !~ HELP_TAG
return
endif
endif
var maxlvl: number = lvls->values()->max()
if type == 'tag'
lvls[type] = 0
elseif type == '1.2'
lvls[type] = lvls[type] ?? lvls->get('1.', maxlvl) + 1
elseif type == '1.2.3'
lvls[type] = lvls[type] ?? lvls->get('1.2', maxlvl) + 1
else
lvls[type] = lvls[type] ?? maxlvl + 1
endif
# Ignore noisy tags.{{{
#
# 14. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
# ^----------------------------------------^
# ^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\zs\*.*
# ---
#
# We don't use conceal because then, `matchfuzzypos()` could match concealed
# characters, which would be confusing.
#}}}
# MAKING YOUR OWN SYNTAX FILES *mysyntaxfile*
# ^------------^
# ^\s*[A-Z].\{-}\*\zs.*
#
var after_HEADLINE: string = '^\s*[A-Z].\{-}\*\zs.*'
# 14. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
# ^----------------------------------------^
# ^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\*\zs.*
var after_numbered: string = '^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\*\zs.*'
# 01.3 Using the Vim tutor *tutor* *vimtutor*
# ^----------------^
var after_numbered_tutor: string = '^\*\d\+\.\%(\d\+\.\=\)*.\{-}\t\*\zs.*'
var noisy_tags: string = $'{after_HEADLINE}\|{after_numbered}\|{after_numbered_tutor}'
text = text->substitute(noisy_tags, '', '')
# We don't remove the trailing asterisk, because the help syntax plugin
# might need it to highlight some headlines.
b:toc.entries->add({
lnum: lnum,
lvl: lvls[type],
text: text,
type: type,
})
enddef
def InitMaxAndCurLvl() #{{{2
b:toc.maxlvl = b:toc.entries
->copy()
->map((_, entry: dict<any>) => entry.lvl)
->max()
b:toc.curlvl = b:toc.maxlvl
enddef
def Popup_settext(winid: number, entries: list<dict<any>>) #{{{2
var text: list<any>
# When we fuzzy search the toc, the dictionaries in `entries` contain a
# `props` key, to highlight each matched character individually.
# We don't want to process those dictionaries further.
# The processing should already have been done by the caller.
if entries->get(0, {})->has_key('props')
text = entries
else
text = entries
->copy()
->map((_, entry: dict<any>): string => entry.text)
endif
popup_settext(winid, text)
SetTitle(winid)
redraw
enddef
def SetTitle(winid: number) #{{{2
var curlnum: number
var lastlnum: number = line('$', winid)
var is_empty: bool = lastlnum == 1
&& winid->winbufnr()->getbufoneline(1) == ''
if is_empty
[curlnum, lastlnum] = [0, 0]
else
curlnum = line('.', winid)
endif
var newtitle: string = printf(' %*d/%d (%d/%d)',
len(lastlnum), curlnum,
lastlnum,
b:toc.curlvl,
b:toc.maxlvl,
)
var width: number = winid->popup_getoptions().minwidth
newtitle = printf('%s%*s',
newtitle,
width - newtitle->strlen(),
'press ? for help ')
popup_setoptions(winid, {title: newtitle})
enddef
def SelectNearestEntryFromCursor(winid: number) #{{{2
var lnum: number = line('.')
var firstline: number = b:toc.entries
->copy()
->filter((_, line: dict<any>): bool => line.lvl <= b:toc.curlvl && line.lnum <= lnum)
->len()
if firstline == 0
return
endif
Win_execute(winid, $'normal! {firstline}Gzz')
enddef
def Filter(winid: number, key: string): bool #{{{2
# support various normal commands for moving/scrolling
if [
'j', 'J', 'k', 'K', "\<Down>", "\<Up>", "\<C-N>", "\<C-P>",
"\<C-D>", "\<C-U>",
"\<PageUp>", "\<PageDown>",
'g', 'G', "\<Home>", "\<End>",
'z'
]->index(key) >= 0
var scroll_cmd: string = {
J: 'j',
K: 'k',
g: '1G',
"\<Home>": '1G',
"\<End>": 'G',
z: 'zz'
}->get(key, key)
var old_lnum: number = line('.', winid)
Win_execute(winid, $'normal! {scroll_cmd}')
var new_lnum: number = line('.', winid)
if print_entry
PrintEntry(winid)
endif
# wrap around the edges
if new_lnum == old_lnum
scroll_cmd = {
j: '1G',
J: '1G',
k: 'G',
K: 'G',
"\<Down>": '1G',
"\<Up>": 'G',
"\<C-N>": '1G',
"\<C-P>": 'G',
}->get(key, '')
if !scroll_cmd->empty()
Win_execute(winid, $'normal! {scroll_cmd}')
endif
endif
# move the cursor to the corresponding line in the main buffer
if key == 'J' || key == 'K'
var lnum: number = GetBufLnum(winid)
execute $'normal! 0{lnum}zt'
# install a match in the regular buffer to highlight the position of
# the entry in the latter
MatchDelete()
selected_entry_match = matchaddpos('IncSearch', [lnum], 0, -1)
endif
SetTitle(winid)
return true
elseif key == 'c'
SelectNearestEntryFromCursor(winid)
return true
# when we press `p`, print the selected line (useful when it's truncated)
elseif key == 'p'
PrintEntry(winid)
return true
# same thing, but automatically
elseif key == 'P'
print_entry = !print_entry
if print_entry
PrintEntry(winid)
else
echo ''
endif
return true
elseif key == 'q'
popup_close(winid, -1)
return true
elseif key == '?'
ToggleHelp(winid)
return true
# scroll help window
elseif key == "\<C-J>" || key == "\<C-K>"
var scroll_cmd: string = {"\<C-J>": 'j', "\<C-K>": 'k'}->get(key, key)
if scroll_cmd == 'j' && line('.', help_winid) == line('$', help_winid)
scroll_cmd = '1G'
elseif scroll_cmd == 'k' && line('.', help_winid) == 1
scroll_cmd = 'G'
endif
Win_execute(help_winid, $'normal! {scroll_cmd}')
return true
# increase/decrease the popup's width
elseif key == '+' || key == '-'
var width: number = winid->popup_getoptions().minwidth
if key == '-' && width == 1
|| key == '+' && winid->popup_getpos().col == 1
return true
endif
width = width + (key == '+' ? 1 : -1)
# remember the last width if we close and re-open the TOC later
b:toc.width = width
popup_setoptions(winid, {minwidth: width, maxwidth: width})
return true
elseif key == 'H' && b:toc.curlvl > 1
|| key == 'L' && b:toc.curlvl < b:toc.maxlvl
CollapseOrExpand(winid, key)
return true
elseif key == '/'
# This is probably what the user expect if they've started a first fuzzy
# search, press Escape, then start a new one.
DisplayNonFuzzyToc(winid)
[{
group: AUGROUP,
event: 'CmdlineChanged',
pattern: '@',
cmd: $'FuzzySearch({winid})',
replace: true,
}, {
group: AUGROUP,
event: 'CmdlineLeave',
pattern: '@',
cmd: 'TearDown()',
replace: true,
}]->autocmd_add()
# Need to evaluate `winid` right now with an `eval`'ed and `execute()`'ed heredoc because:{{{
#
# - the mappings can only access the script-local namespace
# - `winid` is in the function namespace; not in the script-local one
#}}}
var input_mappings: list<string> =<< trim eval END
cnoremap <buffer><nowait> <Down> <ScriptCmd>Filter({winid}, 'j')<CR>
cnoremap <buffer><nowait> <Up> <ScriptCmd>Filter({winid}, 'k')<CR>
cnoremap <buffer><nowait> <C-N> <ScriptCmd>Filter({winid}, 'j')<CR>
cnoremap <buffer><nowait> <C-P> <ScriptCmd>Filter({winid}, 'k')<CR>
END
input_mappings->execute()
var look_for: string
try
popup_setoptions(winid, {mapping: true})
look_for = input('look for: ', '', $'custom,{Complete->string()}') | redraw | echo ''
catch /Vim:Interrupt/
TearDown()
finally
popup_setoptions(winid, {mapping: false})
endtry
return look_for == '' ? true : popup_filter_menu(winid, "\<CR>")
endif
return popup_filter_menu(winid, key)
enddef
def FuzzySearch(winid: number) #{{{2
var look_for: string = getcmdline()
if look_for == ''
DisplayNonFuzzyToc(winid)
return
endif
# We match against *all* entries; not just the currently visible ones.
# Rationale: If we use a (fuzzy) search, we're probably lost. We don't know
# where the info is.
var matches: list<list<any>> = b:toc.entries
->copy()
->matchfuzzypos(look_for, {key: 'text'})
fuzzy_entries = matches->get(0, [])->copy()
var pos: list<list<number>> = matches->get(1, [])
var text: list<dict<any>>
if !has('textprop')
text = matches->get(0, [])
else
var buf: number = winid->winbufnr()
if prop_type_get('help-fuzzy-toc', {bufnr: buf}) == {}
prop_type_add('help-fuzzy-toc', {
bufnr: buf,
combine: false,
highlight: 'IncSearch',
})
endif
text = matches
->get(0, [])
->map((i: number, match: dict<any>) => ({
text: match.text,
props: pos[i]->copy()->map((_, col: number) => ({
col: col + 1,
length: 1,
type: 'help-fuzzy-toc',
}))}))
endif
Win_execute(winid, 'normal! 1Gzt')
Popup_settext(winid, text)
enddef
def DisplayNonFuzzyToc(winid: number) #{{{2
fuzzy_entries = null_list
Popup_settext(winid, GetTocEntries())
enddef
def PrintEntry(winid: number) #{{{2
echo GetTocEntries()[line('.', winid) - 1]['text']
enddef
def CollapseOrExpand(winid: number, key: string) #{{{2
# Must be saved before we reset the popup contents, so we can
# automatically select the least unexpected entry in the updated popup.
var buf_lnum: number = GetBufLnum(winid)
# find the nearest lower level for which the contents of the TOC changes
if key == 'H'
while b:toc.curlvl > 1
var old: list<dict<any>> = GetTocEntries()
--b:toc.curlvl
var new: list<dict<any>> = GetTocEntries()
# In `:help`, there are only entries in levels 3.
# We don't want to collapse to level 2, nor 1.
# It would clear the TOC which is confusing.
if new->empty()
++b:toc.curlvl
break
endif
var did_change: bool = new != old
if did_change || b:toc.curlvl == 1
break
endif
endwhile
# find the nearest upper level for which the contents of the TOC changes
else
while b:toc.curlvl < b:toc.maxlvl
var old: list<dict<any>> = GetTocEntries()
++b:toc.curlvl
var did_change: bool = GetTocEntries() != old
if did_change || b:toc.curlvl == b:toc.maxlvl
break
endif
endwhile
endif
# update the popup contents
var toc_entries: list<dict<any>> = GetTocEntries()
Popup_settext(winid, toc_entries)
# Try to select the same entry; if it's no longer visible, select its
# direct parent.
var toc_lnum: number = 0
for entry: dict<any> in toc_entries
if entry.lnum > buf_lnum
break
endif
++toc_lnum
endfor
Win_execute(winid, $'normal! {toc_lnum ?? 1}Gzz')
enddef
def MatchDelete() #{{{2
if selected_entry_match == 0
return
endif
selected_entry_match->matchdelete()
selected_entry_match = 0
enddef
def Callback(winid: number, choice: number) #{{{2
MatchDelete()
if help_winid != 0
help_winid->popup_close()
help_winid = 0
endif
if choice == -1
fuzzy_entries = null_list
return
endif
var lnum: number = GetTocEntries()
->get(choice - 1, {})
->get('lnum')
fuzzy_entries = null_list
if lnum == 0
return
endif
cursor(lnum, 1)
normal! zvzt
enddef
def ToggleHelp(menu_winid: number) #{{{2
if help_winid == 0
var height: number = [HELP_TEXT->len(), winheight(0) * 2 / 3]->min()
var longest_line: number = HELP_TEXT
->copy()
->map((_, line: string) => line->strcharlen())
->max()
var width: number = [longest_line, winwidth(0) * 2 / 3]->min()
var pos: dict<number> = popup_getpos(menu_winid)
var [line: number, col: number] = [pos.line, pos.col]
--col
var zindex: number = popup_getoptions(menu_winid).zindex
++zindex
help_winid = HELP_TEXT->popup_create({
line: line,
col: col,
pos: 'topright',
minheight: height,
maxheight: height,
minwidth: width,
maxwidth: width,
border: [],
borderchars: ['─', '│', '─', '│', '┌', '┐', '┘', '└'],
highlight: &buftype == 'terminal' ? 'Terminal' : 'Normal',
scrollbar: false,
zindex: zindex,
})
setwinvar(help_winid, '&cursorline', true)
setwinvar(help_winid, '&linebreak', true)
matchadd('Special', '^<\S\+\|^\S\{,2} \@=', 0, -1, {window: help_winid})
matchadd('Number', '\d\+', 0, -1, {window: help_winid})
for lnum: number in HELP_TEXT->len()->range()
if HELP_TEXT[lnum] =~ '^─\+$'
matchaddpos('Title', [lnum], 0, -1, {window: help_winid})
endif
endfor
else
if IsVisible(help_winid)
popup_hide(help_winid)
else
popup_show(help_winid)
endif
endif
enddef
def Win_execute(winid: number, cmd: any) #{{{2
# wrapper around `win_execute()` to enforce a redraw, which might be necessary
# whenever we change the cursor position
win_execute(winid, cmd)
redraw
enddef
def TearDown() #{{{2
autocmd_delete([{group: AUGROUP}])
cunmap <buffer> <Down>
cunmap <buffer> <Up>
cunmap <buffer> <C-N>
cunmap <buffer> <C-P>
enddef
#}}}1
# Util {{{1
def GetType(): string #{{{2
return &buftype == 'terminal' ? 'terminal' : &filetype
enddef
def GetTocEntries(): list<dict<any>> #{{{2
return fuzzy_entries ?? b:toc.entries
->copy()
->filter((_, entry: dict<any>): bool => entry.lvl <= b:toc.curlvl)
enddef
def GetBufLnum(winid: number): number #{{{2
var toc_lnum: number = line('.', winid)
return GetTocEntries()
->get(toc_lnum - 1, {})
->get('lnum')
enddef
def IsVisible(win: number): bool #{{{2
return win->popup_getpos()->get('visible')
enddef
def IsSpecialHelpLine(line: string): bool #{{{2
return line =~ '^[<>]\=\s*$'
|| line =~ '^\s*\*'
|| line =~ HELP_RULER
|| line =~ HELP_HEADLINE
enddef
def Complete(..._): string #{{{2
return b:toc.entries
->copy()
->map((_, entry: dict<any>) => entry.text->trim(' ~')->substitute('*', '', 'g'))
->filter((_, text: string): bool => text =~ '^[-a-zA-Z0-9_() ]\+$')
->sort()
->uniq()
->join("\n")
enddef

View File

@@ -0,0 +1,5 @@
vim9script noclear
import autoload '../autoload/helptoc.vim'
command -bar HelpToc helptoc.Open()

View File

@@ -4,7 +4,7 @@ vim9script
# Author: Bram Moolenaar
# Copyright: Vim license applies, see ":help license"
# Last Change: 2024 Jul 04
# Last Change: 2024 Nov 19
# Converted to Vim9: Ubaldo Tiberi <ubaldo.tiberi@gmail.com>
# WORK IN PROGRESS - The basics works stable, more to come
@@ -38,6 +38,11 @@ vim9script
# The communication with gdb uses GDB/MI. See:
# https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI.html
var DEBUG = false
if exists('g:termdebug_config')
DEBUG = get(g:termdebug_config, 'debug', false)
endif
def Echoerr(msg: string)
echohl ErrorMsg | echom $'[termdebug] {msg}' | echohl None
enddef
@@ -49,7 +54,9 @@ enddef
# Variables to keep their status among multiple instances of Termdebug
# Avoid to source the script twice.
if exists('g:termdebug_loaded')
Echoerr('Termdebug already loaded.')
if DEBUG
Echoerr('Termdebug already loaded.')
endif
finish
endif
g:termdebug_loaded = true
@@ -121,7 +128,9 @@ var breakpoint_locations: dict<any>
var BreakpointSigns: list<string>
var evalFromBalloonExpr: bool
var evalFromBalloonExprResult: string
var evalInPopup: bool
var evalPopupId: number
var evalExprResult: string
var ignoreEvalError: bool
var evalexpr: string
# Remember the old value of 'signcolumn' for each buffer that it's set in, so
@@ -202,7 +211,9 @@ def InitScriptVariables()
BreakpointSigns = []
evalFromBalloonExpr = false
evalFromBalloonExprResult = ''
evalInPopup = false
evalPopupId = -1
evalExprResult = ''
ignoreEvalError = false
evalexpr = ''
# Remember the old value of 'signcolumn' for each buffer that it's set in, so
@@ -1478,10 +1489,23 @@ def SendEval(expr: string)
evalexpr = exprLHS
enddef
# Returns whether to evaluate in a popup or not, defaults to false.
def EvaluateInPopup(): bool
if exists('g:termdebug_config')
return get(g:termdebug_config, 'evaluate_in_popup', false)
endif
return false
enddef
# :Evaluate - evaluate what is specified / under the cursor
def Evaluate(range: number, arg: string)
var expr = GetEvaluationExpression(range, arg)
echom $"expr: {expr}"
if EvaluateInPopup()
evalInPopup = true
evalExprResult = ''
else
echomsg $'expr: {expr}'
endif
ignoreEvalError = false
SendEval(expr)
enddef
@@ -1541,6 +1565,37 @@ def Balloon_show(expr: string)
endif
enddef
def Popup_format(expr: string): list<string>
var lines = expr
->substitute('{', '{\n', 'g')
->substitute('}', '\n}', 'g')
->substitute(',', ',\n', 'g')
->split('\n')
var indentation = 0
var formatted_lines = []
for line in lines
var stripped = line->substitute('^\s\+', '', '')
if stripped =~ '^}'
indentation -= 2
endif
formatted_lines->add(repeat(' ', indentation) .. stripped)
if stripped =~ '{$'
indentation += 2
endif
endfor
return formatted_lines
enddef
def Popup_show(expr: string)
var formatted = Popup_format(expr)
if evalPopupId != -1
popup_close(evalPopupId)
endif
# Specifying the line is necessary, as the winbar seems to cause issues
# otherwise. I.e., the popup would be shown one line too high.
evalPopupId = popup_atcursor(formatted, {'line': 'cursor-1'})
enddef
def HandleEvaluate(msg: string)
var value = msg
->substitute('.*value="\(.*\)"', '\1', '')
@@ -1555,13 +1610,12 @@ def HandleEvaluate(msg: string)
#\ ->substitute('\\0x00', NullRep, 'g')
#\ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g')
->substitute(NullRepl, '\\000', 'g')
if evalFromBalloonExpr
if empty(evalFromBalloonExprResult)
evalFromBalloonExprResult = $'{evalexpr}: {value}'
if evalFromBalloonExpr || evalInPopup
if empty(evalExprResult)
evalExprResult = $'{evalexpr}: {value}'
else
evalFromBalloonExprResult ..= $' = {value}'
evalExprResult ..= $' = {value}'
endif
Balloon_show(evalFromBalloonExprResult)
else
echomsg $'"{evalexpr}": {value}'
endif
@@ -1570,8 +1624,12 @@ def HandleEvaluate(msg: string)
# Looks like a pointer, also display what it points to.
ignoreEvalError = true
SendEval($'*{evalexpr}')
else
elseif evalFromBalloonExpr
Balloon_show(evalExprResult)
evalFromBalloonExpr = false
elseif evalInPopup
Popup_show(evalExprResult)
evalInPopup = false
endif
enddef
@@ -1588,7 +1646,7 @@ def TermDebugBalloonExpr(): string
return ''
endif
evalFromBalloonExpr = true
evalFromBalloonExprResult = ''
evalExprResult = ''
ignoreEvalError = true
var expr = CleanupExpr(v:beval_text)
SendEval(expr)
@@ -1861,6 +1919,11 @@ def CreateBreakpoint(id: number, subid: number, enabled: string)
var label = ''
if exists('g:termdebug_config') && has_key(g:termdebug_config, 'sign')
label = g:termdebug_config['sign']
elseif exists('g:termdebug_config') && has_key(g:termdebug_config, 'sign_decimal')
label = printf('%02d', id)
if id > 99
label = '9+'
endif
else
label = printf('%02X', id)
if id > 255

View File

@@ -17,6 +17,9 @@ endif
if !exists("g:matchparen_insert_timeout")
let g:matchparen_insert_timeout = 60
endif
if !exists("g:matchparen_disable_cursor_hl")
let g:matchparen_disable_cursor_hl = 0
endif
let s:has_matchaddpos = exists('*matchaddpos')
@@ -189,10 +192,18 @@ func s:Highlight_Matching_Pair()
" If a match is found setup match highlighting.
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
if s:has_matchaddpos
call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10))
if !g:matchparen_disable_cursor_hl
call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10))
else
call add(w:matchparen_ids, matchaddpos('MatchParen', [[m_lnum, m_col]], 10))
endif
else
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
if !g:matchparen_disable_cursor_hl
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
else
exe '3match MatchParen /\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
endif
call add(w:matchparen_ids, 3)
endif
let w:paren_hl_on = 1

View File

@@ -1,9 +1,12 @@
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN SECTION
" Maintainer: This runtime file is looking for a new maintainer.
" Date: Feb 09, 2021
" Date: Sep 09, 2021
" Last Change:
" 2024 May 08 by Vim Project: cleanup legacy Win9X checks
" 2024 Oct 27 by Vim Project: cleanup gx mapping
" 2024 Oct 28 by Vim Project: further improvements
" 2024 Oct 31 by Vim Project: use autoloaded functions
" Former Maintainer: Charles E Campbell
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1
@@ -31,6 +34,10 @@ set cpo&vim
" ---------------------------------------------------------------------
" Public Interface: {{{1
" Commands Launch/URL {{{2
command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim(<q-args>))
command -complete=file -nargs=1 Open call netrw#Open(trim(<q-args>))
" " }}}
" Local Browsing Autocmds: {{{2
augroup FileExplorer
au!

6
runtime/plugin/tutor.vim Normal file
View File

@@ -0,0 +1,6 @@
if exists('g:loaded_tutor_mode_plugin') || &compatible
finish
endif
let g:loaded_tutor_mode_plugin = 1
command! -nargs=? -complete=custom,tutor#TutorCmdComplete Tutor call tutor#TutorCmd(<q-args>)

View File

@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2023 Sep 05
" Last Change: 2024 Nov 02
"
" Additional contributors:
"
@@ -1843,6 +1843,10 @@ if s:settings.use_css && !s:settings.no_doc
" default font size for different elements
call append('.', '* { font-size: 1em; }')
+
" use color scheme styles for links
" browser-default blue/purple colors for links don't look like the existing theme and are unreadable on dark backgrounds
call append('.', 'a { color: inherit; }')
+
" if we use any input elements for unselectable content, make sure they look
" like normal text
if !empty(s:settings.prevent_copy)

Some files were not shown because too many files have changed in this diff Show More