Two more configs.

This commit is contained in:
Nicholas Marriott 2019-05-22 07:12:38 +01:00
parent 54dfe36340
commit b68fc7f104
2 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,56 @@
# 256 colors for vim
set -g default-terminal "screen-256color"
# Set default shell to zsh
set-option -g default-shell /bin/zsh
# Start window numbering at 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Cycle panes with C-b C-b
unbind ^B
bind ^B select-pane -t :.+
# Reload config wtih a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Mouse works as expected
# set -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Use the system clipboard
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# Clear the pane and its history
bind -n C-k send-keys C-l \; clear-history
# 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"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# C-l is taken oer by vim style pane navigation
bind C-l send-keys 'C-l'
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
# bind-key -t vi-copy v begin-selection
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
# unbind -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Powerline
run-shell "powerline-daemon -q"
source "/Users/adamcooper/Library/Python/3.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf"

View File

@ -0,0 +1,84 @@
# none of these attempts worked, to bind keys, except sometimes during the sesssion. Oh well.
# I thought maybe that was because F1 is handled differently in a console than in X, but
# even just C-1 didnt work. Using just "a" or "x" as the key did, but not yet sure why not "C-".
#bind-key -T root C-1 attach-session -t$0
#But this one works now, only picks the wrong one? Mbe need2understand what "$1" or $0 mean, better,
#but with the stub maybe this doesn't matter:
bind-key "`" switch-client -t$1
new-session #$0, stub, for keystroke convenience
#$1 for root
new-session #a stub I guess, where keyboard convenience is concerned
new-window
send-keys -l pgup
send-keys Enter
send-keys -l "less /root/.tmux.conf &"
send-keys -l "echo; echo; echo Put something here for ssa or just run manly?"
send-keys Enter
new-window
new-window
new-window sul #for lcall, like man pages
send-keys -l "man tmux&"
send-keys Enter
select-window -t :=1
#$2 for om, so, can do C-b C-s 2 to get to the session, then C-b <#s> to get ~"tabs"
new-session sula ; send-keys -l q #0
send-keys Enter Escape Escape
new-window sula ; send-keys -l q #1
send-keys Enter Escape Escape
new-window sula ; send-keys -l q #2
send-keys Enter Escape Enter Enter
new-window sula ; send-keys q #3, to start:
send-keys Enter Escape
# %%need a sleep here & .. ?
send-keys Enter Enter Enter Enter
new-window sula ; send-keys -l q #4
send-keys Enter Escape Escape
new-window sula
new-window sula
new-window sula
new-window sula
new-window sula
select-window -t :=2
select-window -t :=3
#$3 for email (mutt)
new-session sula
new-window sula ; send-keys mutt Enter
#nah, probly betr not?:
#send-keys -l z
#send-keys -l "thepassifdecide"
#send-keys Enter
new-window sula ; send-keys mutt Enter
send-keys -l "c!=sent"
send-keys Enter
new-window sula ; send-keys -l "cd mail/config; less mailsig.txt&"
send-keys Enter
send-keys "less macros&"
send-keys Enter
select-window -t :=1
#$4 for lacall-net: links etc
new-session suln
new-window suln
#send-keys -l "lkslfx" #; et; links ksl.com"
#send-keys asdafdfadfadfadfadf
#%%does opening links break subsequent cmds? With this Enter, the switch-client etc dont work:
#send-keys Enter
#send-keys Space Space Space
new-window suln
new-window suln
select-window -t :=1
#send-keys Space Space Space
#$5 for lacall-secnet, links?:
#new-session sulsn
# then, where to start:
#%%need a sleep here, or ck a debug thing?
switch-client -t"$0"
send-keys -l "sleep 2"
send-keys Enter
switch-client -t$2