diff --git a/.local/bin/tmux-cht.sh b/.local/bin/tmux-cht.sh new file mode 100755 index 00000000..68215e86 --- /dev/null +++ b/.local/bin/tmux-cht.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf` +if [[ -z $selected ]]; then + exit 0 +fi + +read -p "Enter Query: " query + +if grep -qs "$selected" ~/.tmux-cht-languages; then + query=`echo $query | tr ' ' '+'` + tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" +else + tmux neww bash -c "curl -s cht.sh/$selected~$query | less" +fi + diff --git a/.local/bin/tmux-sessionizer b/.local/bin/tmux-sessionizer new file mode 100755 index 00000000..461772d3 --- /dev/null +++ b/.local/bin/tmux-sessionizer @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +if [[ $# -eq 1 ]]; then + selected=$1 +else + selected=$(find ~/ ~/Development -mindepth 1 -maxdepth 1 -type d | fzf) +fi + +if [[ -z $selected ]]; then + exit 0 +fi + +selected_name=$(basename "$selected" | tr . _) +tmux_running=$(pgrep tmux) + +if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then + tmux new-session -s $selected_name -c $selected + exit 0 +fi + +if ! tmux has-session -t $selected_name 2> /dev/null; then + tmux new-session -ds $selected_name -c $selected +fi + +tmux switch-client -t $selected_name diff --git a/.tmux-cht-command b/.tmux-cht-command new file mode 100644 index 00000000..04551d3d --- /dev/null +++ b/.tmux-cht-command @@ -0,0 +1,37 @@ +find +man +tldr +sed +awk +tr +cp +ls +grep +xargs +rg +ps +mv +kill +lsof +less +head +tail +tar +cp +rm +rename +jq +cat +ssh +cargo +git +git-worktree +git-status +git-commit +git-rebase +docker +docker-compose +stow +chmod +chown +make diff --git a/.tmux-cht-languages b/.tmux-cht-languages new file mode 100644 index 00000000..d3f0c716 --- /dev/null +++ b/.tmux-cht-languages @@ -0,0 +1,19 @@ +golang +solidity +nodejs +javascript +tmux +typescript +zsh +cpp +c +lua +rust +python +bash +php +haskell +ArnoldC +css +html +gdb diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 00000000..393047ba --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,14 @@ +set -g bell-action none +set -g visual-bell on +set -g status-style 'bg=#333333 fg=#5eacd3' + +bind r source-file ~/.tmux.conf +set -g base-index 1 + +set-window-option -g mode-keys vi + +# forget the find window. That is for chumps +bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" + +bind-key -r i run-shell "tmux neww tmux-cht.sh" +