Skip to content

Instantly share code, notes, and snippets.

@kdmsnr
Created April 22, 2016 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdmsnr/251d3e38c17226e35686e5f44e91c383 to your computer and use it in GitHub Desktop.
Save kdmsnr/251d3e38c17226e35686e5f44e91c383 to your computer and use it in GitHub Desktop.
(defun memo-create()
(interactive)
(let ((memo-name (format-time-string "%Y-%m-%d-%s")))
(find-file (concat "~/Dropbox/memo/" memo-name ".md"))))
(defun memo-search()
(interactive)
(setq q (read-string "grep word: "))
(ag-regexp q "~/Dropbox/memo/")
(select-window ; select ag buffer
(car (my/get-buffer-window-list-regexp "^\\*ag "))))
(defun memo-list()
(interactive)
(ag-regexp "^#[^#]" "~/Dropbox/memo/")
(select-window ; select ag buffer
(car (my/get-buffer-window-list-regexp "^\\*ag "))))
(global-set-key (kbd "C-c m") 'memo-create)
(global-set-key (kbd "C-c s") 'memo-search)
(global-set-key (kbd "C-c l") 'memo-list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment