This repository contains personal dotfiles for setting up a development environment from scratch. It's primarily written in Fish shell scripts with Lua configuration for Neovim.
run.fish- Main entry point that detects OS and launches appropriate setup scriptsos/{arch,darwin,ubuntu}/- OS-specific installation and configuration scriptsos/common/- Cross-platform utilities and shared functionalityfish/functions/- Reusable Fish shell functions for messaging and git operationsnvim/- Neovim configuration using Lua with lazy.nvim plugin managementmise/- Development tool version management configurationstarship/- Shell prompt customizationghostty/- Terminal emulator configurationtmux/- Terminal multiplexer settings
# Test individual fish functions
fish -c "source path/to/script.fish; function-name"
# Validate fish syntax
fish -n path/to/script.fish
# Run the main launcher
./run.fish
./run.fish --launcher # Interactive mode# Test Neovim configuration
nvim --headless -c "lua require('sethen.core')" -c "qa"
# Check for Lua syntax errors
lua -c "require('path/to/module')"
# Validate plugin specifications
nvim --headless -c "Lazy check" -c "qa"# Validate starship config
starship config validate
# Check mise configuration
mise doctor
# Validate TOML files
mise run --dry-run # If availableImports & Dependencies:
- All scripts must start with
#!/usr/bin/env fish - Use
sourceor direct function calls for dependencies - Functions should be self-contained with minimal dependencies
Naming Conventions:
- Functions:
kebab-casewith descriptive names (e.g.,header-message,git-branch-name) - Variables:
UPPER_SNAKE_CASEfor globals,lower_snake_casefor locals - Files:
kebab-case.fish
Code Structure:
#!/usr/bin/env fish
function function-name
# Argument validation
if test (count $argv) -eq 0
echo "usage: function-name <argument>" >&2
return 1
end
set -l variable value # Local variables
# Main logic
# ...
endError Handling:
- Always validate arguments and provide usage messages
- Use
>&2for error messages - Return non-zero exit codes on errors
- Use conditional execution with
and/or
Messaging System:
- Use provided messaging functions:
header-message,success-message,error-message, etc. - Consistent color coding and formatting across all scripts
Imports & Module Structure:
-- Use local variables for modules
local keymaps = require('sethen.core.keymaps')
local telescope = require('telescope')
-- Module returns should be tables
return {
plugin_name = 'repo/plugin',
config = function()
-- Configuration logic
end,
keys = { /* keybindings */ },
dependencies = { /* dependencies */ }
}Naming Conventions:
- Files:
kebab-case.lua - Variables:
snake_case - Functions:
snake_case - Constants:
UPPER_SNAKE_CASE
Code Style:
- 3-space indentation (consistent with existing code)
- Use string concatenation with
..operator - Prefer
localover global variables - Use vim.opt for options, vim.o for single options
Plugin Configuration:
- Use lazy.nvim plugin specification format
- Include dependencies as arrays
- Use
keysfor keybinding declarations - Separate
configfunctions for complex setups
Style Guidelines:
- Use double quotes for string values
- Maintain consistent indentation (2 spaces)
- Group related settings together
- Use descriptive section headers
File Organization:
- Keep tool-specific configs in their respective directories
- Use
[tools]section for version specifications in mise.toml - Include schema references where available
-
Testing Changes:
- Test fish scripts in isolated environment before integration
- Use
--dry-runflags where available for package installations - Validate Neovim configuration in headless mode
-
OS Compatibility:
- Test changes on target OS (Arch, Darwin, Ubuntu)
- Use OS-specific directories for platform-dependent code
- Common functionality should go in
os/common/
-
Installation Order:
- Pre-installation scripts in
pre/directories - Main installations in
main/directories - Post-configuration in
post/directories - Utilities are shared across phases
- Pre-installation scripts in
- No interactive prompts unless using gum/fzf for selection
- Idempotent operations - scripts should handle re-runs gracefully
- Error propagation - use proper exit codes and error messages
- Logging - use standardized messaging functions for consistent output
- Modularity - each function should do one thing well
- Documentation - include usage examples in function comments when needed
The repository relies on these core tools:
fishshell for scriptingmisefor version managementneovimfor text editingstarshipfor shell promptgitfor version controlgumfor interactive CLI elementsghosttyterminal emulator
Ensure all dependencies are installed before testing changes to the dotfiles setup.