zsh tmux
This commit is contained in:
		
							
								
								
									
										73
									
								
								.tmux.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								.tmux.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,73 @@ | ||||
| # ================================ | ||||
| # tmux configuration | ||||
| # ================================ | ||||
|  | ||||
| # General | ||||
| set -g default-terminal "screen-256color" | ||||
| set -g escape-time 0 | ||||
| set -g history-limit 10000 | ||||
| set -g mouse on | ||||
|  | ||||
| # Prefix key | ||||
| unbind C-b | ||||
| set -g prefix C-a | ||||
| bind C-a send-prefix | ||||
|  | ||||
| # Reload config | ||||
| bind r source-file ~/.tmux.conf \; display-message "Config reloaded!" | ||||
|  | ||||
| # Window navigation | ||||
| bind -n C-h select-pane -L | ||||
| bind -n C-j select-pane -D | ||||
| bind -n C-k select-pane -U | ||||
| bind -n C-l select-pane -R | ||||
|  | ||||
| # Pane splitting | ||||
| bind | split-window -h -c "#{pane_current_path}" | ||||
| bind - split-window -v -c "#{pane_current_path}" | ||||
| unbind '"' | ||||
| unbind % | ||||
|  | ||||
| # Pane resizing | ||||
| bind -r H resize-pane -L 5 | ||||
| bind -r J resize-pane -D 5 | ||||
| bind -r K resize-pane -U 5 | ||||
| bind -r L resize-pane -R 5 | ||||
|  | ||||
| # Window creation | ||||
| bind c new-window -c "#{pane_current_path}" | ||||
|  | ||||
| # Copy mode | ||||
| setw -g mode-keys vi | ||||
| bind -T copy-mode-vi v send-keys -X begin-selection | ||||
| bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" | ||||
| bind -T copy-mode-vi r send-keys -X rectangle-toggle | ||||
|  | ||||
| # Status bar | ||||
| set -g status-position bottom | ||||
| set -g status-bg black | ||||
| set -g status-fg white | ||||
| set -g status-left-length 40 | ||||
| set -g status-right-length 50 | ||||
|  | ||||
| set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" | ||||
| set -g status-right "#[fg=cyan]%d %b %R" | ||||
|  | ||||
| # Window status | ||||
| setw -g window-status-current-style fg=black,bg=green | ||||
| setw -g window-status-style fg=white,bg=black | ||||
|  | ||||
| # Pane borders | ||||
| set -g pane-border-style fg=black | ||||
| set -g pane-active-border-style fg=green | ||||
|  | ||||
| # Activity monitoring | ||||
| setw -g monitor-activity on | ||||
| set -g visual-activity on | ||||
|  | ||||
| # Start windows and panes at 1 | ||||
| set -g base-index 1 | ||||
| setw -g pane-base-index 1 | ||||
|  | ||||
| # Renumber windows when a window is closed | ||||
| set -g renumber-windows on | ||||
							
								
								
									
										73
									
								
								.zshrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								.zshrc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,73 @@ | ||||
| # ================================ | ||||
| # zsh configuration | ||||
| # ================================ | ||||
|  | ||||
| # History | ||||
| HISTFILE=~/.zsh_history | ||||
| HISTSIZE=10000 | ||||
| SAVEHIST=10000 | ||||
| setopt HIST_IGNORE_DUPS | ||||
| setopt HIST_IGNORE_ALL_DUPS | ||||
| setopt HIST_IGNORE_SPACE | ||||
| setopt HIST_FIND_NO_DUPS | ||||
| setopt HIST_REDUCE_BLANKS | ||||
| setopt SHARE_HISTORY | ||||
|  | ||||
| # Directory navigation | ||||
| setopt AUTO_CD | ||||
| setopt AUTO_PUSHD | ||||
| setopt PUSHD_IGNORE_DUPS | ||||
|  | ||||
| # Completion | ||||
| autoload -Uz compinit | ||||
| compinit | ||||
| setopt AUTO_MENU | ||||
| setopt COMPLETE_ALIASES | ||||
|  | ||||
| # Key bindings | ||||
| bindkey -e | ||||
| bindkey '^R' history-incremental-search-backward | ||||
|  | ||||
| # Prompt | ||||
| autoload -U colors && colors | ||||
| PROMPT='%{$fg[cyan]%}%n@%m%{$reset_color%}:%{$fg[yellow]%}%~%{$reset_color%}$ ' | ||||
|  | ||||
| # Aliases | ||||
| alias ll='ls -la' | ||||
| alias la='ls -a' | ||||
| alias l='ls -CF' | ||||
| alias grep='grep --color=auto' | ||||
| alias ..='cd ..' | ||||
| alias ...='cd ../..' | ||||
|  | ||||
| # Git aliases | ||||
| alias g='git' | ||||
| alias gs='git status' | ||||
| alias ga='git add' | ||||
| alias gc='git commit' | ||||
| alias gp='git push' | ||||
| alias gl='git log --oneline' | ||||
| alias gd='git diff' | ||||
|  | ||||
| # Tmux aliases | ||||
| alias t='tmux' | ||||
| alias ta='tmux attach' | ||||
| alias tl='tmux list-sessions' | ||||
|  | ||||
| # Functions | ||||
| mkcd() { | ||||
|     mkdir -p "$1" && cd "$1" | ||||
| } | ||||
|  | ||||
| # Load local zshrc if exists | ||||
| [[ -f ~/.zshrc.local ]] && source ~/.zshrc.local | ||||
|  | ||||
| # Environment variables | ||||
| export EDITOR=nvim | ||||
| export VISUAL=nvim | ||||
| export PAGER=less | ||||
| export LESS='-R' | ||||
|  | ||||
| # Path additions | ||||
| export PATH="$PATH:$HOME/.local/bin" | ||||
| export PATH="$PATH:$HOME/bin" | ||||
							
								
								
									
										56
									
								
								install.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										56
									
								
								install.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,56 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| # ================================ | ||||
| # Dotfiles installation script | ||||
| # ================================ | ||||
|  | ||||
| DOTFILES_DIR="$HOME/git/dotfiles" | ||||
|  | ||||
| echo "Setting up dotfiles..." | ||||
|  | ||||
| # Function to create symlink | ||||
| create_symlink() { | ||||
|     local source="$1" | ||||
|     local target="$2" | ||||
|      | ||||
|     if [ -L "$target" ]; then | ||||
|         echo "Removing existing symlink: $target" | ||||
|         rm "$target" | ||||
|     elif [ -f "$target" ]; then | ||||
|         echo "Backing up existing file: $target -> $target.backup" | ||||
|         mv "$target" "$target.backup" | ||||
|     fi | ||||
|      | ||||
|     echo "Creating symlink: $source -> $target" | ||||
|     ln -s "$source" "$target" | ||||
| } | ||||
|  | ||||
| # Zsh configuration | ||||
| if [ -f "$DOTFILES_DIR/.zshrc" ]; then | ||||
|     create_symlink "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc" | ||||
| fi | ||||
|  | ||||
| # Tmux configuration | ||||
| if [ -f "$DOTFILES_DIR/.tmux.conf" ]; then | ||||
|     create_symlink "$DOTFILES_DIR/.tmux.conf" "$HOME/.tmux.conf" | ||||
| fi | ||||
|  | ||||
| # Neovim configuration | ||||
| if [ -d "$DOTFILES_DIR/nvim" ]; then | ||||
|     mkdir -p "$HOME/.config" | ||||
|     if [ -L "$HOME/.config/nvim" ]; then | ||||
|         echo "Removing existing symlink: $HOME/.config/nvim" | ||||
|         rm "$HOME/.config/nvim" | ||||
|     elif [ -d "$HOME/.config/nvim" ]; then | ||||
|         echo "Backing up existing directory: $HOME/.config/nvim -> $HOME/.config/nvim.backup" | ||||
|         mv "$HOME/.config/nvim" "$HOME/.config/nvim.backup" | ||||
|     fi | ||||
|     create_symlink "$DOTFILES_DIR/nvim" "$HOME/.config/nvim" | ||||
| fi | ||||
|  | ||||
| echo "Dotfiles setup complete!" | ||||
| echo "" | ||||
| echo "To apply changes:" | ||||
| echo "  - For zsh: source ~/.zshrc or restart your terminal" | ||||
| echo "  - For tmux: tmux source-file ~/.tmux.conf (if running) or restart tmux" | ||||
| echo "  - For nvim: restart nvim" | ||||
		Reference in New Issue
	
	Block a user