Linux installation scripts and dotfile customization
My Macbook Pro from circa 2014 was getting more and more angry with me each time I would update the OS. Many applications were too cumbersome to run. I was just beginning to work on more complex software projects and my editing, compilation, and especially browsing workflow became annoyingly slow.
I wanted to make the system as lightweight as possible and after some research I chose to back everything up, wipe the drive, and install Linux. The installation process was so smooth and as soon as I rebooted my computer, instant speed. I downloaded some applications that would barely work before, namely Firefox, and was amazed at how quickly it launched and even ran with no problems. And so began my love of Linux...
I enjoy creating custom installation scripts, configuration files, and doing other miscellaneous computer automation. Bash scripts have become a near daily task with my job and my other projects.
I keep my dotfiles in a github repository and the following is a script to link all configuration files to their correct locations.
#!/bin/bash
mkdir $HOME/.config
ln -snvf $(pwd)/i3 $HOME/.config/
ln -snvf $(pwd)/i3status $HOME/.config/
ln -snvf $(pwd)/nvim $HOME/.config/
ln -snvf $(pwd)/.bashrc $HOME/.bashrc
ln -snvf $(pwd)/.xinitrc $HOME/.xinitrc
ln -snvf $(pwd)/.gitconfig $HOME/.gitconfig
ln -snvf $(pwd)/.alacritty.yml $HOME/.alacritty.yml
ln -snvf $(pwd)/.tmux.conf $HOME/.tmux.conf
#
# By adding $HOME/.scripts to my path
# I can create custom executables
# and run them as a shell command
#
ln -snvf $(pwd)/.scripts $HOME
Here's a cool little bash function that I use in some of my scripts to check if a command exists.
check_cmd () {
if ! command -v $1 &> /dev/null; then
echo $2
exit
fi
}
Neovim
I had a TA in college who suggested I try Vim. He showed me some cool features and explained the power of text objects and motions. I didn't really process this interaction until about a year after when going through the process of overhauling my machine. With my minimal system in mind, instead of installing my old text editor, I decided to continue using Vim for the day because I had been using it to edit some system config files.
It was frustrating to navigate at first and I would constantly be looking up commands and using the arrow keys. When researching ways to accomplish certain actions, there were many commands that looked like gibberish but I tested each to see what they did. I found this process to be incredibly rewarding.
I have been using only Vim, or one of it's flavors, for probably about two years and while I am still very much a beginner, I can honestly say I don't think I will ever be able write code without the Vim motions and tools. I use Neovim, a Vim-fork focused on extensibility and usability.
Some things I like about Neovim and some of my set up.
- Lua for plugins, scripting, and configuration.
- Built-in LSP for interfacing with language servers.
- Packer, a plugin manager.
- Telescope, a versatile plugin for finding, filtering, previewing, grepping, and more...
- Treesitter, a plugin for Tree-sitter parsing.