Skip to content

Commit

Permalink
Removed local copy (necessary for nano-counsel that is now optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
rougier committed Dec 21, 2020
1 parent e342ac8 commit fd5e68a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 492 deletions.
47 changes: 41 additions & 6 deletions nano-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ If not, it closes nano command."
;; Advice after select window to check for focus
(advice-add #'select-window :after #'nano-command--check-focus))



;; ---------------------------------------------------------------------
(defun nano-capture-refile (file &optional headline)
"Move current headline to a specified location"
Expand Down Expand Up @@ -252,7 +254,6 @@ If not, it closes nano command."
(org-mark-ring-goto))
(switch-to-buffer buffer)))


(defun nano-capture-meeting ()
(interactive)
(let* ((content (format-time-string
Expand All @@ -273,14 +274,46 @@ If not, it closes nano command."
(org-mark-ring-goto))
(switch-to-buffer buffer)))

(defun nano-capture-link ()
(interactive)
(let ((inhibit-message t))
(setq org-link-file-path-type 'absolute)
(call-interactively 'org-store-link)
(nano-command "LINK"
#'nano-capture-link-finalize
(nth 1 (car org-stored-links))
"Name link under cursor")))

(defun nano-capture-link-finalize (content)
(interactive)
(let ((inhibit-message t)
(buffer (current-buffer)))
(with-temp-buffer
(insert "* ")
(org-insert-link nil (car (pop org-stored-links)) content)
(insert " :@LINK:")
(org-mark-ring-push)
(nano-capture-refile "~/Documents/org/inbox.org" "")
(org-mark-ring-goto))
(switch-to-buffer buffer)))

(define-key global-map (kbd "C-c t") #'nano-capture-todo)
(define-key global-map (kbd "C-c m") #'nano-capture-meeting)

(defun nano-command-x ()
(interactive)
(nano-command "M-x" #'nano-command-x-finalize "" "Enter command"))

(defun nano-command-x-finalize (command)
(interactive)
(command-execute (intern command)))

;; (defun nano-command-x ()
;; (interactive)
;; (nano-command "M-x" nil "" "Enter command"))

(setq mac-right-command-modifier 'alt)
(setq mac-left-command-modifier 'meta)
(define-key global-map (kbd "A-x") #'nano-command-x)

(define-key global-map (kbd "C-c k") #'nano-capture-link)
(define-key global-map (kbd "C-c t") #'nano-capture-todo)
(define-key global-map (kbd "C-c m") #'nano-capture-meeting)

;; (defun nano-command-shell ()
;; (interactive)
Expand All @@ -299,3 +332,5 @@ If not, it closes nano command."
;; (define-key global-map (kbd "C-c r") #'nano-command-mail-reply)
;; (define-key global-map (kbd "C-c R") #'nano-command-mail-reply-all)


(provide 'nano-command)
8 changes: 5 additions & 3 deletions nano-layout.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

(setq default-frame-alist
(append (list
'(font . "Roboto Mono:style=Light:size=14")
;; '(font . "Roboto Mono Emacs Regular:size=14")
;; '(font . "Roboto Mono:style=Light:size=14")
'(font . "Roboto Mono Emacs Regular:size=14")
'(min-height . 1) '(height . 45)
'(min-width . 1) '(width . 81)
'(vertical-scroll-bars . nil)
Expand All @@ -46,6 +46,8 @@
(set-display-table-slot standard-display-table 'wrap
(make-glyph-code ?↩ 'fallback))

;; (set-fontset-font t nil "Fira Code" nil 'append)

;; Fix bug on OSX in term mode & zsh (spurious % after each command)
(add-hook 'term-mode-hook
(lambda () (setq buffer-display-table (make-display-table))))
Expand All @@ -57,7 +59,7 @@
(tool-bar-mode 0)
(tooltip-mode 0)
(menu-bar-mode 0)
(global-hl-line-mode 1)
;; (global-hl-line-mode 1)
(setq x-underline-at-descent-line t)

;; Vertical window divider
Expand Down
Loading

0 comments on commit fd5e68a

Please sign in to comment.