Skip to content

Commit

Permalink
[guide] improve macros guide to follow styling principles
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Nov 29, 2023
1 parent 1564fb8 commit ddcf9a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions visidata/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,22 @@ class MacrosGuide(GuideSheet):
Macros allow you to bind a command sequence to a keystroke or longname, to replay when that keystroke is pressed or the command is executed by longname.
The basic usage is:
1. Press `m` (macro-record) to begin recording the macro.
2. Go through the commands you wish to record.
3. Then type `m` again to complete the recording, and prompt for the keystroke or longname to bind it to.
1. `m` (`macro-record`) to begin recording the macro.
2. Execute a series of commands.
3. `m` again to complete the recording, and prompt for the keystroke or longname to bind it to.
The macro will then be executed everytime the provided keystroke or longname are used. Note: the Alt+keys and the function keys are left unbound; overriding other keys may conflict with existing bindings, now or in the future.
Executing a macro will the series of commands starting on the current row and column on the current sheet.
# The Macros Sheet
Use `gm` (`macro-sheet`) to open an index of existing macros.
- `gm` (`macro-sheet`) to open an index of existing macros.
Use `d` to mark macros for deletion. Use `z Ctrl+S` to then commit any changes.
- `d` to mark macros for deletion.
- `z Ctrl+S` to then commit any changes.
- `Enter` to open the macro in the current row, and view the series of commands composing it.'''

`Enter` to open the macro in the current row, and you can view the series of commands composing it.'''


Sheet.addCommand('m', 'macro-record', 'vd.cmdlog.startMacro()', 'record macro')
Expand Down

0 comments on commit ddcf9a7

Please # to comment.