Skip to main content

Fancy console

Components

  • bash
  • starship
  • tmux
    • tmux plugin manager
    • bacula theme with top bar formatting
  • bat - a cat clone with wings (syntax highlighting +++)

Starship

Install Starship

curl -sS https://starship.rs/install.sh | sh

Configure shell to run it

# for BASH
cat <<EOF > ~/.bashrc
eval "$(starship init bash)"
EOF
# for FISH
cat <<EOF > ~/.config/fish/config.fish
starship init fish | source
EOF
# for PowerShell
# Add the following to the end of your PowerShell configuration (find it by running $PROFILE):
Invoke-Expression (&starship init powershell)
# for Xonsh
cat <<EOF > ~/.xonshrc
execx($(starship init xonsh))
EOF
# for 
cat <<EOF > ~/

EOF

Configure to use preset

Make it pretty!

starship preset pastel-powerline -o ~/.config/starship.toml

Customize the preset

Adding the hostname to the prompt by editing the file ~/.config/starship.toml

.
.
$username\
$hostname\
.
.

[hostname]
ssh_only = false
style = "bg:#9A348E"
format = '[$ssh_symbol$hostname ]($style)'
trim_at = '.'
disabled = false

tmux configuration

The configuration below includes:

  • tmux plugin manager
  • dracula theme with top bar formatting
sudo apt install tmux
mkdir ~/.config/tmux

cat <<EOF > ~/.config/tmux/tmux.conf
#improve colors
set -g default-terminal 'screen-256color'

# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+

# change prefix key because this is easier to hit
set -g prefix2 C-s

# reload config
unbind r
bind r source-file ~/.config/tmux/tmux.conf

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

set -g @plugin 'dracula/tmux'

set -g @dracula-show-powerline true
set -g @dracula-fixed-location "Baton Rouge"
set -g @dracula-plugins "weather"
set -g @dracula-show-flags true
set -g @dracula-show-left-icon session
set -g status-position top
  
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'EOF

bat / batcat

I keep forgetting about this tool.

https://github.com/sharkdp/bat

-end