Skip to content

guntas-13/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

My personal macOS dotfiles managed with GNU Stow.
Zsh configuration with Powerlevel10k. Neovim configuration with NvChad. Terminal emulator configs for Alacritty & Ghostty as well as Tmux configuration managed using TPM (Tmux Plugin Manager) with Gitmux and Catppuccin Tmux (Catppuccin theme for Tmux). Finally, a Miniconda setup for Python environment (conda-env.yml)

Note

  • $HOME refers to the user's home directory: /Users/your-username/ or ~.
  • Most configurations are now looked in for in XDG_CONFIG_HOME following the XDG Base Directory Specification.
  • XDG_CONFIG_HOME defaults to $HOME/.config/ in this configuration.
  • $(brew prefix <package>) returns the installation path of a Homebrew package (/opt/homebrew/opt/<package> on Mac).

Quick Start

Prerequisites

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Required Packages

Install essential tools via Homebrew:

brew install \
  git \
  stow \
  zsh \
  neovim \
  tmux \
  fzf \
  zoxide \
  tree \
  bash \
  gawk \
  coreutils \
  gnu-sed \
  git-lfs \
  osx-cpu-temp \
  btop \
  bat \
  eza \
  vim --override-system-vi

Installation

  1. Clone the repository

    git clone https://github.com/guntas-13/dotfiles.git $HOME/dotfiles
    cd $HOME/dotfiles
  2. Set Zsh as the default shell

    chsh -s $(which zsh)

    Restart your terminal for the changes to take effect.

  3. Install Oh My Zsh

    Install Oh My Zsh using the official installation script:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

    When prompted, allow Oh My Zsh to set up the default configuration. You'll overwrite it in the next step.

  4. Deploy dotfiles with Stow

    cd $HOME/dotfiles
    stow --adopt .

    After running stow --adopt ., the following symlinks will be created:

    ~/.zshrc           -> ~/dotfiles/.zshrc
    ~/.p10k.zsh       -> ~/dotfiles/.p10k.zsh
    ~/.config/nvim/    -> ~/dotfiles/.config/nvim/
    ~/.config/alacritty/ -> ~/dotfiles/.config/alacritty/
    ~/.config/tmux/    -> ~/dotfiles/.config/tmux/
    ~/.config/ghostty/  -> ~/dotfiles/.config/ghostty/
    
  5. Download Nerd Fonts

    Download and install a Nerd Font from the Nerd Fonts repository or their website or use Homebrew:

    brew install --cask font-<FONT NAME>-nerd-font
  6. Download Alacritty and/or Ghostty

    Visit Alacritty and/or Ghostty to download and install the latest release for macOS.

     brew install --cask alacritty ghostty
  7. Set up Conda environment

    Download & Install from miniconda website or use the following commands:

    # Download and install Miniconda
    curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
    bash Miniconda3-latest-MacOSX-arm64.sh

    Initialize conda (if not done during installation):

    conda init zsh

    Restart your terminal, then load the conda environment:

    cd $HOME/dotfiles
    conda env create -f conda-env.yml
    conda activate <environment_name>

    To update the conda-env.yml file after installing new packages, run:

    conda env export --no-builds > $HOME/dotfiles/conda-env.yml

Important

Remove the below block from .zshrc file. This block was automatically added during past conda initialization and a new block will be appended during the above installation steps.

Remove this block!
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/guntas13/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/guntas13/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/guntas13/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/guntas13/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

  1. Install Tmux Plugin Manager (TPM)

    Follow instructions from the TPM repository:

    git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
  2. Install Gitmux Follow instructions from the Gitmux repository.

    brew install gitmux

    Save the default configuration to a new file:

    gitmux -printcfg > $HOME/.gitmux.conf
  3. Configure Powerlevel10k

p10k configure
  1. Tmux Install Packages
# Start a new Tmux session
tmux
tmux source ~/.config/tmux/tmux.conf

Note

  • prefix is overwritten to Ctrl + Space in this configuration. Inside a Tmux session, press prefix + I (capital i) to install Tmux plugins.
  • Ctrl-Space + v to open a vertical split, Ctrl-Space + h to open a horizontal split.
  • Ctrl + <hjkl> to switch between panes like vim.
  • In NeoChad, Space is the leader key. Space + t h for theme panel, Ctrl + n or Space + e to open file explorer.

Database Tools (Optional)

Install and configure database servers if needed:

PostgreSQL

brew install postgresql@16
# Start PostgreSQL service
brew services start postgresql@16

Install PgAdmin as a GUI tool for managing PostgreSQL databases.

Change Data Directory

psql postgres

postgres=# SHOW config_file;
postgres=# SHOW data_directory;

vim opt/homebrew/var/postgresql@16/postgresql.conf
cp -R /opt/homebrew/var/postgresql@16 <new_data_directory_path>
sudo chown $(whoami):admin <new_data_directory_path>
chmod 700 <new_data_directory_path>

PostgreSQL Commands

To create a new database:

createdb -h localhost -p 5432 -U guntas13 <db_name>

To restore a database from a dump file:

pg_restore -v -h localhost -p 5432 -U guntas13 -d <db_name> <.dump file>

To create a dump of a database:

pg_dump -v -h localhost -p 5432 -U guntas13 -Fc -f <.dump flc> <db_name>

MongoDB

brew tap mongodb/brew
brew install [email protected]
# Start MongoDB service
brew services start [email protected]

Install NoSQLBooster as a GUI tool for managing MongoDB databases.

Change Data Directory

vim /opt/homebrew/etc/mongod.conf
─────┬─────────────────────────────────────────────────────
     │ File: mongod.conf
─────┼─────────────────────────────────────────────────────
   1 │ systemLog:
   2 │   destination: file
   3 │   path: /opt/homebrew/var/log/mongodb/mongo.log
   4 │   logAppend: true
   5 │ storage:
   6 │   dbPath: <new_data_directory_path>
   7 │ net:
   8 │   bindIp: 127.0.0.1, ::1
   9 │   ipv6: true
─────┴─────────────────────────────────────────────────────
sudo chown $(whoami):admin <new_data_directory_path>
chmod 755 <new_data_directory_path>

MongoDB Commands

To restore a database from a dump file:

mongorestore --uri="mongodb://localhost:27017" --drop <dump_directory>

or for a specific database:

mongorestore --db <db_name> --uri="mongodb://localhost:27017" --drop <dump_directory>/<db_name>

To create a dump of a database:

mongodump --uri="mongodb://localhost:27017" --out <dump_directory>

Preview of the Configuration

Resources

Tools & Package Managers

Shell & Terminal

Editors & Multiplexers

Thanks to the YouTube Channels: Dreams of Anatomy and Dreams of Code. Check out these vidoes:

This Zsh config is perhaps my favorite one yet.

IMAGE ALT TEXT

Turn VIM into a full featured IDE with only one command

IMAGE ALT TEXT

Tmux has forever changed the way I write code.

IMAGE ALT TEXT

Stow has forever changed the way I manage my dotfiles

IMAGE ALT TEXT

About

my macOS dotfiles for zsh, neovim, tmux, alacritty, ghostty

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published