Compare commits
No commits in common. "cb67f5011c45e9eb0fef5a1945e4656191ddd182" and "7895820b331e010ff437d54a18936d8a1c03dce8" have entirely different histories.
cb67f5011c
...
7895820b33
@ -17,11 +17,9 @@ bind -r j select-pane -D
|
|||||||
bind -r h select-pane -L
|
bind -r h select-pane -L
|
||||||
bind -r l select-pane -R
|
bind -r l select-pane -R
|
||||||
|
|
||||||
# reload tmux.conf
|
|
||||||
bind r source-file "~/.config/tmux/tmux.conf" \; display-message "tmux.conf reloaded"
|
bind r source-file "~/.config/tmux/tmux.conf" \; display-message "tmux.conf reloaded"
|
||||||
|
|
||||||
# use tmux-sessionizer in place of f find
|
|
||||||
bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
|
||||||
|
|
||||||
# bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/personal/dev/todo.md"
|
# bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/personal/dev/todo.md"
|
||||||
|
|
||||||
|
# bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
||||||
|
|
@ -11,12 +11,12 @@ export PATH=$HOME/.local/bin:$HOME/.local/scripts:$PATH
|
|||||||
export PATH=$PATH:/opt/homebrew/opt/ccache/libexec
|
export PATH=$PATH:/opt/homebrew/opt/ccache/libexec
|
||||||
|
|
||||||
# executable name overrides
|
# executable name overrides
|
||||||
alias ls='ls -F'
|
|
||||||
alias vim='nvim'
|
alias vim='nvim'
|
||||||
|
|
||||||
# shortcuts for common commands
|
# shortcuts for common commands
|
||||||
alias 3e='echo;echo;echo'
|
alias 3e='echo;echo;echo'
|
||||||
alias 12e='3e;3e;3e;3e'
|
alias 12e='3e;3e;3e;3e'
|
||||||
|
alias ls='ls -F'
|
||||||
alias cl='clear; '
|
alias cl='clear; '
|
||||||
alias cls='clear;ls'
|
alias cls='clear;ls'
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
### script run plan
|
|
||||||
- run `./pre-run` script to create env vars
|
|
||||||
- run `./run`
|
|
||||||
- run `./copy_configs`
|
|
||||||
|
|
20
copy_configs
20
copy_configs
@ -1,6 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
local dry="0"
|
dry="0"
|
||||||
|
|
||||||
execute() {
|
execute() {
|
||||||
log "execute $@"
|
log "execute $@"
|
||||||
@ -19,10 +19,10 @@ done
|
|||||||
log "---------------- dotfiles ----------------"
|
log "---------------- dotfiles ----------------"
|
||||||
|
|
||||||
copy_dir() {
|
copy_dir() {
|
||||||
local from=$1
|
from=$1
|
||||||
local to=$2
|
to=$2
|
||||||
pushd $from > /dev/null
|
pushd $from > /dev/null
|
||||||
local dirs=(`find . -mindepth 1 -maxdepth 1 -type d`)
|
dirs=(`find . -mindepth 1 -maxdepth 1 -type d`)
|
||||||
for dir in $dirs; do
|
for dir in $dirs; do
|
||||||
[[ -d $to/$dir ]] && execute rm -rf $to/$dir
|
[[ -d $to/$dir ]] && execute rm -rf $to/$dir
|
||||||
execute cp -rp $dir $to/$dir
|
execute cp -rp $dir $to/$dir
|
||||||
@ -31,13 +31,13 @@ copy_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
copy_file() {
|
copy_file() {
|
||||||
local from=$1
|
from=$1
|
||||||
local to=$2
|
to=$2
|
||||||
local filename=$(basename $from)
|
filename=$(basename $from)
|
||||||
[[ -e $to/$filename ]] && execute rm $to/$filename
|
[[ -e $to/$filename ]] && execute rm $to/$filename
|
||||||
execute cp -p $from $to/$filename
|
execute cp -p $from $to/$filename
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_dir src_files/.config $HOME/.config
|
copy_dir .config $HOME/.config
|
||||||
copy_dir src_files/.local $HOME/.local
|
copy_dir .local $HOME/.local
|
||||||
copy_file src_files/.zshrc $HOME
|
copy_file .zshrc $HOME
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
mkdirs_after_setting_shell_env_vars() {
|
|
||||||
[[ ! -d $HOMEBOX ]] && mkdir $HOMEBOX
|
|
||||||
[[ ! -d $DEVDIR ]] && mkdir $DEVDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
mkdirs_after_setting_shell_env_vars
|
|
@ -1,11 +1,10 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
mkdirs_before_copying_config_files() {
|
|
||||||
[[ ! -d $HOME/.config ]] && mkdir $HOME/.config
|
[[ ! -d $HOME/.config ]] && mkdir $HOME/.config
|
||||||
[[ ! -d $HOME/.local ]] && mkdir $HOME/.local
|
[[ ! -d $HOME/.local ]] && mkdir $HOME/.local
|
||||||
[[ ! -d $HOME/.local/bin ]] && mkdir $HOME/.local/bin
|
[[ ! -d $HOME/.local/bin ]] && mkdir $HOME/.local/bin
|
||||||
[[ ! -d $HOME/.local/build ]] && mkdir $HOME/.local/build
|
[[ ! -d $HOME/.local/build ]] && mkdir $HOME/.local/build
|
||||||
[[ ! -d $HOME/.local/tmp ]] && mkdir $HOME/.local/tmp
|
[[ ! -d $HOME/.local/tmp ]] && mkdir $HOME/.local/tmp
|
||||||
}
|
|
||||||
|
|
||||||
mkdirs_before_copying_config_files
|
# [[ ! -d $HOME/dbox ]] && mkdir $HOME/dbox
|
||||||
|
[[ ! -d $HOME/dev ]] && mkdir $HOME/dev
|
||||||
|
8
run
8
run
@ -1,7 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
local single_script_filter=""
|
single_script_filter=""
|
||||||
local dry="0"
|
dry="0"
|
||||||
|
|
||||||
execute() {
|
execute() {
|
||||||
log "execute $@"
|
log "execute $@"
|
||||||
@ -17,10 +17,10 @@ while [[ $# > 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
local script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
|
script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
|
||||||
log "run // script_dir: $script_dir -- args: $single_script_filter"
|
log "run // script_dir: $script_dir -- args: $single_script_filter"
|
||||||
cd $script_dir
|
cd $script_dir
|
||||||
local scripts=(`find ./runs -maxdepth 1 -mindepth 1 -type f`)
|
scripts=(`find ./runs -maxdepth 1 -mindepth 1 -type f`)
|
||||||
for script in $scripts; do
|
for script in $scripts; do
|
||||||
if [[ -x $script ]]; then
|
if [[ -x $script ]]; then
|
||||||
if echo "$script" | grep -qv "$single_script_filter"; then
|
if echo "$script" | grep -qv "$single_script_filter"; then
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
local install_command="sudo apt install"
|
install_command="sudo apt install"
|
||||||
[[ -x $(which brew) ]] && install_command="brew install"
|
[[ -x $(which brew) ]] && install_command="brew install"
|
||||||
|
|
||||||
local neovim_dir=$HOME/.local/build/neovim
|
neovim_dir=$HOME/.local/build/neovim
|
||||||
local neovim_version="v0.10.3"
|
neovim_version="v0.10.3"
|
||||||
[ ! -z $NVIM_VERSION ] && neovim_version="$NVIM_VERSION"
|
[ ! -z $NVIM_VERSION ] && neovim_version="$NVIM_VERSION"
|
||||||
echo "neovim_version: \"$neovim_version\""
|
echo "neovim_version: \"$neovim_version\""
|
||||||
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
local omitted_dirs=(
|
|
||||||
$HOME
|
|
||||||
$HOMEBOX
|
|
||||||
$DEVDIR
|
|
||||||
)
|
|
||||||
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
|
|
||||||
tmux new-window -d -n cmd &&
|
|
||||||
tmux rename-window $EDITOR &&
|
|
||||||
$EDITOR .
|
|
||||||
|
|
||||||
clear
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
switch_to() {
|
|
||||||
[[ -z $TMUX ]] && tmux attach-session -t $1 || tmux switch-client -t $1
|
|
||||||
}
|
|
||||||
|
|
||||||
tmux_session_exists() {
|
|
||||||
[[ -n $(pgrep tmux) ]] && tmux list-sessions | grep -q "^$1:"
|
|
||||||
}
|
|
||||||
|
|
||||||
hydrate() {
|
|
||||||
local tmux_hydrate_path="$HOME/.local/bin/.tmux-session-hydrate"
|
|
||||||
[[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate"
|
|
||||||
[[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M
|
|
||||||
}
|
|
||||||
|
|
||||||
local search_dirs=(
|
|
||||||
$HOME
|
|
||||||
$HOMEBOX
|
|
||||||
$DEVDIR
|
|
||||||
$DEVDIR/git
|
|
||||||
$DEVDIR/git/me
|
|
||||||
$DEVDIR/git/gary
|
|
||||||
$DEVDIR/git/other
|
|
||||||
)
|
|
||||||
local selected_path=''
|
|
||||||
[[ $# -eq 1 ]] && selected_path=$1 ||
|
|
||||||
selected_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf)
|
|
||||||
[[ -z $selected_path ]] && exit 0
|
|
||||||
|
|
||||||
local selected_name=$(basename "$selected_path" | tr . _)
|
|
||||||
|
|
||||||
! (tmux_session_exists $selected_name) &&
|
|
||||||
tmux new-session -d -s $selected_name -c $selected_path &&
|
|
||||||
hydrate $selected_name $selected_path
|
|
||||||
switch_to $selected_name
|
|
Loading…
x
Reference in New Issue
Block a user