Skip to content

Settings of my terminals (UI, plugins, aliases, etc.)

License

Notifications You must be signed in to change notification settings

pyxelr/my-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My Terminal

The applied terminal varies by the host OS:

Additionally, I have included my NeoVim (text editor) config which is OS agnostic.

This repo only does not list my IDE: VS Code settings.

🍎 iTerm2

iTerm2 - my main terminal for macOS.

🎨 Appearance

iTerm2

πŸ‘¨β€πŸ’» Zsh settings

  • Framework: Oh My Zsh
  • Prompt: Starship
    • If you have installed conda, I suggest to disable printing environment names, as they will be displayed already by Starship: conda config --set changeps1 False

Plugins

Oh My Zsh plugins:

External plugins:

Shell aliases

Note

Since 2024/01/07, I keep my core text-expansion config in my-espanso-config.

I recommend keeping aliases in the ~/.aliases file, and then source this file in your respective profile file through source ~/.aliases. Keep in mind that a bunch of aliases is already configured through the aforementioned Oh My Zsh plugins, which you can quickly check using the aliases plugin.

general:

  • alias aliases='code ~/.aliases' ← quickly open ~/.aliases in VS Code
  • alias lisl='exa -hla --icons' ← better ls with exa
  • alias list='exa -hlas time --icons' ← better ls with exa (ordered by time)
  • alias treee='br -c :pt' ← better tree with broot
  • alias path='echo -e ${PATH//:/\\n}' ← show all directories in the PATH variable, one per line
  • alias ports='netstat -a | grep -i "listen"' ← show all open ports and the processes using them
  • alias reload='source ~/.zshrc' ← reload the configuration file for zsh
  • alias zshrc='code ~/.zshrc' ← quickly open ~/.zshrc in VS Code

kubernetes:

  • alias k8s-get-pods='kubectl get pods --all-namespaces' ← get the list of all pods
  • alias k8s-get-services='kubectl get services --all-namespaces' ← get the list of all services

macOS:

  • alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" ← find and delete all .DS_Store files in the current directory and all subdirectories

functions:

  • check if a website is up or down:

    function website-status(){
      curl -Is "$1" | head -n 1
    }
  • open finder in the current folder:

    function openfinder(){
        open -a Finder "$1";
    }

Shell tools

You can find a list of my recommended shell tools in my other repo.

✨ Extras

Extra iTerm2 configuration:

  1. Jump between words with βŒ₯ + ←/β†’
    • Settings > Profiles > Keys > Key Mappings > +
      • Keyboard shortcut: βŒ₯ ←, Action: Send Escape Sequence, Esc+: b
      • Keyboard shortcut: βŒ₯ β†’, Action: Send Escape Sequence, Esc+: f
  2. Delete words with βŒ₯ + BACKSPACE
    • Settings > Profiles > Keys > General
      • Left and Right option keys: change from Normal to Esc+

πŸ–₯ Windows Terminal

Windows Terminal - my main terminal for Windows.

🎨 Appearance

Windows Terminal

πŸ‘¨β€πŸ’» Profiles

Command Prompt

Git Bash

Install Git Bash from here.

Add profile to Windows Terminal:

  • Name: Git Bash
  • Command line: %PROGRAMFILES%/Git/bin/bash.exe -i -l
  • Starting directory: %USERPROFILE%
  • Icon: %PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico

Extras:

  • Prompt: Starship
  • To be able to activate conda environments, you may also need to set a system variable: PYTHONIOENCODING=utf8

.bash_profile:

# Set Starship theme
eval "$(starship init bash)"

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
eval "$('/c/Users/pawel/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
# <<< conda initialize <<<

PowerShell 7

I am using PowerShell 7 in addition to the native Windows PowerShell 5.

Extras:

$PROFILE:

# Set Starship
Invoke-Expression (&starship init powershell)

# Show navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

# Autocompletion for arrow keys
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward

WSL - Ubuntu 22.04 (LTS)

Install Ubuntu:

  1. Set a default version of WSL: wsl --set-default-version 2.
  2. Install Ubuntu 22.04 LTS.

Setup the environment:

  1. Start with sudo apt update and sudo apt upgrade.
  2. Install Zsh, Oh My Zsh and Starship.
  3. Copy the πŸ‘¨β€πŸ’» Zsh settings.

Extras:

  • Disable beep sound in Windows Terminal settings for the Ubuntu Profile (Advanced > Bell notification style)
  • If you have installed conda, I suggest to disable printing environment names, as they will be displayed already by Starship: conda config --set changeps1 False.

🐧 Neovim

Neovim - my main text editor used within the terminal of any OS.

🎨 Appearance

Neovim

πŸ‘¨β€πŸ’» Setup

  1. Make sure you have set up the local terminal of your OS (ideally as in this repo).

  2. Follow the installation steps of Neovim and NvChad.

  3. Post installation steps to set up the config files:

    cd ~/.config/nvim
    mkdir lua/custom
    cp examples/init.lua lua/custom/init.lua
    cp examples/chadrc.lua lua/custom/chadrc.lua
  4. Edit ~/.config/nvim/lua/custom/chadrc.lua (apply chadracula theme and enable dashboard):

    local M = {}
    
    M.ui = {
      theme = "chadracula",
    }
    
    M.plugins = {
      user = {
          ["goolord/alpha-nvim"] = {
            disable = false,
          },
      },
    }
    
    return M
  5. Start Neovim with nvim and do :PackerSync. You can also display the file explorer with CTRL + N.

  6. Optionally, apply Neovim in your IDE, such as in VS Code through the VSCode Neovim extension.

πŸ€– Termux

Termux - my main terminal for Android installed from F-Droid.

🎨 Appearance

Termux

UI modified with Termux:Styling (obtained from F-Droid):

  • Theme: Dracula
  • Font: FiraCode (JetBrains Mono does not support icons of exa --icons)
  • Keyboard: Gboard

πŸ‘¨β€πŸ’» Setup

  1. Install F-Droid, and use it to install Termux with Termux:Styling.
  2. Open up Termux and start with apt update and apt upgrade.
  3. Install extra packages: pkg install git, pkg install python and pkg install vim.
  4. Install Zsh (pkg install zsh), Oh My Zsh and Starship (pkg install starship).
  5. Copy the πŸ‘¨β€πŸ’» Zsh settings.
  6. Optionally, install further tools such as Tool-X.