Commit Graph

287 Commits

Author SHA1 Message Date
dundargoc
1b235fe6ca
docs(options): move all removed options to vim_diff.txt (#18770)
It's more consistent to gather all removed options in one spot rather
than spreading it out.
2022-05-28 16:42:56 +08:00
Gregory Anders
9e1ee9fb1d
refactor!: delete insertmode (#18547)
Neovim already removed `evim` (or any similar flags). The 'insertmode'
option is a weird remnant, so get rid of it.

The 'insertmode' option is replaced with a script that closely emulates
the option. This script is documented at :help 'insertmode'
2022-05-22 21:20:18 -06:00
Dundar Goc
97fc68850f refactor!: remove 'terse' option
Having two methods of setting the same option is redundant and can be
potentially confusing. Recommend adding 's' to 'shortmess' instead.
2022-05-19 00:15:40 +02:00
Dundar Goc
11957f51cc refactor!: remove 'remap' option
An option that should always be kept on except for when working with old
Vi scripts is of little use to us.
2022-05-19 00:15:36 +02:00
zeertzjq
030417d80b
revert: "feat(mappings): do not simplify the rhs of a mapping" (#18553)
This reverts commit 7ac5359143.
This fix can cause more problems than it solves.
2022-05-13 11:31:17 +08:00
yamatsum
233c41cb8c
feat(defaults): search selection by * and # in visual mode (#18538) 2022-05-13 08:28:10 +08:00
Ivan
78a1e6bc00 feat(defaults): session data in $XDG_STATE_HOME #15583
See: 4f2884e16d

- Move session persistent data to $XDG_STATE_HOME Change 'directory',
  'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to
  $XDG_STATE_HOME/nvim.
- Move logs to $XDG_STATE_HOME, too.
- Add stdpath('log') support.

Fixes: #14805
2022-05-12 07:13:45 -07:00
Famiu Haque
7e10b0dae6
docs: move "hl-VertSplit" to deprecated.txt #18328 2022-04-30 15:23:30 -07:00
zeertzjq
7ac5359143 feat(mappings): do not simplify the rhs of a mapping 2022-04-29 21:12:48 +08:00
zeertzjq
3601cef137 feat(mappings): do not replace existing mapping for simplified form 2022-04-29 15:51:04 +08:00
Gregory Anders
2dddc86a42
fix: show autocmd output when F is in shortmess (#18251)
The default value of including F in 'shortmess' has the unfortunate side
effect of hiding output from autocommands. This is a common source of
confusion and often leads people to think their autocommands are not
working when they are. There is a small snippet in the docs for
'shortmess' indicating that the F flag suppresses autocmd output, but
it's not easy to find if you don't already know to look for it.

This commit removes that behavior of the F flag to make it only suppress
file info when opening a new file.
2022-04-25 08:44:18 -06:00
Famiu Haque
b16afe4d55 feat(highlight): implement CurSearch highlight
Adds a `CurSearch` highlight group to highlight the current search result under the cursor.
2022-04-17 19:24:59 +06:00
Justin M. Keyes
72652cbc46
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous
:source. Its "create tempfile" behavior is not a required part of most
tests that use it.

Some tests still need the old "create tempfile" behavior either because
they test SID behavior, or because of missing nvim_exec features: #16071
2022-03-27 10:25:55 -07:00
bfredl
3c7e937a89
Merge pull request #17266 from famiu/feat/ui/global-statusline
feat(statusline): add global statusline
2022-03-17 20:16:39 +01:00
Famiu Haque
5ab1229174 feat: add support for global statusline
Ref: #9342

Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`.

Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`.

The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
2022-03-18 00:21:41 +06:00
Gregory Anders
f291a0339c
fix: use normal! <C-L> in default <C-L> mapping (#17695) 2022-03-12 17:56:53 -07:00
zeertzjq
e8107f0748 vim-patch:8.2.4498: using <Plug> with "noremap" does not work
Problem:    Using <Plug> with "noremap" does not work.
Solution:   Always remap <Plug>. (closes vim/vim#9879, closes vim/vim#9789)
1fc34225ac
2022-03-03 22:41:09 +08:00
zeertzjq
0cb9a577ed docs: clarify actual behavior of <Plug> 2022-03-01 09:28:27 +08:00
shadmansaleh
0347875a5c feat: ignore nore on <Plug> maps 2022-02-27 08:21:21 +06:00
Sean Dewar
b149665689
vim-patch:8.2.3573: cannot decide whether to skip test that fails with 64 bit
Problem:    Cannot decide whether to skip test that fails with 64 bit ints.
            (closes vim/vim#9072)
Solution:   Add v:sizeofint, v:sizeoflong and v:sizeofpointer.  Improve the
            check for multiply overflow.
69b3072d98

Omit v:sizeof{int,long,pointer} as they're only really used for tests.
2022-02-17 14:45:22 +00:00
zeertzjq
059d36e326 feat(events): add DirChangedPre
In Nvim, like DirChanged, this also triggers when switching windows.

This marks Vim patch 8.2.4335 as ported.

vim-patch:8.2.4335: no autocommand event triggered before changing directory

Problem:    No autocommand event triggered before changing directory. (Ronnie
            Magatti)
Solution:   Add DirChangedPre. (closes vim/vim#9721)
28e8f73ae2
2022-02-11 12:55:58 +08:00
dundargoc
64116d7850
chore: fix typos (#17250)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
Co-authored-by: Axel Dahlberg <git@valleymnt.com>
2022-02-08 08:19:06 +08:00
Sean Dewar
4f7a8991a9
vim-patch:8.2.0233: crash when using garbagecollect() in between rand()
Problem:    Crash when using garbagecollect() in between rand().
Solution:   Redesign the rand() and srand() implementation. (Yasuhiro
            Matsumoto, closes vim/vim#5587, closes vim/vim#5588)
4f645c54ef

Omit test_srand_seed.
Unmacroify SHUFFLE_XOSHIRO128STARSTAR and SPLITMIX32 while we're at it (leave
ROTL alone as it's fairly innocent).
2022-02-05 14:01:00 +00:00
Gregory Anders
de6f9233ee
refactor: source ftplugin.vim separately from filetype.vim (#17129)
This is a follow-on to #17040. The real benefit of #17040 was ensuring
that the ftplugin FileType autocommand was defined first and thus always
fired first. A side effect of the implementation in #17040 was that
setting variables that modified the state of filetype detection (such as
g:did_load_filetypes or g:do_filetype_lua) could no longer be set in the
user's init file. Filetype detection can also no longer be prevented
from loading by using `:filetype off`.

This PR addresses both of those side effects by unconditionally sourcing
ftplugin.vim and indent.vim before the user's init file (which ensures
that these autocommands run first) and sourcing filetype.vim *after* the
user's init file (thus allowing it to be blocked or modified).
2022-01-18 12:46:41 -07:00
Gregory Anders
fcf5dd34fd
refactor: enable filetype detection before user startup scripts (#17040) 2022-01-17 14:11:59 -07:00
Thomas Vigouroux
684c782546 docs(autocmd): update docs to match implementation
docs(reg_recorded): add links to relevant docs

docs(Recording): update docs to match implementation

docs(Q) update references of Q to be gQ

docs(autocmd) add description about state of reg_record{ing,ed} for RecordingLeave

docs(vim_diff) add Recording{Enter,Leave} to features

docs(index) removed duplicate gQ

docs(options) removed line about gQ erroring in visual mode

Update runtime/doc/vim_diff.txt

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

docs(vim_diff) removed double mention of Q
2021-12-18 08:54:07 -07:00
Thomas Vigouroux
8a4e26c6fe feat(autocmd): add Recording autocmds
feat(eval): add reg_recorded()

This function is used the get the last recorded register.

style(Recording): rename handler to match suggestions

fix(RecordingLeave): send autocommand earlier

This makes the autocommand fire just before setting reg_recorded to
reg_recording, this way we clearly show that we are actually just before
actually quitting the recording mode.
2021-12-18 10:54:26 +01:00
zeertzjq
53c95ccd1b
docs(vim_diff.txt): document SearchWrapped (#16612) 2021-12-10 15:04:11 -07:00
dundargoc
caa6992a10
chore: fix typos (#16361)
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-27 11:10:48 -05:00
zeertzjq
dba3590a0e
vim-patch:8.2.3591: no event is triggered when closing a window (#16306)
Problem:    No event is triggered when closing a window.
Solution:   Add the WinClosed event. (Naohiro Ono, closes vim/vim#9110)
23beefed73

Nvim has already implemented this feature, so this only changes tests
and docs.
2021-11-17 21:11:09 -05:00
zeertzjq
bdd180b5d2
docs: clarify chdir/CWD behaviors #16083 2021-10-19 07:37:11 -07:00
zeertzjq
8727d38012 vim-patch:8.1.1291: not easy to change directory and restore
Problem:    Not easy to change directory and restore.
Solution:   Add the chdir() function. (Yegappan Lakshmanan, closes vim/vim#4358)
1063f3d200

Also includes some documentation changes from patch 8.1.1218.
2021-10-17 22:04:53 +08:00
zeertzjq
920473d2f2 vim-patch:8.0.1459: cannot handle change of directory
Problem:    Cannot handle change of directory.
Solution:   Add the DirChanged autocommand event. (Andy Massimino,
            closes vim/vim#888)  Avoid changing directory for 'autochdir' too often.
b7407d3fc9

Only add "auto" pattern. "window" and "global" are already implemented.
Skip `Test_dirchanged_auto` using `CheckFunction test_autochdir`.
Part of PR #15952. More information can be found there.

N/A patches for version.c:

vim-patch:8.0.1460: missing file in patch

Problem:    Missing file in patch.
Solution:   Add changes to missing file.
b5cb65ba2b

vim-patch:8.0.1461: missing another file in patch

Problem:    Missing another file in patch.
Solution:   Add changes to missing file.
15833239a4
2021-10-17 22:04:53 +08:00
Justin M. Keyes
b63b4777ec
docs: third-party licenses, TEST_COLORS, system() #15665 2021-09-14 10:20:33 -07:00
Sean Dewar
cd18fe17a8
vim-patch:8.1.1116: cannot enforce a Vim script style
Problem:    Cannot enforce a Vim script style.
Solution:   Add the :scriptversion command. (closes vim/vim#3857)
558ca4ae55

:scriptversion is N/A, but ":let ..=" is relevant.

N/A patches for version.c

vim-patch:8.1.1188: not all Vim variables require the v: prefix

Problem:    Not all Vim variables require the v: prefix.
Solution:   When scriptversion is 3 all Vim variables can only be used with
            the v: prefix.  (Ken Takata, closes vim/vim#4274)
d2e716e6df

vim-patch:8.1.1190: has('vimscript-3') does not work

Problem:    has('vimscript-3') does not work.
Solution:   Add "vimscript-3" to the list of features.
93a4879c20

vim-patch:8.1.2038: has('vimscript-4') is always 0

Problem:    has('vimscript-4') is always 0.
Solution:   Add "vimscript-4" to the feature table. (Naruhiko Nishino,
            closes vim/vim#4941)
af91438338
2021-09-11 15:33:06 +01:00
Justin M. Keyes
9f3679cbfd docs: naming conventions 2021-09-09 06:28:11 -07:00
Justin M. Keyes
5f8518b3f0
fix(defaults): "syntax sync maxlines=1" on CmdwinEnter #15552
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.

ref #15401 622a36b1f1
2021-09-02 10:29:59 -07:00
Gregory Anders
622a36b1f1
feat(defaults): limit syntax cost on CmdwinEnter #15401
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.

ref #6289 #6399
2021-09-02 04:17:04 -07:00
Gregory Anders
460019366e feat: defaults: auto-create backup dir
Copy the behavior of 'undodir' and create the last specified directory
in the 'backupdir' option if it doesn't exist.

Use trailing slashes for 'backupdir' as well as 'viewdir' and 'undodir'
by default. Note that 'undodir' always behaves as though it has the
trailing slashes, regardless of whether or not they are present. They
are added to the default option value to minimize surprise.

The '.' value in 'backupdir' is kept because the default behavior for
backups is solely to have a backup if the save of the main file to disk
fails. As soon as that save is completed the backup file is removed, so
generally there is no need to put them in a central location.

Co-authored by: murphy66 <murphy66@gmail.com>
2021-08-27 10:34:44 -06:00
Björn Linse
d088066fa1
Merge pull request #15422 from bfredl/syn_name2id_go_brr
feat(highlights): some improvements and perf fixes
2021-08-19 15:48:22 +02:00
Björn Linse
fca52f5f32 feat(match): allow hl group to be defined after :match command 2021-08-19 15:08:50 +02:00
Gregory Anders
d417e67e59 feat(defaults): set nojoinspaces 2021-08-17 16:39:04 -06:00
Gregory Anders
f6c72b745c feat(defaults): set hidden 2021-08-17 16:38:39 -06:00
Gregory Anders
2cb8db34e3
feat: defaults: set undo points in <C-U> and <C-W> (#15400) 2021-08-16 18:28:52 -07:00
Gregory Anders
3954537b9e
feat(defaults): remove 'options' from viewoptions #15397
ref #6289
2021-08-16 13:05:24 -07:00
Gregory Anders
4ba74953b5
feat(defaults): switchbuf=uselast #15394 2021-08-16 11:20:46 -07:00
Gregory Anders
0aa8128aaa
feat(defaults): map CTRL-L to search highlights, update diffs #15385 2021-08-16 08:31:14 -07:00
Justin M. Keyes
54726e8bb9
fix(defaults): do not map Y in visual-mode #15387
Y in visual-mode is unrelated to the normal-mode behavior.

reverts part of #13268
2021-08-16 00:13:25 -07:00
Matthieu Coudron
5a111c1b02
feat(defaults): map Y to y$ #13268
rationale:
- consistent with D and Y
- long recommended by Vim's own ":help Y"

close #13268
close #416
ref #6289
2021-08-15 21:24:59 -07:00
Gregory Anders
d3bc61b31d fixup! fix(highlight): remove syncolor.vim 2021-07-27 14:14:42 -06:00