-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from falbru/add-rc-folder
Add kakoune scripts
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
provide-module kakoune-qt %{ | ||
|
||
hook global SessionRenamed .*:.* %{ | ||
nop %sh{ KAKQT_SESSION_ID=$kak_client_env_KAKQT_SESSION_ID kak-qt cli rename-session $kak_session } | ||
} | ||
|
||
define-command -override -docstring "new [<commands>]: create a new Kakoune client" new -params .. %{ nop %sh{ | ||
KAKQT_SESSION_ID=$kak_client_env_KAKQT_SESSION_ID kak-qt cli new-client $@ | ||
}} | ||
complete-command -menu new command | ||
|
||
define-command kakqt-focus -params ..1 -docstring ' | ||
kakqt-focus [<client>]: focus the given client | ||
If no client is passed then the current one is used' \ | ||
%{ | ||
evaluate-commands %sh{ | ||
if [ $# -eq 1 ]; then | ||
printf "evaluate-commands -client '%s' kakqt-focus" "$1" | ||
elif [ -n "$kak_client_env_KAKQT_WINDOW_ID" ]; then | ||
KAKQT_SESSION_ID=$kak_client_env_KAKQT_SESSION_ID kak-qt cli focus $kak_client_env_KAKQT_WINDOW_ID | ||
fi | ||
} | ||
} | ||
complete-command -menu kakqt-focus client | ||
|
||
} |