Skip to content

crafts69guy/.dotfiles

Repository files navigation

fish screenshot nvim screenshot

Warning: Don’t blindly use my settings unless you know what that entails. Use at your own risk!

πŸ“Œ Contents

  • Neovim – Custom plugins, keybindings, and themes (LazyVim)
  • Tmux – Optimized terminal workflow
  • Git – Configuration for efficient version control
  • Karabiner – Custom key mappings with Fn (Hyper) key
  • Fish Shell – Enhanced terminal experience with Tide prompt
  • FZF – Fuzzy finder with fd, ripgrep, bat integration
  • GNU Stow – Simple dotfiles management

πŸš€ Setting Up a New Machine with This Repo

This repository uses GNU Stow to manage dotfiles efficiently with symlinks. Follow these steps to set up your new machine:

1. Install Required Packages

Install Stow & Essential Tools

macOS:

brew install stow git fish tmux neovim fd ripgrep bat eza fzf

Linux (Debian/Ubuntu):

sudo apt update && sudo apt install stow git fish tmux neovim

Linux (Arch):

sudo pacman -S stow git fish tmux neovim

Install Fisher

A plugin manager for Fish
macOS:

curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher

Install Tide after installed fisher (optional)

The ultimate Fish prompt.

Tide-Configuration-Wizard

macOS:

fisher install IlanCosman/tide@v6

2. Clone This Repository

git clone https://github.com/crafts-cnc/.dotfiles.git ~/.dotfiles
cd ~/.dotfiles

3. Apply Dotfiles Using Stow

To symlink all configurations:

# Using run script (recommended)
~/.dotfiles/stow_setup.sh

# Without script
stow -v . # [Add -R flag if need]

To symlink specific configurations:

# Stow .config package contains fish, tmux, nvim,...
stow -v ~/.dotfiles/.config

# Stow biome file configurations
stow -v ~/.dotfiles/biome.json

4. Restart Your Shell (optional)

exec fish  # or exec zsh

5. Verify the Setup (optional)

Check if configurations are correctly applied:

echo $SHELL   # Should show fish or zsh
nvim --version  # Ensure Neovim is installed

πŸš€ Karabiner Element Application

I use Karabiner to customize keyboard mappings for Vim efficiency and FZF workflows.

Installation

brew install --cask karabiner-elements

Custom Mappings

Vim Efficiency:

  • Caps Lock β†’ Left Control
  • Ctrl + [ β†’ Escape
  • Fn + h/j/k/l β†’ Arrow keys

FZF Workflows (Fn as Hyper Key):

  • Fn + f β†’ Fuzzy find files
  • Fn + d β†’ Fuzzy find directories
  • Fn + g β†’ Git modified files
  • Fn + b β†’ Git branches
  • Fn + ; β†’ Git log
  • Fn + p β†’ Projects switcher
  • Fn + t β†’ Tmux sessions
  • Fn + w β†’ Tmux windows
  • Fn + n β†’ New tmux session
  • Fn + q β†’ Kill tmux session
  • Fn + s β†’ Ripgrep search
  • Fn + x β†’ Kill processes
  • Fn + o β†’ Kill by port

Search in the registry:

karabiner screenshot simple karabiner screenshot complex

karabiner screenshot sample

πŸ” FZF Setup

Comprehensive fuzzy finder integration with modern CLI tools, based on official fzf documentation.

Dependencies

brew install fzf fd ripgrep bat eza ghq

Features

  • fd – Fast file/directory search (replaces find)
  • ripgrep – Fast text search with live reload
  • bat – Syntax-highlighted file previews
  • eza – Modern ls with tree view for directories
  • Solarized Dark theme matching Ghostty terminal
  • ghq – Project management

Key Bindings

Key Function Description
Fn+f Files Search files with fd + bat preview
Fn+d Directories Navigate directories with eza tree
Fn+g Git files Browse git modified files
Fn+b Git branches Switch git branches
Fn+; Git log Browse git commit history
Fn+p Projects Switch between projects (ghq)
Fn+t Tmux sessions Switch tmux sessions
Fn+w Tmux windows Switch tmux windows
Fn+n New session Create and switch to new tmux session
Fn+q Tmux kill Kill tmux sessions/panes
Fn+s Ripgrep Interactive text search with live reload
Fn+x Processes Kill processes with confirmation
Fn+o Ports Kill processes by port number
Ctrl+r History Search command history

Functions

# Interactive ripgrep search
fzf_ripgrep [pattern]

# Quick process killer
fzf_kill        # SIGTERM
fzf_kill -9     # SIGKILL

# Kill tmux sessions or panes
fzf_tmux_kill          # Kill sessions (multi-select)
fzf_tmux_kill --panes  # Kill panes

# Create new tmux session
fzf_tmux_new_session   # Prompt for name, create and switch

# Two-phase ripgrep search
fzf_rg "search term"

# And more: fzf_files, fzf_directories, fzf_git_branches, fzf_git_log, etc.

Configuration Files

  • .config/fish/conf.d/fzf.fish – FZF environment variables
  • .config/fish/conf.d/fzf_bindings.fish – Key bindings
  • .config/fish/functions/fzf_*.fish – Individual workflow functions
  • .config/karabiner/karabiner.json – Fn key mappings

πŸ›  Neovim Setup

Requirements


🎨 Enable undercurl in iTerm2

1. Export TERM in your shell config

Add this to your ~/.zshrc or ~/.bashrc:

export TERM="xterm-256color"
[[ -n $TMUX ]] && export TERM="screen-256color"

Restart your shell after making the changes.

2. Configure Neovim

Add the following options in init.lua or ~/.config/nvim/lua/config/options.lua:

vim.opt.spell = true
vim.opt.spelllang = { 'en_us' }

3. Generate Terminal Description

Run:

infocmp > /tmp/$TERM.ti

4. Edit Terminal Description

Open /tmp/$TERM.ti and find this line:

smul=\E[4m,

Modify it by adding:

 Smulx=\E[4:%p1%dm,

Save the file.

5. Compile Terminal Description

Run:

tic -x /tmp/$TERM.ti

6. Restart iTerm2 and Test

Close and reopen iTerm2, then check if undercurl works:

echo -e "\e[4:3mUndercurl Test\e[0m"

Result undercurl


πŸ“œ How to Use

  1. Takuya's blog - vim-setup-to-speed-up-javascript-coding-for-my-electron-and-react-native-apps
  2. Takuya's blog - a-productive-command-line-git-workflow-for-indie-app-developers
  3. GNU Stow cheat sheet

πŸ“Œ About Me

πŸš€ Happy Coding!

About

This repo leverages GNU Stow to simplify symlink management, making it easy to install and update configurations across different machines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors