1
0
Fork 0

fix typos

This commit is contained in:
Andrey Orst 2018-09-22 22:39:05 +03:00
parent bbc279f9cd
commit 62fe13bb45

View file

@ -1,29 +1,29 @@
# Contributoin guidelines # Contribution guidelines
Before writing additional functionality to fzf.kak please refer to Before writing additional functionality to fzf.kak please refer to
[Kakoune's scripting guidelines](https://github.com/mawww/kakoune/blob/master/doc/writing_scripts.asciidoc). [Kakoune's scripting guidelines](https://github.com/mawww/kakoune/blob/master/doc/writing_scripts.asciidoc).
## Adding new command ## Adding new command
When adding commands to fzf.kak script please ensure to provide meaningfull names, When adding commands to fzf.kak script please ensure to provide meaningful names,
and prever full command defenitions. Also ensure that code must be resourcible, so if user and prefer full command definitions. Also ensure that code must be resourceable, so if user
want to resource kakrc plugin would not provide any warnings. want to resource kakrc plugin would not provide any warnings.
Good code: Good code:
```kak ```kak
define-command -override -hidden -docstring \ define-command -override -hidden -docstring \
"This is an example of adding new fzf-mode command. "This is an example of adding new fzf-mode command.
Note that '-override' is used since script should always be resourcible Note that '-override' is used since script should always be resourceable
If shell scripting is involved please follow POSIX standards, and test If shell scripting is involved please follow POSIX standards, and test
your code in POSIX shells, like 'dash', 'ash', and popular POSIX-compatible your code in POSIX shells, like 'dash', 'ash', and popular POSIX-compatible
shells, like 'bash' and 'zsh' You earn bonus points if your script works in 'fish'. shells, like 'bash' and 'zsh' You earn bonus points if your script works in 'fish'.
Also notice that '-hidden' is used since all commands of fzf should be accesible from Also notice that '-hidden' is used since all commands of fzf should be accessible from
fzf-mode keybindings. User should not remember all possible commands. fzf-mode key bindings. User should not remember all possible commands.
" \ fzf-good-example %{ " \ fzf-good-example %{
# This script features fzf command that accepts two arguments: # This script features fzf command that accepts two arguments:
# First argument is the command that should be used by kakoune # First argument is the command that should be used by Kakoune
# after fzf returns its result # after fzf returns its result
# Second argument is a command to the fzf itself, which will be used # Second argument is a command to the fzf itself, which will be used
# to provede list for fzf to show. # to provide list for fzf to show.
fzf "echo $1" "echo 'this␤is␤an␤example'" fzf "echo $1" "echo 'this␤is␤an␤example'"
} }
@ -34,15 +34,15 @@ map global fzf -docstring "fzf example command" e '<esc>: fzf-good-example<ret>'
Bad code: Bad code:
```kak ```kak
# example # example
def fzf-good-exmpl %{ fzf "echo $1" "echo 'actually i'm bad example'" } def fzf-good-exmpl %{ fzf "echo $1" "echo 'actually I'm bad example'" }
``` ```
Although such code is short, it is not *safe*, because reloading kakrc will cause an error here. Although such code is short, it is not *safe*, because reloading kakrc will cause an error here.
Also user doesnt know about all fzf commands, and by not adding command to `fzf-mode` you force Also user doesn't know about all fzf commands, and by not adding command to `fzf-mode` you force
user to search for fzf commands in commandline which isn't the way how plugin should work. And even user to search for fzf commands in command-line which isn't the way how plugin should work. And even
if user finds this command in commandline, there's no documentation, and name is short and may be not if user finds this command in command-line, there's no documentation, and name is short and may be not
meaningful enough for user to understand what this command actually does. The name may also be misleading meaningful enough for user to understand what this command actually does. The name may also be misleading
like in whis example - command says that it is good, but the result will be bad for the user. like in this example - command says that it is good, but the result will be bad for the user.
## Shell scripting ## Shell scripting
Shell scripting should be POSIX compatible. Please avoid bashisms. You can refer to Shell scripting should be POSIX compatible. Please avoid bashisms. You can refer to