Skip to the content.

Productivity shortcuts & settings

Iterm2

Shortcuts

Hotkey Window

To configure ITerm 2 hot key window.

  1. Open iTerm2
  2. Go to preference > Keys > Hotkey
  3. “Create a Dedicated HotKey Window”
  4. On the Hotkey, choose the shortcut by holding Ctrl and h. Then click ok to create
  5. Ctrl + h to open use hotkey window
  6. Set background image randomly. Download file from https://github.com/jamsyoung/iterm2-random-background to ~/Downloads. Then go to iterm2 Preferences/profiles/general and add the execution code osascript ~/Downloads/iterm2-random-background.scpt (I think osa means os Apple?) in “Send text at start”.

Cool things to configure

  1. Configure iterms to either be transparent or use background image. (Preferences>profile>(select the correct profile)>windows)
  2. Use the ubuntu colors! (Preferences>profile>colors)
  3. Use ZSH_THEME="powerlevel10k/powerlevel10k" in the .zshrc file. May have to install oh-my-zsh.

Remap keys

https://apple.stackexchange.com/questions/89981/remapping-keys-in-iterm2 In iterm2, go to Preferences/keys/keybindings then we can add custom key binding. For example, I want to remap cmd + / to gc. I’ll do cmd + / in the keyboard shortcut, and select send hex code. To find out the hex code for gc, I use the app Key Codes in Mac and type gc in the app. The code is the last part of unicode. For example, g is 0x67 and c is 0x63.

Some random cool terminal apps

Shortcuts

Extensions

shortcuts. - shift+left, shift+right to go back and go forward (in url) - command+left, command+right to move between tabs. - Note: there’re some issues with command on a new tab: https://github.com/mikecrittenden/shortkeys/issues/44. The solution is to use Chrome native shortcut UI via this extension. See bottom of this page https://github.com/mikecrittenden/shortkeys/wiki/How-To-Use-Shortkeys. Basically, need to go to chrome://extensions/shortcuts and configure the shortcut there instead. chrome://extensions/configureCommands

Mac

Shortcuts

Cool apps

Spectacle

Window manager. It shows all the shortcuts in the app. Move left/right, move top left/right, move bottom left/right, move center, move full-screen

Mac Spaces & Mission Control

AppCleaner

List of cool apps: https://www.youtube.com/watch?v=RNqDkF17ogY&t=411s&ab_channel=devaslife

Alfred

Replacement for Spotlight search.

Raycast

Free alternative for Alfred

CursorEffect 2

Make the mouse look pretty

Keycastr

Capture the typed keys

Istat Menu

Display stuff like weather, cpu, memory usages in the top bar.

InsomniaX

Disable lid sleep. Used to be good for stuff like training ML models over night on Jupyter notebook, and we want to disable Mac autosleep.

Aerial companion

Beautiful desktop and screensaver based on Apple 4K video TV.

Dozer

Arrange the menu bar/hide application. Free alternative to Bartender.

Weather live widget (appstore)

Slick app to display weather / current temperature on the menu bar.

VSCode

Shortcuts

To change keyboard shortcuts. Open command palette and search for keyboard shortcuts

Trick to find out what the command’s name for a key binding. E.g. I don’t know what the name of the command associated with Cmd + W. Go to keyboard shortcuts, search for tab and pick a random tab command that has no key binding. Then, try to add Cmd + W key binding to it. VSCode will warn that there are already existing commands and you can see what they are. Alternatively, put the command in bracket and search in keyboards i.e. search for "cmd + w"

Useful reference: https://zellwk.com/blog/useful-vscode-keyboard-shortcuts/

Configure

  1. Make vscode transparent by installing vibrancy. Can see through the background
  2. Use bearded or spotify or github themes
  3. Use the (anime) background extension
  4. (Of course) use vim extension (with vimrc linked! Can config this in user settings)
  5. Use github copilot (It’s insanely smart. Holy smoke!)
  6. Use extensions for specific language (e.g. Python, Javascript suppport have separate extensions).

Vim

Shortcuts

Commands

Panes

Sourcing files

:so nameOfTheFile in vim to source a .vimrc or something.vim file or :so % to source the current file

Autocomplete

Macros

Macros: combinations of keys

Store macros to register

  1. qa (store to register a)
  2. then type some command
  3. q finish recording macro
  4. @a repeat last op from register

Terminal

https://www.youtube.com/watch?v=8m5t9VDAqDE&t=122s&ab_channel=ThePrimeagen Neovim (and vim) has terminal. Use ctrl+\ ctrl+n to leave the terminal (insert) mode. Do :terminal to open in new tab or :split | terminal or :vsplit | terminal to open in new split. Trick: (Primageon) when there’s an error message coming from file abc.xyz we can put the cursor under the file and hit ctrl+w f to go to that file

Packages

Install color theme

Download a something.vim from github. Then put that into ~/.vim/colors. Then, we can use “:colorscheme something” to set the color.

Primageon

https://www.youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw The goat!!

https://www.youtube.com/watch?v=nnhqVDIx-go&ab_channel=ThePrimeagen: More navigation

Configure

Configure the file .vimrc in the root directory

Neovim

Neovim also supports github copilot! https://github.com/github/copilot.vim. It’s also easy to sync vim and neovim configs https://vi.stackexchange.com/questions/12794/how-to-share-config-between-vim-and-neovim. Only need to put the following

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
source ~/.vimrc

in ~/.config/nvim/init.vim file.