Open mohkale opened 4 years ago
@mohkale For shell command bindings, only the first line is shown so users can add a comment line as the first line to be shown as the documentation. For :
command bindings, this does not work since I think we parse the command beforehand and strip the comments in the lexer. It may be nice to make it work like shell commands but I'm not sure if it's possible.
For shell command bindings, only the first line is shown so users can add a comment line as the first line to be shown as the documentation
@gokcehan I'm not sure what you mean by this, could you share an example?
@mohkale Sure, for example the following keybinding:
map aa ${{
# create a new git repo
git init
host='https://github.com'
printf "host [https://github.com]: "
read host
host=${host:-https://github.com}
printf "path (user/repo): "
read path
git remote add origin ${host}/${path}.git
touch README.md
git add README.md
git commit -m 'initial commit'
}}
shows up as:
aa ${{ # create a new git repo ... }}
We should probably add such an example to our tips wiki.
at the moment lf just seems to specify the name of the command for a binding, and then a list of the arguments that're passed to it. At the very least for complicated
push
commands, this results in some really unreadable text.For eg.
Would it be possible to substitute keys into the help string where possible, for example <space> in my binding for
or is there intention to add a command to set the help string shown on a binding.