Configurations - alarwasyi98/dotfiles-win GitHub Wiki
Program Configuration
This section provides instructions and custom configuration after installing essential tools. I prioritize performance, consistency across environments, and aesthetics for daily use. Each section contains the configuration file location and key customizations applied.
Most of these configs is associated with Gruvbox colorscheme because I found it easy on eye. There's another scheme you can try as follows:
Windows Terminal
- Config File:
setting.json
- Location:
$ENV:LOCALAPPDATA\Packages\Windows.Terminal...
- Dependencies: Nerd-Fonts
I switch between Windows Terminal and WezTerm depending on the workflow. Hereβs how I set up both with modern shell environments.
- Append colorscheme(s) into
setting.json
- Using FiraCode Nerd Font as default font interface. Nerd Fonts is available to install via-scoop
- Set the font size 9 - 12 with line-height 1.2 and font-weight to Bold
- Cursor line Bar (|)
- Windows transparency 30% - 50% with acrylic activated
- Padding set to be 9
WezTerm
- Config File:
wezterm.lua
- Location:
$ENV:USERPROFILE\.config\wezterm
- Dependencies: Nerd-Fonts
The key of the appearance is located on the similarity to Windows Terminal configs. Refer to wezterm.lua
Bat
- Config File:
config
- Location:
$ENV:APPDATA\bat\
- Dependencies:
less
,more
, Visual C++ Redistributable
bat
can also be customized with a configuration file. The location of the file is dependent on your operating system. To get the default path for your system, call
bat --config-file
Alternatively, you can use BAT_CONFIG_PATH
or BAT_CONFIG_DIR
environment variables to point bat
to a non-default location of the configuration file or the configuration directory respectively:
export BAT_CONFIG_PATH="/path/to/bat/bat.conf"
export BAT_CONFIG_DIR="/path/to/bat"
Set-Item -Force -Path "ENV:BAT_CONFIG_PATH" -Value "path/to/bat/config"
Set-Item -Force -Path "ENV:BAT_CONFIG_DIR" -Value "path/to/bat/"
A default configuration file can be created with the --generate-config-file
option.
bat --generate-config-file
There is also now a systemwide configuration file, which is located under /etc/bat/config
on Linux and Mac OS and C:\ProgramData\bat\config
on windows. If the system wide configuration file is present, the content of the user configuration will simply be appended to it.
The configuration file is a simple list of command line arguments. Use bat --help
to see a full list of possible options and values. In addition, you can add comments by prepending a line with the #
character.
Example configuration file:
# Set the theme to "Gruvbox"
--theme="gruvbox-dark"
# Show line numbers, Git modifications and file header (but no grid)
--style="numbers,changes,header"
# Use italic text on the terminal (not supported on all terminals)
--italic-text=always
# Use C++ syntax for Arduino .ino files
--map-syntax "*.ino:C++"
Refer to Bat Docs
Git
- Config File:
.gitconfig
- Location:
$ENV:USERPROFILE\.gitconfig
- Dependencies: Lazygit, Delta
Git is the version control system (VCS) designed and developed by Linus Torvalds, the creator of the Linux kernel. Git is now used to maintain AUR packages, as well as many other projects, including sources for the Linux kernel.
~/.gitconfig
or ~/.config/git/config
file: Values specific personally to you, the user. You can make Git read and write to this file specifically by passing the --global
option, and this affects all of the repositories you work with on your system. Instead, use --local
to read and write in specific repository.
I've configured git
with these command. I wrote git settings as command intentionally so you can execute them individually and know what it does.
# 1 Setup user identity
git config --global user.name "$yourname"
git config --global user.email "$useremail"
# 2 Set core behaviour
git config --global core.editor "code"
git config --global core.pager "delta" # delta required
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global core.longpaths true
# 3 Set default branch name
git config --global init.defaultBranch main
# 4 Set credential helper (read more: https://git-scm.com/docs/git-credential)
git config --global credential.helper store
# 5 Set UI color
git config --global color.ui auto
# 6 Set VS Code as default difftool
git config --global difftool.default-difftool.cmd "code --wait --diff \$LOCAL \$REMOTE"
git config --global difftool.default-difftool.cmd "code --wait --diff \$LOCAL \$REMOTE" # safer repeat due to nested key
# 7 Set merge and pull option
git config --global merge.renamelimit 99999
git config --global merge.conflictstyle zdiff3 # delta setting
git config --global pull.rebase true
# 8 Fetch optimization
git config --global fetch.parallel 0
# 9 Git Aliases
git config --global alias.br "branch"
git config --global alias.chp "cherry-pick --no-commit"
git config --global alias.ci "commit"
git config --global alias.co "checkout"
git config --global alias.ls "log -n20 --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %C(bold blue)by %an%Creset %C(green)%cr%Creset' --abbrev-commit"
git config --global alias.mrg "merge --no-commit --no-ff"
git config --global alias.pl "pull --recurse-submodules"
git config --global alias.ps "push"
git config --global alias.smu "submodule update --init"
git config --global alias.st "status"
# 10 delta-git diff setting
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
Otherwise, you can craft your own script to automate these configuration automatically.
Neovim
[!note] Neovim configuration has been moved to its own dedicated repository for better versioning and modular management. You can find it here!
- Config File:
init.lua
- Location:
$ENV:LOCALAPPDATA\nvim
- Dependencies: C Compiler, fzf, fd-find, ripgrep, Nerd-Fonts, lazygit (optional)
Neovim is a modern, highly extensible text editor that's a fork of the original Vim editor, built to be more flexible and easier to use. It's designed for programmers and other users who need a powerful, customizable editor for various tasks, including writing code, editing text files, and more.
[!important] Its important to installing C Compiler / Build Tools for Language Server Protocol (LSP) capability in neovim. Simply download This MinGW Binaries Bundle Files and extract it to
C:\
directory and addC:\\minGW64\\bin
path to$PATH
Evironment Variable. See define environment variable in Windows
LazyVim Installation
LazyVim: Setting up Neovim from scratch can be a bit daunting, as it requires configuring many things manually. LazyVim is a "Neovim distribution" (often called a "distro"). It comes pre-configured with a lot of sensible defaults, useful plugins, and a nice interface, making it much easier to get started. Here's the steps:
-
Backup or even remove your current configuration
Move-Item $env:LOCALAPPDATA\\nvim $env:LOCALAPPDATA\\nvim.bak # Optional but remommended to avoid conflicts Move-Item $env:LOCALAPPDATA\\nvim-data $env:LOCALAPPDATA\\nvim-data.bak
-
Clone the starter or you can clone the configured file
# Clone the Starter Boilerplate git clone https://github.com/LazyVim/starter $env:LOCALAPPDATA\nvim # Otherwise, you can use mine git clone https://github.com/alarwasyi98/neovim $env:LOCALAPPDATA\nvim
-
Remove
.git
folder, so you can add your repo laterRemove-Item $env:LOCALAPPDATA\\nvim\\.git -Recurse -Force
-
Start Neovim
nvim
You will prompted to installation process. If there's any error, try to quit and restart neovim. Don't worry, as long as every requirement installed, there will not be any error appear.
Configure, Add, and Overriding Plugins
The files autocmds.lua
, keymaps.lua
, lazy.lua
and options.lua
under lua/config
will be automatically loaded at the appropriate time, so you don't need to require those files manually. LazyVim comes with a set of default config files that will be loaded before your own
~/.config/nvim
βββ lua
β βββ config
β β βββ autocmds.lua
β β βββ keymaps.lua
β β βββ lazy.lua
β β βββ options.lua
β βββ plugins
β βββ spec1.lua
β βββ **
β βββ spec2.lua
βββ init.lua
[!caution] Do not require
autocmds
,keymaps
,lazy
oroptions
underlua/config
orlazyvim.config
manually. LazyVim will load those files automatically.
NuShell
- Config File:
config.nu
- Location:
$ENV:APPDATA\nushell
- Dependencies: None
PowerShell
- Config File:
Microsoft.PowerShell_Profile.ps1
- Location:
$ENV:USERPROFILE\Documents\PowerShell
- Dependencies: Terminal, Nerd-Fonts
PowerShell is a modern command shell that includes the best features of other popular shells. PowerShell accept and returns .NET object and data manipulation.
Actually, For flexibility and modularity, Iβve moved PowerShell repo to an individual repo. I will include it here when the Symbolic link or something like that is widely-supported.
Checkout the PowerShell repository Right Here!
Spicetify
- Config File:
config-xpui.ini
- Location:
$ENV:APPDATA\spicetify
- Dependencies: Spotify Client, Git
Spicetify is a multiplatform command-line tool to customize the official Spotify client that allows users to customize their Spotify appearance as they wish.
You can install the program by running this command in PowerShell as Admin.
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/spicetify/spicetify/cli/main/install.ps1" | Invoke-Expression
Otherwise, Spicetify now available in Winget for Windows-compatibility reason.
winget install --Id Spicetify.Spicetify -e --silent
After the installation successfully, you can configure it by downloading themes outside. I recommend the official theme repository of Spicetify.
Let's move on to configuration and theming our Spotify client. First thing first, clone the official theme repo to your local computer.
[!note] In Linux, Arch-based especially, you can find themes in AUR
git clone --depth=1 https://github.com/spicetify/spicetify-themes.git
cd spicetify-themes
After that, copy the content of the repo to Spicetify Theme Directory.
cp * "$(spicetify -c | Split-Path)\Themes\" -Recurse
Then choose which theme to apply by running:
spicetify config current_theme THEME_NAME
Some themes have 2 or more different color schemes. After selecting the theme you can switch between them with:
spicetify config color_scheme SCHEME_NAME
[!tip] In this case, i'll install
text
theme withgruvbox
scheme so it will look like aspotify-tui
appearance.# Choose the theme spicetify config current_theme text # apply the scheme spicetify config color_scheme gruvbox
Starship
- Config File:
starship.toml
- Location:
$ENV:USERPROFILE\.config\starship
- Dependencies: Nerd-Fonts, Terminal, Shell
Starship is now available in winget
, run the following command to install it.
winget install --Id Starship.Starship -e --silent
After installation successfully, just append the configuration file to starship.toml
file. Usually located in ~/.config/starship.toml
for Linux and MacOS, and $ENV:USERPROFILE\.config\starship
for Windows.
However, it can't start automatically without init
script. Initialize Starship by write the following line in the desired Shell Configuration File.
# ~/.bashrc
eval "$(starship init bash)"
# ~/.zshrc
eval "$(starship init zsh)"
# ~/.config/fish/config.fish
starship init fish | source
# ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Invoke-Expression (&starship init powershell)
# ../config.nu
mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
Superfile
- Config File:
config.toml
- Location:
$ENV:LOCALAPPDATA\superfile
- Dependencies: ffmpeg, Nerd-Fonts.
Superfile (spf
) is sleek and visually appealing, making it a great choice for lightweight file or directory with excellent interface.