0
0

ターミナル環境をWarpでもなんでもiTermっぽくする

Posted at

きっかけ

コマンドラインツールに悩んでいた頃に、iTermを使っている人がショートカットキーでパカパカアプリを切り替えているのが羨ましかった。

当時Warpが流行っていたのでWarpでそういうことができないかなぁと思って調べた。

ショートカットキーで任意のアプリをパカパカする

まず、HammerSpoonをインストールします。

brew install hammerspoon

init.luaに以下のコードを書いて再読み込みさせます。

hs.hotkey.bind({'ctrl'}, 'q', function()
  local warp = hs.application.find('Warp')
  if warp:isFrontmost() then
    warp:hide()
  else
    hs.application.launchOrFocus('/Applications/Warp.app')
  end
end

動作

Ctrl+qで任意のアプリがパカパカします。

余談

同じ要領でWindowsライクにFinder(Explorer)をパカパカできるようにしてます。

hs.hotkey.bind({'ctrl'}, 'e', function()
  local finder = hs.application.find('Finder')
  if finder:isFrontmost() then
    finder:hide()
  else
    hs.application.launchOrFocus('/System/Library/CoreServices/Finder.app')
  end
end

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0