Skip to content

mieubrisse/cmdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmdk

The ⌘-k "access anything" shortcut is awesome on Notion, Slack, etc.

The terminal, by comparison, is a dinosaur: tons of repeated cd and ls and TAB just to get anywhere.

This is ⌘-k for the terminal: access anything on your filesystem, from anywhere, with previews before you open:

Based on what you choose...

  • Directories get cdd to
  • Text files get opened in vim
  • Images and PDFs get opened in the Preview app
  • .key files get opened in Keynote

Huge thanks to fzf. I've been fed up with terminal navigation for a decade, and discovering fzf was the last piece needed to make cmdk possible.

Installation

  1. brew install fzf fd bat tiv
  2. git clone [email protected]:mieubrisse/cmdk.git ~/.cmdk
  3. Add to your .zshrc or .bashrc:

    source ~/.cmdk/cmdk.sh
  4. Bind the ⌘-k hotkey to send the text cmdk\n in your terminal

    💡 In iTerm, this is done with Settings → Profiles → Keys → Keybindings → + → Send Text, then binding ⌘-k to send the text cmdk\n.

    💡 If you prefer another hotkey (e.g. ⌘-p), simply bind that to send the cmdk\n string instead.

  5. Open a new shell

Usage

Press ⌘-k (or type cmdk) and...

  • Type to start filtering

    💡 If you're trying to get a directory, add a / to the end of your search term. E.g. down/ will pull up the Downloads directory

  • Ctrl-j and Ctrl-k to scroll up and down the results list
  • ENTER to select the result
  • TAB to select multiple items before ENTER
  • Ctrl-u to clear the selection

⚠️ Some directories like Library, /, and .git are full of stuff users don't need to access, so their contents are excluded. To get to their contents, first ⌘-k to them and then ⌘-k again to see their contents.

💡 Sometimes you only want to jump to the contents of the current directory. This can be done by calling cmdk -o. I've set up a separate iTerm hotkey for this: ⌘-l to send cmdk -o\n.

TODO

About

⌘-k "access anything" for your terminal

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages