Skip to content

Latest commit

Β 

History

History
1012 lines (769 loc) Β· 23.8 KB

File metadata and controls

1012 lines (769 loc) Β· 23.8 KB
title Optimize Your Computer Experience
sub_title How I Learned to πŸ’œ and Never Leave My Keyboard / Terminal
author Alexander Mark Weber
event Magnetic Resonance Journal Club
date 2025-09-08
theme
name override
catppuccin-mocha
slide_title footer palette
padding_bottom padding_top
1
0
style center right height
template
<span class="noice">_Optimize Your Computer Experience_</span>
{current_slide} / {total_slides}
1
classes
noice
foreground
red
options
implicit_slide_ends incremental_lists list_item_newlines image_attributes_prefix
true
true
2

Intro

As neuroimaging data scientists, we spend much of our time at our computers.

Any inefficiencies we have at the computer can lead to:

Time lost ⏰

  • If we imagine up to one hour per day of inefficiencies, this adds up to 250 hours a year, or 47 workdays lost

Poor health 🍎

  • Constant strain from repetitive mouse movements can cause carpal tunnel syndrome πŸ–

Loss of focus 🎯

  • Task switching or distractions can cause mental fatigue, reduced productivity, and loss of focus.

Intro

This talk will be a highly opinionated set of suggestions designed to help you:

  • get better at your keyboard, and learn to customize it (resist the mouse 🐁)
  • use a better copy / paste application: keep a history, and have favourites on hand
  • use a better screen capture application: allows for instant annotations
  • use a fancy terminal emulator and learn to πŸ’œ the terminal
  • use a terminal multiplexer like tmux
  • use and configure a better shell, like zsh
  • learn to πŸ’œ vim keybindings and use them everywhere
  • lean into new terminal user interfaces that will speed up your life
  • use a window tiling manager

How to use / listen to this talk:

  • Relax
  • Don't worry too much about the details; this talk is meant to expose you to new ideas
  • This talk will be available online as a go-to resource (.md and .pdf)
  • I will include links at the end for those interested in learning more
  • Later, if you like what you see, you can install and try and customize to your heart's content!

Important

A small about of command line / shell / terminal knowledge is helpful

Poll

How many of you already use the command line daily?

echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i

Touch Typing

What is it?

The skill of typing on a keyboard without looking at the keys.

Benefits

  • Multitasking
  • Stay focused
  • Type-as-fast-as-you-think
  • Long-term gains / translatable across jobs

Poll

How do you currently type?

echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i

Touch Typing

Keyboard modifications

Homerow mods

  • Key behaves differently depending on: hold, tap, tap-then-hold

Benefits

  • Reduced strain on your pinky
  • Can free up other keys to be used for other purposes

Touch Typing

Keyboard modifications

Layers

  • Can assign olds keys, like alt to create a new 'mod layer'

Benefits

  • Don't need to move your fingers far from the homerow
  • Customizable to your particular needs
  • Example: numbers to F-keys; HJKL to arrows

Warning

Making these mods can then make it harder to switch back to a normal keyboard. But you get used to it.

Install a Copy/Paste Application with Memory and Favourites

Example Application: CopyQ (Linux, Windows, and macOS)

Benefits

  • Monitors system clipboard and saves its content in customized tabs
  • Saved clipboard can be later copied and pasted directly into any application
  • I have my tray pop-up with Alt+Ctrl+V, then I just pick the number I want
  • Can setup 'pinned' items to always have on hand
  • Can handle images and text

[DEMO]

Install a Better Screen Capture

Example Application: FlameShot (Linux, Windows, and macOS)

Benefits

  • Choose to add an arrow mark, highlight text, blur a section (blur or pixelate an area), add a text, draw something, add a rectangular/circular shaped border, add an incrementing counter number, and add a solid color box
  • Customize the interface color, button selection, keyboard shortcuts, how images are saved

[DEMO]

Install a Better Terminal Emulator

Poll

Who here uses a non-default terminal emulator?

echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i

Install a Better Terminal Emulator

What is it?

Provides access to a terminal and all its applications such as command-line interfaces (CLI) and terminal-based user interfaces (TUI) --- as opposed to a graphical user interface (GUI)

Example Application(s): Alacritty, Wezterm, Kitty, or Ghostty

Benefits

  • improved speed using GPU for rendering
  • rich customization and theming
  • multiplexing and tabs (not all emulators)
  • inline image and media support (not all emulators)
  • so many keyboard shortcuts

[DEMO]

Install a Terminal Multiplexer Like Tmux

What is it?

Allows multiple terminal sessions to be accessed simultaneously in a single window.

Benefits

  • persistent sessions: keep a session running in the background even if you disconnect from the server or close your terminal window
    • prevent data loss
    • work remotely: ssh into a machine, start a tmux session, run some program, 'detach', then logout. Next time you ssh into the machine, run tmux -a to attach to the last session

Install a Terminal Multiplexer Like Tmux

What is it?

Allows multiple terminal sessions to be accessed simultaneously in a single window.

Benefits

  • multi-pane layouts; monitor multiple processes; complex layouts
  • collaboration and shared sessions

[DEMO]

/// clear
tmux

Install a Better Shell (Zsh with plugins)

What is it?

  • Most command lines will use bash out of the box (except macOS now)
  • zsh is an extended version of the Bourne Shell (sh)

Benefits

  • Automatic cd: Just type the name of the directory
  • Recursive path expansion: For example "/u/lo/b" expands to "/usr/local/bin"

Install a Better Shell (Zsh with plugins)

Benefits

  • Automatic syntax highlighting: words, file extensions, and other things visible in the Terminal are color-coded
  • Autocompletion of command-line options and arguments
  • Plugin and theme support: ZSH includes many different plugin frameworks (oh-my-zsh)

[DEMO]

/// clear
/// docker run -it ubuntu-zsh-curl

Learn Vim (Keybindings)

Poll

Who here uses vim or vim keybindings?

echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i

Learn Vim (Keybindings)

What is Vim?

  • Powerful, open-source text editor.
  • Known for 'modal-editing': different modes for different tasks (and memes about not knowing how to exit)

Benefits

  • Nearly every action is performed with a key command: edit text without ever taking your hands off the keyboard
  • Powerful combos and 'motions'
  • Macros
  • Column-wise visual selection

Learn Vim (Keybindings)

Benefits

  • Fully customizable
  • Plugins allow you to shape vim/nvim into almost any IDE
  • Super lightweight and fast
  • Installed by default on most systems
  • Modal editing trains muscle memory, so your hands just do the edit without breaking your thought process
  • Vim has been around for decades and is still actively developed

[DEMO]

/// clear
/// source ~/.zshrc
vim

Learn Vim (Keybindings)

Install Vim plugins on everything

In your shell

In your .zshrc file, add (or set -o vi in .bashrc):

bindkey -v

Now, when you are in the terminal and you press Esc, you will be able to edit your commands

[DEMO]

/// clear
/// source ~/.zshrc
/// zsh

Builtin commands use vim motions: less, more, man, git while diff viewing

In your browser

  • Navigate the web without touching the mouse.
  • Use a clever highlighting method to click on links.
  • Available for Chrome, Edge, and Firefox

[DEMO]

Vim plugins for other apps

  • VSCode
  • Rstudio
  • Jupyter lab
  • PDF Readers like Zathura

Better Terminal Apps

bat - read files in color (replace cat)

eza - list files in color (replace ls)

fzf - fuzzy finding: can be combined with so many other CLI applications

zoxide - better directory navigation (replace cd)

yazi - file manager (or ranger, or vifm)

rg - better word search (replace grep)

fd - better file finder (replace find)

lazygit - TUI for git management

Better Terminal Apps: bat

What is bat?

bat is simply a more colorful/useful version of builtin cat

/// source ~/.zshrc
cat ~/Scripts/AvalancheText/avytext.py
/// source ~/.zshrc
/// alias bat='bat -f -p'
bat ~/Scripts/AvalancheText/avytext.py

Better Terminal Apps: eza

What is eza?

eza is simply a more colorful/useful version of builtin ls

/// source ~/.zshrc
/// alias ls='\ls --color=always'
ls -l ~/Arduino/libraries/ 

Better Terminal Apps: eza

What is eza?

eza is simply a more colorful/useful version of builtin ls

/// source ~/.zshrc
/// alias eza='eza --color=always'
eza -l ~/Arduino/libraries/

Better Terminal Apps: fzf

What is fzf?

fzf allows you to 'fuzzy' search files / directories / history / more

Benefits

  • don't need to type exact strings
  • interactive selection
  • works with virtually any command that produces line-based output
  • real-time filtering: results update instantly as you type
  • multi-select capability
  • preview integration
  • fully customizable

Better Terminal Apps: fzf

[DEMO]

  • Ctrl+R
  • Alt+C
  • Ctrl+T
  • kill -9 **<TAB>
  • git log --oneline | fzf --preview 'git show {1}'
  • env | fzf | cut -d'=' -f1 | xargs -I {} sh -c 'echo ${} | xclip -sel clip'
  • apt list | fzf -m | cut -d'/' -f1 | xargs sudo apt install
  • docker ps | fzf | awk '{print $1}' | xargs docker exec -it {} /bin/bash

Note

| is a 'pipe', making the output of one command the input of the next

Better Terminal Apps: rg

What is rg?

rg or ripgrep, is a modern, extremely fast command-line search tool that recursively searches directories for regex patterns

Note

regex stands for regular expressions, and is used to specify a match pattern in text. Example: /r[aeiou]+/g: for lowercase r followed by one or more lowercase vowels

Benefits

  • much faster than the builtin grep
  • skips hidden files by default (can be disabled with --hidden)
  • colored output by default, file type filtering, case-insensitive search

Better Terminal Apps: rg

Examples

/// source ~/.zshrc
/// alias rg='rg --pretty'
rg "docker ps"

Better Terminal Apps: rg

Examples

/// source ~/.zshrc
/// alias rg='rg --pretty'
rg -C 1 "docker ps"

Better Terminal Apps: rg

More ideas

  • Open matching files in editor: rg -l "bug" | xargs $EDITOR
  • Pipe to fzf for interactive selection: rg "class " --type py | fzf | xargs $EDITOR
  • Search in specific directories only: rg "api_key" src/ config/
  • Search hidden files too: rg "secret" --hidden
  • Ignore .gitignore rules: rg "temp" --no-ignore
  • Create .rgignore file for project-specific ignores: echo "*.log" >> .rgignore

Better Terminal Apps: fd

What is fd?

fd is an alternative to the traditional find command

Benefits

  • significantly faster than find due to parallel directory traversal, performance optimization, smart filtering and pruning
  • simpler syntax than find
  • regex patterns by default (can be disabled with -F)
  • skips hidden files by default (can be disabled with -H)
  • colored output by default, file type filtering, case-insensitive search (can be disabled with -s)

Better Terminal Apps: fd

Examples

  • Find only files (not directories): fd -t f "pattern"
    • -t d for directories;
    • -t x for executables;
    • -t l for symlinks
  • Find files with multiple extensions: fd "\.(js|ts|jsx|tsx)$"

  • Find files modified within last day: fd --changed-within 1day

  • Find files larger than 100MB: fd --size +100m

  • Find empty files: fd --size 0
  • Pipe to fzf for interactive selection: fd | fzf --preview 'bat {}'

  • Find and execute command on each: fd "\.log$" -x rm {}

  • Same as above but piped to fzf first with multi-select: fd "\.log$" | fzf -m | xargs rm

Better Terminal Apps: zoxide

What is zoxide?

zoxide is an alternative to cd to enter directories. It learns your habits and lets you quickly navigate to frequently and recently used directories.

Benefits

  • Tracks directory frequency and recency using a ranking algorithm - the more you visit a directory, the higher it ranks.
  • Fuzzy matching: You don't need to type exact directory names. Type partial matches and zoxide figures out where you want to go.
  • Speed: Much faster than manually typing long paths or using cd ../../some/long/path

Better Terminal Apps: zoxide

Comparison

cd

cd /home/user/projects/awesome-proj/src/components

zoxide (after having visited the directory before)

z components      # Jumps directly there
z awesome src     # Fuzzy match multiple parts
z proj comp       # Even shorter matches work

Other features

  • zoxide query doc: Shows where 'z doc' would take you
  • zoxide query --list: List all tracked directories with scores
  • zoxide remove /path/to/old/project: Remove directories from database
  • zi: can be setup as interactive mode with fzf

[DEMO]

/// clear
/// source ~/.zshrc
zi

Better Terminal Apps: yazi or vifm

What are terminal file managers?

yazi and vifm are terminal-based file managers that provide visual, keyboard-driven file navigation and management.

Benefits

  • Fast
  • Rich previews (images, pdfs, code with syntax highlighting)
  • Customizable, extendible with plugins
  • Multi-file select
  • Multi-pane or -tab
  • Vim key bindings
  • Rename in batch
  • Preview archive contents without extracting
  • Integration with fzf for searching
  • Bookmark frequently used directories

[DEMO]

/// clear
/// source ~/.zshrc
yazi

Better Terminal Apps: lazygit

What is it?

A simple terminal-based user interface (TUI) for Git. It provides an interactive, visual way to perform Git operations without having to remember complex Git commands or type them repeatedly.

Benefits

  • Visual git workflow: branches, commits, staged/unstaged changes, and file diffs
  • Simplified staging: you can stage and unstage files or even specific lines within files using simple keyboard shortcuts, making it much easier to craft precise commits.
  • Interactive rebasing: Complex operations like interactive rebasing, squashing commits, or reordering commit history
  • Commit history navigation: Browse through commit history with ease, view diffs between commits

[DEMO]

/// clear
lazygit

Install a Window Tiling Manager

What is it?

A type of window manager that automatically arranges windows in non-overlapping tiles that fill the entire screen, unlike traditional "floating" windows.

Benefits

  • Maximum screen utilization
  • Side-by-side windows (documents)
  • Multitasking efficiency
  • Keyboard driven

Customize with Keyboard Shortcuts

  • Navigate between windows/workspaces
  • Move windows around or between workspaces
  • Turn tiling on/off/stacked

[DEMO]

Summary

This talk was a highly opinionated set of suggestions designed to help you:

  • get better at your keyboard, and learn to customize it (resist the mouse 🐁)
  • use a better copy / paste application: keep a history, and have favourites on hand
  • use a better screen capture application: allows for instant annotations
  • use a fancy terminal emulator and learn to πŸ’œ the terminal
  • use a terminal multiplexer like tmux
  • use and configure a better shell, like zsh
  • learn to πŸ’œ vim keybindings and use them everywhere
  • lean into new terminal user interfaces that will speed up your life
  • use a window tiling manager

Poll

Which tool from today are you most excited to try?

echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i

Resources

Touch typing skills:



Modifying your keyboard:

Kmonad:
karabiner-elements: (macOS)

Better Copy / Paste:

CopyQ:

Better Screen Capture

Flameshot:

Terminal Emulators

Wezterm:
Kitty:
Alacritty:
Ghostty:

Tmux

tmux:
oh-my-tmux:

Zsh

oh-my-zsh:

Vim and Neovim

Vim:
Neovim:
Lazyvim (neovim distro):
run :Tutor inside vim/neovim to learn
πŸ“˜ Practical Vim by Drew Neil πŸ“˜

Resources

Get better at the command line

πŸ“˜ Efficient Linux at the Command Line by Daniel J. Barrett πŸ“˜
SFU has courses all the time

Modern TUIs

bat:
eza:
fzf:
rg:
fd:
zoxide:
yazi:
vifm:
lazygit:

Window Tiling Managers

Aerospace for MacOS:
Pop-shell for Linux operating systems:

Dotfiles:

tmux, vim, zsh, vifm:

Thank You

Download

This talk can be downloaded from

OptimizeYourComputerExperienceTalk_presenterm.md

Run with presenterm (need to install first) from a terminal (works best with Kitty)

Or view as Pdf: OptimizeYourComputerExperienceTalk.pdf

width:40%

Links



ξ·€

ο‚›

figlet -f big "Questions?" | lolcat -f
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i