]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
use elpy
[lib.git] / emacs_el / configuration / don-configuration.org
index 854cbe7b00fccb19c73246b58b2ae388c5fe4105..50fbec086a22ac157e96757f6998f540e5a2af23 100644 (file)
@@ -82,7 +82,13 @@ load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
     :config (setq paradox-execute-asynchronously t)
     )
 #+END_SRC
-* Add library paths
+* Paths
+** Update PATH
+#+BEGIN_SRC emacs-lisp
+  (add-to-list 'exec-path '"/usr/local/bin")
+  (add-to-list 'exec-path '"~/bin/")
+#+END_SRC
+** Add library paths
 
 #+BEGIN_SRC emacs-lisp
   (add-to-list 'load-path '"~/lib/emacs_el/")
@@ -980,7 +986,7 @@ This can be used to link things pretty quickly if necessary
     ("o" (find-file "~/projects/org-notes/ool.org"))
     ("f" (find-file "~/projects/org-notes/fh.org"))
     ("s" (find-file "~/projects/org-notes/sndservers.org"))
-    ("r" (find-file "~/projects/org-notes/refile.org"))
+    ("r" (find-file my/org-refile-file))
     ("p" (find-file "~/projects/research/papers_to_read.org"))
     ("R" (find-file "~/projects/research/paper_notes.org"))
     ("h" (find-file "~/projects/org-notes/hpcbio.org"))
@@ -1203,8 +1209,8 @@ This can be used to link things pretty quickly if necessary
     (defun dla/ess-region-remote-eval (start end)
       "Evaluate region in a remote ESS instance"
       (interactive "r")
-      (shell-command-on-region start end "eval_r" (get-buffer-create "***essregionremoteeval***"))
-      kill-buffer "***essregionremoteeval***")
+      (shell-command-on-region start end "eval_r" (get-buffer-create "***essregionremoteeval***") nil nil nil)
+      (kill-buffer "***essregionremoteeval***"))
     ;; Don't restore history or save workspace image
     '(inferior-R-args "--no-restore-history --no-save")
     )
@@ -1221,6 +1227,14 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   )
 #+END_SRC
 
+** YAML Mode
+#+BEGIN_SRC emacs-lisp
+  (use-package yaml-mode
+    ;; add ess to the x major mode
+    :mode ("\\.\\(yaml|yml\\)\\'" . yaml-mode)
+  )
+#+END_SRC
+
 ** Polymode
 #+BEGIN_SRC emacs-lisp
 (use-package poly-noweb
@@ -1288,6 +1302,26 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
     (setq atomic-chrome-buffer-open-style 'full)
     )
 #+END_SRC
+** Edit Server
+#+BEGIN_SRC emacs-lisp
+  (use-package edit-server
+    :ensure t
+    :commands edit-server-start
+    :init (if after-init-time
+              (edit-server-start)
+            (add-hook 'after-init-hook
+                      #'(lambda() (edit-server-start))))
+    :config (setq edit-server-new-frame-alist
+                  '((name . "Edit with Emacs FRAME")
+                    (top . 200)
+                    (left . 200)
+                    (width . 80)
+                    (height . 25)
+                    (minibuffer . t)
+                    (menu-bar-lines . t)
+                    (window-system . x)))
+    )
+#+END_SRC
 ** Multiple Cursors
    :PROPERTIES:
    :ID:       6fcf218b-a762-4c37-9339-a8202ddeb544
@@ -1356,6 +1390,15 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
     (setq default-abbrev-mode t))
 #+END_SRC
 
+** Python Programming
+#+BEGIN_SRC emacs-lisp
+  (use-package elpy
+    :ensure t
+    :init
+    (elpy-enable)
+    )
+#+END_SRC
+
 ** Go language
 #+BEGIN_SRC emacs-lisp
 (use-package go-mode
@@ -1572,24 +1615,19 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 
   ; org mode agenda files
   (setq org-agenda-files
-        (quote ("~/projects/org-notes/debbugs.org"
-            "~/projects/org-notes/notes.org"
-            "~/projects/org-notes/holidays.org"
-            "~/projects/org-notes/refile.org"
-            "~/projects/org-notes/diary.org"
-            "~/projects/org-notes/ool.org"
-            "~/projects/org-notes/sndservers.org"
-            "~/projects/org-notes/chaim.org"
-            "~/projects/org-notes/wildman.org"
-            "~/projects/org-notes/uddin.org"
-            "~/projects/org-notes/reviews.org"
-            "~/projects/org-notes/laurel.org"
-            "~/projects/org-notes/from-calendar.org"
-            "~/org-mode/from-mobile.org"
-            "~/projects/org-notes/fh.org")))
+        (append
+        (file-expand-wildcards "~/projects/org-notes/*.org")
+        (file-expand-wildcards "~/org-mode/from-mobile.org")
+        (file-expand-wildcards "~/org-notes-*/*.org")
+        )
+  )
+  (setq my/org-refile-file
+        (car (seq-filter
+              (lambda (file) (string-match-p (regexp-quote "/refile.org") file))
+              org-agenda-files)))
 
   (set-register ?n (cons 'file "~/projects/org-notes/notes.org"))
-  (set-register ?r (cons 'file "~/projects/org-notes/refile.org"))
+  (set-register ?r (cons 'file my/org-refile-file))
   (set-register ?o (cons 'file "~/projects/org-notes/ool.org"))
   (set-register ?s (cons 'file "~/projects/org-notes/sndservers.org"))
   (set-register ?c (cons 'file "~/projects/org-notes/chaim.org"))
@@ -1621,33 +1659,33 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 ** Capture Templates
 #+BEGIN_SRC emacs-lisp
   (setq org-capture-templates  ;; mail-specific note template, identified by "m"
-        `(("m" "Mail" entry (file "~/projects/org-notes/refile.org")
+        `(("m" "Mail" entry (file my/org-refile-file)
            "* %?\n\n  Source: %u, [[%:link][%:description]]\n  %:initial")
-          ("t" "todo" entry (file "~/projects/org-notes/refile.org")
+          ("t" "todo" entry (file my/org-refile-file)
            "* TODO %?\n  :PROPERTIES:\n  :END:\n  :LOGBOOK:\n  :END:\n%U\n%a\n" :clock-in t :clock-resume t)
-          ("r" "respond" entry (file "~/projects/org-notes/refile.org")
+          ("r" "respond" entry (file my/org-refile-file)
            "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
-          ("n" "note" entry (file "~/projects/org-notes/refile.org")
+          ("n" "note" entry (file my/org-refile-file)
            "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
-          ("s" "schedule" entry (file "~/projects/org-notes/refile.org")
+          ("s" "schedule" entry (file my/org-refile-file)
            "* %? :cal:\n%^{scheduled:}t\n%U\n%a\n" :clock-in t :clock-resume t)
           ("j" "Journal" entry (file+datetree "~/projects/org-notes/diary.org")
            "* %?\n%U\n" :clock-in t :clock-resume t)
-          ("w" "org-protocol" entry (file "~/projects/org-notes/refile.org")
+          ("w" "org-protocol" entry (file my/org-refile-file)
            "* TODO Review %c\n%U\n" :immediate-finish t)
-          ("M" "Meeting" entry (file "~/projects/org-notes/refile.org")
+          ("M" "Meeting" entry (file my/org-refile-file)
            "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
-          ("S" "Seminar" entry (file "~/projects/org-notes/refile.org")
+          ("S" "Seminar" entry (file my/org-refile-file)
            "* SEMINAR notes %? :SEMINAR:\n%U" :clock-in t :clock-resume t)
           ("P" "Paper to read" entry (file+headline "~/projects/research/papers_to_read.org" "Refile")
            "* TODO Get/Read %? \n%U" :clock-in t :clock-resume t)
-          ("p" "Phone call" entry (file "~/projects/org-notes/refile.org")
+          ("p" "Phone call" entry (file my/org-refile-file)
            "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
            ("J" "job" entry (file+olp "~/projects/org-notes/notes.org"
                                        "Jobs"
                                        ,(format-time-string "Positions %Y"))
            "* TODO Apply for %? :job:\nSCHEDULED: <%<%Y-%m-%d>>\n%U\n%x\n" :clock-in t :clock-resume t)
-          ("h" "Habit" entry (file "~/projects/org-notes/refile.org")
+          ("h" "Habit" entry (file my/org-refile-file)
            "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n%a\n")
           )
         )
@@ -2466,6 +2504,11 @@ same directory as the org-buffer and insert a link to this file."
   )
 #+END_SRC
 * Keybindings
+** Home/End Begining/End of line
+#+BEGIN_SRC emacs-lisp
+  (global-set-key [home] 'move-beginning-of-line)
+  (global-set-key [end] 'move-end-of-line)
+#+END_SRC
 ** Goto line
 #+BEGIN_SRC emacs-lisp
   (global-unset-key "\M-g")