Skip to content

Commit

Permalink
feat: better file naming, improved consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nhunt committed Jul 21, 2020
1 parent 654f141 commit 0897376
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
22 changes: 12 additions & 10 deletions dotfiles/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Prevent rename
set -g allow-rename off

# Use 256 colors
set -g default-terminal "tmux-256color"

Expand All @@ -15,9 +17,9 @@ set -g default-shell $SHELL
set -sg escape-time 0

# Increase scrollback history above the default of 2000
set -g history-limit 50000
set -g history-limit 50000

# Limit size of window in session by smallest client only when both viewing the same window. By defaul all windows are limited
# Limit size of window in session by smallest client only when both viewing the same window. By default all windows are limited
setw -g aggressive-resize on

# Style status line
Expand All @@ -39,7 +41,7 @@ setw -g monitor-activity on
setw -g window-status-activity-style bg=white

# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi 'v' send-keys -X begin-selection

# Make window and pane index start with 1, by default it would be 0 which is a bigger stretch on the keyboard
set -g base-index 1
Expand Down Expand Up @@ -82,14 +84,14 @@ bind Escape copy-mode
unbind p # Prefix p is previous window by default
bind p paste-buffer

bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind-key -T copy-mode-vi PPage send-keys -X page-up
bind-key -T copy-mode-vi NPage send-keys -X page-down
bind -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind -T copy-mode-vi PPage send-keys -X page-up
bind -T copy-mode-vi NPage send-keys -X page-down

bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; send-keys -M"
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi WheelDownPane send-keys -X halfpage-down

# Smart pane switching with awareness of Vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
Expand All @@ -108,8 +110,8 @@ set -g @continuum-restore 'on'
# Restore vim sessions
set -g @resurrect-strategy-vim 'session'

# Include WSL specific stuff
if-shell "test $OSTYPE = linux-gnu && test -n $WSL_DISTRO_NAME" 'source-file ~/.wsl.tmux.conf' 'source-file ~/.macos.tmux.conf'
# Include WSL specific stuff - this might be a bit flaxy depending on distro
if-shell "test $OSTYPE = linux-gnu && test -n $WSL_DISTRO_NAME" 'source-file ~/.tmux.wsl.conf' 'source-file ~/.tmux.macos.conf'

# Initialize TPM (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
8 changes: 3 additions & 5 deletions dotfiles/.macos.tmux.conf → dotfiles/.tmux.macos.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Copy-paste integration
set-option -g default-command "reattach-to-user-namespace -l zsh"

bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"

# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi Enter send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi 'y' send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi 'y' send-keys -X copy-selection

# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"

bind -T copy-mode-vi 'y' send-keys -X copy-selection

#Buffers to/from Mac clipboard, yay tmux book from pragprog
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
3 changes: 3 additions & 0 deletions dotfiles/.tmux.wsl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copy-paste integration for WSLENV
if-shell -b 'test -n "$WSLENV"' 'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel clip.exe'
if-shell -b 'test -n "$WSLENV"' 'bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel clip.exe'
3 changes: 0 additions & 3 deletions dotfiles/.wsl.tmux.conf

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/install-dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ln -nfsv "$DOTFILES_DIR/.prompt" ~
ln -nfsv "$DOTFILES_DIR/.p10k.zsh" ~
ln -nfsv "$DOTFILES_DIR/.shared-shell-setup" ~
ln -nfsv "$DOTFILES_DIR/.tmux.conf" ~
ln -nfsv "$DOTFILES_DIR/.macos.tmux.conf" ~
ln -nfsv "$DOTFILES_DIR/.wsl.tmux.conf" ~
ln -nfsv "$DOTFILES_DIR/.tmux.macos.conf" ~
ln -nfsv "$DOTFILES_DIR/.tmux.wsl.conf" ~
ln -nfsv "$DOTFILES_DIR/.vimrc" ~
ln -nfsv "$DOTFILES_DIR/.zshrc" ~
ln -nfsv "$GIT_DIR/.git-prompt.sh" ~
Expand Down
1 change: 0 additions & 1 deletion vim/ftplugin/typescript.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
let b:ale_fixers=['prettier']
let b:ale_linters=['prettier']

0 comments on commit 0897376

Please sign in to comment.