mirror of
https://github.com/mawww/kakoune.git
synced 2026-11-04 14:06:36 +01:00
Page:
Distinguish between focused and unfocused clients in Tmux
Pages
Ambiguous Keys
Annotated examples of "Kakoune script"
Avoid the escape key
Bar
Bc
Building
Clang
Community
Ctags
Distinguish between focused and unfocused clients in Tmux
Documenting Plugins
Dynamic Window Title
EditorConfig
Eval Exec
Fuzzy finder
Git integration via Tig
Grep
HTML editing
Hacking
Header files
Highlighters
Home
IDE
Implementing user mode
Increment and Decrement
Indentation and Tabulation
Info boxes
Installing Plugins
Integrating Other CLI apps
JSON RPC
Jumplist
Kak daemon helper : 1 session per project
Languages
Line flags
Manipulating dates with Chronic
Migrating from Vim popular plugins
Migrating from Vim
Normal mode commands
OpenBSD
Plugin Managers
Qalculate
Ranger
Readline
Regex
Registers & Clipboard
Registers Clipboard
Reverse search
Running commands at startup
Rust
Selections combinations
Selections
Setting Plugin Options
Shell scripting
Status line
String syntax
TUI
The window scope
Tips for building from source
Undo tree
Wc
Windows tips
Wrapping
Writing Plugins
kak ‐p
macOS tips
zsh zle
No results
1
Distinguish between focused and unfocused clients in Tmux
Vladimir Bauer edited this page 2021-01-15 14:33:31 +05:00
Table of contents
Although tmux highlights active pane's borders and even lets to customize them via pane-active-border-style option, it's sometimes more desirable to instantly distinguish between focused and unfocused clients, as tiny borders are not so visible. Here is a script to achieve this via toggling status line background color:
# StatusLine face toggle
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
declare-option -hidden str last_focus_in
declare-option -hidden str focus_out_face "rgb:FDFDFD,rgb:8e908c"
hook global -group status-line-face-toggle FocusIn .* %{
set-option global last_focus_in %val{client}
unset-face window StatusLine
evaluate-commands %sh{
for client in $kak_client_list; do
if [ "$client" != "$kak_hook_param" ]; then
printf "eval -no-hooks -client %s 'set-face window StatusLine %s'\n" \
"$client" "$kak_opt_focus_out_face"
fi
done
}
}
hook global -group status-line-face-toggle WinDisplay .* %{
evaluate-commands %sh{
if [ "$kak_client" == "$kak_opt_last_focus_in" ]; then
echo "unset-face window StatusLine"
elif [ -n "$kak_opt_last_focus_in" ]; then
printf "set-face window StatusLine %s\n" "$kak_opt_focus_out_face"
fi
}
}
Relevant discussion
Wiki Home Page
Onboarding
Keys
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV
Editing
User Interface
Integration with OS and other tools
- Languages
- IDE
- Bar
- Dynamic Window Title
- Kak daemon helper : 1 session per project
- Registers & Clipboard
- macOS tips
- Windows tips
- Fuzzy finders
- JSON-RPC UI
- bc
- Qalculate!
- wc
- Shell Scripting
- Manipulating dates with Chronic
- Integrating Other CLI apps
