Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set Ctrl-a as the prefix key, similar to GNU Screen
- set-option -g prefix C-a
- unbind-key C-b
- # Toggle between the last active window
- bind-key C-a last-window
- bind-key a send-prefix # Allows sending a prefix as a literal character to the applications
- bind-key A command-prompt "rename-window '%%'" # Rename current window
- # Bindings for various tmux functions
- bind-key d detach-client
- bind-key D choose-client
- bind-key x confirm-before -p "kill-pane #P? (y/n)" kill-pane
- bind-key X confirm-before -p "kill-window #W? (y/n)" kill-window
- bind-key ']' paste-buffer
- bind-key '[' copy-mode
- bind-key ' ' next-window
- bind-key Bspace previous-window
- # Window and pane creation
- bind-key c new-window
- bind-key '%' split-window -v
- bind-key '|' split-window -h
- bind-key \\ split-window -v
- bind-key '"' split-window -v
- bind-key Tab select-pane -t :.+
- bind-key BTab select-pane -t :.-
- # Navigation between windows
- bind-key n next-window
- bind-key p previous-window
- bind-key l last-window
- bind-key f command-prompt "find-window '%%'"
- # Miscellaneous
- bind-key w list-windows
- bind-key t clock-mode
- bind-key C-t swap-pane -U
- bind-key , command-prompt "rename-window '%%'"
- bind-key . command-prompt "move-window -t '%%'"
- bind-key ':' command-prompt
- bind-key '$' command-prompt -I '#' "rename-session '%%'" # Rename session with a prompt
- # bash to see all color names:
- # for i in {0..255}; do \
- printf "\x1b[38;5;${i}mcolor%-5i\x1b[0m" $i ; \
- if ! (( ($i + 1 ) % 8 )); then echo ; fi ; \
- done
- # Setup the status bar
- set -g status on
- set -g status-justify left
- set -g status-style bg=black,fg=white
- set -g status-interval 60 # Update the status line every minute
- set -g status-left " "
- set -g status-right "[#S] @#H - %Y-%m-%d %H:%M"
- set -g window-status-current-format "#[fg=white,bg=darkblue]#I:#W"
- set -g window-status-format "#I-#W"
- set -g mouse on # Enable mouse support
- set -g default-terminal "screen-256color" # default terminal to 256 colors
- set -ga terminal-overrides ',*256color*:bce' # Make sure back color erase (bce) is enabled
- set -g bell-action any # listen to alerts from all windows
- set -g monitor-bell on # notice bell in windows
- set -g visual-bell off # only propagate bell, don't warn user, as it hangs tmux for a second
- set -g visual-activity both # send bell *and* notify when activity (if monitor-activity)
- setw -g mode-keys vi # Use vi-style keys in copy mode
- setw -g mouse on # Allow scroll wheel to scroll history
- # Reload the configuration without restarting tmux
- bind-key r source-file ~/.tmux.conf \; display-message "Config reloaded!"
- # Help key bindings
- bind-key ? list-keys
- # pt2
- # More keybindings for comprehensive control
- # noexist bind-key M mark-pane
- bind-key '}' next-layout
- bind-key '{' previous-layout
- bind-key C-z suspend-client
- bind-key Z resize-pane -Z
- # Killing and detaching
- bind-key K confirm-before -p "kill-server? (y/n)" kill-server
- bind-key k confirm-before -p "kill-window #W? (y/n)" kill-window
- # Buffer and search
- #bind-key > command-prompt -p "capture-pane -S '%%'" "save-buffer '%%'"
- #bind-key < command-prompt -p "load-buffer '%%'" "paste-buffer '%%'"
- bind-key = choose-buffer
- bind-key P paste-buffer
- # Resize panes
- bind-key - resize-pane -L 5
- bind-key + resize-pane -R 5
- bind-key < resize-pane -D 5
- bind-key > resize-pane -U 5
- # Misc functions
- bind-key b list-buffers
- bind-key C-o rotate-window
- bind-key C-q last-pane
- # Session and window naming
- bind-key C-s command-prompt "rename-session '%%'"
- bind-key C-w command-prompt "rename-window '%%'"
- # Setup escape and other special keys
- bind-key Escape copy-mode
- bind-key C-[ copy-mode
- bind-key C-] paste-buffer
- # Ensure the command line is setup
- bind-key : command-prompt
- # Reload tmux config on the fly
- bind-key R source-file ~/.tmux.conf \; display-message "Config reloaded!"
- # Specific layouts
- bind-key ! break-pane
- # bind-key '"' split-window -v
- # Search and command prompts
- bind-key / command-prompt "search-forward '%%'"
- bind-key ? list-keys
- # Adjustments for handling pane resizing
- bind-key C-Left resize-pane -L 5
- bind-key C-Right resize-pane -R 5
- bind-key C-Up resize-pane -U 5
- bind-key C-Down resize-pane -D 5
- # Rotate and adjust panes
- bind-key C-o rotate-window -D
- bind-key C-p select-pane -U
- bind-key C-n select-pane -D
- bind-key C-b select-pane -L
- bind-key C-f select-pane -R
- # Session management
- bind-key s list-sessions
- bind-key S choose-session
- #pt3
- # More window management
- bind-key '0' select-window -t :=0
- bind-key '1' select-window -t :=1
- bind-key '2' select-window -t :=2
- bind-key '3' select-window -t :=3
- bind-key '4' select-window -t :=4
- bind-key '5' select-window -t :=5
- bind-key '6' select-window -t :=6
- bind-key '7' select-window -t :=7
- bind-key '8' select-window -t :=8
- bind-key '9' select-window -t :=9
- # More misc keybindings
- bind-key C-b send-keys C-b # Useful for applications that need Ctrl-B
- bind-key C-c send-keys C-c # Standard interrupt key in the shell
- bind-key C-d detach-client # Slightly more intuitive binding for detaching
- bind-key C-e command-prompt "send-keys '%%'" # Send arbitrary commands
- bind-key C-k clear-history # Clear the history in the current pane
- # More resizing options for panes
- bind-key M-Left resize-pane -L 5
- bind-key M-Right resize-pane -R 5
- bind-key M-Up resize-pane -U 5
- bind-key M-Down resize-pane -D 5
- # Create a new window with a specific command
- bind-key C command-prompt -p "Command:" "new-window -n '%%' '%%'"
- # Copy mode enhancements
- #noexist bind-key v begin-selection
- #noexist bind-key y copy-selection
- # Scroll mode
- bind-key PgUp copy-mode -u
- # Ensure all special and function keys are configured properly
- bind-key F1 display-panes
- bind-key F2 list-commands
- bind-key F3 previous-window
- bind-key F4 next-window
- # Provide help
- bind-key F12 display-message "For help, press ?"
- # Final touches on visual settings
- # Enable logging for troubleshooting
- set -g @verbose_logging on
- #pt4
- # Additional movement and interaction commands
- bind-key ';' last-pane # Toggle to the last active pane
- bind-key '=' choose-buffer # List and choose buffers
- #bind-key '"' split-window -v # Vertical split
- #bind-key '%' split-window -h # Horizontal split
- bind-key C-o rotate-window # Rotate all panes in the current window
- bind-key m select-pane -M # Toggle mouse mode on/off for pane selection
- # Additional command prompts for quick actions
- bind-key ':' command-prompt # Enter command mode
- bind-key C-k command-prompt "kill-window -t ':%%'" # Kill specified window
- bind-key C-z command-prompt "suspend-client '%%'" # Suspend client
- # Pane selection and arrangement
- bind-key space next-layout # Cycle through pre-defined pane layouts
- bind-key C-space previous-layout # Cycle reverse through pane layouts
- bind-key C-Up command-prompt -p "resize-pane -U '%%'" # Resize pane upward by entered amount
- bind-key C-Down command-prompt -p "resize-pane -D '%%'" # Resize pane downward
- bind-key C-Left command-prompt -p "resize-pane -L '%%'" # Resize pane to the left
- bind-key C-Right command-prompt -p "resize-pane -R '%%'" # Resize pane to the right
- # Enhanced search and navigate capabilities in copy mode
- bind-key '/' command-prompt "search-forward '%%'" # Search forward in copy mode
- bind-key '?' command-prompt "search-backward '%%'" # Search backward in copy mode
- # Register and buffer management
- #bind-key '>' command-prompt -p "save-buffer '%%'" "save-buffer '%%'" # Save buffer to a file
- #bind-key '<' load-buffer # Load buffer from file
- # Detailed window and pane management
- bind-key '*' list-panes # List all panes in the current window
- bind-key '#' list-windows # List all windows in the current session
- bind-key '!' break-pane # Convert the current pane into a new window
- # Function keys for quick access to common tasks
- bind-key F1 display-panes # Display pane numbers
- bind-key F2 list-sessions # List all sessions
- bind-key F3 previous-window # Switch to previous window
- bind-key F4 next-window # Switch to next window
- bind-key F5 source-file ~/.tmux.conf \; display-message "Configuration reloaded" # Reload tmux configuration
- # Custom scripts and tools integration
- bind-key F12 run-shell "tmux-custom-script.sh" # Run a custom shell script
Advertisement
Add Comment
Please, Sign In to add comment