mirror of https://github.com/helix-editor/helix
update instructions
parent
3938a6dc54
commit
4a8c4fbea5
39
STEEL.md
39
STEEL.md
|
@ -53,9 +53,8 @@ to be used as typed commands. For example:
|
||||||
```scheme
|
```scheme
|
||||||
# helix.scm
|
# helix.scm
|
||||||
|
|
||||||
(require-builtin helix/core/typable as helix.)
|
(require (prefix-in helix. "helix/commands.scm"))
|
||||||
(require-builtin helix/core/static as helix.static.)
|
(require (prefix-in helix.static. "helix/static.scm"))
|
||||||
(require-builtin helix/core/keybindings as helix.keybindings.)
|
|
||||||
|
|
||||||
(provide shell git-add open-helix-scm open-init-scm reload-helix-scm)
|
(provide shell git-add open-helix-scm open-init-scm reload-helix-scm)
|
||||||
|
|
||||||
|
@ -125,13 +124,11 @@ For example, if we wanted to select a random theme at startup:
|
||||||
# init.scm
|
# init.scm
|
||||||
|
|
||||||
(require-builtin steel/random as rand::)
|
(require-builtin steel/random as rand::)
|
||||||
(require-builtin helix/core/static as helix.static.)
|
(require (prefix-in helix. "helix/commands.scm"))
|
||||||
(require-builtin helix/core/typable as helix.)
|
(require (prefix-in helix.static. "helix/static.scm"))
|
||||||
|
|
||||||
|
|
||||||
(define rng (rand::thread-rng!))
|
(define rng (rand::thread-rng!))
|
||||||
|
|
||||||
|
|
||||||
;; Picking one from the possible themes
|
;; Picking one from the possible themes
|
||||||
(define possible-themes '("ayu_mirage" "tokyonight_storm" "catppuccin_macchiato"))
|
(define possible-themes '("ayu_mirage" "tokyonight_storm" "catppuccin_macchiato"))
|
||||||
|
|
||||||
|
@ -150,7 +147,7 @@ For example, if we wanted to select a random theme at startup:
|
||||||
|
|
||||||
There are a handful of extra libraries in development for extending helix, and can be found here https://github.com/mattwparas/helix-config.
|
There are a handful of extra libraries in development for extending helix, and can be found here https://github.com/mattwparas/helix-config.
|
||||||
|
|
||||||
If you'd like to use them, create a directory called `cogs` in your `.config/helix` directory, and copy the files in there. In particular, `keymaps.scm` and `options.scm` are working well.
|
If you'd like to use them, create a directory called `cogs` in your `.config/helix` directory, and copy the files in there.
|
||||||
|
|
||||||
### options.scm
|
### options.scm
|
||||||
|
|
||||||
|
@ -160,10 +157,11 @@ If you'd like to override configurations from your toml config:
|
||||||
```scheme
|
```scheme
|
||||||
# init.scm
|
# init.scm
|
||||||
|
|
||||||
(require (only-in "cogs/options.scm" apply-options))
|
(require "helix/configuration.scm")
|
||||||
|
|
||||||
(define *config-map* '((file-picker.hidden false) (cursorline true) (soft-wrap.enable true)))
|
(file-picker (fp-hidden #f))
|
||||||
(apply-options *helix.cx* *config-map*)
|
(cursorline #t)
|
||||||
|
(soft-wrap (sw-enable #t))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -177,22 +175,23 @@ Applying custom keybindings for certain file extensions:
|
||||||
# init.scm
|
# init.scm
|
||||||
|
|
||||||
(require "cogs/keymaps.scm")
|
(require "cogs/keymaps.scm")
|
||||||
|
(require (only-in "cogs/file-tree.scm" FILE-TREE-KEYBINDINGS FILE-TREE))
|
||||||
|
(require (only-in "cogs/recentf.scm" recentf-open-files get-recent-files recentf-snapshot))
|
||||||
|
|
||||||
|
;; Set the global keybinding for now
|
||||||
|
(add-global-keybinding (hash "normal" (hash "C-r" (hash "f" ":recentf-open-files"))))
|
||||||
|
|
||||||
(define scm-keybindings
|
(define scm-keybindings (hash "insert" (hash "ret" ':scheme-indent "C-l" ':insert-lambda)))
|
||||||
(hash
|
|
||||||
"insert"
|
|
||||||
(hash "ret" ':scheme-indent)))
|
|
||||||
|
|
||||||
|
|
||||||
;; Grab whatever the existing keybinding map is
|
;; Grab whatever the existing keybinding map is
|
||||||
(define standard-keybindings (helix-current-keymap))
|
(define standard-keybindings (deep-copy-global-keybindings))
|
||||||
|
|
||||||
|
(define file-tree-base (deep-copy-global-keybindings))
|
||||||
|
|
||||||
;; Overlay the scm keybindings on top of the standard keybindings. This does a little mutation here, so its a bit funky looking.
|
|
||||||
(merge-keybindings standard-keybindings scm-keybindings)
|
(merge-keybindings standard-keybindings scm-keybindings)
|
||||||
|
(merge-keybindings file-tree-base FILE-TREE-KEYBINDINGS)
|
||||||
|
|
||||||
;; For .scm files, use this keybinding set insteead
|
(set-global-buffer-or-extension-keymap (hash "scm" standard-keybindings FILE-TREE file-tree-base))
|
||||||
(set-global-buffer-or-extension-keymap (hash "scm" standard-keybindings))
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue