Replies: 1 comment 2 replies
|
You could bind macros to set the option off and on, like: [keys.insert]
C-v = "@<esc>:set auto-pairs false<ret>i"
C-V = "@<esc>:set auto-pairs true<ret>i"Not as convenient as Vim because you need a different key instead of a toggle, but it will do the job. Adding a toggle function for a single binding will be trivial with the plugin system, for what it’s worth. EDIT, with Steel for adventurous Schemers: (require "helix/configuration.scm")
(require "helix/keymaps.scm")
(require "helix/misc.scm")
;;@doc
;; Toggle the auto-pairs setting on/off.
(define (toggle-auto-pairs)
(let ((new-state (if (get-config-option-value "auto-pairs") #f #t)))
(auto-pairs new-state)
(set-status! (string-append "auto-pairs: " (if new-state "on" "off")))))
(keymap (global)
(normal (C-v ":toggle-auto-pairs"))
(select (C-v ":toggle-auto-pairs"))
(insert (C-v ":toggle-auto-pairs"))) |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In Neovim you can do
C+v, this enters literal input mode. Then you can type in the opening bracket[, (, {and so on and it won't add the closing bracket.This is really useful for auto-pairs. Can you do something like that in Helix?
All reactions