⌨️ Single shortcut to search them all

May 04, 2022

About

Map CMD + K to find them all! It’s by default set in most of the apps to open search bar or start similar activity. Make use of it and set it in different apps like e.g. VIM. Here is the list of activities, invoked by using this shortcut, that are available by default or were mapped by me:

  • Jump to a conversation in Slack
  • Open GitHub Command Palette
  • Start VIM with opened fuzzy finder (custom solution)
  • Switch quickly between notes in Obsidian (needs remaping)

The most important thing is to match the same shortcut with the same functionality regardless of the application you are using.

Jump to a conversation in Slack

Slack has many shortcuts available by default. CMD + K is mapped to a Jump to a conversation action. For me it’s the most important and probably the only one you will ever need. After you hit it, you can type and switch between channels and messages. You will also see unread and draft messages in propositons or the channels you are most active in.

slack

Open GitHub Command Palette

In GitHub CMD + K is mapped to open GitHub Command Palette. It is used to navigate, search, and run commands directly from your keyboard.

Read more about GitHub Command Palette here!

Start VIM with opened fuzzy finder

To use a single shortcut to invoke search functionality in all apps that I use, I also mapped it to start VIM with opened fuzzy finder while using the terminal.

How it works:

CMD + K sends ^[fzfvim to ITerm.

vim fzf config

^[fzfvim is bind to invoke fzfvim function in .zshrc config file.

fzfvim() {
	if git rev-parse --is-inside-work-tree &> /dev/null; then
		</dev/tty vim -c :GFiles
	else
		</dev/tty vim -c :Files
	fi
}
zle -N fzfvim

You will need to install vim or nvim, zsh and fzf.vim plugin installed before configuring this shortcut.

Switch quickly between notes in Obsidian

Obsidian is a powerful knowledge base on top of a local folder of plain text Markdown files. It has a feature called quick switcher which lets you jump to other notes without leaving your keyboard. By default it’s invoked by Ctrl/Cmd+O but can be changed to Ctrl/Cmd+K, and I highly recommend to do so.

obsidian

Summary

With this blogpost you could see how to use a single shortcut to do the same thing in different applications.

Thanks!




Copyright © Damian Budelewski 2022