Skip to content

ronilaukkarinen/dotfiles

Repository files navigation

Rolle's dotfiles

Version bash linux macOS Lua Neovim WezTerm

Cross-platform configuration files for Neovim and WezTerm with OS-specific settings.

image

Installation

bash <(curl -fsSL https://raw.githubusercontent.com/ronilaukkarinen/dotfiles/master/install.sh)

Features

🎯 Modular structure - Shared configs + OS-specific overrides
🔐 Secrets management - API keys in gitignored files
🌍 Cross-platform - Works on Linux, macOS, and Windows
🎮 Gamification & stats - Code::Stats and gamify with streak tracking
🤖 Claude Code integration - Automatic XP tracking for AI-assisted coding

Requirements

Manual installation

For selective updates or if you prefer manual setup:

Clone the repository

git clone [email protected]:ronilaukkarinen/dotfiles.git ~/Projects/dotfiles

Symlink configs (Linux/macOS)

# WezTerm
ln -sf ~/Projects/dotfiles/wezterm ~/.config/wezterm

# Neovim
ln -sf ~/Projects/dotfiles/nvim ~/.config/nvim

# Hammerspoon (macOS only)
ln -sf ~/Projects/dotfiles/hammerspoon ~/.hammerspoon

Symlink configs (Windows - PowerShell as Admin)

# Clone repository
git clone git@github.com:ronilaukkarinen/dotfiles.git $env:USERPROFILE\Projects\dotfiles

# WezTerm
New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.config\wezterm" -Target "$env:USERPROFILE\Projects\dotfiles\wezterm" -Force

# Neovim
New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\AppData\Local\nvim" -Target "$env:USERPROFILE\Projects\dotfiles\nvim" -Force

Configure secrets

# Neovim
cp ~/Projects/dotfiles/nvim/lua/secrets.lua.example ~/Projects/dotfiles/nvim/lua/secrets.lua
nvim ~/Projects/dotfiles/nvim/lua/secrets.lua

# Claude Code
cp ~/Projects/dotfiles/claude-code/secrets.sh.example ~/Projects/dotfiles/claude-code/secrets.sh
nvim ~/Projects/dotfiles/claude-code/secrets.sh

Get your Code::Stats API key from https://codestats.net/my/machines

With symlinks, any changes you make to your configs automatically update the repo! Just commit and push when ready.

Linter and formatter notifications appear automatically when you open files - nvim-lint will warn you if a linter is missing for that specific file type.

Claude code integration

Track your AI-assisted coding activity with Code::Stats automatically! Every time Claude Code writes or edits a file, you'll earn XP and see a yellow ASCII box notification in WezTerm (1 XP per line written by Claude).

The install script sets up the hook symlink automatically. You just need to configure ~/.claude/settings.json:

Configure Claude code hooks

Add the following to your ~/.claude/settings.json (if you already have settings, just add the hooks section):

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write|NotebookEdit",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/codestats-hook.sh"
          }
        ]
      }
    ]
  }
}

How it works

The hook automatically:

  • Detects file type from extension (JavaScript, Python, Markdown, Bash, etc.)
  • Calculates XP based on characters written (1 XP = 1 character)
  • Sends the XP to Code::Stats API after each file edit/write
  • Supports all file types that Claude Code can edit

Now your AI-assisted coding will contribute to your Code::Stats profile!

Auto-save conversations

Automatically save and archive all your Claude Code conversations with searchable markdown transcripts. This uses the claude-conversation-saver plugin wrapping the conversation-logger skill. Read more at Jerad Bitner's blog post.

Run this command in Claude Code:

/plugin marketplace add https://github.com/sirkitree/claude-conversation-saver

Then restart Claude Code. The plugin will automatically save conversations after each response to ~/.claude/conversation-logs/ with markdown transcripts, JSONL raw data, and session metadata.

The plugin needs these tools (likely already installed):

  • git - for cloning the skill
  • jq - JSON processor for parsing data
  • python3 - for markdown conversion

Install missing dependencies:

Arch Linux:

sudo pacman -S git jq python

Debian/Ubuntu:

sudo apt install git jq python3

macOS:

brew install git jq python3

After installation, conversations are automatically saved. Use these slash commands:

  • /convo-search <query> - search across all saved conversations
  • /convo-list - list all saved conversations
  • /convo-recent - show recent conversations

This ensures you never lose important conversations and can search through your entire Claude Code history!

Setup on other machines

On any other machine where you use Claude Code, just run the install script:

bash <(curl -fsSL https://raw.githubusercontent.com/ronilaukkarinen/dotfiles/master/install.sh)

Then configure your secrets and ~/.claude/settings.json as instructed.

Setup on remote servers

For remote servers where you use Claude Code via SSH, run the install script:

bash <(curl -fsSL https://raw.githubusercontent.com/ronilaukkarinen/dotfiles/master/install.sh)

Or for manual Claude Code hook setup only:

# Clone dotfiles
git clone [email protected]:ronilaukkarinen/dotfiles.git ~/Projects/dotfiles

# Create secrets file with your API key
echo '#!/bin/bash
export CODESTATS_API_KEY="YOUR_API_KEY_HERE"' > ~/Projects/dotfiles/claude-code/secrets.sh
chmod +x ~/Projects/dotfiles/claude-code/secrets.sh

# Symlink the hook
mkdir -p ~/.claude/hooks
ln -sf ~/Projects/dotfiles/claude-code/codestats-hook.sh ~/.claude/hooks/codestats-hook.sh

# Add hooks to ~/.claude/settings.json on the server (see above)

Linters

The install script asks which linters you want to activate. You can enable/disable individual linters for different languages. Each linter checks code quality and shows errors/warnings inline as you type.

Available linters

  • phpcs - PHP Code Sniffer for PHP files
  • stylelint - CSS/SCSS linter
  • flake8 - Python linter
  • luacheck - Lua linter
  • jsonlint - JSON linter
  • eslint - JavaScript linter

Manual activation

To manually enable/disable linters after installation, edit ~/Projects/dotfiles/nvim/lua/local.lua:

return {
    -- ... other settings ...

    -- Linters (set to true to enable, false to disable)
    enable_phpcs = true,      -- PHP linter
    enable_stylelint = true,  -- CSS/SCSS linter
    enable_flake8 = true,     -- Python linter
    enable_luacheck = true,   -- Lua linter
    enable_jsonlint = true,   -- JSON linter
    enable_eslint = true,     -- JavaScript linter
}

After editing, restart Neovim for changes to take effect.

Installing linters

If a linter is enabled but not installed, nvim-lint will show a notification with installation instructions when you open a file of that type.

PHP (phpcs)

composer global require squizlabs/php_codesniffer

CSS/SCSS (stylelint)

npm install -g stylelint

Python (flake8)

pip install flake8

Lua (luacheck)

luarocks install luacheck

JSON (jsonlint)

npm install -g jsonlint

JavaScript (eslint)

npm install -g eslint

Project-specific linters

For JavaScript/PHP projects, nvim-lint will automatically detect and use project-local linters:

  • JavaScript: Uses node_modules/.bin/eslint if available in your project
  • PHP: Uses vendor/bin/phpcs if available in your project

This ensures project-specific rules and configurations are respected.

Remote server setup

Install Neovim (first time), oneliner

curl -L https://github.com/ronilaukkarinen/dotfiles/archive/refs/heads/master.tar.gz | tar xz && cp -r dotfiles-master/nvim ~/.config/ && rm -rf dotfiles-master && echo "code_stats_api_key = 'SFxxxx'\ncodestats_username = 'rolle'" > ~/.config/nvim/lua/secrets.lua

Update Neovim, oneliner

curl -L https://github.com/ronilaukkarinen/dotfiles/archive/refs/heads/master.tar.gz | tar xz && cp -r dotfiles-master/nvim/* ~/.config/nvim/ && rm -rf dotfiles-master

Platform-specific notes

Linux

  • Uses /usr/bin/python3
  • nvm integration for Node.js
  • Wayland clipboard workaround for WezTerm

macOS

  • Uses Homebrew Python: /opt/homebrew/bin/python3
  • Background blur effects in WezTerm
  • Optimized font rendering (weight 500, size 13pt)

Windows

  • Uses system Python
  • PowerShell as default shell - Opens with PowerShell (powershell.exe) by default
  • WSL Ubuntu 22.04 - Press Ctrl+Shift+B to spawn WSL Ubuntu in a split pane
  • Launch menu - Access PowerShell, WSL Ubuntu 22.04, Git Bash, or CMD via the launcher (Ctrl+K → search "launcher")
  • Adjusted keybindings where needed

Making "bash" command open WSL Ubuntu 22.04

To make typing bash in PowerShell open WSL Ubuntu 22.04, add this to your PowerShell profile:

# Override bash command to use WSL Ubuntu 22.04
function bash {
    wsl -d Ubuntu-22.04
}

Profile location: C:\Users\YourUsername\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Create the file if it doesn't exist, then restart PowerShell or run . $PROFILE to apply changes.

Installed plugins

Custom features

  • Auto-restore sessions
  • Code::Stats XP in statusline
  • Gamify streak tracking
  • OS-specific configurations
  • Contextual linter notifications (only for files you're editing)

Keybindings

WezTerm

  • Ctrl+Shift+O - Project switcher
  • Ctrl+K - Command palette
  • Ctrl+Shift+B - Spawn WSL Ubuntu 22.04 in split pane (Windows only)
  • Ctrl+W - Close pane
  • Ctrl+Alt+Arrows - Navigate panes
  • Ctrl+Shift+Arrows - Resize panes
  • Ctrl+Shift+R - Reload configuration

Neovim

  • Ctrl+P - Telescope frecency
  • Ctrl+Shift+P - Command palette
  • See individual plugin docs for more keybindings

Syncing gamify data

To sync your gamify streak and statistics across machines:

Install Syncthing

Linux

# Debian/Ubuntu
sudo apt install syncthing

# Arch Linux
sudo pacman -S syncthing

macOS

brew install syncthing

Enable auto-start

Linux (systemd)

# Enable and start Syncthing service
systemctl --user enable syncthing.service
systemctl --user start syncthing.service

macOS

# Syncthing will auto-start after brew installation
brew services start syncthing

Set up syncing

  1. Open the web UI at http://127.0.0.1:8384
  2. Set up GUI authentication (Settings → GUI → Set username and password)
  3. Add a new folder pointing to ~/.local/share/nvim/gamify/ with Folder Label "nvim gamify"
  4. In folder settings, go to Advanced:
    • Tick Ignore Permissions
    • Set Full Rescan Interval (s) to 300 (5 minutes for faster sync)
  5. Share this folder with your other devices
  6. Syncthing will keep your streaks in sync automatically

Remote access via nginx reverse proxy (Linux only)

To access Syncthing web UI from outside your network:

Install nginx

# Debian/Ubuntu
sudo apt install nginx

# Arch Linux
sudo pacman -S nginx

Create nginx reverse proxy configuration

sudo tee /etc/nginx/sites-available/syncthing > /dev/null << 'EOF'
server {
  listen 0.0.0.0:8385;
  listen [::]:8385;
  server_name your-domain.example.com;

  location / {
    proxy_pass http://127.0.0.1:8384/;
    proxy_http_version 1.1;
    proxy_set_header Connection "upgrade";
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;

    # by default nginx times out connections in one minute
    proxy_read_timeout 1d;
  }
}
EOF

Replace your-domain.example.com with your actual domain name.

Enable the nginx site

sudo ln -s /etc/nginx/sites-available/syncthing /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl enable nginx
sudo systemctl start nginx

Configure router port forwarding

Set up port forwarding in your router:

  • External port: 8385
  • Internal IP: Your server's local IP (e.g., 192.168.1.100)
  • Internal port: 8385
  • Protocol: TCP

Access Syncthing remotely

You can now access Syncthing from anywhere at http://your-domain.example.com:8385/

Make sure you have GUI authentication enabled (step 2 in "Set up syncing" above).

Updates

With Symlinks

Simply pull the latest changes:

cd ~/Projects/dotfiles && git pull

Reload WezTerm (Ctrl+Shift+R) and restart Neovim to apply changes.

Without Symlinks

Pull and re-copy files:

Linux/macOS

cd ~/Projects/dotfiles && git pull && cp -r wezterm ~/.config/ && cp -r nvim ~/.config/

Windows (PowerShell)

cd ~/Projects/dotfiles; git pull; Copy-Item -Recurse -Force wezterm "$env:USERPROFILE\.config\"; Copy-Item -Recurse -Force nvim "$env:USERPROFILE\AppData\Local\"

.bashrc

My .bashrc changes depending on the system I'm on, but here are some useful lines to add.

# Add trailing slash when tab-completing directories
bind 'set mark-directories on'
bind 'set mark-symlinked-directories on'

About

.files https://dotfiles.github.io/

Resources

Stars

Watchers

Forks

Packages

No packages published