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