Terminal Emulators
The terminal emulator is basically which terminal program you are using. Most distributions come with the default desktop-environment terminal, and these are usually good enough. There are many more out there though, some with very useful features.
Personally, I highly recommend using the kitty terminal. Kitty is fast, simple, and has a lot of built-in features that make it very efficient. For example, you can have multiple terminal windows in one instance without having to open two terminals. It effectively replaces something like tmux.
Kitty also has some nice default themes, and an easy font changer. If you use kitty, make sure to read the documentation and setup your config.
bashrc/zshrc
So, I recommend actually compartmentalizing your .bashrc, or .zshrc.
I did this by creating a new directory in .config -
[ mkdir ~/.config/.zsh ] - I then made some files in this directory:
[ touch aliases func bashfetch autostart ]
aliases - contains all of my aliases
func - contains custom functions
bashfetch - a very simple and basic fetch script written in bash
autostart - everything else
At the top of .zshrc I begin by sourcing my two plugins, auto suggestions and fast syntax highlighting. Then I source the configuration files with this syntax:
[ source ~/.config/.zsh/aliases ] - And so on for each of the created files.
zsh will then load these files, this way I do not have to work with a really long .zshrc file.
Some Personal Aliases
The shell you use is usually managed in a dot file. For bash this is .bashrc, for zsh it is .zshrc. This file is essentially loaded each time you run the shell, so for example if you put "ls ~" at the bottom of this file, each time the shell is loaded, it will list all files/directories in ~ or in your current user home directory.
In this file, you can set command aliases. For example, instead of typing "sudo pacman -Rns" to destroy a package off of your system, you can write "alias nuke='sudo pacman -Rns'", and now typing the nuke command will run that command.
Personally, I like using ls to list everything, and l to list non-hidden files in a single list. I use lsd as an ls replacement, but for core ls, you can use:
alias l='ls -1'
alias ls='ls -a1'
I use vi, v, e, and edit all for vim.
Some more aliases I use:
alias pls="sudo"
alias cls="clear && zsh" | or "clear && bash" if using bash
alias cat ="bat --color=always"
alias find="fd"
alias f="fd"
alias grep="rg"
alias g="rg"
alias l="lsd -1"
alias ls="lsd -al"
alias update="sudo pacman -Syu && paru -Syu"
alias copy="xclip -selection clipboard"
alias rb="reboot"
This is like my bare minimum setup on my devices, it obviously requires some additional packages.
functions
I have made some pretty basic functions for my zsh setup. I will omit my gcc compile then run script because it is long and not very useful for most people, but it essentially compiles a binary with gcc and asks if we want to run it, made for convenience.
The first function is to run ls after we cd.
I do not know if there are code blocks so im just going to write these in-line
cd () { builtin cd "$@" && lsd -1 }
The next one is something that could be done with aliases but I made it a function, it will open .zshrc in a text editor.
editrc() { ${EDITOR:-vim} ~/.zshrc }
Borderline useless because an alias could achieve the same thing:
alias editrc="vim ~/.zshrc"
Anyway, you can define all sorts of functions here, and have them do all sorts of crazy things.
Autostart / Misc
You can define a prompt by setting the PS1 variable.
PS1='prompt'
Mine is set to the following:
PS1='%F{blue}[%1~] $ %f'
Pretty bare bones and vanilla but it works. You could also look into starship which is a pretty clean prompt plugin.
Maybe soon I will share my bashfetch script, but it will need to be uploaded somewhere before I can do so. Hopefully this was helpful or interesting to someone.
Comments
Displaying 1 of 1 comments ( View all | Add Comment )
5_5
good stuff!!!
Thanks!
by arc0; ; Report
i wish i could send you a friend request y.y
by 5_5; ; Report