- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2020-08-08T13:32:05+00:00","","")
#author("2020-08-11T15:10:31+00:00","","")
#topicpath
///////////////////////////////////////////////////////////////////////////////
* 目次 [#d6fdc437]
#contents();
////////////////////////////////////////////////////////////////////////////////
* neotree [#w0c75833]
- neotree は、
- neotree は、同一フレームの別ウインドウに、ディレクトリ内のリストを表示する。
- 類似機能に [[speedbar + sr-speedbar>Editor/emacs/speedbar#sr-speedbar]] があり、導入の手間は speedbar + sr-speedbar の方が低い。
//==============================================================================
** 環境構築 [#a82e8a95]
+ 以下を git clone する
|~repository |~URI |~remark |
|neotree |https://github.com/jaypei/emacs-neotree.git | |
|all-the-icons |https://github.com/domtronn/all-the-icons.el.git |neotree が依存している |
|memoize |https://github.com/skeeto/emacs-memoize.git |all-the-icons が依存している |
~
+ 設定する
;;; neotree
;; emacs-memoize は、all-the-icons が依存している
;; 設定後初回起動は、M-x all-the-icons-install-fonts でフォントを DL する必要がある
;; -> ${HOME}/.local/share/fonts に保存される
;;
(setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/emacs-memoize") load-path))
(setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/all-the-icons") load-path))
(setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/emacs-neotree") load-path))
(use-package neotree
:init
(setq-default neo-keymap-style 'concise)
:config
(setq neo-smart-open t)
(setq neo-create-file-auto-open t)
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
(bind-key [f8] 'neotree-toggle)
(bind-key "RET" 'neotree-enter-hide neotree-mode-map)
(bind-key "a" 'neotree-hidden-file-toggle neotree-mode-map)
(bind-key "<left>" 'neotree-select-up-node neotree-mode-map)
(bind-key "<right>" 'neotree-change-root neotree-mode-map))
;; Change neotree's font size
;; Tips from https://github.com/jaypei/emacs-neotree/issues/218
(defun neotree-text-scale ()
"Text scale for neotree."
(interactive)
(text-scale-adjust 0)
(text-scale-decrease 1)
(message nil))
(add-hook 'neo-after-create-hook
(lambda (_)
(call-interactively 'neotree-text-scale)))
;; neotree enter hide
;; Tips from https://github.com/jaypei/emacs-neotree/issues/77
(defun neo-open-file-hide (full-path &optional arg)
"Open file and hiding neotree.
The description of FULL-PATH & ARG is in `neotree-enter'."
(neo-global--select-mru-window arg)
(find-file full-path)
(neotree-hide))
(defun neotree-enter-hide (&optional arg)
"Neo-open-file-hide if file, Neo-open-dir if dir.
The description of ARG is in `neo-buffer--execute'."
(interactive "P")
(neo-buffer--execute arg 'neo-open-file-hide 'neo-open-dir))
~
+ 設定後初回の emacs 起動時に、以下のコマンドでフォントを DL する:
M-x all-the-icons-install-fonts
-- ${HOME}/.local/share/fonts に保存される
//==============================================================================
** 参考 URI [#hb11ae0a]
- [[emacsにneotreeを導入してみた>https://qiita.com/minoruGH/items/2034cad4efe8c5dee4d4]]
- [[all-the-icons.el を入れたけど icon が正しく表示出来ない>https://qiita.com/biwakonbu/items/e5766aaeb80f708b999b]]