From 455e2a07bb48ce4211c907b2fb319e53652d1d19 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 20 Apr 2016 16:09:02 -0500 Subject: [PATCH] work on dotfiles --- arch_linux_init/pacaur.bash | 2 + sh/bashrc | 6 +++ sh/inputrc | 2 + sh/layout_dev.tmux | 10 ++++ sh/link.bash | 12 +++-- sh/tmux.conf | 93 +++++++------------------------------ variables.bash | 8 ++-- wm/bspwm_config | 13 ++++-- x/xresources | 4 +- 9 files changed, 61 insertions(+), 89 deletions(-) create mode 100644 sh/inputrc create mode 100644 sh/layout_dev.tmux diff --git a/arch_linux_init/pacaur.bash b/arch_linux_init/pacaur.bash index a16c90c..b402b5d 100755 --- a/arch_linux_init/pacaur.bash +++ b/arch_linux_init/pacaur.bash @@ -21,3 +21,5 @@ cd "$REPOSITORY_PATH/pacaur" makepkg -i --noconfirm cd - +pacuar -S cower pacaur + diff --git a/sh/bashrc b/sh/bashrc index 3f905e9..4944c3c 100644 --- a/sh/bashrc +++ b/sh/bashrc @@ -47,6 +47,9 @@ alias p="ping 8.8.8.8" # emacs aliases alias emacs="emacs -nw" +# arch aliases +alias archupdate="pacaur -Syyu --noconfirm --noedit" + export EDITOR="vim" if command -v nvim >/dev/null 2>&1; then alias vim="nvim" @@ -90,6 +93,9 @@ vman() { alias _man="man" alias man="vman" +complete -cf sudo +complete -cf man + # allow a per-device script that is pulled in if [ -a "$HOME/.bashrc_env" ]; then . "$HOME/.bashrc_env" diff --git a/sh/inputrc b/sh/inputrc new file mode 100644 index 0000000..dd873d5 --- /dev/null +++ b/sh/inputrc @@ -0,0 +1,2 @@ +"\eOd": backward-word +"\eOc": forward-word diff --git a/sh/layout_dev.tmux b/sh/layout_dev.tmux new file mode 100644 index 0000000..9945356 --- /dev/null +++ b/sh/layout_dev.tmux @@ -0,0 +1,10 @@ +splitw -h -p 50 +splitw -v -p 50 +splitw -v -p 50 +selectp -U +selectp -U +splitw -v -p 50 +resize-pane -x 100 +selectp -L +splitw -h -p 50 +selectp -L diff --git a/sh/link.bash b/sh/link.bash index 5e18aad..9a8ca6b 100755 --- a/sh/link.bash +++ b/sh/link.bash @@ -3,12 +3,18 @@ DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) source $DIR/variables.bash -rm "$HOME/.bashrc" -rm "$HOME/.bash_profile" -rm "$HOME/.tmux.conf" +mkdir -p "$HOME/.tmux/layouts" + +rm -f "$HOME/.bashrc" +rm -f "$HOME/.bash_profile" +rm -f "$HOME/.tmux.conf" +rm -f "$HOME/.tmux/layouts/dev.tmux" +rm -f "$HOME/.inputrc" ln -s "$DOTFILES_PATH/sh/bashrc" "$HOME/.bashrc" ln -s "$DOTFILES_PATH/sh/bash_profile" "$HOME/.bash_profile" ln -s "$DOTFILES_PATH/sh/tmux.conf" "$HOME/.tmux.conf" +ln -s "$DOTFILES_PATH/sh/layout_dev.tmux" "$HOME/.tmux/layouts/dev.tmux" +ln -s "$DOTFILES_PATH/sh/inputrc" "$HOME/.inputrc" sed -i "/export DOTFILES_PATH/c export DOTFILES_PATH=\"$DIR\"" "$HOME/.bashrc" diff --git a/sh/tmux.conf b/sh/tmux.conf index f16eb3a..725e0fe 100644 --- a/sh/tmux.conf +++ b/sh/tmux.conf @@ -3,101 +3,36 @@ unbind C-b set -g prefix C-s bind-key s send-prefix -# statusbar on top -set-option -g status-position top +# statusbar on bottom +set-option -g status-position bottom -# better resizing -setw -g aggressive-resize on +setw -g monitor-activity on -set -s escape-time 1 +set -g status off -# terminal -set -g default-terminal "screen-256color" -set-window-option -g utf8 on -set-window-option -g xterm-keys on -set-window-option -g mode-keys vi -set-window-option -g monitor-activity on - -# status bar -set -g status-interval 5 -set -g status-utf8 on -setw -g mode-bg black -set-option -g status-bg default -set-option -g status-fg default -set-option -g status-attr default -set-option -g message-bg default -set-option -g message-fg yellow -set -g status-left '#[fg=green]#(whoami)@#24h > #12S #[fg=default]| ' -set -g status-left-length 64 -set -g status-right '#[fg=blue]%b %d %H:%M' -set -g window-status-current-format '#[fg=blue]#I #W ' -set -g window-status-format '#I #W ' -set -g status +bind-key W resize-pane -x 100 # splitting bind-key v split-window -h bind-key b split-window + +# iterating bind-key H set status - -# pane switching -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -# pane resizing -bind-key -r M-k resize-pane -U 5 -bind-key -r M-j resize-pane -D 5 -bind-key -r M-h resize-pane -L 5 -bind-key -r M-l resize-pane -R 5 -bind-key -r C-k resize-pane -U -bind-key -r C-j resize-pane -D -bind-key -r C-h resize-pane -L -bind-key -r C-l resize-pane -R +bind r source-file ~/.tmux.conf # vim copying setw -g mode-keys vi bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy 'y' copy-selection -# Similar to 'C-w j' to navigate windows in Vim -unbind-key j -bind-key j select-pane -D -unbind-key k -bind-key k select-pane -U -unbind-key h -bind-key h select-pane -L -unbind-key l -bind-key l select-pane -R - -# Enable mouse support (works in iTerm) -# set-window-option -g mode-mouse on -# set-option -g mouse-select-pane on -# set-option -g mouse-resize-pane on -set -g mouse on - -# Start windows and panes at 1, not 0 set -g base-index 1 set -g pane-base-index 1 -# If we want Vim to be told about focus: http://git.io/2UqSgQ -set -g focus-events on - -# Use tmux-resurrect to manage saving/restoring sessions +# use tmux-resurrect to manage saving/restoring sessions set -g @resurrect-save 'S' set -g @resurrect-restore 'R' -# fix pbcopy/pbpaste -if 'command -v reattach-to-user-namespace >/dev/null' \ - 'set -gq @osx-pasteboard true' -if 'tmux show -gv @osx-clipboard' \ - 'set -g default-command "reattach-to-user-namespace -l $SHELL"' - -# Copy top of tmux paste buffer stack to OS clipboard. -# Alternatively, this will always immediately copy to system pasteboard: -# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" -if 'tmux show -gv @osx-clipboard' \ - 'bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"' +bind M-l source-file ~/.tmux/layouts/dev.tmux is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" @@ -111,11 +46,15 @@ bind-key u capture-pane \;\ save-buffer /tmp/tmux-buffer \;\ split-window -l 10 "urlview /tmp/tmux-buffer" -# List of plugins +# list of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'tmux-plugins/tmux-copycat' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-sessionist' -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +# initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' diff --git a/variables.bash b/variables.bash index a72332e..5ca6e8f 100755 --- a/variables.bash +++ b/variables.bash @@ -5,8 +5,8 @@ export DOTFILES_PATH="$HOME/.dotfiles" export REPOSITORY_PATH="$HOME/Documents/Repositories" -export WINDOW_GAP=20 -export BORDER_WIDTH=2 +export WINDOW_GAP=0 +export BORDER_WIDTH=0 source "$DOTFILES_PATH/scripts/get_x_fonts.sh" source "$DOTFILES_PATH/scripts/get_color.sh" @@ -15,8 +15,8 @@ export BAR_ON_XINIT=0 export BAR_FIFO="$DOTFILES_PATH/wm_bar_fifo.lock" export BAR_TOP=1 export BAR_MARGIN=$WINDOW_GAP -export BAR_HEIGHT=28 -export BAR_BORDER_WIDTH=2 +export BAR_HEIGHT=20 +export BAR_BORDER_WIDTH=1 export BAR_FONT_FAMILY="$PRIMARY_FONT_FAMILY_WITH_SIZE" export BAR_UNDERLINE=1 diff --git a/wm/bspwm_config b/wm/bspwm_config index ccd6d3e..198b2fd 100755 --- a/wm/bspwm_config +++ b/wm/bspwm_config @@ -4,10 +4,15 @@ source "$DOTFILES_PATH/variables.bash" source "$DOTFILES_PATH/scripts/get_color.sh" source "$DOTFILES_PATH/scripts/get_x_fonts.sh" -bspc config normal_border_color "#$(get_color 05)" -bspc config focused_border_color "#$(get_color 0D)" -bspc config active_border_color "#$(get_color 0D)" -bspc config presel_feedback_color "#$(get_color 0D)" +# bspc config normal_border_color "#$(get_color 05)" +# bspc config focused_border_color "#$(get_color 0D)" +# bspc config active_border_color "#$(get_color 0D)" +# bspc config presel_feedback_color "#$(get_color 0D)" + +bspc config normal_border_color "#$(get_color 00)" +bspc config focused_border_color "#$(get_color 00)" +bspc config active_border_color "#$(get_color 00)" +bspc config presel_feedback_color "#$(get_color 00)" bspc config border_width "$BORDER_WIDTH" bspc config split_ratio 0.50 bspc config borderless_monocle true diff --git a/x/xresources b/x/xresources index 4801992..a487caa 100755 --- a/x/xresources +++ b/x/xresources @@ -20,5 +20,7 @@ emacs.font: emacspfont *depth: 32 -URxvt.internalBorder: 10 +URxvt.internalBorder: 5 + +Xcursor.theme: human