diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2021-08-17 15:56:37 +0200 |
---|---|---|
committer | Axel Dahlberg <git@valleymnt.com> | 2021-12-18 10:54:26 +0100 |
commit | 8a4e26c6fe7530a0e24268cd373f0d4e53fe81e1 (patch) | |
tree | 9b3178c7db16ab4e06327774cb5d47185f23f6cc /runtime | |
parent | b1757e1c29d07c7958c62427e19e85916670049d (diff) | |
download | rneovim-8a4e26c6fe7530a0e24268cd373f0d4e53fe81e1.tar.gz rneovim-8a4e26c6fe7530a0e24268cd373f0d4e53fe81e1.tar.bz2 rneovim-8a4e26c6fe7530a0e24268cd373f0d4e53fe81e1.zip |
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.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/autocmd.txt | 8 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 6 | ||||
-rw-r--r-- | runtime/doc/intro.txt | 4 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 3 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 |
5 files changed, 20 insertions, 2 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 242631d98c..3cdf979e54 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -828,6 +828,14 @@ RemoteReply When a reply from a Vim that functions as SearchWrapped After making a search with |n| or |N| if the search wraps around the document back to the start/finish respectively. + *RecordingEnter* +RecordingEnter When a macro starts to be recorded. + The pattern is the current file name, and + |reg_recording()| is the current register that + is used. + *RecordinLeave* +RecordingLeave When the is the end of a macro recording. + The pattern is the current file name. *SessionLoadPost* SessionLoadPost After loading the session file created using the |:mksession| command. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 75b782fbff..0e002179e3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2588,6 +2588,7 @@ readdir({dir} [, {expr}]) List file names in {dir} selected by {expr} readfile({fname} [, {type} [, {max}]]) List get list of lines from file {fname} reg_executing() String get the executing register name +reg_recorded() String get the last recorded register name reg_recording() String get the recording register name reltime([{start} [, {end}]]) List get time value reltimefloat({time}) Float turn the time value into a Float @@ -7825,6 +7826,11 @@ reg_executing() *reg_executing()* Returns an empty string when no register is being executed. See |@|. +reg_recorded() *reg_recorded()* + Returns the single letter name of the last recorded register. + Returns an empty string string when nothing was recorded yet. + See |q|. + reg_recording() *reg_recording()* Returns the single letter name of the register being recorded. Returns an empty string string when not recording. See |q|. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index a89263861b..0e0156ac6b 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -563,8 +563,8 @@ The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when make sure Vim is in the mode indicated by 'insertmode', without knowing in what mode Vim currently is. - *gQ* *Q* *mode-Ex* *Ex-mode* *Ex* *EX* *E501* -Q or gQ Switch to Ex mode. This is like typing ":" commands + *gQ* *mode-Ex* *Ex-mode* *Ex* *EX* *E501* +gQ Switch to Ex mode. This is like typing ":" commands one after another, except: - You don't have to keep pressing ":". - The screen doesn't get updated after each command. diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 7e8d93aa71..60e9b6bed4 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -147,6 +147,9 @@ q Stops recording. *@@* *E748* @@ Repeat the previous @{0-9a-z":*} [count] times. + *Q* +Q Repeat the last recorded register [count] times. + *:@* :[addr]@{0-9a-z".=*+} Execute the contents of register {0-9a-z".=*+} as an Ex command. First set cursor at line [addr] (default is diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index bc59ea785e..154b18add7 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -218,6 +218,7 @@ Input/Mappings: Normal commands: |gO| shows a filetype-defined "outline" of the current buffer. + |Q| replays the last recorded macro. Options: 'cpoptions' flags: |cpo-_| |