Replace tmux with kitty
- setup.sh: install kitty instead of tmux, fix clone URL - .bashrc: remove tmux auto-start, add kitty SSH alias - .tmux.conf: removed - README.md: update to kitty documentation
This commit is contained in:
10
.bashrc
10
.bashrc
@@ -105,6 +105,7 @@ conda() {
|
||||
|
||||
# Lazy load nvm
|
||||
load_nvm() {
|
||||
unset -f nvm node npm
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
|
||||
@@ -120,9 +121,14 @@ export VISUAL=vim
|
||||
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
. "$HOME/.cargo/env"
|
||||
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
|
||||
exec tmux
|
||||
|
||||
if [ "$TERM" = "xterm-kitty" ]; then
|
||||
alias ssh="kitty +kitten ssh"
|
||||
fi
|
||||
|
||||
# opencode
|
||||
export PATH=/home/james/.opencode/bin:$PATH
|
||||
export PATH="$HOME/.npm-global/bin:$PATH"
|
||||
|
||||
# OpenClaw Completion
|
||||
source "/home/james/.openclaw/completions/openclaw.bash"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
set-window-option -g mode-keys vi
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
45
README.md
45
README.md
@@ -6,8 +6,7 @@ My personal dotfiles for quick setup on new machines. Change once, update everyw
|
||||
|
||||
| File | Description |
|
||||
|------|-------------|
|
||||
| `.bashrc` | Bash configuration with custom prompt, aliases, lazy-loaded conda/nvm, auto-start tmux |
|
||||
| `.tmux.conf` | tmux config with vi keybindings and TPM plugins |
|
||||
| `.bashrc` | Bash configuration with custom prompt, aliases, lazy-loaded conda/nvm |
|
||||
| `.vimrc` | Vim configuration with clipboard support, syntax highlighting, and sensible defaults |
|
||||
| `setup.sh` | Bootstrap script for new Debian-like machines |
|
||||
|
||||
@@ -22,53 +21,43 @@ Or manually:
|
||||
```bash
|
||||
git clone --bare https://gitea.sjhl.nz/james/dotfiles ~/.dotfiles
|
||||
|
||||
# Define the dotfiles alias
|
||||
dotfiles() {
|
||||
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
|
||||
}
|
||||
|
||||
# Checkout files (will prompt if conflicts exist)
|
||||
dotfiles checkout
|
||||
|
||||
# Hide untracked files from status
|
||||
dotfiles config --local status.showUntrackedFiles no
|
||||
```
|
||||
|
||||
## Managing Your Dotfiles
|
||||
|
||||
After installation, the `dotfiles` command is available in your shell:
|
||||
|
||||
```bash
|
||||
# View status
|
||||
dotfiles status
|
||||
|
||||
# Add changes
|
||||
dotfiles add .bashrc
|
||||
dotfiles commit -m "Update prompt"
|
||||
dotfiles push
|
||||
```
|
||||
|
||||
The alias is already defined in `.bashrc`, so it's available in new terminals.
|
||||
## kitty Usage
|
||||
|
||||
## tmux Usage
|
||||
|
||||
tmux starts automatically when you open a new terminal (configured in `.bashrc`).
|
||||
kitty is the terminal emulator - open it from your desktop launcher or run `kitty`.
|
||||
|
||||
**Basic Commands:**
|
||||
| Command | Action |
|
||||
|---------|--------|
|
||||
| `tmux` | Start new session |
|
||||
| `tmux ls` | List sessions |
|
||||
| `tmux attach -t 0` | Attach to session 0 |
|
||||
| `Ctrl+b d` | Detach from session |
|
||||
| `Ctrl+b c` | Create new window |
|
||||
| `Ctrl+b %` | Split vertically |
|
||||
| `Ctrl+b "` | Split horizontally |
|
||||
| `Ctrl+b [` | Copy/vi mode |
|
||||
| `q` | Exit copy mode |
|
||||
| `Ctrl+Shift+Enter` | New window |
|
||||
| `Ctrl+Shift+]` | Horizontal split |
|
||||
| `Ctrl+Shift+[` | Vertical split |
|
||||
| `Ctrl+Shift+h/j/k/l` | Navigate splits |
|
||||
| `Ctrl+Shift+Arrow` | Resize split |
|
||||
| `Ctrl+Shift+c` | Copy to clipboard |
|
||||
| `Ctrl+Shift+v` | Paste from clipboard |
|
||||
| `Ctrl+Shift+p` | Scrollback pager |
|
||||
| `Ctrl+Shift+h` | Show scrollback |
|
||||
|
||||
**Install TPM plugins:**
|
||||
After first tmux start, press `Ctrl+b I` to install plugins (tpm, tmux-sensible, tmux-yank).
|
||||
**Copy mode** (in scrollback): vi keys to navigate, Enter to copy selection.
|
||||
|
||||
**SSH**: When using kitty, run `ssh` normally - kitty intercepts it for a better experience.
|
||||
|
||||
## Vim Usage
|
||||
|
||||
@@ -89,12 +78,8 @@ Clipboard is integrated - yanking/pasting works with system clipboard.
|
||||
|
||||
## Uninstall
|
||||
|
||||
To remove dotfiles from a machine:
|
||||
|
||||
```bash
|
||||
dotfiles checkout HEAD
|
||||
dotfiles clean -fd
|
||||
rm -rf ~/.dotfiles ~/.dotfiles-backup
|
||||
```
|
||||
|
||||
Your original files will be restored from the backup created during checkout.
|
||||
|
||||
20
setup.sh
20
setup.sh
@@ -19,21 +19,18 @@ done
|
||||
echo ">>> Bootstrapping new Debian-like machine..."
|
||||
|
||||
# 1. Update package list and install essentials
|
||||
echo ">>> Installing bash, tmux, and vim..."
|
||||
echo ">>> Installing bash, kitty, and vim..."
|
||||
sudo apt update
|
||||
# Remove minimal vim if installed, then install clipboard-enabled version
|
||||
sudo apt remove -y vim || true
|
||||
sudo apt install -y bash tmux vim-gtk3 git curl
|
||||
sudo apt install -y bash kitty vim-gtk3 git curl
|
||||
|
||||
# 2. Clone your dotfiles (bare repo style)
|
||||
if [ ! -d "$HOME/.dotfiles" ]; then
|
||||
echo ">>> Cloning dotfiles repo..."
|
||||
git clone --bare https://gitea.james-server.duckdns.org/james/dotfiles $HOME/.dotfiles
|
||||
git clone --bare https://gitea.sjhl.nz/james/dotfiles $HOME/.dotfiles
|
||||
else
|
||||
echo ">>> Dotfiles repo already exists."
|
||||
fi
|
||||
|
||||
|
||||
# 3. Checkout dotfiles
|
||||
dotfiles() {
|
||||
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
|
||||
@@ -43,7 +40,6 @@ if ! dotfiles checkout; then
|
||||
echo ">>> Conflicts detected! Handling conflicting dotfiles..."
|
||||
mkdir -p "$HOME/.dotfiles-backup"
|
||||
|
||||
# Gather conflicts (paths with spaces supported)
|
||||
conflicts=$(dotfiles checkout 2>&1 | grep -E "\s+\." | awk '{print $1}')
|
||||
if [ -n "$conflicts" ]; then
|
||||
if [ "$PROMPT_DELETE" = "0" ]; then
|
||||
@@ -71,12 +67,4 @@ fi
|
||||
|
||||
dotfiles config --local status.showUntrackedFiles no
|
||||
|
||||
# 4. setup tmux
|
||||
mkdir -p ~/.tmux/plugins
|
||||
if [ ! -d ~/.tmux/plugins/tpm ]; then
|
||||
echo ">>> Installing Tmux Plugin Manager..."
|
||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||
fi
|
||||
|
||||
|
||||
echo ">>> Done! Bash, tmux, vim, and dotfiles are ready."
|
||||
echo ">>> Done! Bash, kitty, vim, and dotfiles are ready."
|
||||
|
||||
Reference in New Issue
Block a user