diff options
| author | Tom Dalziel <tom_dl@hotmail.com> | 2024-07-16 13:00:28 +0200 |
|---|---|---|
| committer | Tom Dalziel <tom_dl@hotmail.com> | 2024-07-16 13:00:28 +0200 |
| commit | 81ec688488e8818697004b52eda170e31b28a78c (patch) | |
| tree | d3549b0b3fa3df4c862da51da5473a3f489e28ef /evil-commands.el | |
| parent | fc993435bbb3c486bdf0666298e2204ec170880b (diff) | |
gI works in visual state
Diffstat (limited to 'evil-commands.el')
| -rw-r--r-- | evil-commands.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/evil-commands.el b/evil-commands.el index 45a6e67..2e3a26a 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -2838,14 +2838,18 @@ in the next VCOUNT - 1 lines below the current one." (interactive "p") (evil--insert-line count vcount t)) -(defun evil-insert-0-line (count &optional vcount) +(evil-define-command evil-insert-0-line (count &optional vcount) "Switch to insert state at beginning of current line. Point is placed at column 0, or the beginning of the visual line. The insertion will be repeated COUNT times. If VCOUNT is non nil it should be number > 0. The insertion will be repeated in the next VCOUNT - 1 lines below the current one." + :keep-visual t + :type exclusive (interactive "p") - (evil--insert-line count vcount nil)) + (if (evil-visual-state-p) + (evil-beginning-of-line) + (evil--insert-line count vcount nil))) (defun evil-append-line (count &optional vcount) "Switch to Insert state at the end of the current line. |
