Test to see if "used packages" are automatically installed, also switched to material-theme, globally

clean_emacs
TuDatTr 2018-01-14 12:25:14 +01:00
parent 847809d929
commit f221452275
No known key found for this signature in database
GPG Key ID: 6B2AC5D2CAECE06A
6 changed files with 220 additions and 79 deletions

View File

@ -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)

View File

@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<title>Emacs Configs</title>
<!-- 2018-01-13 Sa 14:55 -->
<title>Emacs configure</title>
<!-- 2018-01-13 Sa 16:37 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Org-mode">
@ -192,7 +192,7 @@ $(function() {
</head>
<body>
<div id="content" class="container">
<div class="row"><div class="col-md-9"><h1 class="title">Emacs Configs</h1>
<div class="row"><div class="col-md-9"><h1 class="title">Emacs configure</h1>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Packages</h2>
@ -244,8 +244,12 @@ $(function() {
<li>yasnippet
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-1-2" class="outline-3">
<h3 id="sec-1-2"><span class="section-number-3">1.2</span> Package Archives</h3>
<div class="outline-text-3" id="text-1-2">
<p>
Adding the melpa package repository to Emacs.
</p>
@ -263,11 +267,22 @@ Adding the melpa package repository to Emacs.
<h2 id="sec-2"><span class="section-number-2">2</span> Themes</h2>
<div class="outline-text-2" id="text-2">
<p>
Using the <a href="https://github.com/olkinn/forest-blue-emacs">Forest Blue</a>-Theme
Using the <a href="https://github.com/cpaulik/emacs-material-theme">Material</a>-Theme.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(load-theme 'forest-blue t)
<pre class="src src-emacs-lisp">(load-theme 'material t)
</pre>
</div>
<p>
Changes the Emacs background to the terminals defaults. (Generally)
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-hook 'window-setup-hook
'(lambda ()
(set-face-background 'default "unspecified-bg")))
</pre>
</div>
</div>
@ -282,6 +297,9 @@ Using the <a href="https://github.com/olkinn/forest-blue-emacs">Forest Blue</a>-
</div><div id="outline-container-sec-3-1-1" class="outline-4">
<h4 id="sec-3-1-1"><span class="section-number-4">3.1.1</span> Copy</h4>
<div class="outline-text-4" id="text-3-1-1">
<p>
Copy the marked area to the clipboard.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(defun copy-to-xclipboard(arg)
@ -306,6 +324,9 @@ Using the <a href="https://github.com/olkinn/forest-blue-emacs">Forest Blue</a>-
<div id="outline-container-sec-3-1-2" class="outline-4">
<h4 id="sec-3-1-2"><span class="section-number-4">3.1.2</span> Cut</h4>
<div class="outline-text-4" id="text-3-1-2">
<p>
Cut the marked area to the clipboard.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(defun cut-to-xclipboard(arg)
@ -331,6 +352,9 @@ Using the <a href="https://github.com/olkinn/forest-blue-emacs">Forest Blue</a>-
<div id="outline-container-sec-3-1-3" class="outline-4">
<h4 id="sec-3-1-3"><span class="section-number-4">3.1.3</span> Paste</h4>
<div class="outline-text-4" id="text-3-1-3">
<p>
Paste from the clipboard.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(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)))
</pre>
</div>
</div>
</div>
<div id="outline-container-sec-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> Personal mode to overwrite Emacs' default keybindings</h3>
<div class="outline-text-3" id="text-3-3">
<p>
Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window
mode tho.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(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")
<pre class="src src-emacs-lisp">(defun transparent-terminal ()
(unless (display-graphic-p (selected-frame))
(set-face-background 'default "unspecified-bg" (selected-frame))))
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Mode customization</h2>
<h2 id="sec-4"><span class="section-number-2">4</span> Mode customisation</h2>
<div class="outline-text-2" id="text-4">
</div><div id="outline-container-sec-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Global Modes</h3>
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Window Modes</h3>
<div class="outline-text-3" id="text-4-1">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(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)
<pre class="src src-emacs-lisp">(menu-bar-mode -1)
</pre>
</div>
</div>
@ -470,9 +479,13 @@ Activate Syntax Highlighting in Org-mode.
</div>
<p>
Add rainbow-delimiteres in org-mode
(add-hook 'org-mode-hook 'rainbow-delimiters-mode)
Add rainbow-delimiters in org-mode
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-hook 'org-mode-hook 'rainbow-delimiters-mode)
</pre>
</div>
</div>
</div>
<div id="outline-container-sec-4-5" class="outline-3">
@ -480,7 +493,8 @@ Add rainbow-delimiteres in org-mode
<div class="outline-text-3" id="text-4-5">
<div class="org-src-container">
<pre class="src src-emacs-lisp"></pre>
<pre class="src src-emacs-lisp">(ivy-mode 1)
</pre>
</div>
</div>
</div>
@ -491,16 +505,21 @@ Add rainbow-delimiteres in org-mode
<pre class="src src-emacs-lisp">(require 'paren)
(setq show-paren-style 'parenthesis)
(show-paren-mode +1)
</pre>
</div>
</div>
</div>
<div id="outline-container-sec-4-7" class="outline-3">
<h3 id="sec-4-7"><span class="section-number-3">4.7</span> Hightlight Line</h3>
<h3 id="sec-4-7"><span class="section-number-3">4.7</span> Highlight line</h3>
<div class="outline-text-3" id="text-4-7">
<p>
Globaly highlight the current line in a slightly darker shade of grey.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(set-face-background 'hl-line "#333333")
<pre class="src src-emacs-lisp">(global-hl-line-mode 1)
(set-face-background 'hl-line "#333333")
(set-face-foreground 'highlight nil)
</pre>
</div>
@ -514,6 +533,32 @@ Add rainbow-delimiteres in org-mode
<pre class="src src-emacs-lisp">(require 'yasnippet)
(setq yas-snippet-dirs
'("~/.emacs.d/snippets/"))
(yas-global-mode 1)
</pre>
</div>
</div>
</div>
<div id="outline-container-sec-4-9" class="outline-3">
<h3 id="sec-4-9"><span class="section-number-3">4.9</span> Personal mode</h3>
<div class="outline-text-3" id="text-4-9">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(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)
</pre>
</div>
</div>
@ -525,6 +570,7 @@ Add rainbow-delimiteres in org-mode
<li><a href="#sec-1">1. Packages</a>
<ul class="nav">
<li><a href="#sec-1-1">1.1. Installed packages:</a></li>
<li><a href="#sec-1-2">1.2. Package Archives</a></li>
</ul>
</li>
<li><a href="#sec-2">2. Themes</a></li>
@ -538,19 +584,19 @@ Add rainbow-delimiteres in org-mode
</ul>
</li>
<li><a href="#sec-3-2">3.2. Personal functions</a></li>
<li><a href="#sec-3-3">3.3. Personal mode to overwrite Emacs' default keybindings</a></li>
</ul>
</li>
<li><a href="#sec-4">4. Mode customization</a>
<li><a href="#sec-4">4. Mode customisation</a>
<ul class="nav">
<li><a href="#sec-4-1">4.1. Global Modes</a></li>
<li><a href="#sec-4-1">4.1. Window Modes</a></li>
<li><a href="#sec-4-2">4.2. Python</a></li>
<li><a href="#sec-4-3">4.3. LaTeX</a></li>
<li><a href="#sec-4-4">4.4. Org</a></li>
<li><a href="#sec-4-5">4.5. Ivy</a></li>
<li><a href="#sec-4-6">4.6. Parenthesis</a></li>
<li><a href="#sec-4-7">4.7. Hightlight Line</a></li>
<li><a href="#sec-4-7">4.7. Highlight line</a></li>
<li><a href="#sec-4-8">4.8. Yasnippet</a></li>
<li><a href="#sec-4-9">4.9. Personal mode</a></li>
</ul>
</li>
</ul>
@ -560,7 +606,7 @@ Add rainbow-delimiteres in org-mode
<footer id="postamble" class="">
<div><p class="date">Date: <span class="timestamp-wrapper"><span class="timestamp">&lt;2018-01-11 Do&gt;</span></span></p>
<p class="author">Author: Tuan-Dat Tran</p>
<p class="date">Created: 2018-01-13 Sa 14:55</p>
<p class="date">Created: 2018-01-13 Sa 16:37</p>
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.3.1 (<a href="http://orgmode.org">Org-mode</a> 8.2.10)</p>
</div>
</footer>

View File

@ -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

View File

@ -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.

13
emacs/.emacs.d/recentf Normal file
View File

@ -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:

View File

@ -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}