Add layout and note plugins
This commit is contained in:
14
layout/_layout
Normal file
14
layout/_layout
Normal file
@@ -0,0 +1,14 @@
|
||||
#compdef layout
|
||||
|
||||
__get_layouts() {
|
||||
ls -1 ~/.config/tmux/layouts 2>/dev/null | \
|
||||
while read -r layout; do echo $layout; done
|
||||
}
|
||||
|
||||
__layouts() {
|
||||
local -a layouts
|
||||
layouts=(${(fo)"$(__get_layouts)"})
|
||||
_describe 'layout' layouts
|
||||
}
|
||||
|
||||
_arguments ':layout:__layouts'
|
||||
10
layout/layout.plugin.zsh
Normal file
10
layout/layout.plugin.zsh
Normal file
@@ -0,0 +1,10 @@
|
||||
layout() {
|
||||
if [[ "$1" == "" ]]; then
|
||||
echo "usage: layout <layout> [name]"
|
||||
else
|
||||
tmux source-file ~/.config/tmux/layouts/$1
|
||||
if [[ "$2" != "" ]]; then
|
||||
tmux rename-window $2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user