dotfiles/mzte-nv/conf/lua/pluginconf/p-tsn-actions.fnl

39 lines
1.6 KiB
Text
Raw Normal View History

2023-02-21 21:42:55 +01:00
(local (mztenv tsna tsna-actions tsna-helpers nullls)
(values (require :mzte_nv) (require :ts-node-action)
(require :ts-node-action.actions)
(require :ts-node-action.helpers) (require :null-ls)))
(local zig-padding {")" " %s"
"]" " %s"
"}" " %s"
"{" "%s "
"," "%s "
:= " %s "
:+ " %s "
:- " %s "
:* " %s "
:/ " %s "
:** " %s "
:++ " %s "})
2023-02-21 21:59:24 +01:00
(macro md-marker-fn [level]
`[{1 (fn [_#] ,(string.rep "#" level)) :name ,(.. "Convert to H" level)}])
2023-02-21 21:42:55 +01:00
(tsna.setup {:zig {:FnCallArguments (tsna-actions.toggle_multiline zig-padding)
:InitList (tsna-actions.toggle_multiline zig-padding)
:VarDecl [{1 #(mztenv.tsn_actions.zigToggleMutability (tsna-helpers.node_text $1))
2023-02-21 21:59:24 +01:00
:name "Toggle Mutability"}]}
:markdown {:atx_h1_marker (md-marker-fn 2)
:atx_h2_marker (md-marker-fn 3)
:atx_h3_marker (md-marker-fn 4)
:atx_h4_marker (md-marker-fn 5)
:atx_h5_marker (md-marker-fn 6)
:atx_h6_marker (md-marker-fn 1)}})
2023-02-21 21:42:55 +01:00
(nullls.register {:name :TSNA
:method [(. nullls :methods :CODE_ACTION)]
:filetypes [:_all]
:generator {:fn (. tsna :available_actions)}})
(vim.keymap.set :n :U (. tsna :node_action) {:noremap true :silent true})