Skip to content

j4hangir/nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

353 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

                _          _    __   _              _       __
  __/\__  _ __ (_) __  __ (_)  / _| (_)   ___    __| |   _  \ \
  \    / | '_ \| | \ \/ / | | | |_  | |  / _ \  / _` |  (_)  | |
  /_  _\ | | | || |  >  < | | |  _| | | |  __/ | (_| |   _   | |
    \/   |_| |_||_| /_/\_\|_| |_|   |_|  \___|  \__,_|  (_)  | |
                                                            /_/
  

πŸ‰ Personal shell environment that follows you everywhere

zsh vim tmux platforms


Prerequisites

Install these before running setup.sh:

zsh  git  curl  vim  tmux

⚑ Quickstart

git clone --recursive git@github.com:j4hangir/nix.git ~/nix
cd ~/nix
./setup.sh

That's it. setup.sh handles everything in one run:

  • 🐚 Install oh-my-zsh + shell plugins via Antigen
  • πŸ”— Wire up ~/.zshrc and ~/.vimrc

πŸ“¦ What's Inside

🐚 Zsh

  • 1M line history with aggressive dedup, cross-session sharing, and instant append
  • Auto CD β€” type a directory name to cd into it
  • Smart completion β€” case-insensitive globbing, rehash on every completion
  • Plugins β€” syntax highlighting, autosuggestions, git, npm, pip, ruby, and more

✏️ Vim

  • Murphy colorscheme on 256 colors
  • 2-space indentation, smart case search
  • j/k move by visual lines
  • Restore cursor position on reopen
  • Modelines disabled for security

πŸ–₯️ Tmux

  • Prefix: Ctrl-U
  • Dvorak-optimized pane navigation β€” h / t / n / s
  • Vi copy mode via cb (pbcopy / wl-copy / xclip / xsel / OSC 52)
  • Mouse support, | and - to split, 30k line scrollback
  • Shift-H to toggle pane logging
  • Plugins: tmux-fingers (hint-based copy, prefix + h) and tmux-jump (EasyMotion-style cursor jumps, prefix + i)

πŸ› οΈ Scripts

All live in scripts/ and are added to $PATH automatically.

Script Description
dh Delete history entries matching a pattern
urlencode RFC 1738 URL encoding
mrtorrent Convert magnet URIs to .torrent files
on_wifi_change Auto-toggle proxy based on WiFi SSID

Smaller utilities (trim, ssh-fingerprint, mklink, adbscrshot) are inlined as functions in aliases.zsh.

🧰 Aliases & Functions

πŸ“‚ Navigation
..  ...  ....  .....     β€” quick upward navigation
cdl <dir>                β€” cd + ls
mkpu <dir>               β€” mkdir -p + pushd
pu / po                  β€” pushd / popd
πŸ” Search & Process
pf <query>               β€” ps aux | grep
opf [filter]             β€” open ports (netstat)
hick <query>             β€” search history with rg
srch <name>              β€” mdfind wrapper (macOS)
πŸ“ Files & Compression
gz <file>                β€” compress with pigz
ftar <name> <path>       β€” create .tar.gz with pigz
dush [path]              β€” human-readable disk usage
getchmod <file>          β€” show numeric permissions
🌐 Network
getip [host]             β€” show public IP or resolve hostname
proxytoggle [on|off]     β€” toggle SOCKS proxy per interface
dl <url>                 β€” download with axel (10 threads)
✨ Misc
nalias [-d desc] <name> <cmd>  β€” create persistent aliases
substitute <from> <to>         β€” find-and-replace across files
takeover                       β€” detach all other tmux sessions

πŸ—οΈ Architecture

~/.zshrc
  └── init.sh                    ← entrypoint
        β”œβ”€β”€ envs.sh              ← exports ($NIXDIR, $EDITOR, $LESS)
        β”œβ”€β”€ aliases.zsh          ← aliases & functions
        β”œβ”€β”€ iTerm2-ssh.zsh       ← iTerm2 tab colors for SSH
        β”œβ”€β”€ vendor/antigen.zsh   ← plugin manager (vendored)
        β”œβ”€β”€ antigen bundles      ← 19 plugins loaded
        └── configs/zshrc        ← zsh options, completions, keybindings

configs/       β†’ tool configs (zshrc, vimrc, tmux.conf, screenrc, ripgreprc, …)
scripts/       β†’ added to $PATH (standalone executables)
utils/         β†’ helper scripts sourced by other files
tmux/          β†’ dvorak.tmux.conf (sourced by configs/tmux.conf)
vendor/        β†’ third-party files (antigen)

OS detection happens in utils/os_detect.sh and is stored in $os. Many aliases and functions branch on it for platform-specific behavior.

πŸ–₯️ Platform Support

macOS Linux FreeBSD
Core shell βœ… βœ… βœ…
Aliases βœ… βœ… βœ…
Spotlight search (srch) βœ… β€” β€”
Proxy toggle βœ… β€” β€”

πŸ”§ Environment Variables

Variable Purpose
$NIXDIR Absolute path to this repo at runtime
$NOTIVE_AUTH Auth token for the notive push service

πŸ™Œ Credits

Built and maintained by j4hangir.

πŸ“œ License

Personal dotfiles β€” use whatever you find useful.

Contributors