mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2019-03-11 6d9503d41b759b76b794d2eecb969e7c3d85e986
config.org
@@ -5,7 +5,7 @@
  (when (eq system-type 'windows-nt)
    (add-to-list 'exec-path "C:/msys64/usr/bin")
    (add-to-list 'exec-path "C:/msys64/mingw64/bin")
    (add-to-list 'exec-path "c:/Program Files/Racket")
    (add-to-list 'exec-path "c:/Program Files/gnuplot")
    (setenv "PATH" (mapconcat #'identity exec-path path-separator)))
#+END_SRC
@@ -71,7 +71,7 @@
  (pdf-tools-install))
#+END_SRC
* Helm and projectile
* Helm and Projectile
** Helm core
#+BEGIN_SRC emacs-lisp
(use-package helm-config
@@ -114,7 +114,8 @@
     :config
     (projectile-global-mode)
     (setq projectile-completion-system 'helm)
     (setq projectile-indexing-method 'alien))
     (when (eq system-type 'windows-nt)
       (setq projectile-indexing-method 'alien)))
 #+END_SRC
*** Let it compile things
 #+BEGIN_SRC emacs-lisp
@@ -281,11 +282,11 @@
** Workgroups
Open the pages when you quit
#+BEGIN_SRC emacs-lisp
(use-package workgroups2
  :ensure t
  :diminish workgroups-mode
  :config
  (workgroups-mode 1))
  ;; (use-package workgroups2
  ;;   :ensure t
  ;;   :diminish workgroups-mode
  ;;   :config
  ;;   (workgroups-mode 1))
#+END_SRC
** ibuffer
#+BEGIN_SRC emacs-lisp
@@ -396,7 +397,7 @@
** Tramp
#+BEGIN_SRC emacs-lisp
  (when (eq system-type 'windows-nt)
    (setq tramp-default-method "plink"))
    (setq tramp-default-method "pscp"))
  (setq password-cache-expiry nil)
#+END_SRC
@@ -451,63 +452,63 @@
    :ensure t
    :diminish company-mode
    :config
    (add-hook 'prog-mode-hook 'company-mode)
    (global-company-mode)
    (setq company-idle-delay 0)
    (setq company-minimum-prefix-length 3))
#+END_SRC
** Magit
#+BEGIN_SRC emacs-lisp
(use-package magit
  :ensure t
  :commands magit-get-top-dir
  :bind ("C-x g" . magit-status)
  :init
  (progn
    ;; make magit status go full-screen but remember previous window
    ;; settings
    ;; from: http://whattheemacsd.com/setup-magit.el-01.html
    (defadvice magit-status (around magit-fullscreen activate)
      (window-configuration-to-register :magit-fullscreen)
      ad-do-it
      (delete-other-windows))
    ;; Close popup when committing - this stops the commit window
    ;; hanging around
    ;; From: http://git.io/rPBE0Q
    (defadvice git-commit-commit (after delete-window activate)
      (delete-window))
    (defadvice git-commit-abort (after delete-window activate)
      (delete-window))
  :config
  (progn
    ;; restore previously hidden windows
    (defadvice magit-quit-window (around magit-restore-screen activate)
      (let ((current-mode major-mode))
  (use-package magit
    :ensure t
    :commands magit-get-top-dir
    :bind ("C-x g" . magit-status)
    :init
    (progn
      ;; make magit status go full-screen but remember previous window
      ;; settings
      ;; from: http://whattheemacsd.com/setup-magit.el-01.html
      (defadvice magit-status (around magit-fullscreen activate)
        (window-configuration-to-register :magit-fullscreen)
        ad-do-it
        ;; we only want to jump to register when the last seen buffer
        ;; was a magit-status buffer.
        (when (eq 'magit-status-mode current-mode)
          (jump-to-register :magit-fullscreen)))))
        (delete-other-windows))
  ;; magit settings
  (setq
   ;; don't put "origin-" in front of new branch names by default
   magit-default-tracking-name-function 'magit-default-tracking-name-branch-only
   ;; open magit status in same window as current buffer
   magit-status-buffer-switch-function 'switch-to-buffer
   ;; highlight word/letter changes in hunk diffs
   magit-diff-refine-hunk t
   ;; ask me if I want to include a revision when rewriting
   magit-rewrite-inclusive 'ask
   ;; ask me to save buffers
   magit-save-some-buffers t
   ;; pop the process buffer if we're taking a while to complete
   magit-process-popup-time 10
   ;; ask me if I want a tracking upstream
   magit-set-upstream-on-push 'askifnotset
   )))
      ;; Close popup when committing - this stops the commit window
      ;; hanging around
      ;; From: http://git.io/rPBE0Q
      (defadvice git-commit-commit (after delete-window activate)
        (delete-window))
      (defadvice git-commit-abort (after delete-window activate)
        (delete-window))
      :config
      (progn
        ;; restore previously hidden windows
        (defadvice magit-quit-window (around magit-restore-screen activate)
          (let ((current-mode major-mode))
            ad-do-it
            ;; we only want to jump to register when the last seen buffer
            ;; was a magit-status buffer.
            (when (eq 'magit-status-mode current-mode)
              (jump-to-register :magit-fullscreen)))))
      ;; magit settings
      (setq
       ;; don't put "origin-" in front of new branch names by default
       magit-default-tracking-name-function 'magit-default-tracking-name-branch-only
       ;; open magit status in same window as current buffer
       magit-status-buffer-switch-function 'switch-to-buffer
       ;; highlight word/letter changes in hunk diffs
       magit-diff-refine-hunk t
       ;; ask me if I want to include a revision when rewriting
       magit-rewrite-inclusive 'ask
       ;; ask me to save buffers
       magit-save-some-buffers t
       ;; pop the process buffer if we're taking a while to complete
       magit-process-popup-time 10
       ;; ask me if I want a tracking upstream
       magit-set-upstream-on-push 'askifnotset
       )))
#+END_SRC
** CEDET
*** semantic
@@ -565,27 +566,24 @@
#+END_SRC
**** company
#+BEGIN_SRC emacs-lisp
  (add-hook 'c-mode-common-hook
       (lambda ()
         (define-key c-mode-base-map  [(tab)] 'company-complete)))
    (use-package company-c-headers
   :ensure t
   :after company
   :config
   (add-hook 'c++-mode-hook 'company-mode)
   (add-hook 'c-mode-hook 'company-mode))
        :ensure tk
        :after company
        :config
        (add-hook 'c++-mode-hook 'company-mode)
        (add-hook 'c-mode-hook 'company-mode))
    (use-package company-irony
      :ensure t
      :config
      (add-to-list 'company-backends '(company-c-headers
                   company-dabbrev-code
                   company-irony)))
                                       company-dabbrev-code
                                       company-irony)))
    (use-package irony
      :ensure t
      :config
      (setq w32-pipe-read-delay 0)
      (add-hook 'c++-mode-hook 'irony-mode)
      (add-hook 'c-mode-hook 'irony-mode)
      (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
@@ -642,6 +640,23 @@
    :after company
    :config
    (add-to-list 'company-backends 'company-math-symbols-unicode))
  (use-package company-reftex
    :ensure t
    :after company
    :config
    (add-to-list 'company-backends 'company-reftex))
  (use-package company-auctex
    :ensure t
    :after company
    :config
    (company-auctex-init))
  (use-package company-bibtex
    :ensure t
    :after company
    (add-to-list 'company-backends 'company-bibtex))
#+END_SRC
**** Preview pane
#+BEGIN_SRC emacs-lisp
@@ -650,6 +665,35 @@
  :config
  (latex-preview-pane-enable))
#+END_SRC
**** TeXcount
     Word counts in latex
     #+BEGIN_SRC emacs-lisp
       (when (eq system-type 'windows-nt)
         (add-to-list 'exec-path "c:/Users/joelg/TeXcount_3_1_1")
         (setenv "PATH" (mapconcat #'identity exec-path path-separator)))
       (defun texcount ()
         (interactive)
         (let*
             ( (this-file (buffer-file-name))
               (enc-str (symbol-name buffer-file-coding-system))
               (enc-opt
                (cond
                 ((string-match "utf-8" enc-str) "-utf8")
                 ((string-match "latin" enc-str) "-latin1")
                 ("-encoding=guess")
                 ) )
               (word-count
                (with-output-to-string
                  (with-current-buffer standard-output
                    (call-process "texcount" nil t nil "-0" enc-opt this-file)
                    ) ) ) )
           (message word-count)
           ) )
       (add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map (kbd "C-c c") 'texcount)))
       (add-hook 'latex-mode-hook (lambda () (define-key latex-mode-map (kbd "C-c c") 'texcount)))
     #+END_SRC
*** PlantUML
#+BEGIN_SRC emacs-lisp
(use-package plantuml-mode
@@ -657,6 +701,36 @@
  :init
  (setq plantuml-jar-path "c:/ProgramData/chocolatey/lib/plantuml/tools/plantuml.jar"))
#+END_SRC
*** Matlab
**** Matlab mode
#+BEGIN_SRC emacs-lisp
  (use-package matlab-mode
    :ensure t
    :config
    (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
    (add-to-list
     'auto-mode-alist
     '("\\.m$" . matlab-mode))
    (setq matlab-indent-function t))
#+END_SRC
*** Racket
**** Major mode
#+BEGIN_SRC emacs-lisp
  (when (eq system-type 'windows-nt)
    (add-to-list 'exec-path "c:/Program Files/Racket")
    (setenv "PATH" (mapconcat #'identity exec-path path-separator)))
  (use-package racket-mode
      :ensure t
      :config
      (autoload 'racket-mode "Racket" "Racket Editing Mode" t)
      (add-to-list
       'auto-mode-alist
       '("\\.rkt$" . matlab-mode))
      (setq matlab-indent-function t))
#+END_SRC
* Org mode
** Up to date org
#+BEGIN_SRC emacs-lisp
@@ -688,3 +762,10 @@
  :config
    (add-hook 'org-mode-hook (lambda () (org-bullets-mode))))
#+END_SRC
** Org Babel
*** Languages
Add C to org babel supported languages
#+BEGIN_SRC emacs-lisp
  (add-to-list 'org-babel-load-languages '(C . t))
#+END_SRC