Created
June 9, 2019 12:58
-
-
Save edef1c/30d54baf271db252eb2dda3ea2b0a43a to your computer and use it in GitHub Desktop.
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
define-command nix-jump %{ | |
execute-keys <esc><a-i><a-w> | |
edit %sh{ | |
if [[ "$kak_selection" =~ ^\<(.*)\>$ ]]; then | |
path="$(nix-instantiate --find-file "${BASH_REMATCH[1]}")" | |
else | |
cd "$(dirname "$kak_buffile")" | |
path="$(realpath "$kak_selection")" | |
fi | |
if [ -d "$path" ]; then | |
echo "$path/default.nix" | |
else | |
echo "$path" | |
fi | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment