|
|
@ -2,9 +2,7 @@
|
|
|
|
(require-builtin helix/core/static as helix.static.)
|
|
|
|
(require-builtin helix/core/static as helix.static.)
|
|
|
|
(require-builtin helix/core/keybindings as helix.keybindings.)
|
|
|
|
(require-builtin helix/core/keybindings as helix.keybindings.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(provide set-theme-dracula
|
|
|
|
(provide
|
|
|
|
|
|
|
|
set-theme-dracula
|
|
|
|
|
|
|
|
set-theme-dracula__doc__
|
|
|
|
set-theme-dracula__doc__
|
|
|
|
set-theme-custom
|
|
|
|
set-theme-custom
|
|
|
|
set-theme-custom__doc__
|
|
|
|
set-theme-custom__doc__
|
|
|
@ -24,14 +22,18 @@
|
|
|
|
run-highlight
|
|
|
|
run-highlight
|
|
|
|
make-minor-mode!
|
|
|
|
make-minor-mode!
|
|
|
|
git-status
|
|
|
|
git-status
|
|
|
|
reload-helix-scm)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reload-helix-scm
|
|
|
|
|
|
|
|
static-format)
|
|
|
|
|
|
|
|
|
|
|
|
;;@doc
|
|
|
|
;;@doc
|
|
|
|
;; Sets the theme to be the dracula theme
|
|
|
|
;; Sets the theme to be the dracula theme
|
|
|
|
(define (set-theme-dracula cx)
|
|
|
|
(define (set-theme-dracula cx)
|
|
|
|
(helix.theme cx (list "dracula") helix.PromptEvent::Validate))
|
|
|
|
(helix.theme cx (list "dracula") helix.PromptEvent::Validate))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(enqueue-callback! 'helix.static.format)
|
|
|
|
|
|
|
|
(enqueue-callback! 'set-theme-dracula)
|
|
|
|
|
|
|
|
|
|
|
|
;;@doc
|
|
|
|
;;@doc
|
|
|
|
;; Sets the theme to be the theme passed in
|
|
|
|
;; Sets the theme to be the theme passed in
|
|
|
|
(define (set-theme-custom cx entered-theme)
|
|
|
|
(define (set-theme-custom cx entered-theme)
|
|
|
@ -66,7 +68,6 @@
|
|
|
|
(define (delete-word-forward cx)
|
|
|
|
(define (delete-word-forward cx)
|
|
|
|
(helix.static.delete_word_forward cx))
|
|
|
|
(helix.static.delete_word_forward cx))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;@doc
|
|
|
|
;;@doc
|
|
|
|
;; Registers a minor mode with the registered modifer and key map
|
|
|
|
;; Registers a minor mode with the registered modifer and key map
|
|
|
|
;;
|
|
|
|
;;
|
|
|
@ -80,8 +81,6 @@
|
|
|
|
(value->jsexpr-string)
|
|
|
|
(value->jsexpr-string)
|
|
|
|
(helix.keybindings.set-keybindings!)))
|
|
|
|
(helix.keybindings.set-keybindings!)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-syntax minor-mode!
|
|
|
|
(define-syntax minor-mode!
|
|
|
|
(syntax-rules (=>)
|
|
|
|
(syntax-rules (=>)
|
|
|
|
[(minor-mode! modifier (key => function))
|
|
|
|
[(minor-mode! modifier (key => function))
|
|
|
@ -94,40 +93,26 @@
|
|
|
|
(make-minor-mode! modifier (minor-mode-cruncher (key => function) remaining ...))]
|
|
|
|
(make-minor-mode! modifier (minor-mode-cruncher (key => function) remaining ...))]
|
|
|
|
|
|
|
|
|
|
|
|
[(minor-mode! modifier (key => (function ...)) remaining ...)
|
|
|
|
[(minor-mode! modifier (key => (function ...)) remaining ...)
|
|
|
|
(make-minor-mode! modifier (minor-mode-cruncher (key => function) ... remaining ...))]
|
|
|
|
(make-minor-mode! modifier (minor-mode-cruncher (key => function) ... remaining ...))]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-syntax minor-mode-cruncher
|
|
|
|
(define-syntax minor-mode-cruncher
|
|
|
|
(syntax-rules (=>)
|
|
|
|
(syntax-rules (=>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(minor-mode-cruncher (key => (function ...)))
|
|
|
|
[(minor-mode-cruncher (key => (function ...)))
|
|
|
|
(hash key (map (lambda (x)
|
|
|
|
(hash key (map (lambda (x) (string-append ":" (symbol->string x))) (quote (function ...))))]
|
|
|
|
(string-append ":" (symbol->string x)))
|
|
|
|
|
|
|
|
(quote (function ...))))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(minor-mode-cruncher (key => function))
|
|
|
|
[(minor-mode-cruncher (key => function))
|
|
|
|
(hash key (string-append ":" (symbol->string (quote function))))]
|
|
|
|
(hash key (string-append ":" (symbol->string (quote function))))]
|
|
|
|
|
|
|
|
|
|
|
|
[(minor-mode-cruncher (key => (function ...)) remaining ...)
|
|
|
|
[(minor-mode-cruncher (key => (function ...)) remaining ...)
|
|
|
|
(hash-insert
|
|
|
|
(hash-insert (minor-mode-cruncher remaining ...)
|
|
|
|
(minor-mode-cruncher remaining ...)
|
|
|
|
key
|
|
|
|
key (map (lambda (x)
|
|
|
|
(map (lambda (x) (string-append ":" (symbol->string x))) (quote (function ...))))]
|
|
|
|
(string-append ":" (symbol->string x)))
|
|
|
|
|
|
|
|
(quote (function ...))))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(minor-mode-cruncher (key => function) remaining ...)
|
|
|
|
[(minor-mode-cruncher (key => function) remaining ...)
|
|
|
|
(hash-insert
|
|
|
|
(hash-insert (minor-mode-cruncher remaining ...)
|
|
|
|
(minor-mode-cruncher remaining ...)
|
|
|
|
|
|
|
|
key
|
|
|
|
key
|
|
|
|
(string-append ":" (symbol->string (quote function))))]
|
|
|
|
(string-append ":" (symbol->string (quote function))))]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;@doc
|
|
|
|
;;@doc
|
|
|
|
;; Highlight to the matching paren
|
|
|
|
;; Highlight to the matching paren
|
|
|
@ -137,13 +122,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
(define (run-expr cx)
|
|
|
|
(define (run-expr cx)
|
|
|
|
(define current-selection (helix.static.current_selection cx))
|
|
|
|
(define current-selection (helix.static.current_selection cx))
|
|
|
|
(when (or (equal? "(" current-selection)
|
|
|
|
(when (or (equal? "(" current-selection) (equal? ")" current-selection))
|
|
|
|
(equal? ")" current-selection))
|
|
|
|
|
|
|
|
(highlight-to-matching-paren cx)
|
|
|
|
(highlight-to-matching-paren cx)
|
|
|
|
(helix.static.run-in-engine! cx (helix.static.current-highlighted-text! cx))
|
|
|
|
(helix.static.run-in-engine! cx (helix.static.current-highlighted-text! cx))
|
|
|
|
(helix.static.normal_mode cx)))
|
|
|
|
(helix.static.normal_mode cx)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (run-highlight cx)
|
|
|
|
(define (run-highlight cx)
|
|
|
|
(helix.static.run-in-engine! cx (helix.static.current-highlighted-text! cx)))
|
|
|
|
(helix.static.run-in-engine! cx (helix.static.current-highlighted-text! cx)))
|
|
|
|
|
|
|
|
|
|
|
@ -152,15 +135,15 @@
|
|
|
|
;; If the current selection is not on a bracket, this is a no-op
|
|
|
|
;; If the current selection is not on a bracket, this is a no-op
|
|
|
|
(define (delete-sexpr cx)
|
|
|
|
(define (delete-sexpr cx)
|
|
|
|
(define current-selection (helix.static.current_selection cx))
|
|
|
|
(define current-selection (helix.static.current_selection cx))
|
|
|
|
(when (or (equal? "(" current-selection)
|
|
|
|
(when (or (equal? "(" current-selection) (equal? ")" current-selection))
|
|
|
|
(equal? ")" current-selection))
|
|
|
|
|
|
|
|
(highlight-to-matching-paren cx)
|
|
|
|
(highlight-to-matching-paren cx)
|
|
|
|
(helix.static.delete_selection cx)))
|
|
|
|
(helix.static.delete_selection cx)))
|
|
|
|
|
|
|
|
|
|
|
|
; (minor-mode! "+" ("l" => lam)
|
|
|
|
; (minor-mode! "+" ("l" => lam)
|
|
|
|
; ("q" => (set-theme-dracula lam)))
|
|
|
|
; ("q" => (set-theme-dracula lam)))
|
|
|
|
|
|
|
|
|
|
|
|
(minor-mode! "P" ("l" => lam)
|
|
|
|
(minor-mode! "P"
|
|
|
|
|
|
|
|
("l" => lam)
|
|
|
|
("p" => highlight-to-matching-paren)
|
|
|
|
("p" => highlight-to-matching-paren)
|
|
|
|
("d" => delete-sexpr)
|
|
|
|
("d" => delete-sexpr)
|
|
|
|
("r" => run-expr))
|
|
|
|
("r" => run-expr))
|
|
|
|