diff --git a/.profile b/.profile new file mode 120000 index 000000000..8f4d7af49 --- /dev/null +++ b/.profile @@ -0,0 +1 @@ +../.profile \ No newline at end of file diff --git a/.tmux copy.conf b/.tmux copy.conf new file mode 100644 index 000000000..6efe102ed --- /dev/null +++ b/.tmux copy.conf @@ -0,0 +1,226 @@ +########################## +### from internets +########################## + +# From https://github.com/eduncan911/dotfiles/blob/master/.tmux.conf +bind-key -n M-0 select-window -t 0 +bind-key -n M-1 select-window -t 1 +bind-key -n M-2 select-window -t 2 +bind-key -n M-3 select-window -t 3 + +# macOS fix for clipboard, vim/nvim, tmux and iterm2 (yikes) +if-shell "uname | grep -q Darwin" "set -g default-shell $SHELL" +if-shell "uname | grep -q Darwin" "set -g default-command \"reattach-to-user-namespace -l ${SHELL}\"" + +# From https://superuser.com/a/552493/393361 +bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 +bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 + +# From https://superuser.com/questions/813661/how-to-configure-tmux-iterm-to-display-session-name-as-title-in-terminal-tab +set-option -g set-titles on + +# from https://github.com/tmux-plugins/tmux-continuum/issues/30 +set -g set-titles-string '#h ❐ #S ● #I #W' + +set -g display-panes-time 800 # slightly longer pane indicators display time +set -g display-time 1000 # slightly longer status messages display time + +# disable status bar - PSK - it's handy actually to tell if you're in tmux +# or not. +# set -g status off + +# nifty way to hide pane and bring it back +bind-key ! break-pane -d -n _hidden_pane +bind-key @ join-pane -s $.1 + +########################## +### from https://github.com/thoughtbot/dotfiles/blob/master/tmux.conf +########################## + +set -g default-terminal 'screen-256color' +# renumber windows sequentially after closing any of them +set -g renumber-windows on + + +# soften status bar color from harsh green to light gray +set -g status-style bg='#262626',fg='#a1cfd1' + +# set status bg to grey from https://protechnotes.com/comprehensive-tmux-tutorial-for-beginners-with-a-cheat-sheet/ +set -g status-bg colour236 + +# remove administrative debris (session name, hostname, time) in status bar +#set -g status-left '' +#set -g status-right '' + +# increase scrollback lines +set -g history-limit 10000 + +# Local config +if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local' + +########################## +# From https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/zsh-navigation-tools +########################## +bind h run-shell -b "~/.oh-my-zsh/plugins/zsh-navigation-tools/znt-tmux.zsh" + +########################## +### From https://pragprog.com/titles/bhtmux2/tmux-2/ +########################## +# Our .tmux.conf file + +# Setting the prefix from C-b to C-s +set -g prefix C-s +# Free the original Ctrl-b prefix keybinding +unbind C-b +#setting the delay between prefix and command +set -s escape-time 1 +# Ensure that we can send Ctrl-S to other apps +bind C-s send-prefix +set-option -g prefix2 C-b + + +# Set the base index for windows to 1 instead of 0 +set -g base-index 1 + +# Set the base index for panes to 1 instead of 0 +setw -g pane-base-index 1 + + +########################## +# From https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ +########################## + +# split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + + +# moving between panes with Prefix h,j,k,l +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Set the default terminal mode to 256color mode +set -g default-terminal "screen-256color" + +# trying to stop tmux (tmux) being overwritten/corrupted +# commented out cos gives 'no current session'. +# set allow-rename off + +# https://tmuxcheatsheet.com/tmux-plugins-tools/?full_name=tmux-plugins%2Ftmux-prefix-highlight +set -g @prefix_highlight_show_copy_mode 'on' +set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=yellow,bold' # default is 'fg=default,bg=yellow' +set -g @prefix_highlight_show_sync_mode 'on' +set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=green' # default is 'fg=default,bg=yellow' + +# Center the window list in the status line +set -g status-justify centre + +# enable activity alerts +setw -g monitor-activity on +set -g visual-activity on +# reload config file (change file location to your the tmux.conf you want to use) +bind r source-file ~/.tmux.conf + +# switch panes using Alt-arrow without prefix +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Enable mouse mode (tmux 2.1 and above) +set -g mouse on +set-option -g mouse on + +setw -g automatic-rename on # rename window to reflect current program +# renumber windows when a window is closed +set -g renumber-windows on + +###################### +### DESIGN CHANGES ### +###################### + +# loud or quiet? +set -g visual-activity off +set -g visual-bell off +set -g visual-silence off +setw -g monitor-activity off +set -g bell-action none + +# modes +setw -g clock-mode-colour colour5 +setw -g mode-style 'fg=colour1 bg=colour18 bold' + +# panes +set -g pane-border-style 'fg=colour19 bg=colour0' +set -g pane-active-border-style 'bg=colour0 fg=colour9' + +# ——————— Continuum ——————— +# https://github.com/tmux-plugins/tmux-continuum +set -g @continuum-restore 'on' +set -g @continuum-boot 'on' +set -g @continuum-boot-options 'iterm' + +# From https://github.com/tmux-plugins/tmux-continuum/issues/30 +set -g @continuum-save-interval '1' +set -g @continuum-boot-options 'iterm,fullscreen' +run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux + +# https://github.com/tmux-plugins/tmux-resurrect +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' + +# From https://github.com/tmux-plugins/tmux-continuum/blob/master/docs/automatic_start.md +set -g @plugin 'tmux-plugins/tmux-sidebar' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'tmux-plugins/tmux-open' +# ——————— Continuum ——————— + +# statusbar +set -g status-position bottom +set -g status-justify left +# Status line right side - 31-Oct 13:37 +#set -g status-right "#[fg=cyan]%d %b %R" + +setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' +setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' + +#setw -g window-status-style 'fg=colour9 bg=colour18' +#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' + +# setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' + +# Status line left side to show Session:window:pane +set -g status-left-length 40 +set -g status-left "#{prefix_highlight} #[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" + +# Update the status line every sixty seconds +set -g status-interval 5 + +# messages +#set -g message-style 'fg=colour232 bg=colour16 bold' + +# https://github.com/jonmosco/kube-tmux.git +# set -g status-right-length 80 # long enough for our long cluster names +# set -g status-right "#(/bin/bash $HOME/.tmux/kube-tmux/kube.tmux 250 red cyan)" + +########################## +# PLUGINS +# From https://github.com/tmux-plugins/tpm +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'jimeh/tmux-themepack' +set -g @themepack 'powerline/block/blue' + +# Other examples: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'git@github.com:user/plugin' +# set -g @plugin 'git@bitbucket.com:user/plugin' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' +########################## diff --git a/.zprofile b/.zprofile new file mode 120000 index 000000000..933b64ca1 --- /dev/null +++ b/.zprofile @@ -0,0 +1 @@ +../.zprofile \ No newline at end of file diff --git a/IntelliJ-Shortcuts.md b/IntelliJ-Shortcuts.md index 7535f0beb..187ad49c5 120000 --- a/IntelliJ-Shortcuts.md +++ b/IntelliJ-Shortcuts.md @@ -1 +1 @@ -../../IntelliJ-Shortcuts.md \ No newline at end of file +/Users/peter/src/IntelliJ-Shortcuts.md \ No newline at end of file diff --git a/aliases.sh b/aliases.sh new file mode 100644 index 000000000..9cede1417 --- /dev/null +++ b/aliases.sh @@ -0,0 +1,22 @@ +############################################################################## +# PSK's aliases. Better late than never... +############################################################################## + +alias "lhx"="ls ~" +alias "go-go-mono"="cd ~\/src\/rune\/go-mono" +alias "go-tortilla"="cd ~\/src\/rune\/go-mono\/tortilla" +alias "go-omz"="cd ~\/.oh-my-zsh" +alias "ggm"="cd ~\/src\/rune\/go-mono" +alias "gtor"="cd ~\/src\/rune\/go-mono\/tortilla" +alias "gtx"="cd ~\/src\/rune\/go-mono\/tortilla" +alias "gpm"="cd ~\/src\/rune\/python-mono" +alias "grad"="cd ~\/src\/rune\/python-mono\/radish" +alias "gomz"="cd ~\/.oh-my-zsh" +alias "goomz"="cd ~\/.oh-my-zsh" +alias "mtil"="make-big-break&& make test-integration-local 2>&1 | tee .\/make-local.log ; docker-stop-all-containers >\/dev\/null &" +alias "maketil"="make-big-break&& make test-integration-local 2>&1 | tee .\/make-local.log ; docker-stop-all-containers >\/dev\/null &" +alias "mti"="today-time&& make test-integration 2>&1 | tee .\/make-local.log ; docker-stop-all-containers >\/dev\/null &" +alias "maketi"="today-time&& make test-integration 2>&1 | tee .\/make-local.log ; docker-stop-all-containers >\/dev\/null &" +alias "errorsx"="^FATA|^ERR|^WAR|^FAIL" +alias "errx"="^FATA|^ERR|^WAR|^FAIL" +alias "RegEx Error Search"="^FATA|^ERR|^WAR|^FAIL" diff --git a/bin b/bin new file mode 120000 index 000000000..22f0a97dc --- /dev/null +++ b/bin @@ -0,0 +1 @@ +/Users/peter/bin \ No newline at end of file diff --git a/lib/functions.zsh b/lib/functions.zsh index 9e6285dbb..bcd7745b1 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -300,6 +300,13 @@ function page-break() { for i in {1..9}; do; make-break done + today-time +} + +function today-time() { + echo "————————————\n" + date +"%a %l:%M%p" + echo "\n————————————" } alias make-big-break=page-break @@ -597,4 +604,31 @@ bindkey '^Xf' peco-directories zle -N peco-files bindkey '^X^f' peco-files -### peco functions ### +########################### +# Percol https://github.com/mooz/percol +########################### +function ppgrep() { + if [[ $1 == "" ]]; then + PERCOL=percol + else + PERCOL="percol --query $1" + fi + ps aux | eval $PERCOL | awk '{ print $2 }' +} + +function ppkill() { + if [[ $1 =~ "^-" ]]; then + QUERY="" # options only + else + QUERY=$1 # with a query + [[ $# > 0 ]] && shift + fi + ppgrep $QUERY | xargs kill $* +} + +alias interactive-ps-grep="ppgrep" +alias grep-ps-percol="ppgrep" +alias grep-ps-interactive="ppgrep" +alias interactive-kill="ppkill" +alias kill-interactive="ppkill" +alias kill-percol="ppkill" diff --git a/plugins/term_tab/term_tab.plugin.zsh b/plugins/term_tab/term_tab.plugin.zsh index 1b612df68..444fe1edf 100644 --- a/plugins/term_tab/term_tab.plugin.zsh +++ b/plugins/term_tab/term_tab.plugin.zsh @@ -37,5 +37,5 @@ function _term_list(){ } zle -C term_list menu-complete _generic -bindkey "^v" term_list +bindkey "^0" term_list zstyle ':completion:term_list::::' completer _term_list diff --git a/rune-shell-funcs.zsh b/rune-shell-funcs.zsh index 0d5f7a5ce..8bde37430 100644 --- a/rune-shell-funcs.zsh +++ b/rune-shell-funcs.zsh @@ -19,53 +19,58 @@ export RUNE_SRC=${HOME}/src/rune export GO_MONO=${RUNE_SRC}/go-mono # Params: the command to execute in each source sub dir iterate-source-dirs() { - page-break - cd $GO_MONO - - TLD=$(pwd) - - for DIR in gorune carrotstream tortilla; do - echo "DIR: $DIR" - cd $DIR - $* - RESULT=$? - if [ $RESULT -ne "0" ]; then - echo "\n\n$* failed in $DIR, exiting." - fi + today-time + echo -e "\ncd $GO_MONO" cd $GO_MONO - done + + TLD=$(pwd) + + for DIR in gorune carrotstream tortilla; do + echo "DIR: $DIR" + cd $DIR + $* + RESULT=$? + if [ $RESULT -ne "0" ]; then + echo "\n\n$* failed in $DIR, exiting." + fi + cd $GO_MONO + done } go-make-mocks() { - iterate-source-dirs make mocks + iterate-source-dirs make mocks } go-lint() { - iterate-source-dirs golangci-lint run -v --timeout 2m0s ./... + iterate-source-dirs golangci-lint run -v --timeout 2m0s ./... } go-build() { - iterate-source-dirs go build ./... + iterate-source-dirs go build ./... +} + +go-fmt() { + iterate-source-dirs go fmt ./... } go-make() { - iterate-source-dirs make + iterate-source-dirs make } go-test() { - iterate-source-dirs go test ./... + iterate-source-dirs go test ./... } go-make-clean() { - iterate-source-dirs make clean + iterate-source-dirs make clean } psgr-rune() { - psgr 'taco|tortilla|broccoli|influx|carrotstream|artichoke' + psgr 'taco|tortilla|broccoli|influx|carrotstream|artichoke' } gitignore-update() { - pushd ${HOME}/src/rune/go-mono - echo -e "\nprod-query*/" >>.gitignore - popd + pushd ${HOME}/src/rune/go-mono + echo -e "\nprod-query*/" >>.gitignore + popd } diff --git a/znt b/znt new file mode 120000 index 000000000..ccf868836 --- /dev/null +++ b/znt @@ -0,0 +1 @@ +/Users/peter/.config/znt \ No newline at end of file