GithubHelp home page GithubHelp logo

Comments (5)

keicy avatar keicy commented on August 24, 2024

Helm

  • pros
    • migemo 対応している
    • チラ見機能便利かも
  • cons
    • キーバインドのDocがない
      • プラグインフォルダを grep して検索すればできそう

from .emacs.d.

keicy avatar keicy commented on August 24, 2024

Ivy

  • pros
    • 画面が見やすい
  • cons
    • migemo 対応されてないっぽい/情報がなかった
    • チラ見機能がなさそう

from .emacs.d.

keicy avatar keicy commented on August 24, 2024

結論

こういうツール自体使ってみないと分からない点が多すぎるので、ひとまずpropsが多く、また、標準として広く対応されている Helm を使ってみることにする。
それで不便があればまた移行を考えようと思う。

ちなみに、 ido は試して結果、UIが気に入らなかったため候補外。

from .emacs.d.

keicy avatar keicy commented on August 24, 2024

Helm のキーバインド

カーソル移動

helm のプラグインフォルダを C-p C-n などでgrep

# C-p
kei@kei:~/.emacs.d/24.5.1/el-get/helm$ findword "C-p"
./helm-lib.el:        (?\C-p (helm-help-previous-line))
./helm.el:    (define-key map (kbd "C-p")        'helm-previous-line)
./helm-eval.el:    (define-key map (kbd "C-p")        'previous-line)

# C-n
./helm-lib.el:        (?\C-n (helm-help-next-line))
./helm.el:    (define-key map (kbd "C-n")        'helm-next-line)
./helm-eval.el:    (define-key map (kbd "C-n")        'next-line)

幾つかの機能でそれぞれのキーマップを持っていて、それぞれに定義している模様。これらのマップに再定義すれば良いと思われる。

フォルダ階層移動 (helm-find-files)

helm のプラグインフォルダを C-j でgrep

# C-j

./helm-elisp.el:    :persistent-help "Toggle describe function / C-u C-j: Toggle advice"))
./helm-help.el:`helm-execute-persistent-action' called with a prefix arg (C-u C-j) or with its specific command
./helm-help.el:**** Use `C-j' (persistent action) on a directory to go down one level
./helm-help.el:Note: The tree is reinitialized each time you enter a new tree with `C-j'
./helm-help.el:*** Use `C-u C-j' to watch an image or `C-<down>'
./helm-help.el:*** `C-j' on a filename will expand in helm-buffer to this filename
./helm-help.el:Second hit on `C-j' will display buffer filename.
./helm-help.el:Third hit on `C-j' will kill buffer filename.
./helm-help.el:NOTE: `C-u C-j' will display buffer directly.
./helm-help.el:just type \"/home/you/foo/..else\" and hit `C-j' or enter the final \"/\", helm will show you all
./helm-help.el:**** Use `C-u C-j' to watch an image
./helm-help.el:**** `C-j' on a filename will expand in helm-buffer to this filename
./helm-help.el:Second hit on `C-j' will display buffer filename.
./helm-help.el:Third hit on `C-j' will kill buffer filename.
./helm-help.el:NOTE: `C-u C-j' will display buffer directly.
./helm-help.el:You can do this with `C-j' (persistent-action), to do it repetitively
./helm-help.el:*** You can get help on any command with persistent action (C-j)
★ ./helm.el:    (define-key map (kbd "C-j")        'helm-execute-persistent-action)
./helm.el:| C-j     | C-z              | Persistent Action (Execute and keep helm session)         |
./helm-files.el:When this is set you will be able to expand archive filenames with `C-j'
./helm-files.el:or hitting C-j on \"..\"."
./helm-files.el:First hit on C-j expand CANDIDATE second hit open file.
./helm-files.el:          ;; An image file and it is the second hit on C-j,

色々出ているが、キーマップ定義は★のものだけっぽい。ここに再定義すれば良いっぽい。

# C-l

./helm-help.el:**** Use `C-l' on a directory to go up one level
./helm-help.el:**** Use `C-r' to walk back the resulting tree of all the `C-l' you did
./helm-help.el:NOTE: This is different from using `C-l' in that `C-l' doesn't move cursor on top but stays on previous
./helm-help.el:NOTE: This different to using `C-l' in that `C-l' don't move cursor on top but stay on previous
./helm.el:    (define-key map (kbd "C-l")        'helm-recenter-top-bottom-other-window)
./helm.el:    (define-key map (kbd "M-C-l")      'helm-reposition-window-other-window)
./helm-font.el:    (define-key map (kbd "<C-left>")      'helm-ucs-persistent-backward)
★./helm-files.el:    (define-key map (kbd "C-l")           'helm-find-files-up-one-level)
★./helm-files.el:    (define-key map (kbd "C-l")           'helm-find-files-up-one-level)
./helm-files.el:  "Retrieve previous paths reached by `C-l' in helm-find-files."

helm-find-files での挙動定義は上記★で定義されている模様。このマップに再定義する。

from .emacs.d.

keicy avatar keicy commented on August 24, 2024

作業要点

詳細は Dropbox の作業ログ参照

  • bind-keys* による絶対キー定義を helm 中は無効にする必要がある
    • bind-keys* のキーは、 下記のように emulation-mode-map-alists に override-global-mode を追加して定義される
      • (add-to-list 'emulation-mode-map-alists `((override-global-mode . ,override-global-map)))
      • emulation-mode-map はキーマップ定義の上位にあるmapで、その他のmap定義を上書きできる優先度を持つ
    • よって、 override-global-mode を helm 中に無効にすれば良い
      • (add-hook 'helm-minibuffer-set-up-hook (lambda () (override-global-mode -1)))
  • さらに、 helm の map にキー定義を追加する必要がある
    • 本来であれば、 上記で無効後、 単に helm-map などにキー定義追加すれば良いはずだが、なぜか C-i のみ挙動が変
      • helm-map については emulation-mode-map に専用の map を作成し、 helm 中だけ有効にするようにした
        • (add-hook 'helm-minibuffer-set-up-hook (lambda () (keicy-helm-mini-buffer-mode 1)))
    • helm-find-files-map については理論通り、単純に定義追加でいけたのでそうしている

from .emacs.d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.