Setting up my configs on a new *nix machine

Moving linux distributions is a big deal. Because I've setup my configs exactly the way I wanted. Everything worked best for my workflow, and losing them would make me waste a lot of hours of work. For example, a terminal application called "autojump" will help me navigate through the file system a lot more quickly.

If I visited these directories:

  • ~/.config/nvim
  • ~/projects/gaiden
  • ~/sandbox/struct_test

All I need to do to get inside nvim for example is to just execute j nvim. gaiden? j gai, etc. I recently came up with a simple idea that's been done many times before: Create a github repository filled with your dotfiles called dotfiles!

And in the repository include the configs, as well as a setup.sh file with the following contents:

user="yjh"
config="/home/$user/.config/"

# Powerline fonts
# More info https://powerline.readthedocs.io/en/master/installation/linux.html
pip install --user git+git://github.com/powerline/powerline 
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf

mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/

# Terminal stuff
sudo pacman -Syu yay
yay -S fish alacritty starship exa bat autojump

# Fonts
yay -S noto-fonts-emoji noto-fonts-extra nodejs

mv alacritty/ $config
mv fish/ $config
mv nvim/ $config
mv qtile/ $config

What is does is download the powerline fonts. As a neovim user I have a plugin called airline which is a status bar plugin that displays the status of your editor, whether you're in command mode, insert mode, normal mode, etc. And I like it when it has the powerline style status bar. Which is why that's a must.

After all of that it downloads yay the AUR helper then I use yay to install a variety of apps, including alacritty the terminal emulator, starship prompt which is like a status bar for a terminal. And some other stuff. I download more fonts and node.js which is needed for another one of my neovim plugins CoC which is autocompletion.


Neovim

Neovim configurations are done through .vim files, I have a few of them to separate the files so that everything isn't stuffed into one massive config file, and to be more organized. For example a very important config that I've setup is called <leader>st and set scrolloff=20. <leader>st will start a terminal inside of vim in a resized split. If you start a terminal without additional setup it just spawns in your current window, and takes up all the space. If you're a familiar with IDEs such as VSCode or PyCharm, etc. They have an intergrated terminal, this keybinding does just that. set scrolloff=20 will let me scroll up and down a screen once there are 20 lines remaining either above or below me, without this I would have to scroll to the very bottom of the page, before being able to see what's under me.

<leader>st isn't that simple it's actually all of this:

nnoremap <leader>st :bel split term://fish<cr>:resize 8<cr>i

While set scrolloff=20 is just that.

Plugins

Plugins are very useful extensions to improve the experience, I have quite a few of them with the most important being NERDTree, Telescope, CoC, and gruvbox.

NERDTree

is a file explorer that is superior to the built-in netrw file explorer. It allows you to navigate unfamiliar code bases by checking out the file structure. It also serves as a way to make paths clearer to you so no more quitting out of vim then typing ls.

Telescope

A fuzzy file finder, it can guess which file you want to look for based on what you've typed in the search column. If I would like to edit the file ./src/module/test.rs and I was in src, I do not need to type in module/test.rs in the search bar, simply test.rs will suffice.

Gruvbox

Is a colorscheme, and a favourite of mine, same goes for most people. Gruvbox is the most popular colorscheme for vim. Period. This is a stylistic plugin, and nothing to do with programming.


Fish shell

Fish is my favourite shell , it has auto-complete features, and it's config is very easy to configure, and a variety of functions can be made easily. I have my a custom function called commit which accepts the name of the git branch, and the commit message. And it will automatically be pushed to the appropriate github repository.

If anyone is curious this is what the commit function looks like:

function commit
    set branch $argv[1]
    set message $argv[2]

    git add .

    git commit -am "$message"

    git push origin $branch
end

Qtile

Qtile is my tiling window manager and I have configs set to my preference, so I can move and shift towards different groups. Perform shortcut commands, and run dmenu.