From bfb0dd39dbf5c9b281abb7fce8b4f60bca0e7708 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Thu, 4 Feb 2021 10:42:52 -0600 Subject: use xdg basedir layout for tmux --- deploy.sh | 19 +++++++++++++++- tmux.conf | 55 ----------------------------------------------- xdg-config/tmux/tmux.conf | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 56 deletions(-) delete mode 100644 tmux.conf create mode 100644 xdg-config/tmux/tmux.conf diff --git a/deploy.sh b/deploy.sh index 5ae9d85..ae88db5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,7 +6,24 @@ rm -rf dotfiles-backup mkdir -p dotfiles-backup # deploy -for f in vimrc gvimrc gitconfig gitignore zshrc zsh dircolors.conf tmux.conf hammerspoon +if [ -z "$XDG_CONFIG_HOME" ]; +then + config_home="$HOME/.config" +else + config_home="$XDG_CONFIG_HOME" +fi +cd xdg-config +for d in * +do + dest="$config_home/$d" + if [ -e "$dest" ]; then + mv "$dest" ../dotfiles-backup/$d + fi + ln -sf "$(pwd)/$d" "$dest" +done +cd .. + +for f in vimrc gvimrc gitconfig gitignore zshrc zsh dircolors.conf hammerspoon do if [ -e ~/.${f} ]; then mv ~/.${f} dotfiles-backup/${f} diff --git a/tmux.conf b/tmux.conf deleted file mode 100644 index b1b98e0..0000000 --- a/tmux.conf +++ /dev/null @@ -1,55 +0,0 @@ -# vi bindings -set -g status-keys vi -setw -g mode-keys vi - -# reasonable history buffer -set -g history-limit 10000 - -# status line -setw -g window-status-current-style bright -set -g status-right '#(date "+%H:%M %Z %Y-%m-%d")' -set -g status-style bg=white -set -g status-left " #S@#h " -set -g status-left-length 15 -set -g status-left-style bg=green,fg=white - -# ui -set -g set-titles on -set -g default-terminal "screen-256color" -set -ga terminal-overrides ",xterm-256color:Tc" -set -g pane-border-style fg=white - -# splits -bind | split-window -h -bind \\ split-window -h -bind - split-window -v - -# reversed to match vim split names -bind v select-layout even-horizontal -bind h select-layout even-vertical - -# vim-style resize -bind -r H resize-pane -L 2 -bind -r J resize-pane -D 2 -bind -r K resize-pane -U 2 -bind -r L resize-pane -R 2 - -# vim-style move -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -# unbind arrow keys -unbind Up -unbind Down -unbind Left -unbind Right -unbind M-Up -unbind M-Down -unbind M-Left -unbind M-Right -unbind C-Up -unbind C-Down -unbind C-Left -unbind C-Right diff --git a/xdg-config/tmux/tmux.conf b/xdg-config/tmux/tmux.conf new file mode 100644 index 0000000..b1b98e0 --- /dev/null +++ b/xdg-config/tmux/tmux.conf @@ -0,0 +1,55 @@ +# vi bindings +set -g status-keys vi +setw -g mode-keys vi + +# reasonable history buffer +set -g history-limit 10000 + +# status line +setw -g window-status-current-style bright +set -g status-right '#(date "+%H:%M %Z %Y-%m-%d")' +set -g status-style bg=white +set -g status-left " #S@#h " +set -g status-left-length 15 +set -g status-left-style bg=green,fg=white + +# ui +set -g set-titles on +set -g default-terminal "screen-256color" +set -ga terminal-overrides ",xterm-256color:Tc" +set -g pane-border-style fg=white + +# splits +bind | split-window -h +bind \\ split-window -h +bind - split-window -v + +# reversed to match vim split names +bind v select-layout even-horizontal +bind h select-layout even-vertical + +# vim-style resize +bind -r H resize-pane -L 2 +bind -r J resize-pane -D 2 +bind -r K resize-pane -U 2 +bind -r L resize-pane -R 2 + +# vim-style move +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# unbind arrow keys +unbind Up +unbind Down +unbind Left +unbind Right +unbind M-Up +unbind M-Down +unbind M-Left +unbind M-Right +unbind C-Up +unbind C-Down +unbind C-Left +unbind C-Right -- cgit v1.2.3