Fix tmux and some other stuff

This commit is contained in:
Daniel Flanagan 2020-03-06 15:44:26 -06:00
parent 2348608e88
commit ac010d0c4f
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
7 changed files with 35 additions and 28 deletions

View File

@ -237,7 +237,7 @@ super + shift + v
sh -c 'kill -USR1 $(cat "/var/run/user/$UID/polybar-mic-script.sh.pid")'
super + shift + e
rofimoji --use-clipboard --rofi-args='--sort -sorting-method fzf'
rofimoji --insert-with-clipboard --rofi-args='--sort -sorting-method fzf'
super + shift + p
rofi-pass

View File

@ -73,6 +73,7 @@ Plug 'michaeljsmith/vim-indent-object' " adds an indent
Plug 'wellle/targets.vim' " adds some more handy text objects
Plug 'dbakker/vim-projectroot' " adds helper functions for getting to a project's root directory
Plug 'junegunn/goyo.vim' " better distraction-free editing
Plug 'junegunn/limelight.vim' " dim inactive blocks of code
Plug 'tpope/vim-sleuth' " try and detect indent method
Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings
Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language

View File

@ -22,10 +22,11 @@ set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_byt
# set our EDITOR to neovim if we've got it
set -Ux EDITOR vim
if has_command nvim
alias vim nvim
alias ovim 'command vim'
set -Ux EDITOR nvim
end
alias ovim 'command vim' # always have an alias to normal vim just in case
alias vim $EDITOR
alias vi $EDITOR
# more sane ls colors
set -Ux LS_COLORS 'ow=01;36;40'

View File

@ -44,6 +44,7 @@ set -Ux XDG_PICTURES_DIR $NICE_HOME/img
set -Ux XDG_VIDEOS_DIR $NICE_HOME/video
set -Ux XDG_GAMES_DIR $NICE_HOME/games
set -Ux TMUX_PLUGIN_MANAGER_PATH $XDG_CONFIG_HOME/tmux/plugins/
set -Ux NOTES_PATH $XDG_DOCUMENTS_DIR/notes
set -Ux USER_LOGS_PATH $XDG_DOCUMENTS_DIR/logs
set -Ux SCROTS_PATH $XDG_PICTURES_DIR/scrots

View File

@ -8,7 +8,7 @@ bind-key T source-file "$HOME/.tmux.conf" \; display-message "source-file done"
unbind r
bind r source-file "$HOME/.tmux.conf"
# set -as terminal-overrides ',xterm*:smxx=\E[9m'
# set -as terminal-overrides ",xterm*:smxx=\E[9m"
set -g default-terminal "screen-256color"
# sane defaults
@ -46,11 +46,11 @@ bind-key j switch-client -p
bind-key h switch-client -p
bind-key k switch-client -n
bind-key l switch-client -n
# bind s run-shell "tmux new-window sh -c '$DOTFILES_PATH/bin/tmuxswitcher'"
bind s run-shell "tmux new-window 'sh -c ~/.config/dotfiles/bin/tmuxswitcher'"
# bind s run-shell "tmux new-window sh -c "$DOTFILES_PATH/bin/tmuxswitcher""
bind s run-shell "tmux new-window \"sh -c ~/.config/dotfiles/bin/tmuxswitcher\""
# reset the working directory of the current session
bind-key P attach-session -t . -c '#{pane_current_path}' \; display-message 'Reset session dir to #{pane_current_path}'
bind-key P attach-session -t . -c "#{pane_current_path}" \; display-message "Reset session dir to #{pane_current_path}"
# status bar and messages
set -g status-position bottom
@ -61,7 +61,7 @@ set -g status-right-length 80
set -g status-right "#[fg=colour4]#W#[fg=default]#[bg=default] #H"
set -g status-left-length 200
set -g status-left "#[fg=colour7]#(~/.config/dotfiles/bin/tmux-session-list #S)"
set -g message-style 'fg=colour7 bg=colour18'
set -g message-style "fg=colour7 bg=colour18"
bind-key O display-message "#(tmux-save-buffer #S)"
@ -74,7 +74,7 @@ set -g clock-mode-colour colour8
# windows (which I don't use much...?)
# TODO: do I have a use case for windows?
setw -g window-status-current-format ''
setw -g window-status-current-format ""
# vim copying
setw -g mode-keys vi
@ -84,7 +84,7 @@ set -g base-index 1
set -g pane-base-index 1
# custom predefined layouts
bind M-l source-file $XDG_CONFIG_HOME/tmux/layouts/dev.tmux
bind M-l source-file "$XDG_CONFIG_HOME/tmux/layouts/dev.tmux"
# present a menu of urls to open from the visible pane
# TODO: fzf-ify this
@ -94,10 +94,10 @@ bind-key u capture-pane \;\
# seamlessly handle pane switching in and out of vim panes
# see GitHub repos tmux-plugins/vim-tmux-focus-events and christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
is_vim="ps -o state= -o comm= -t \"#{pane_tty}\" \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -Tcopy-mode-vi 'C-h' send -X "cancel select-pane -L"
bind-key -Tcopy-mode-vi "C-h" send -X "cancel select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
@ -105,45 +105,47 @@ bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# YANKING
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
bind-key -Tcopy-mode-vi "y" send -X copy-selection
set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/tmux/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/tpm"
set -g @plugin "tmux-plugins/tmux-sensible"
set -g @plugin "lytedev/tmux-resurrect"
set -g @plugin "lytedev/tmux-continuum"
# prefix+[ for select mode
# v for visual mode
# yank to clipboard with y
# paste with prefix+]
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin "tmux-plugins/tmux-yank"
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "tmux-plugins/tmux-sessionist"
set -g @plugin "christoomey/vim-tmux-navigator"
# plugin options
# enable continuum
set -g @continuum-restore 'on'
set -g @continuum-restore "on"
# let continuum startup on boot
set -g @continuum-boot 'on'
set -g @continuum-boot "on"
# bindings for tmux-resurrect
set -g @resurrect-save 'C-v'
set -g @resurrect-restore 'R'
set -g @resurrect-save "C-v"
set -g @resurrect-restore "R"
# initialize tmux plugin manager
run '$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm'
run "~/.config/tmux/plugins/tpm/tpm"
# attempt at integrating nested tmux sessions nicely
# bind -T root F12 \
# set prefix None \;\
# set key-table off \;\
# set status off \
# if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
# if -F "#{pane_in_mode}" "send-keys -X cancel" \;\
# refresh-client -S \;\
# bind -T off F12 \

View File

@ -3,7 +3,8 @@
mkdir -p "$HOME/.config/systemd/user"
# tmux plugin manager
git clone https://github.com/tmux-plugins/tpm "$XDG_CONFIG_HOME/tmux/plugins/tpm"
[ ! -d "$XDG_CONFIG_HOME/tmux/plugins/tpm" ] && \
git clone https://github.com/tmux-plugins/tpm "$XDG_CONFIG_HOME/tmux/plugins/tpm"
# load tmux config
tmux source-file "$HOME/.tmux.conf"

View File

@ -27,6 +27,7 @@ export XDG_PICTURES_DIR="$NICE_HOME/img"
export XDG_VIDEOS_DIR="$NICE_HOME/video"
export XDG_GAMES_DIR="$NICE_HOME/games"
export TMUX_PLUGIN_MANAGER_PATH="${TMUX_PLUGIN_MANAGER_PATH:-$XDG_CONFIG_HOME/tmux/plugins/}"
export NOTES_PATH="${NOTES_PATH:-$XDG_DOCUMENTS_DIR/notes}"
export USER_LOGS_PATH="${USER_LOGS_PATH:-$XDG_DOCUMENTS_DIR/logs}"
export SCROTS_PATH="${SCROTS_PATH:-$XDG_PICTURES_DIR/scrots}"