diff --git a/emacs/.emacs.d/config.el b/emacs/.emacs.d/config.el index 17ffdfd..9a6356b 100644 --- a/emacs/.emacs.d/config.el +++ b/emacs/.emacs.d/config.el @@ -2,8 +2,36 @@ (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(package-initialize) -(load-theme 'forest-blue t) +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(require 'use-package) +(setq use-package-always-ensure t) + +(use-package aggressive-indent) +(use-package anaconda-mode) +;; (use-package auctex) throws error with use-package +(use-package counsel) +(use-package eclim) +(use-package flycheck) +(use-package google-this) +(use-package ivy) +(use-package material-theme) +(use-package ox-twbs) +(use-package rainbow-delimiters) +(use-package rainbow-mode) +(use-package smartparens) +(use-package swiper) +(use-package yasnippet) + +(load-theme 'material t) + +(add-hook 'window-setup-hook + '(lambda () + (set-face-background 'default "unspecified-bg"))) (defun copy-to-xclipboard(arg) (interactive "P") @@ -57,6 +85,10 @@ (if (= (point) (progn (back-to-indentation) (point))) (beginning-of-line))) +(defun transparent-terminal () + (unless (display-graphic-p (selected-frame)) + (set-face-background 'default "unspecified-bg" (selected-frame)))) + (menu-bar-mode -1) (add-hook 'python-mode-hook 'anaconda-mode) @@ -78,14 +110,16 @@ '(lambda () (setq org-src-fontify-natively t))) -(ivy-mode 1) +(add-hook 'org-mode-hook 'rainbow-delimiters-mode) + +(counsel-mode 1) (require 'paren) (setq show-paren-style 'parenthesis) (show-paren-mode +1) (global-hl-line-mode 1) -(set-face-background 'hl-line "#333333") +(set-face-background 'hl-line "#141b1e") (set-face-foreground 'highlight nil) (require 'yasnippet) diff --git a/emacs/.emacs.d/config.html b/emacs/.emacs.d/config.html index ec28f7e..f563f6b 100644 --- a/emacs/.emacs.d/config.html +++ b/emacs/.emacs.d/config.html @@ -1,8 +1,8 @@ -Emacs Configs - +Emacs configure + @@ -192,7 +192,7 @@ $(function() {
-

Emacs Configs

+

Emacs configure

1 Packages

@@ -244,8 +244,12 @@ $(function() {
  • yasnippet
  • +
    +
    - +
    +

    1.2 Package Archives

    +

    Adding the melpa package repository to Emacs.

    @@ -263,11 +267,22 @@ Adding the melpa package repository to Emacs.

    2 Themes

    -Using the Forest Blue-Theme +Using the Material-Theme.

    -
    (load-theme 'forest-blue t)
    +
    (load-theme 'material t)
    +
    +
    + +

    +Changes the Emacs background to the terminals defaults. (Generally) +

    +
    + +
    (add-hook 'window-setup-hook 
    +      '(lambda () 
    +	 (set-face-background 'default "unspecified-bg")))
     
    @@ -282,6 +297,9 @@ Using the Forest Blue-

    3.1.1 Copy

    +

    +Copy the marked area to the clipboard. +

    (defun copy-to-xclipboard(arg)
    @@ -306,6 +324,9 @@ Using the Forest Blue-
     

    3.1.2 Cut

    +

    +Cut the marked area to the clipboard. +

    (defun cut-to-xclipboard(arg)
    @@ -331,6 +352,9 @@ Using the Forest Blue-
     

    3.1.3 Paste

    +

    +Paste from the clipboard. +

    (defun paste-from-xclipboard()
    @@ -368,45 +392,30 @@ Go back to indentation, if you are at the indentation, go to beginning of the li
          (beginning-of-line)))
     
    -
    -
    -
    -

    3.3 Personal mode to overwrite Emacs' default keybindings

    -
    + +

    +Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window +mode tho. +

    -
    (defvar my-keys-minor-mode-map
    -  (let ((map (make-sparse-keymap)))
    -    (define-key map (kbd "C-a") 'back-to-indentation-or-beginning)
    -    (define-key map (kbd "C-c M-w") 'copy-to-xclipboard)
    -    (define-key map (kbd "C-c C-w") 'cut-to-xclipboard)
    -    (define-key map (kbd "C-c M-y") 'paste-from-xclipboard)
    -    map)
    -  "my-keys-minor-mode keymap.")
    -
    -(define-minor-mode my-keys-minor-mode
    -  "A minor mode so that my key settings override annoying major modes."
    -  :init-value t
    -  :lighter " my-keys")
    +
    (defun transparent-terminal ()
    +  (unless (display-graphic-p (selected-frame))
    +    (set-face-background 'default "unspecified-bg" (selected-frame))))
     
    -

    4 Mode customization

    +

    4 Mode customisation

    -

    4.1 Global Modes

    +

    4.1 Window Modes

    -
    (global-hl-line-mode 1)
    -(my-keys-minor-mode 1)
    -(ivy-mode 1)
    -(show-paren-mode +1)
    -(menu-bar-mode -1)
    -(yas-global-mode 1)
    +
    (menu-bar-mode -1)
     
    @@ -470,9 +479,13 @@ Activate Syntax Highlighting in Org-mode.

    -Add rainbow-delimiteres in org-mode -(add-hook 'org-mode-hook 'rainbow-delimiters-mode) +Add rainbow-delimiters in org-mode

    +
    + +
    (add-hook 'org-mode-hook 'rainbow-delimiters-mode)
    +
    +
    @@ -480,7 +493,8 @@ Add rainbow-delimiteres in org-mode
    -
    
    +
    (ivy-mode 1)
    +
    @@ -491,16 +505,21 @@ Add rainbow-delimiteres in org-mode
    (require 'paren)
     (setq show-paren-style 'parenthesis)
    +(show-paren-mode +1)
     
    -

    4.7 Hightlight Line

    +

    4.7 Highlight line

    +

    +Globaly highlight the current line in a slightly darker shade of grey. +

    -
    (set-face-background 'hl-line "#333333")
    +
    (global-hl-line-mode 1)
    +(set-face-background 'hl-line "#333333")
     (set-face-foreground 'highlight nil)
     
    @@ -514,6 +533,32 @@ Add rainbow-delimiteres in org-mode
    (require 'yasnippet)
     (setq yas-snippet-dirs
       '("~/.emacs.d/snippets/"))
    +(yas-global-mode 1)
    +
    +
    +
    +
    + +
    +

    4.9 Personal mode

    +
    +
    + +
    (defvar my-keys-minor-mode-map
    +  (let ((map (make-sparse-keymap)))
    +    (define-key map (kbd "C-a") 'back-to-indentation-or-beginning)
    +    (define-key map (kbd "C-c M-w") 'copy-to-xclipboard)
    +    (define-key map (kbd "C-c C-w") 'cut-to-xclipboard)
    +    (define-key map (kbd "C-c M-y") 'paste-from-xclipboard)
    +    map)
    +  "my-keys-minor-mode keymap.")
    +
    +(define-minor-mode my-keys-minor-mode
    +  "A minor mode so that my key settings override annoying major modes."
    +  :init-value t
    +  :lighter " my-keys")
    +
    +(my-keys-minor-mode 1)
     
    @@ -525,6 +570,7 @@ Add rainbow-delimiteres in org-mode
  • 1. Packages
  • 2. Themes
  • @@ -538,19 +584,19 @@ Add rainbow-delimiteres in org-mode
  • 3.2. Personal functions
  • -
  • 3.3. Personal mode to overwrite Emacs' default keybindings
  • -
  • 4. Mode customization +
  • 4. Mode customisation
  • @@ -560,7 +606,7 @@ Add rainbow-delimiteres in org-mode diff --git a/emacs/.emacs.d/config.org b/emacs/.emacs.d/config.org index adec229..cf22ca2 100644 --- a/emacs/.emacs.d/config.org +++ b/emacs/.emacs.d/config.org @@ -11,43 +11,68 @@ #+SELECT_TAGS: export * Packages -** Installed packages: -- aggressive-indent -- anaconda-mode -- auctex -- dash -- eclim -- epl -- f -- flycheck -- forest-blue-theme -- google-this -- highlight-indentation -- ivy -- ox-twbs -- pkg-info -- popup -- pythonic -- rainbow-delimiters -- rainbow-mode -- s -- smartparens -- yasnippet - ** Package Archives Adding the melpa package repository to Emacs. #+BEGIN_SRC emacs-lisp (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(package-initialize) +#+END_SRC +** Installed packages: + - aggressive-indent - Minor mode to aggressively keep your code always indented + - anaconda-mode - Code navigation, documentation lookup and completion for Python + - auctex - Integrated environment for *TeX* + - counsel - Various completion functions using Ivy + - eclim - An interface to the Eclipse IDE. + - flycheck - On-the-fly syntax checking + - forest-blue-theme - Emacs theme with a dark background. + - google-this - A set of functions and bindings to google under point. + - ivy - Incremental Vertical completYon + - material-theme - A Theme based on the colors of the Google Material Design + - ox-twbs - Bootstrap compatible HTML Back-End for Org + - rainbow-delimiters - Highlight brackets according to their depth + - rainbow-mode - Colorize color names in buffers + - smartparens - Automatic insertion, wrapping and paredit-like navigation with user defined pairs. + - swiper - Isearch with an overview. Oh, man! + - yasnippet - Yet another snippet extension for Emacs. + +#+BEGIN_SRC emacs-lisp +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(require 'use-package) +(setq use-package-always-ensure t) + +(use-package aggressive-indent) +(use-package anaconda-mode) +;; (use-package auctex) throws error with use-package +(use-package counsel) +(use-package eclim) +(use-package flycheck) +(use-package google-this) +(use-package ivy) +(use-package material-theme) +(use-package ox-twbs) +(use-package rainbow-delimiters) +(use-package rainbow-mode) +(use-package smartparens) +(use-package swiper) +(use-package yasnippet) #+END_SRC * Themes -Using the [[https://github.com/olkinn/forest-blue-emacs][Forest Blue]]-Theme. -I chose this theme, since it natively uses "unspecified-bg". +Using the [[https://github.com/cpaulik/emacs-material-theme][Material]]-Theme. #+BEGIN_SRC emacs-lisp -(load-theme 'forest-blue t) +(load-theme 'material t) #+END_SRC +Changes the Emacs background to the terminals defaults. (Generally) +#+BEGIN_SRC emacs-lisp +(add-hook 'window-setup-hook + '(lambda () + (set-face-background 'default "unspecified-bg"))) +#+END_SRC * Functions ** Cut/Copy and Paste by Boruch Baum *** Copy @@ -117,26 +142,37 @@ Go back to indentation, if you are at the indentation, go to beginning of the li (if (= (point) (progn (back-to-indentation) (point))) (beginning-of-line))) #+END_SRC -* Mode customisation + +Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window +mode tho. +#+BEGIN_SRC emacs-lisp +(defun transparent-terminal () + (unless (display-graphic-p (selected-frame)) + (set-face-background 'default "unspecified-bg" (selected-frame)))) +#+END_SRC +* Modes ** Window Modes #+BEGIN_SRC emacs-lisp (menu-bar-mode -1) #+END_SRC ** Python +Using Anaconda-mode as default python development mode #+BEGIN_SRC emacs-lisp (add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'anaconda-eldoc-mode) #+END_SRC ** LaTeX +Some default settings for LaTeX-Mode. +AucTeX is needed. #+BEGIN_SRC emacs-lisp (require 'tex) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) #+END_SRC - ** Org +Enable a Twitter Bootstrap mode as an export mode for Org-mode. #+BEGIN_SRC emacs-lisp (require 'ox-twbs) #+END_SRC @@ -154,14 +190,15 @@ Activate Syntax Highlighting in Org-mode. (add-hook 'org-mode-hook '(lambda () (setq org-src-fontify-natively t))) - #+END_SRC Add rainbow-delimiters in org-mode -(add-hook 'org-mode-hook 'rainbow-delimiters-mode) -** Ivy #+BEGIN_SRC emacs-lisp -(ivy-mode 1) +(add-hook 'org-mode-hook 'rainbow-delimiters-mode) +#+END_SRC +** Ivy/Counsel/Swiper +#+BEGIN_SRC emacs-lisp +(counsel-mode 1) #+END_SRC ** Parenthesis #+BEGIN_SRC emacs-lisp @@ -173,7 +210,7 @@ Add rainbow-delimiters in org-mode Globaly highlight the current line in a slightly darker shade of grey. #+BEGIN_SRC emacs-lisp (global-hl-line-mode 1) -(set-face-background 'hl-line "#333333") +(set-face-background 'hl-line "#141b1e") (set-face-foreground 'highlight nil) #+END_SRC ** Yasnippet diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 40f1b76..86c578d 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -7,7 +7,7 @@ ;; If there is more than one, they won't work right. '(package-selected-packages (quote - (anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme)))) + (counsel swiper material-theme anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs/.emacs.d/recentf b/emacs/.emacs.d/recentf new file mode 100644 index 0000000..c41188b --- /dev/null +++ b/emacs/.emacs.d/recentf @@ -0,0 +1,13 @@ +;;; Automatically generated by ‘recentf’ on Sat Jan 13 17:16:00 2018. + +(setq recentf-list + '( + "/home/tuan/.dotfiles/emacs/.emacs.d/config.org" + )) + +(setq recentf-filter-changer-current 'nil) + + +;; Local Variables: +;; coding: utf-8-emacs +;; End: diff --git a/emacs/.emacs.d/snippets/latex-mode/fspoll b/emacs/.emacs.d/snippets/latex-mode/fspoll new file mode 100644 index 0000000..32bef12 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/fspoll @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: Template of polls for FS +# key: fspoll +# -- +\begin{tabular}{ccc} + \toprule + Ja & Nein & Enthaltung \\\\ + \midrule + 3 & 1 & 9 \\\\ + \bottomrule +\end{tabular} \ No newline at end of file