Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Private environment files
.zshenv.private
zshenv.private
*.private

# OS files
.DS_Store
Thumbs.db

# Editor files
*.swp
*.swo
*~
.idea/
.vscode/

# Backup files
*.old
*.old.*
*.bak
*.backup
16 changes: 9 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Repository Purpose

This is a personal development environment setup tool that automates the installation and configuration of common development tools (zsh, nvim, screen, go) on Linux/Mac systems. It creates a consistent development environment with a focus on Go development.
This is a personal development environment setup tool that automates the installation and configuration of common development tools (zsh, nvim, tmux, go) on Linux/Mac systems. It creates a consistent development environment with a focus on Go development.

## Key Commands

### Setup Commands
- `make` or `make all` - Install all tools (zsh, nvim, screen, go)
- `make zsh` - Install zsh with oh-my-zsh and powerlevel10k
- `make` or `make all` - Install all tools (zsh, nvim, tmux, go)
- `make zsh` - Install minimal zsh configuration with Pure prompt (no frameworks)
- `make nvim` - Configure neovim for Go development
- `make screen` - Setup GNU screen
- `make tmux` - Setup tmux with minimal configuration
- `make go` - Create Go directory structure
- `make help` - Show available targets

Expand Down Expand Up @@ -41,8 +41,9 @@ This is a personal development environment setup tool that automates the install
- All scripts use `set -e` for error handling

3. **Configuration storage**:
- Tool configs are stored in subdirectories (zsh/, nvim/, screen/)
- Tool configs are stored in subdirectories (zsh/, nvim/, tmux/)
- Central configuration in `config` file controls backup behavior and paths
- Private environment template: `zsh/zshenv.private.template`

### Important Configuration
- `DT_BACKUP` - Whether to backup existing files (default: true)
Expand All @@ -62,6 +63,7 @@ To add support for other distros, modify the case statement in the `base` file a
## Development Notes

- Never requires sudo - users must install system packages first
- kubectl is conditionally loaded in zshrc to prevent errors if not installed
- The zsh setup creates ~/.zshenv.private from template for API keys and tokens
- The nvim Go setup requires golangci-lint to be installed separately
- gopls is automatically installed by vim-go on first use
- gopls is automatically installed by vim-go on first use
- Backup files are created with .old suffix (or .old.N for multiple backups)
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.PHONY: all
all: zsh nvim screen go
all: zsh nvim tmux go

.PHONY: zsh
zsh: ## Installs oh-my-zsh with powerline10k theme and config files.
zsh: ## Installs minimal zsh configuration (pure shell, no frameworks).
@./zsh.sh

.PHONY: nvim
nvim: ## Sets up nvim with plugins and config files.
@./nvim.sh

.PHONY: screen
screen: ## Sets up screen.
@./screen.sh
.PHONY: tmux
tmux: ## Sets up tmux with minimal configuration.
@./tmux.sh

.PHONY: go
go: ## Sets up go directories.
Expand Down
61 changes: 50 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,44 @@ I've used devtools on Ubuntu, ArchLinux, and Mac OS X. It may work for other Lin

Currently the following tools are setup:

* `zsh` with `oh-my-zsh` and the `powerline10k` theme.
* `zsh` with minimal configuration (no frameworks) including Pure prompt, syntax highlighting, and autosuggestions.
* `nvim` with `gruvbox` theme and modern Go development support using `vim-go`, `gopls`, and `golangci-lint`.
* `screen` with some basic changes to its look.
* `tmux` with minimal configuration, mouse support, and intuitive key bindings.
* `go` with configurable directory structure.

I will probably add more in the future, like Docker.

### Minimal Zsh Features

The minimal zsh configuration includes:
- Command history with deduplication and sharing between sessions
- Tab completion with case-insensitive menu selection
- Enhanced ls commands using `eza` with icons and colors
- Git aliases (gs, ga, gc, gp, gl, gd)
- [Pure](https://github.com/sindresorhus/pure) prompt (installed automatically)
- [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) for fish-like suggestions
- [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) for command highlighting
- [fzf](https://github.com/junegunn/fzf) integration for fuzzy finding (Ctrl+R for history, Ctrl+T for files, Alt+C for directories)
- Private environment variables support via `~/.zshenv.private` (template provided)

### Minimal Tmux Features

The minimal tmux configuration includes:
- Mouse support enabled for clicking and scrolling
- Automatic window renumbering when one is closed
- Increased scrollback history (10000 lines)
- No delay when pressing Escape key
- 256 color support
- Vi keybindings in copy mode
- Clean status bar with date/time display
- Visual pane borders with active pane highlighting

## Install

First, make sure to install the following packages using your OS's package manager:

* `screen`
**Required:**
* `tmux`
* `unzip`
* `nvim`
* `zsh`
Expand All @@ -32,6 +58,12 @@ First, make sure to install the following packages using your OS's package manag
* `make`
* `wget`

**Optional but recommended for enhanced features:**
* `eza` - modern replacement for ls with icons and colors
* `fzf` - fuzzy finder for history, files, and directories
* `fd` - faster alternative to find (used by fzf)
* `bat` - cat with syntax highlighting (used by fzf for file preview)

### Optional: Go Development

If you want to use the Go development features, you'll need to install Go and related tools.
Expand All @@ -46,7 +78,10 @@ Install prereqs first, devtools will not install them for you:

```
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install neovim zsh git make wget unzip screen
sudo apt-get install neovim zsh git make wget unzip tmux

# Optional but recommended
sudo apt-get install eza fzf fd-find bat
```

#### Optional: Kubernetes Development
Expand Down Expand Up @@ -93,7 +128,13 @@ Install the prereqs first, devtools will not install them for you:

```
brew update && brew upgrade
brew install nvim git make wget screen
brew install nvim git make wget tmux

# Optional but recommended
brew install eza fzf fd bat

# After installing fzf, run its install script for key bindings
$(brew --prefix)/opt/fzf/install
```

#### Optional: Kubernetes Development
Expand Down Expand Up @@ -162,22 +203,20 @@ Targets:
go Sets up go directories.
help Shows help.
nvim Sets up nvim with plugins and config files.
screen Sets up screen.
zsh Installs oh-my-zsh with powerline10k theme and config files.
tmux Sets up tmux with minimal configuration.
zsh Installs minimal zsh configuration (pure shell, no frameworks).
```

For example, to just setup screen, run:
For example, to just setup tmux, run:

```
make screen
make tmux
```

## Other

I like to set my terminal theme to the gruvbox theme, the same theme I'm using for `nvim`. For iterm2, download the theme at https://github.com/herrbischoff/iterm2-gruvbox and import it.

You'll also need powerline fonts for your terminal, otherwise some weird symbols will show up. My preference is Mononoki Nerd Font from https://www.nerdfonts.com/.

Also, I install `screenfetch` when zsh starts up. On Ubuntu, install it as follows:

1. Run `sudo apt-get install screenfetch`.
Expand Down
13 changes: 12 additions & 1 deletion base
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ function echook {
function backup {
if [ "$DT_BACKUP" == "true" ]; then
if [ -f "$1" ]; then
mv "$1" "$1.old"
# Find the next available backup number
if [ ! -f "$1.old" ]; then
echoinfo "Backing up $1 to $1.old"
mv "$1" "$1.old"
else
num=1
while [ -f "$1.old.$num" ]; do
num=$((num + 1))
done
echoinfo "Backing up $1 to $1.old.$num"
mv "$1" "$1.old.$num"
fi
fi
fi
}
Expand Down
22 changes: 12 additions & 10 deletions go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ mkdir -p "$DT_GOPATH"
mkdir -p "$DT_GOPATH/src"
mkdir "$DT_GOPATH/bin"

# Add env vars to zshrc
echo "# Go environment variables" >> "$HOME/.zshrc"
echo "export PATH=\"$DT_GOPATH/bin:\$PATH\"" >> "$HOME/.zshrc"
echo "export GOPATH=\"$DT_GOPATH\"" >> "$HOME/.zshrc"

if [ ! -z "$DT_GOPRIVATE" ]; then
echo "export GOPRIVATE=\"$DT_GOPRIVATE\"" >> "$HOME/.zshrc"
fi

echo >> "$HOME/.zshrc"
# Create modular Go configuration file
GO_ENV_FILE="$HOME/.zsh.go.env"
echoinfo "Creating Go environment file at $GO_ENV_FILE..."
{
echo "# Go environment variables (managed by devtools)"
echo "export PATH=\"$DT_GOPATH/bin:\$PATH\""
echo "export GOPATH=\"$DT_GOPATH\""
if [ ! -z "$DT_GOPRIVATE" ]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider using [ -n "$VAR" ] instead of [ ! -z "$VAR" ] for checking if a variable is non-empty. Both are functionally equivalent, but -n is more explicit.

Suggested change
if [ ! -z "$DT_GOPRIVATE" ]; then
if [ -n "$DT_GOPRIVATE" ]; then

echo "export GOPRIVATE=\"$DT_GOPRIVATE\""
fi
} > "$GO_ENV_FILE"
echosuccess "Go configuration written to $GO_ENV_FILE"

echook

21 changes: 0 additions & 21 deletions screen.sh

This file was deleted.

19 changes: 0 additions & 19 deletions screen/screenrc

This file was deleted.

17 changes: 17 additions & 0 deletions tmux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Exit if any command fails
set -e

. base

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other scripts, it's recommended to source scripts with an explicit relative path. shellcheck also recommends this practice (SC1091).

Suggested change
. base
. ./base


echosuccess "Setting up tmux..."

# Back up existing .tmux.conf
backup "$HOME/.tmux.conf"

# Copy new .tmux.conf
cp tmux/tmux.conf "$HOME/.tmux.conf"

echook
echo
46 changes: 46 additions & 0 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ------------------------------------------------------------------------------
# ESSENTIAL SETTINGS
# ------------------------------------------------------------------------------

# Enable mouse support for clicking and scrolling
set -g mouse on

# Renumber windows automatically when one is closed
set -g renumber-windows on

# Increase the amount of scrollback history
set -g history-limit 10000

# Remove the delay when pressing the escape key
set -sg escape-time 0

# Set the default terminal to support 256 colors
set -g default-terminal "screen-256color"

# Set keybindings in copy mode to be like the Vi editor
setw -g mode-keys vi

# ------------------------------------------------------------------------------
# VISUAL SETTINGS
# ------------------------------------------------------------------------------

# Status bar
set -g status-position bottom
set -g status-style 'bg=colour234 fg=colour137'
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20

# Window status
setw -g window-status-current-style 'fg=colour81 bg=colour238 bold'
setw -g window-status-current-format ' #I:#W#F '
setw -g window-status-style 'fg=colour138 bg=colour235'
setw -g window-status-format ' #I:#W#F '

# Pane borders
set -g pane-border-style 'fg=colour238'
set -g pane-active-border-style 'fg=colour51'

# Messages (e.g., when reloading config)
set -g message-style 'fg=colour232 bg=colour166 bold'
Loading