Reorganized .emacs

This commit is contained in:
TuDatTr
2018-01-05 12:15:52 +01:00
parent b1ea714647
commit 4e85c75919
2 changed files with 55 additions and 52 deletions

42
.emacs
View File

@@ -52,7 +52,7 @@
((= 16 opt) "s")))) ((= 16 opt) "s"))))
(insert (shell-command-to-string (concat "xsel -o -" opt)))))) (insert (shell-command-to-string (concat "xsel -o -" opt))))))
;; elpy-mode functions
(defun pyexec () (defun pyexec ()
"Execute the python program in an external terminal." "Execute the python program in an external terminal."
(interactive) (interactive)
@@ -60,7 +60,7 @@
(shell-command (concat "termite --hold -e \"python " buffer-file-name "\"")) (shell-command (concat "termite --hold -e \"python " buffer-file-name "\""))
) )
) )
;; CC-mode functions
(defun cppexec () (defun cppexec ()
"Execute the python program in an external terminal." "Execute the python program in an external terminal."
(interactive) (interactive)
@@ -69,7 +69,7 @@
(shell-command (concat "termite --hold -e \"./a.out\"")) (shell-command (concat "termite --hold -e \"./a.out\""))
) )
) )
;; Latex ;; Latex-mode functions
(fset 'next-section (fset 'next-section
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("\\sec (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("\\sec
" 0 "%d")) arg))) " 0 "%d")) arg)))
@@ -84,6 +84,11 @@
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(custom-safe-themes '(custom-safe-themes
(quote
("66881e95c0eda61d34aa7f08ebacf03319d37fe202d68ecf6a1dbfd49d664bc3" default)))
'(dp-pairs
(quote
(("(" ")" nil)
("[" "]" nil) ("[" "]" nil)
("{" "}" dp-brace-post-handler)))) ("{" "}" dp-brace-post-handler))))
'(elpy-dedicated-shells t) '(elpy-dedicated-shells t)
@@ -107,9 +112,7 @@
;; Startup ;; Startup
;; Load Theme ;; Load Theme
(load-theme 'forest-blue t)
;; General stuff
(load-theme 'forest-blue t) (load-theme 'forest-blue t)
;; Python ;; Python
@@ -117,10 +120,13 @@
(defalias 'workon 'pyvenv-workon) (defalias 'workon 'pyvenv-workon)
(workon "~/.virtualenv/default") (workon "~/.virtualenv/default")
(eval-after-load 'elpy (eval-after-load 'elpy
'(define-key elpy-mode-map (kbd "C-c C-c") 'pyexec)
) )
;; C++ ;; C++
(eval-after-load 'cc-mode
'(define-key c++-mode-map (kbd "C-c C-c") 'cppexec)) '(define-key c++-mode-map (kbd "C-c C-c") 'cppexec))
;; LaTeX ;; LaTeX
(require 'tex) (require 'tex)
(setq TeX-auto-save t) (setq TeX-auto-save t)
@@ -128,27 +134,23 @@
(setq-default TeX-master nil) (setq-default TeX-master nil)
(eval-after-load 'latex (eval-after-load 'latex
'(define-key LaTeX-mode-map (kbd "C-c n") 'next-section)) '(define-key LaTeX-mode-map (kbd "C-c n") 'next-section))
(eval-after-load 'latex (eval-after-load 'latex
'(define-key LaTeX-mode-map (kbd "C-c p") 'prev-section))
;; Tex To PDF
'(define-key LaTeX-mode-map (kbd "C-c p") 'prev-section)) '(define-key LaTeX-mode-map (kbd "C-c p") 'prev-section))
;; Yasnippet ;; Yasnippet
(setq yas-snippet-dirs (setq yas-snippet-dirs
'("~/.emacs.d/snippets" ;; personal snippets/copied ones '("~/.emacs.d/snippets" ;; personal snippets/copied ones
) )
) )
(yas-global-mode t)
;; flycheck
(add-hook 'after-init-hook #'global-flycheck-mode) ;; Modes
;; dummyparents
(eval-after-load "dummyparens-autoloads"
'(progn
(if (require 'dummyparens nil t)
(global-dummyparens-mode)
(show-paren-mode 1) (show-paren-mode 1)
;; Google-this
(menu-bar-mode -1) (menu-bar-mode -1)
(google-this-mode 1)
(nyan-mode 1)
(TeX-global-PDF-mode t)
(yas-global-mode t)
(global-dummyparens-mode) (global-dummyparens-mode)
(add-hook 'after-init-hook #'global-flycheck-mode) (add-hook 'after-init-hook #'global-flycheck-mode)

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*~ *~
\#*\# \#*\#
*.log *.log
.#\config