From b1d01d96bb7923787987d44a8d7f41b88cf3b60b Mon Sep 17 00:00:00 2001 From: Chizi123 <joelgrun@gmail.com> Date: Tue, 19 Feb 2019 08:23:53 +0000 Subject: [PATCH] Added reftex and some minor changes --- config.org | 299 +++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 176 insertions(+), 123 deletions(-) diff --git a/config.org b/config.org index 5aa556b..39dc487 100644 --- a/config.org +++ b/config.org @@ -3,9 +3,11 @@ Dependencies needed for Aspell, poppler PDF-tools, compilers and ghost-script provided by mingw64 #+BEGIN_SRC emacs-lisp (when (eq system-type 'windows-nt) - (add-to-list 'exec-path "C:/msys64/usr/bin") + ;; (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:/Users/joelg/TeXcount_3_1_1") + (add-to-list 'exec-path "c:/Program Files/gnuplot") (setenv "PATH" (mapconcat #'identity exec-path path-separator))) #+END_SRC @@ -71,7 +73,7 @@ (pdf-tools-install)) #+END_SRC -* Helm and projectile +* Helm and Projectile ** Helm core #+BEGIN_SRC emacs-lisp (use-package helm-config @@ -110,10 +112,12 @@ (use-package projectile :ensure t :bind ("C-c p" . projectile-command-map) + :diminish projectile-mode :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 @@ -170,6 +174,13 @@ (find-file "~/.emacs.d/config.org")) (global-set-key (kbd "C-c e d") 'config-visit) #+END_SRC +** Go to init.el +#+BEGIN_SRC emacs-lisp + (defun init-visit () + (interactive) + (find-file "~/.emacs.d/init.el")) + (global-set-key (kbd "C-c e i") 'init-visit) +#+END_SRC ** Reload configuration #+BEGIN_SRC emacs-lisp (defun config-reload () @@ -194,6 +205,7 @@ #+BEGIN_SRC emacs-lisp (use-package rainbow-mode :ensure t + :diminish rainbow-mode :init (add-hook 'prog-mode-hook 'rainbow-mode)) #+END_SRC @@ -256,6 +268,7 @@ #+BEGIN_SRC emacs-lisp (use-package undo-tree :ensure t + :diminish undo-tree-mode :config (global-undo-tree-mode)) #+END_SRC @@ -264,6 +277,7 @@ #+BEGIN_SRC emacs-lisp (use-package volatile-highlights :ensure t + :diminish volatile-highlights-mode :config (volatile-highlights-mode t)) #+END_SRC @@ -272,6 +286,7 @@ #+BEGIN_SRC emacs-lisp (use-package workgroups2 :ensure t + :diminish workgroups-mode :config (workgroups-mode 1)) #+END_SRC @@ -384,7 +399,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 @@ -410,13 +425,14 @@ * Programming tweaks ** Yasnippet #+BEGIN_SRC emacs-lisp - (use-package yasnippet - :ensure t - :diminish yas-minor-mode - :config - (use-package yasnippet-snippets - :ensure t) - (yas-reload-all)) + (use-package yasnippet + :ensure t + :diminish yas-minor-mode + :config + (use-package yasnippet-snippets + :ensure t) + (yas-reload-all) + (yas-global-mode 1)) #+END_SRC ** flycheck #+BEGIN_SRC emacs-lisp @@ -436,120 +452,11 @@ #+BEGIN_SRC emacs-lisp (use-package company :ensure t - :hook (prog-mode) + :diminish company-mode :config + (global-company-mode) (setq company-idle-delay 0) (setq company-minimum-prefix-length 3)) -#+END_SRC -** Language specific configs -*** C/C++ -**** yasnippet -#+BEGIN_SRC emacs-lisp -(add-hook 'c++-mode-hook 'yas-minor-mode) -(add-hook 'c-mode-hook 'yas-minor-mode) -#+END_SRC -**** flycheck clang -#+BEGIN_SRC emacs-lisp -(use-package flycheck-clang-analyzer - :ensure t - :config - (with-eval-after-load 'flycheck - (require 'flycheck-clang-analyzer) - (flycheck-clang-analyzer-setup))) -#+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)) - - (use-package company-irony - :ensure t - :config - (add-to-list company-backends '((company-c-headers - company-dabbrev-code - company-irony)))) - - (use-package irony - :ensure t - :config - (add-hook 'c++-mode-hook 'irony-mode) - (add-hook 'c-mode-hook 'irony-mode) - (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)) -#+END_SRC -*** emacs-lisp -**** eldoc -#+BEGIN_SRC emacs-lisp -(add-hook 'emacs-lisp-mode-hook 'eldoc-mode) -#+END_SRC -**** yasnippet -#+BEGIN_SRC emacs-lisp -(add-hook 'emacs-lisp-mode-hook 'yas-minor-mode) -#+END_SRC -**** company -#+BEGIN_SRC emacs-lisp -(add-hook 'emacs-lisp-mode-hook 'company-mode) - -(use-package slime - :ensure t - :config - (setq inferior-lisp-program "/usr/bin/sbcl") - (setq slime-contribs '(slime-fancy))) - -(use-package slime-company - :ensure t - :init - (require 'company) - (slime-setup '(slime-fancy slime-company))) -#+END_SRC -*** x86 -**** x86-lookup -#+BEGIN_SRC emacs-lisp -(use-package x86-lookup - :ensure t - :init - (setq x86-lookup-pdf "D:/Coding/x86-instructions.pdf") - :bind ("C-h x" . x86-lookup)) -#+END_SRC -*** Latex -**** AucTex -#+BEGIN_SRC emacs-lisp -(use-package tex - :ensure auctex - :config - (setq TeX-auto-save t) - (setq TeX-parse-self t) - (setq doc-view-ghostscript-program "c:/msys64/mingw64/bin/gswin32c.exe") - (setq preview-gs-command "c:/msys64/mingw64/bin/gs.exe")) -#+END_SRC -**** Company -#+BEGIN_SRC emacs-lisp - (use-package company-math - :ensure t - :after company - :config - (add-to-list 'company-backends 'company-math-symbols-unicode)) -#+END_SRC -**** Preview pane -#+BEGIN_SRC emacs-lisp -(use-package latex-preview-pane - :ensure t - :config - (latex-preview-pane-enable)) -#+END_SRC -*** PlantUML -#+BEGIN_SRC emacs-lisp -(use-package plantuml-mode - :ensure t - :init - (setq plantuml-jar-path "c:/ProgramData/chocolatey/lib/plantuml/tools/plantuml.jar")) #+END_SRC ** Magit #+BEGIN_SRC emacs-lisp @@ -643,7 +550,151 @@ :map c++-mode-map ("M-RET" . 'srefactor-refactor-at-point))) #+END_SRC -* Org mode +** Language specific configs +*** C/C++ +**** yasnippet +#+BEGIN_SRC emacs-lisp +(add-hook 'c++-mode-hook 'yas-minor-mode) +(add-hook 'c-mode-hook 'yas-minor-mode) +#+END_SRC +**** flycheck clang +#+BEGIN_SRC emacs-lisp +(use-package flycheck-clang-analyzer + :ensure t + :config + (with-eval-after-load 'flycheck + (require 'flycheck-clang-analyzer) + (flycheck-clang-analyzer-setup))) +#+END_SRC +**** company +#+BEGIN_SRC emacs-lisp + (use-package company-c-headers + :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))) + + (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)) +#+END_SRC +*** emacs-lisp +**** eldoc +#+BEGIN_SRC emacs-lisp +(add-hook 'emacs-lisp-mode-hook 'eldoc-mode) +#+END_SRC +**** yasnippet +#+BEGIN_SRC emacs-lisp +(add-hook 'emacs-lisp-mode-hook 'yas-minor-mode) +#+END_SRC +**** company +#+BEGIN_SRC emacs-lisp +(add-hook 'emacs-lisp-mode-hook 'company-mode) + +(use-package slime + :ensure t + :config + (setq inferior-lisp-program "/usr/bin/sbcl") + (setq slime-contribs '(slime-fancy))) + +(use-package slime-company + :ensure t + :init + (require 'company) + (slime-setup '(slime-fancy slime-company))) +#+END_SRC +*** x86 +**** x86-lookup +#+BEGIN_SRC emacs-lisp +(use-package x86-lookup + :ensure t + :init + (setq x86-lookup-pdf "D:/Coding/x86-instructions.pdf") + :bind ("C-h x" . x86-lookup)) +#+END_SRC +*** Latex +**** AucTex +#+BEGIN_SRC emacs-lisp +(use-package tex + :ensure auctex + :config + (setq TeX-auto-save t) + (setq TeX-parse-self t) + (setq doc-view-ghostscript-program "c:/msys64/mingw64/bin/gswin32c.exe") + (setq preview-gs-command "c:/msys64/mingw64/bin/gs.exe")) +#+END_SRC +**** Company +#+BEGIN_SRC emacs-lisp + (use-package company-math + :ensure t + :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)) +#+END_SRC +**** Preview pane +#+BEGIN_SRC emacs-lisp +(use-package latex-preview-pane + :ensure t + :config + (latex-preview-pane-enable)) +#+END_SRC +**** TeXcount + Word counts in latex + #+BEGIN_SRC emacs-lisp + (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 + :ensure t + :init + (setq plantuml-jar-path "c:/ProgramData/chocolatey/lib/plantuml/tools/plantuml.jar")) +#+END_SRC +* Org mode ** Up to date org #+BEGIN_SRC emacs-lisp (use-package org @@ -658,6 +709,8 @@ (setq org-export-with-smart-quotes t) (setq org-src-window-setup 'current-window) (add-hook 'org-mode-hook 'org-indent-mode) +(diminish 'org-indent-mode) +(diminish 'visual-line-mode) #+END_SRC ** Line wrapping #+BEGIN_SRC emacs-lisp -- Gitblit v1.9.3