An experiment to create a kakoune plugin for neuron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

# https://neuron.zettel.page
# # Detection
# hook global BufCreate ^.*zettelkasten.*[.]md$ %{
# set-option buffer filetype zettel
# }
# # Initialization
# hook global WinSetOption filetype=zettel %{
# require-module neuron
# }
# provide-module neuron %{
# Highlighters
# add-highlighter shared/zettel regions
# add-highlighter shared/zettel/neuron-wikilink region "\[\[" "\]\]" fill link
# add-highlighter shared/zettel/neuron-metadata region "---" "---" fill value
define-command \
-docstring "create new zettel with neuron" \
neuron-new %{
evaluate-commands %sh{
echo edit $(neuron new -d ~/zettelkasten)
}
}
define-command \
-docstring "follow zettel link to file" \
neuron-follow-link %{
}
# neuron open -> open current zettel in browser
# neuron search -> find a zettel to open
# neuron query -> run a neuron query, open resulting JSON in new buffer
define-command \
-docstring "run neuron query and open JSON in new buffer" \
neuron-query %{
edit -scratch *neuron-query-results*
set-option buffer filetype json
set-register | %sh{
neuron query -d ~/zettelkasten | jq
}
execute-keys '%d"|P;'
}
# neuron rib -> run command in $directory
# }