| 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 |
|
||||||||||||||||||||||||||||
| options |
|
As neuroimaging data scientists, we spend much of our time at our computers.
Any inefficiencies we have at the computer can lead to:
- If we imagine up to one hour per day of inefficiencies, this adds up to 250 hours a year, or 47 workdays lost
- Constant strain from repetitive mouse movements can cause carpal tunnel syndrome π
- Task switching or distractions can cause mental fatigue, reduced productivity, and loss of focus.
- 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
- 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 (
.mdand.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
How many of you already use the command line daily?
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8iThe skill of typing on a keyboard without looking at the keys.
- Multitasking
- Stay focused
- Type-as-fast-as-you-think
- Long-term gains / translatable across jobs
How do you currently type?
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i- Key behaves differently depending on: hold, tap, tap-then-hold
- Reduced strain on your pinky
- Can free up other keys to be used for other purposes
- Can assign olds keys, like
altto create a new 'mod layer'
- 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.
- 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]
- 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]
Who here uses a non-default terminal emulator?
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8iProvides 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)
- 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]
Allows multiple terminal sessions to be accessed simultaneously in a single window.
- 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:
sshinto a machine, start atmuxsession, run some program, 'detach', then logout. Next time yousshinto the machine, runtmux -ato attach to the last session
Allows multiple terminal sessions to be accessed simultaneously in a single window.
- multi-pane layouts; monitor multiple processes; complex layouts
- collaboration and shared sessions
[DEMO]
/// clear
tmux- Most command lines will use
bashout of the box (except macOS now) zshis an extended version of the Bourne Shell (sh)
- Automatic
cd: Just type the name of the directory - Recursive path expansion: For example "/u/lo/b" expands to "/usr/local/bin"
- 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-curlWho here uses vim or vim keybindings?
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8i- Powerful, open-source text editor.
- Known for 'modal-editing': different modes for different tasks (and memes about not knowing how to exit)
- 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
- 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
vimIn your .zshrc file, add (or set -o vi in .bashrc):
bindkey -vNow, when you are in the terminal and you press Esc, you will be able to edit your commands
[DEMO]
/// clear
/// source ~/.zshrc
/// zshBuiltin commands use vim motions: less, more, man, git while diff viewing
- Navigate the web without touching the mouse.
- Use a clever highlighting method to click on links.
- Available for Chrome, Edge, and Firefox
[DEMO]
- VSCode
- Rstudio
- Jupyter lab
- PDF Readers like Zathura
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.pyeza is simply a more colorful/useful version of builtin ls
/// source ~/.zshrc
/// alias ls='\ls --color=always'
ls -l ~/Arduino/libraries/ eza is simply a more colorful/useful version of builtin ls
/// source ~/.zshrc
/// alias eza='eza --color=always'
eza -l ~/Arduino/libraries/fzf allows you to 'fuzzy' search files / directories / history / more
- 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
[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 installdocker 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
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
- 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
/// source ~/.zshrc
/// alias rg='rg --pretty'
rg "docker ps"/// source ~/.zshrc
/// alias rg='rg --pretty'
rg -C 1 "docker ps"- 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
fd is an alternative to the traditional find command
- significantly faster than
finddue 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)
- Find only files (not directories):
fd -t f "pattern"-t dfor directories;-t xfor executables;-t lfor 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
fzffirst with multi-select:fd "\.log$" | fzf -m | xargs rm
zoxide is an alternative to cd to enter directories. It learns your habits and lets you quickly navigate to frequently and recently used directories.
- 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
zoxidefigures out where you want to go. - Speed: Much faster than manually typing long paths or using
cd ../../some/long/path
cd /home/user/projects/awesome-proj/src/componentsz components # Jumps directly there
z awesome src # Fuzzy match multiple parts
z proj comp # Even shorter matches work
zoxide query doc: Shows where 'z doc' would take youzoxide query --list: List all tracked directories with scoreszoxide remove /path/to/old/project: Remove directories from database
zi: can be setup as interactive mode withfzf
[DEMO]
/// clear
/// source ~/.zshrc
ziyazi and vifm are terminal-based file managers that provide visual, keyboard-driven file navigation and management.
- 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
fzffor searching - Bookmark frequently used directories
[DEMO]
/// clear
/// source ~/.zshrc
yaziA 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.
- 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
lazygitA type of window manager that automatically arranges windows in non-overlapping tiles that fill the entire screen, unlike traditional "floating" windows.
- Maximum screen utilization
- Side-by-side windows (documents)
- Multitasking efficiency
- Keyboard driven
- Navigate between windows/workspaces
- Move windows around or between workspaces
- Turn tiling on/off/stacked
[DEMO]
- 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
Which tool from today are you most excited to try?
echo https://www.menti.com/alzie6uycsir | qrencode -t utf8iKmonad:
karabiner-elements: (macOS)
Wezterm:
Kitty:
Alacritty:
Ghostty:
Vim:
Neovim:
Lazyvim (neovim distro):
run :Tutor inside vim/neovim to learn
π Practical Vim by Drew Neil π
π Efficient Linux at the Command Line by Daniel J. Barrett π
SFU has courses all the time
bat:
eza:
fzf:
rg:
fd:
zoxide:
yazi:
vifm:
lazygit:
Aerospace for MacOS:
Pop-shell for Linux operating systems:
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
figlet -f big "Questions?" | lolcat -fecho https://www.menti.com/alzie6uycsir | qrencode -t utf8i










