Created
May 18, 2023 16:33
-
-
Save dviererbe/d33d0ff996f3e9c0c369bfbf121d8e99 to your computer and use it in GitHub Desktop.
Adapter script to call Codium from sensible-editor with the +n syntax.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eo pipefail | |
case "$#" in | |
"0") | |
codium --wait | |
;; | |
"1") | |
codium --wait "$1" | |
;; | |
"2") | |
lineposition="$(echo "$1" | grep -oP "(?<=^\+)(\\d+$)" || echo "$1" | grep -oP "(?<=^\+)(\\d+,\\d+$)")" | |
codium --wait --goto "$2:${lineposition//,/:}" | |
;; | |
"*") | |
echo "Too many arguments" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install you have to create a config file in your home folder to tell sensible-editor where to find the script.