Skip to content

GrinlexGH/.dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

120 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ Grinlex's Dotfiles

Join Discord

This is my dotfiles repository - collection of the most convenient configurations for me, as far as I could make, for programs and Unix-like environments. Zsh Preview

✨ Features

🔁 Enhanced Zsh Config

  • Delete word on Ctrl + delete / backspace
  • Convenient and beautiful bira theme
  • Command completion via zsh-autosuggestions
  • Alias completion
  • Zoxide & uv setup

🔗 Shell aliases

  • dotfiles = git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"
  • mc-{start,stop,log,rcon} = $MINECRAFT_SERVER_DIR/{start,stop,log,rcon}.sh

🧬 .zshenv Setup

Adds $HOME/bin & $HOME/.local/bin to $PATH if exist.
Setup spicetify, jdtls, kotlin-lsp, Android SDK, Vulkan SDK and many other programs if they exist.
See .zshenv

📝 Neovim Setup

A modern Neovim configuration with powerful language tooling and visual polish:

🔑 Keybindings (Leader: Space)

Keybind Action
leader + s.. Window split management
Ctrl + arrows Change split size (mini.basics)
Ctrl + h/j/k/l Split navigation (mini.basics)
leader + t.. Tab management
leader + e.. File explorer (nvim-tree)
leader + nh Clear search highlights
leader + n Notifications (snacks)
leader + g.. Code actions (native + mini.surround)
leader + rs Restart LSP
leader + d/D Show diagnostics (line / buffer)
leader + x.. Open diagnostics window (trouble)
P Toggle diagnostics window preview (trouble)
leader + f.. Open search (telescope)
Ctrl + h/j/k/l Navigate search results (telescope)
Alt + h/j/k/l Navigate search preview (telescope)
Ctrl + e Quote text (exact) (telescope)
K Show hover docs
Ctrl + Space Show autocomplete (blink.cmp)
Ctrl + j/k Navigate autocomplete (blink.cmp)
Alt + j/k Scroll autocomplete docs (blink.cmp)
Ctrl + e Cancel autocomplete (blink.cmp)
gc.. Linewise comment (Comment)
gb.. Blockwise comment (Comment)
leader + h.. Git hunk navigation (gitsigns)
leader + lg Launch LazyGit (lazygit)
]/[ + t Next / previous todo comment (todo-comments)
zA Toggle region comment fold under cursor (region-folding)
zR Open all region comment folds (region-folding)
zM Close all region comment folds (region-folding)
Alt + h/j/k/l Move selection / current line (mini.move)
s [+..] Substitute (substitute)
Alt + i Toggle terminal (FTerm)

📸 Neovim Preview

Neovim Preview 1

Neovim Preview 2

📦 Requirements

Install with:

sudo pacman -S cmake make clang unzip python3 fzf ripgrep zsh zoxide lazygit uv fastfetch neovim ninja
cargo install --locked tree-sitter-cli
# For the latest version of nvim
sudo snap install nvim --classic
sudo apt install cmake make clang-tidy g++ unzip python3-venv fzf ripgrep xclip zoxide bash-completion npm fastfetch ninja-build lazygit cargo zsh curl
cargo install --locked tree-sitter-cli

🚀 Installation

Using Arch Wiki's dotfile method:

git clone --bare https://github.com/GrinlexGH/.dotfiles.git $HOME/.dotfiles

alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'

dotfiles checkout
dotfiles config --local status.showUntrackedFiles no

If you get error like:

error: The following untracked working tree files would be overwritten by checkout:
    .bashrc
    .gitignore
Please move or remove them before you can switch branches.
Aborting

You can backup these files and try again:

mkdir -p .dotfiles-backup && \
dotfiles checkout 2>&1 | grep -E "^\s" | awk '{print $1}' | \
while read file; do
    mkdir -p ".dotfiles-backup/$(dirname "$file")"
    mv "$file" ".dotfiles-backup/$file"
done

dotfiles checkout
dotfiles config --local status.showUntrackedFiles no

To update the dotfiles later:

dotfiles pull

🌐 Useful stuff

Nerd fonts:
https://www.nerdfonts.com/font-downloads

Zsh plugins:
https://github.com/zsh-users/zsh-autosuggestions

Fix self-hosted servers when Windscribe VPN is on:

if ! grep -q "direct_lan" /etc/iproute2/rt_tables; then
  echo "200 direct_lan" | sudo tee -a /etc/iproute2/rt_tables
fi

sudo tee /etc/NetworkManager/dispatcher.d/99-windscribe-fix << 'EOF'
#!/bin/bash

INTERFACE=$1
ACTION=$2
TABLE_ID="200"

if [[ "$INTERFACE" =~ ^(tun|wg|utun|ppp) ]]; then
    IS_VPN=true
else
    IS_VPN=false
fi

case "$ACTION" in
    up)
        if [ "$IS_VPN" = true ]; then
            MAX_RETRIES=15
            for ((i=1; i<=MAX_RETRIES; i++)); do
                if ip rule list | grep -qE "32764|16383"; then
                    VPN_READY=true
                    break
                fi
                sleep 1
            done

            if [ "$VPN_READY" != true ]; then
                exit 0
            fi

            PHYS_INT=$( ip -4 route show default | grep -vE 'tun|wg|utun|ppp|docker|br-|veth' | awk '{print $5}' | head -n1)

            if [ -n "$PHYS_INT" ]; then
                LAN_IP=$(ip -4 addr show "$PHYS_INT" | awk '/inet / {print $2}' | cut -d/ -f1)
                LAN_NET=$(ip route show dev "$PHYS_INT" | grep -v default | grep "scope link" | awk '{print $1}' | head -n1)
                GATEWAY=$(ip route show dev "$PHYS_INT" | awk '/default via/ {print $3}' | head -n1)

                if [ -n "$LAN_IP" ] && [ -n "$GATEWAY" ]; then
                    ip rule del table $TABLE_ID 2>/dev/null
                    ip route flush table $TABLE_ID 2>/dev/null

                    ip route add $LAN_NET dev $PHYS_INT scope link table $TABLE_ID 2>/dev/null
                    ip route add default via $GATEWAY dev $PHYS_INT table $TABLE_ID 2>/dev/null

                    ip rule add from $LAN_IP table $TABLE_ID priority 16000 2>/dev/null
                fi
            fi
        fi
        ;;
    down)
        if [ "$IS_VPN" = true ]; then
            ip rule del table $TABLE_ID 2>/dev/null
            ip route flush table $TABLE_ID 2>/dev/null
        fi
        ;;
esac
EOF

sudo chmod +x /etc/NetworkManager/dispatcher.d/99-windscribe-fix

About

My config folder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors