0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sequel Ace, Sequel ProのサジェストをCtrl + P, Ctrl + Nで移動する方法

Posted at

普段shell, vim, emacsなどを使う方はCtrl + P Ctrl + Nの移動に慣れていると思います

しかし、Sequel Aceでは、コードのサジェストのときに矢印キーでしか移動できずにイライラが溜まっていました。macの矢印キーはとても押しにくい・・・

そこで、hammerspoonを使ってSequel Ace起動時にのみCtrl + P Ctrl + Nを矢印キーにremapしましょう

configファイル

local function keyStroke(mods, key)
  return function() hs.eventtap.keyStroke(mods, key, 0) end
end
local function remap(mods, key, fn)
  return hs.hotkey.bind(mods, key, fn, nil, fn)
end
local sequelAceRemapKeys = {
  remap({'ctrl'}, 'n', keyStroke({}, 'down')),
  remap({'ctrl'}, 'p', keyStroke({}, 'up'))
}
local function handleSequalAceEvent(name, event, app)
  if event == hs.application.watcher.activated then
    if name == 'Sequel Ace' then
      for i, key in ipairs(sequelAceRemapKeys) do
        key:enable()
      end
    else
      for i, key in ipairs(sequelAceRemapKeys) do
        key:disable()
      end
    end
  end
end
appsWatcher = hs.application.watcher.new(handleSequalAceEvent)
appsWatcher:start()

快適快適〜!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?