Skip to content

Gerrrt/dotfiles-Ubuntu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles · Ubuntu / WSL2

Personal terminal environment for Ubuntu running under WSL2 — tuned for security engineering and penetration testing work. Built around Neovim, tmux, and zsh with a focus on keyboard-driven workflows and minimal friction.

Bootstrap a fresh environment: git clone https://github.com/Gerrrt/dotfiles-Ubuntu ~/.config && bash ~/.config/setup.sh


Stack

Layer Tool Notes
Terminal Windows Terminal TokyoNight scheme, CaskaydiaCove Nerd Font
Shell zsh + Starship Custom plugin loader, no Oh My Zsh
Editor Neovim lazy.nvim, full LSP, DAP, neotest
Multiplexer tmux TPM, TokyoNight theme, sessionizer
History Atuin SQLite-backed, synced
Fuzzy finder fzf + fzf-lua fd + bat previews
File manager yazi TUI, replaces Ranger
Git TUI lazygit delta pager, conventional commits
Directory nav zoxide z / Alt+Z jump

Directory Structure

~/.config/
├── setup.sh              # Provisions a fresh Ubuntu/WSL2 environment
├── wsl.conf              # WSL2 system config (copy to /etc/wsl.conf manually)
├── atuin/
│   └── config.toml
├── git/
│   ├── .gitconfig        # Core git config, delta pager, aliases
│   └── ignore            # Global gitignore (HOME-level)
├── lazygit/
│   └── config.yml        # Delta pager, nvim editor, custom commands
├── nvim/
│   └── lua/gerrrt/
│       ├── config/       # options, keymaps, autocmds, lazy bootstrap
│       ├── plugins/      # One file per plugin
│       ├── servers/      # One file per LSP server
│       └── utils/        # lsp.lua, diagnostics.lua
├── tmux/
│   ├── tmux.conf
│   └── scripts/
│       ├── tmux-sessionizer.sh
│       ├── tmux-scratch.sh
│       └── tmux-menu.sh
└── zsh/
    ├── .zshenv           # XDG dirs, EDITOR, COLORTERM, TERM, PATH
    ├── .zprofile         # (empty — login shell handled by /etc/profile)
    ├── .zshrc            # Entry point — sources all modules below
    ├── aliases.zsh       # eza, bat, git, WSL2 interop, navigation
    ├── atuin.zsh         # Atuin init (sourced BEFORE plugins.zsh)
    ├── bindings.zsh      # vi-mode keybindings via zvm_after_init hook
    ├── fzf.zsh           # fzf config + custom widgets (batcat-aware)
    ├── plugins.zsh       # Lightweight plugin loader
    ├── prompt.zsh        # Starship init
    ├── security.zsh      # Recon, nmap, SSL, network aliases (Linux cmds)
    └── starship.toml     # Prompt theme

Quick Start

# Clone into ~/.config (repo lives here directly — no stow needed)
git clone <your-repo-url> ~/.config

# Bootstrap: installs packages, Atuin, TPM, sets default shell
bash ~/.config/setup.sh

# Apply WSL2 system config (restart WSL after)
sudo cp ~/.config/wsl.conf /etc/wsl.conf
wsl --shutdown   # run from Windows PowerShell

# Point zsh at this config directory (add to /etc/zsh/zshenv)
# sudo tee -a /etc/zsh/zshenv << 'EOF'
# export XDG_CONFIG_HOME="$HOME/.config"
# [ -d "$XDG_CONFIG_HOME/zsh" ] && export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
# EOF

Then open a new terminal and run tmux, followed by prefix + I to install plugins. In Neovim, run :Lazy sync to install all plugins.


Windows Terminal

Windows Terminal configuration is managed separately in the dotfiles-Windows repo.

Zsh

Keybindings

Key Action
Ctrl+R Fuzzy history search (custom fzf widget)
Ctrl+E Atuin TUI history search
Ctrl+F Fuzzy file picker — no hidden files
Ctrl+T Fuzzy file picker — including hidden files
Ctrl+G tmux sessionizer from shell
Alt+Z Zoxide fuzzy jump
Ctrl+\ Toggle zsh-autosuggestions
/ History substring search by prefix
Ctrl+→ Forward word
Ctrl+← Backward word

Plugins

Plugin Purpose
zsh-autosuggestions Fish-style inline suggestions
zsh-history-substring-search Prefix-filtered Up/Down history
zsh-vi-mode Vi keybindings with cursor shape
fast-syntax-highlighting Syntax highlighting
fzf-tab fzf-powered tab completion
zsh-you-should-use Alias reminder

Update all plugins: zplugin-update

Useful functions

Function Usage
fif <term> Find term inside files (rg + fzf + bat preview)
fbr Fuzzy git branch checkout
dotsync Commit and push ~/.config to GitHub
sslcheck <host> Print SSL cert dates + issuer

Neovim

Leader: Space

Navigation

Key Action
s Flash jump (label-based 2-char motion)
S Flash Treesitter jump
<leader>e Toggle file tree
<leader>z Zen mode
<C-h/j/k/l> Move between windows / tmux panes

Harpoon

Key Action
<leader>ha Add current file to list
<leader>hh Open quick menu
<leader>1-4 Jump to mark 1–4
<leader>hn/hp Next / previous mark

LSP

Key Action
K Hover documentation
<leader>gd Peek definition
<leader>gD Go to definition
<leader>ca Code action
<leader>rn Rename symbol
<leader>D / d Line / cursor diagnostics
<leader>pd / nd Prev / next diagnostic
<leader>oi Organise imports

Fuzzy (fzf-lua)

Key Action
<leader>ff Files
<leader>fg Live grep
<leader>fb Buffers
<leader>fd LSP finder
<leader>fr References
<leader>fs Document symbols
<leader>fw Workspace symbols

Testing (neotest)

Key Action
<leader>tt Run nearest test
<leader>tf Run file
<leader>ts Toggle summary panel
<leader>to Toggle output panel
<leader>td Debug nearest test (DAP)

Debugging (nvim-dap — Rust, via codelldb)

Key Action
<leader>dc Continue / start
<leader>do Step over
<leader>di Step into
<leader>du Step out
<leader>db Toggle breakpoint
<leader>dr Open REPL

tmux

Prefix: Ctrl+A

Panes & windows

Key Action
prefix + | Split vertically
prefix + - Split horizontally
prefix + h/j/k/l Navigate panes
Shift+←/→ Previous / next window
prefix + c New window (cwd)
prefix + r Reload config

Popups

Key Action
prefix + f Project sessionizer
prefix + g lazygit popup
prefix + T Scratchpad session
prefix + w Session/window switcher

WSL2 clipboard

y in copy mode pipes through clip.exe to the Windows clipboard. pbpaste reads back from Windows clipboard via PowerShell.


Security Tools

Aliases in zsh/security.zsh — Linux command equivalents of the MacBook setup.

Alias / Function Purpose
listening / ports Listening ports via ss -tulnp
conns Active TCP connections
myip External IP via ipinfo.io
localip LAN IP on eth0
nmap-quick/full/vuln Common nmap scan patterns
rscan / rscan-full RustScan fast port scan
sslcheck <host> Cert dates, subject, issuer
sha256 / sha512 sha256sum / sha512sum
b64e / b64d Base64 encode / decode
hflush Flush systemd-resolved DNS cache

WSL2 Notes

wsl.conf lives at /etc/wsl.conf on the Linux side — it's tracked in this repo but must be placed manually. After any change: wsl --shutdown from Windows PowerShell.

Key setting: appendWindowsPath = false removes hundreds of Windows PATH entries from the Linux shell, significantly speeding up every command lookup. Windows executables like clip.exe and explorer.exe are still accessible via their full path (/mnt/c/Windows/System32/clip.exe) — the aliases in aliases.zsh handle this.


Maintenance

# Commit and push dotfiles
dotsync

# Update all zsh plugins
zplugin-update

# Update Neovim plugins
nvim +LazyUpdate

# Update tmux plugins
# prefix + U (inside tmux)

# Update system packages
sudo apt update && sudo apt upgrade

About

My personal configuration for WSL2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors