dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit a68e6ef733b4aaa15ef708134465c86d175d0354
parent 1d08fbda30a7c9ae985275e4dd1b678114afd87d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 23 Apr 2020 14:14:20 +0200

Add option to repeat split with second argument as split count

Diffstat:
M.profile | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/.profile b/.profile @@ -111,16 +111,18 @@ tsplit() { echo "error: not in tmux session" >&2 return 1 fi - if [ $# -eq 0 ] || [ "$1" = "l" ]; then - tmux split-pane -h -c "$PWD" - elif [ "$1" = "j" ]; then - tmux split-pane -v -c "$PWD" - elif [ "$1" = "w" ]; then - tmux new-window -c "$PWD" - else - echo "error: split direction not understood" >&2 - return 2 - fi + for i in $(jot "${2-1}"); do + if [ $# -eq 0 ] || [ "$1" = "l" ]; then + tmux split-pane -h -c "$PWD" + elif [ "$1" = "j" ]; then + tmux split-pane -v -c "$PWD" + elif [ "$1" = "w" ]; then + tmux new-window -c "$PWD" + else + echo "error: split direction not understood" >&2 + return 2 + fi + done } hurlo() {