Shellit.kak a Kakoune editor command line gateway.
/bin/sh -c "${@:1}"
See or clone the docs/javadoc, docs/coverage, and docs/tests for the API.
Download pre-built shellit.jar with sha256 checksum.
$ openssl dgst -sha256 shellit.kak-<version>.jar
USAGE:
shellit [-i | -debug] <BINARY|JAR|OTHER> [FLAGS] [args ...]
OPTIONS:
-i:
ignore output in Kakoune client
-debug:
terminal debugging of a java.lang.Process
BINARY|JAR|OTHER:
is on your PATH|CLASSPATH|OTHER
FLAGS:
are native to the BINARY|JAR|OTHER
DISCUSSION:
Shellit a Kakoune command line gateway. Easily invoke a
binary, jar, or any script/executable without leaving
the kakoune command line. With automated temp file setup
and teardown on stdin/out/err. Default invocation
opens the temporary file in current kakoune client.
Kakoune exit :q triggers temporary file deletion,
invoke kakoune's :write command to save the buffers
output to a file name and destination of your choosing.
NOTE:
:shellit stderr available in kakoune *debug* buffer
:shellit -i flag success/failure -markup in kakoune
EXAMPLE:
:shellit python3 --help
:shellit perl --help
:shellit shellit.run --help
:shellit brew info shellcheck
:shellit brew home shellcheck
:shellit howdoi -c -n 5 catch an exception kotlin
:shellit curl https://cheat.sh/:intro
:ansi-render see https://github.com/eraserhd/kak-ansi
:shellit open https://github.com/eraserhd/kak-ansi
Woman had me my man-pants, press play on the motivational song spotify Schubert: Ave Maria, D.839 or youtube and put yourself in scrutineers mode. Peer review time!
HTML format:
docs/javadoc/index.html docstrings with UML diagrams and Harvard referencing style.
docs/coverage/index.html 96% coverage.
docs/tests/index.html viewable results of all tests 102/102 passing.
Building
@see gradle wrapper
@see shadowJar
Run the gradle command from the terminal in shellit.kak top level directory:
$ gradle wrapper
Linux/OSX:
$ ./gradlew shadowJar
Windows:
$ gradlew.bat shadowJar
The fat-jar is located:
$ shellit.kak/build/libs/shellit.kak-<version>.jar
Build with passing tests use:
$ ./gradlew build
Shutdown the gradle daemon:
$ ./gradlew --stop
Gradle is a command line tool:
$ ./gradlew --help
$ ./gradlew tasks
$ ./gradlew dependencies --configuration compileClasspath
NOTE:
Gradle can also build shared and static libraries, and executables in Assembler, C/C++ and Obj-C/C++
Installing
The Software Development Kit Manager: ‘SDKMAN! installs smoothly on Mac OSX, Linux, WLS, Cygwin, Solaris and FreeBSD. We also support Bash and ZSH shells’.
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
$ sdk install java 11.0.6.hs-adpt // moving target^1
$ sdk install kotlin
$ sdk install gradle
$ sdk install kscript // optional
NOTE:
- The package
build.gradle.kts
targets Java 11 ProcessHandle- [1^] Run
$ sdk list java
to see all available java sdk’s. - See sdkman for more details.
- [1^] Run
- kscript is required for kakoune syntax highlighting through kotlin.kak
- Hyperskill & Jetbrains Academy 2019, Theory: Java Archive, What is Java Archive?, viewed on 05 Dec 2019, https://hyperskill.org/learn/step/4311
# kakoune command
define-command -params .. shellit %{ evaluate-commands %sh{ java -jar <your-path-to>/shellit.kak-<version>.jar "${kak_session}" "${@:1}" } }
# .<shell>rc command
if [[ -d "$HOME/.local/jars" ]] ; then
JARPATH="$HOME/.local/jars"
export JARPATH
fi
javajar.sh
#!/bin/sh
# `.jar` suffix is no longer required from bash command line
exec java -jar "$JARPATH/$1.jar" "${@:2}"
exit 1
# .bash_alias command
alias jj=<your-path-to>/javajar.sh
Alternate Setup (linux/osx/*nix)
# kakoune command
define-command -params .. shellit %{ evaluate-commands %sh{ shellit.run "${kak_session}" "${@:1}" } }
jars-linux.sh
#!/bin/sh
##
# author Tommaso, P 2019, How to make a JAR file Linux executable, corderwall.com,
# viewed on 6 Jan 2019, <https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable>
##
MYSELF=`which "$0" 2>/dev/null`
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
exec "$java" $java_args -jar $MYSELF "$@"
exit 1
$ cat jars-linux.sh shellit.kak-<version>.jar > shellit.run && chmod u+x,u-w,og-rwx shellit.run && mv shellit.run ~/.local/bin/
shellit.kak see GRAALVM.md for details.
TODO:
/*
* bitbucket repo ✅
* uml diagrams ✅
* logger ✅
* mockk ✅
* tests and coverage ✅
* dokka api, docstrings and references ✅
* build fatjar ✅
* post on discuss.kakoune ✅
*/
NOTE:
Before running ./gradlew
command run: $ pgrep java
, note the process_id of all current running java processes.
Then run all the required ./gradlew
commands, after re-run the previous pgrep
command for any additional unclosed java process noting their process_id.
You can then use the: $ kill process_id
to terminate the additional running java process.
The cause is strictly ./gradlew
command and NOT shellit.run
or shellit.jar
.
@see The Gradle Daemon for more information.
For best practices with internet-of-things::IO()
.
# kakoune command
define-command -params .. shellit %{ evaluate-commands %sh{ run-shellit-kak.sh "${kak_session}" "${@:1}" } }
# run-shellit-kak.sh
#!/bin/sh
java -Djava.security.manager -Djava.security.policy==<your>.policy -cp <path>/shellit.kak-<version>.jar org.kjd.shellit.kak.ShellitKt "${@:1}"
Kakoune General Information
Kakoune is an open source modal editor. The source code lives on github mawww/kakoune.
A discussion on the repository structure of ’community plugins’ for Kakoune can be reviewed here: Standardi(s|z)ation of plugin file-structure layout #2402.
Read the Kakoune wiki for information on install options via a Plugin Manager.
Thank you to the Kakoune community 180+ contributors for a great modal editor in the terminal. I use it daily for the keyboard shortcuts.
That’s it for the shellit.kak readme, anything else you may need to know just pick up a book and read it Polar Bookshelf. Thanks all. Bye.