Skip to content

Latest commit

 

History

History
executable file
·
66 lines (63 loc) · 2.8 KB

demo_notes.org

File metadata and controls

executable file
·
66 lines (63 loc) · 2.8 KB

Filetree package description

File tree view/manipulation package

The package provides a set of interactive tools to help quickly find files, information in files, or information associated with files–and using a tree to help visualize the directory structure of a set of files.

Packages used for demo

Use cases

Recentf wrapper

Background and motivation

Original motivation: hard to use recentf for large number entries.

(setq recentf-max-saved-items 500)

Navigation

up/down by line/branch

select file

Views

depth, split directories, all-the-icons

Filtering/Expanding

narrow to subtree

undo

drop file/dir

filter by regex/shortcuts

(defun filetree-configure-default-filetypes ()
  "Define default `filetree-filetype-list'.
This defines filetype faces, filetype regex, and filter shortcuts.
This function is given as an example.  The user can generate their own
custom function with calls to `filetree-add-filetype'"
  (interactive)
  (setq filetree-filetype-list nil)
  (filetree-add-filetype "No Filter" 0   ""        ())
  (filetree-add-filetype "Python"    ?p  "\.py$"   '(:foreground "steel blue"))
  (filetree-add-filetype "Org-mode"  ?o  "\.org$"  '(:foreground "DarkOliveGreen4"))
  (filetree-add-filetype "elisp"     ?e  "\\(?:\\.e\\(?:l\\|macs\\)\\)"  '(:foreground "purple"))
  (filetree-add-filetype "C"         ?c  "\\(?:\\.[ch]$\\|\\.cpp\\)"     '(:foreground "navyblue"))
  (filetree-add-filetype "PDF"       ?d  "\.pdf$"  '(:foreground "maroon"))
  (filetree-add-filetype "Matlab"    ?m  "\.m$"    '(:foreground "orange"))
  (filetree-add-filetype "Text"      ?t  "\.txt$"  '(:foreground "gray50")))

expand by regex/shortcuts (inc. split dir)

helm-search

stack operations (subract, union)

Other file lists

Other ways to populate file list

  • filetree-show-cur-buffers
  • filetree-show-cur-dir
  • filetree-show-cur-dir-recursively

Save/Load

Search within files

grep for function from recent file

File notes

General notes (tasks, notes on code flow, notes on papers, etc.)

  • Key binding:
(global-set-key (kbd "C-c <return>") (lambda ()
                                       "Toggle filetree-info-buffer and switch to it if active"
                                     (interactive)
                                     (filetree-toggle-info-buffer t)))
  • By default stored in a global notes file, and narrowed to relevant section.
  • Can also use a project local notes file (just put appropriately named file in project root directory).

Integration with file tree viewer