.emacs.d

My Emacs configuration files.
Log | Files | Refs | README

commit 2ffdc23db8d3c32718cdfa2b725e0086b830b237
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Tue, 10 Feb 2015 15:22:51 -0500

First commit.

Diffstat:
A.gitignore | 13+++++++++++++
AREADME.md | 4++++
Abookmarks | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acustom.el | 48++++++++++++++++++++++++++++++++++++++++++++++++
Adefuns/duplicate-line.el | 15+++++++++++++++
Adefuns/hexcolour-css.el | 15+++++++++++++++
Adefuns/move-line.el | 18++++++++++++++++++
Adefuns/navigate-brackets.el | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adefuns/top-join-line.el | 6++++++
Agithub-markdown.css | 851+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ainit.el | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alisp/key-bindings.el | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alisp/setup-appearance.el | 38++++++++++++++++++++++++++++++++++++++
Alisp/setup-autopair-mode.el | 4++++
Alisp/setup-css-mode.el | 9+++++++++
Alisp/setup-emmet-mode.el | 6++++++
Alisp/setup-helm-mode.el | 3+++
Alisp/setup-html-mode.el | 10++++++++++
Alisp/setup-js-mode.el | 3+++
Alisp/setup-macros.el | 36++++++++++++++++++++++++++++++++++++
Alisp/setup-magit.el | 11+++++++++++
Alisp/setup-markdown-mode.el | 9+++++++++
Alisp/setup-multi-web-mode.el | 9+++++++++
Alisp/setup-org-mode.el | 28++++++++++++++++++++++++++++
Alisp/setup-package.el | 8++++++++
Alisp/setup-projectile.el | 4++++
Alisp/setup-web-mode.el | 18++++++++++++++++++
Alisp/setup-yasnippet.el | 3+++
Asite-lisp/README.md | 7+++++++
29 files changed, 1469 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,13 @@ +auto-save-list +backups +*~ +session.* +tramp +elpa +*.elc +*.eld +.yas-compiled-snippets.el + +.DS_Store +/setup-smtp.el +/.mc-lists.el diff --git a/README.md b/README.md @@ -0,0 +1,4 @@ +.emacs.d +======== + +Ma configuration pour GNU Emacs. Grandement basé et inspiré par ceux de [Magnar Sveen](https://github.com/magnars/.emacs.d) et de [Steve Purcell](https://github.com/purcell/emacs.d). diff --git a/bookmarks b/bookmarks @@ -0,0 +1,70 @@ +;;;; Emacs Bookmark Format Version 1 ;;;; +;;; This format is meant to be slightly human-readable; +;;; nevertheless, you probably don't want to edit it. +;;; -*- End Of Bookmark File Format Version Stamp -*- +(("hs0ucy.log" + (filename . "~/Seafile/Ma Bibliothèque/notes/hs0ucy.log.org") + (front-context-string . "klist accessibil") + (rear-context-string . "e;\n*** TODO Chec") + (position . 3457)) +("walter-src" + (filename . "~/_Projets/walter/walter-com/src/") + (front-context-string . "themes\n drwxr-x") + (rear-context-string . "96 jui 2 14:50 ") + (position . 574)) +("mail" + (filename . "/tmp/mail.md") + (front-context-string) + (rear-context-string . "est en markdown.") + (position . 175)) +("hugosoucycc" + (filename . "~/Seafile/Ma Bibliothèque/projets/hugosoucycc/") + (front-context-string . "archetypes\n -rw") + (rear-context-string . "96 aoû 15 16:51 ") + (position . 259)) +("JSKrill" + (filename . "~/Seafile/Ma Bibliothèque/projets/JSKrill/") + (front-context-string . "jskrill.html\n -") + (rear-context-string . "52 aoû 13 15:00 ") + (position . 255)) +("walter-theme" + (filename . "~/_Projets/walter/walter-com/src/themes/walter-theme/src/main/webapp/") + (front-context-string . "..\n -rw-r--r-- ") + (rear-context-string . "96 fév 18 14:44 ") + (position . 231)) +("ssqca-cmsentities" + (filename . "~/_Projets/ssq/refonte-de-ssq-ca/src/cms-entities/global/journal/") + (front-context-string . "articles\n drwxr") + (rear-context-string . "96 Mar 3 08:12 ") + (position . 275)) +("ssqca-layouts" + (filename . "~/_Projets/ssq/refonte-de-ssq-ca/src/layouts/ssqca-layouts/src/main/webapp/") + (front-context-string . "2_2_columns.png\n") + (rear-context-string . "36 Nov 1 09:05 ") + (position . 285)) +("ssqca-theme" + (filename . "~/_Projets/ssq/refonte-de-ssq-ca/src/themes/ssqca-theme/src/main/webapp/") + (front-context-string . "config.rb\n drwx") + (rear-context-string . "72 Mar 4 09:48 ") + (position . 289)) +("notes" + (filename . "~/Seafile/Ma Bibliothèque/notes") + (front-context-string . "..\n -rw-r--r-- ") + (rear-context-string . "96 Jan 7 14:17 ") + (position . 178)) +("projets" + (filename . "~/_Projets/") + (front-context-string . "brunobouchard\n ") + (rear-context-string . "96 Oct 10 06:21 ") + (position . 203)) +("www" + (filename . "~/public_html/") + (front-context-string . "..\n drwxr-xr-x ") + (rear-context-string . "96 Jan 2 11:48 ") + (position . 171)) +("emacs" + (filename . "~/.emacs.d/") + (front-context-string . "appearance.el~\n ") + (rear-context-string . "64 Dec 19 23:39 ") + (position . 203)) +)+ \ No newline at end of file diff --git a/custom.el b/custom.el @@ -0,0 +1,48 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(column-number-mode t) + '(custom-safe-themes + (quote + ("9b94a52c25ea76b72df2050928d18e7fe9060e9c7f7d992f33bf35d4931b0444" "009d2b33a4c04e847e36b77803daed44c77646e58e218271d609c85876091180" "9dae95cdbed1505d45322ef8b5aa90ccb6cb59e0ff26fef0b8f411dfc416c552" "7fbb8d064286706fb1e319c9d3c0a8eafc2efe6b19380aae9734c228b05350ae" "3b819bba57a676edf6e4881bd38c777f96d1aa3b3b5bc21d8266fa5b0d0f1ebf" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "f0a99f53cbf7b004ba0c1760aa14fd70f2eabafe4e62a2b3cf5cabae8203113b" "8b231ba3e5f61c2bb1bc3a2d84cbd16ea17ca13395653566d4dfbb11feaf8567" "7a9f392481b6e2fb027ab9d8053ab36c0f23bf5cc1271206982339370d894c74" "ed81411169b1b3e3d4cfc39b09d68ea13e0ff7708dc5b9d0bedb319e071968ad" "8eef22cd6c122530722104b7c82bc8cdbb690a4ccdd95c5ceec4f3efa5d654f5" default))) + '(display-battery-mode t) + '(display-time-mode t) + '(indent-tabs-mode nil) + '(mail-use-rfc822 t) + '(safe-local-variable-values (quote ((encoding . utf-8)))) + '(show-paren-mode t) + '(size-indication-mode t) + '(tab-width 4) + '(tool-bar-mode nil) + '(user-full-name "Hugo Soucy") + '(user-mail-address "hugo@soucy.cc") + '(vc-annotate-background "#2B2B2B") + '(vc-annotate-color-map + (quote + ((20 . "#BC8383") + (40 . "#CC9393") + (60 . "#DFAF8F") + (80 . "#D0BF8F") + (100 . "#E0CF9F") + (120 . "#F0DFAF") + (140 . "#5F7F5F") + (160 . "#7F9F7F") + (180 . "#8FB28F") + (200 . "#9FC59F") + (220 . "#AFD8AF") + (240 . "#BFEBBF") + (260 . "#93E0E3") + (280 . "#6CA0A3") + (300 . "#7CB8BB") + (320 . "#8CD0D3") + (340 . "#94BFF3") + (360 . "#DC8CC3")))) + '(vc-annotate-very-old-color "#DC8CC3")) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/defuns/duplicate-line.el b/defuns/duplicate-line.el @@ -0,0 +1,15 @@ +;; Duplicating lines & commenting them + +(defun djcb-duplicate-line (&optional commentfirst) + "comment line at point; if COMMENTFIRST is non-nil, comment the original" + (interactive) + (beginning-of-line) + (let + ((beg (point))) + (end-of-line) + (let ((str (buffer-substring beg (point)))) + (when commentfirst + (comment-region beg (point))) + (insert-string + (concat (if (= 0 (forward-line 1)) "" "\n") str "\n")) + (forward-line -1)))) diff --git a/defuns/hexcolour-css.el b/defuns/hexcolour-css.el @@ -0,0 +1,15 @@ +;; Display colors from hex values in CSS +(defvar hexcolour-keywords + '(("#[abcdef[:digit:]]\\{6\\}" + (0 (put-text-property + (match-beginning 0) + (match-end 0) + 'face (list :background + (match-string-no-properties 0))))))) +(defun hexcolour-add-to-font-lock () + (font-lock-add-keywords nil hexcolour-keywords)) + +(add-hook 'css-mode-hook 'hexcolour-add-to-font-lock) +(add-hook 'scss-mode-hook 'hexcolour-add-to-font-lock) +(add-hook 'php-mode-hook 'hexcolour-add-to-font-lock) +(add-hook 'html-mode-hook 'hexcolour-add-to-font-lock) diff --git a/defuns/move-line.el b/defuns/move-line.el @@ -0,0 +1,18 @@ +;; Move Current Line + +;; Up +(defun move-line-up () + "Move up the current line." + (interactive) + (transpose-lines 1) + (forward-line -2) + (indent-according-to-mode)) + +;; Down +(defun move-line-down () + "Move down the current line." + (interactive) + (forward-line 1) + (transpose-lines 1) + (forward-line -1) + (indent-according-to-mode)) diff --git a/defuns/navigate-brackets.el b/defuns/navigate-brackets.el @@ -0,0 +1,57 @@ +;; Commands to Navigate Brackets (http://ergoemacs.org/emacs/emacs_navigating_keys_for_brackets.html) + +(defun forward-open-bracket (&optional number) + "Move cursor to the next occurrence of left bracket or quotation mark. + +With prefix NUMBER, move forward to the next NUMBER left bracket or quotation mark. + +With a negative prefix NUMBER, move backward to the previous NUMBER left bracket or quotation mark." + (interactive "p") + (if (and number + (> 0 number)) + (backward-open-bracket (- 0 number)) + (forward-char 1) + (search-forward-regexp + (eval-when-compile + (regexp-opt + '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number) + (backward-char 1))) + +(defun backward-open-bracket (&optional number) + "Move cursor to the previous occurrence of left bracket or quotation mark. +With prefix argument NUMBER, move backward NUMBER open brackets. +With a negative prefix NUMBER, move forward NUMBER open brackets." + (interactive "p") + (if (and number + (> 0 number)) + (forward-open-bracket (- 0 number)) + (search-backward-regexp + (eval-when-compile + (regexp-opt + '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number))) + +(defun forward-close-bracket (&optional number) + "Move cursor to the next occurrence of right bracket or quotation mark. +With a prefix argument NUMBER, move forward NUMBER closed bracket. +With a negative prefix argument NUMBER, move backward NUMBER closed brackets." + (interactive "p") + (if (and number + (> 0 number)) + (backward-close-bracket (- 0 number)) + (search-forward-regexp + (eval-when-compile + (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number))) + +(defun backward-close-bracket (&optional number) + "Move cursor to the previous occurrence of right bracket or quotation mark. +With a prefix argument NUMBER, move backward NUMBER closed brackets. +With a negative prefix argument NUMBER, move forward NUMBER closed brackets." + (interactive "p") + (if (and number + (> 0 number)) + (forward-close-bracket (- 0 number)) + (backward-char 1) + (search-backward-regexp + (eval-when-compile + (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number) + (forward-char 1))) diff --git a/defuns/top-join-line.el b/defuns/top-join-line.el @@ -0,0 +1,6 @@ +;; Compress a few lines into one + +(defun top-join-line () + "Join the current line with the line beneath it." + (interactive) + (delete-indentation 1)) diff --git a/github-markdown.css b/github-markdown.css @@ -0,0 +1,851 @@ +@font-face { + font-family: octicons-anchor; + src: url(data:font/woff;charset=utf-8;base64,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) format('woff'); +} + +.markdown-body { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + color: #333; + overflow: hidden; + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; + font-size: 16px; + line-height: 1.6; + word-wrap: break-word; +} + + a { + background: transparent; +} + + a:active, + a:hover { + outline: 0; +} + + strong { + font-weight: bold; +} + + h1 { + font-size: 2em; + margin: 0.67em 0; +} + + img { + border: 0; +} + + hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + + pre { + overflow: auto; +} + + code, + kbd, + pre { + font-family: monospace, monospace; + font-size: 1em; +} + + input { + color: inherit; + font: inherit; + margin: 0; +} + + html input[disabled] { + cursor: default; +} + + input { + line-height: normal; +} + + input[type="checkbox"] { + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} + + table { + border-collapse: collapse; + border-spacing: 0; +} + + td, + th { + padding: 0; +} + + * { + -moz-box-sizing: border-box; + box-sizing: border-box; +} + + input { + font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; +} + + a { + color: #4183c4; + text-decoration: none; +} + + a:hover, + a:focus, + a:active { + text-decoration: underline; +} + + hr { + height: 0; + margin: 15px 0; + overflow: hidden; + background: transparent; + border: 0; + border-bottom: 1px solid #ddd; +} + + hr:before { + display: table; + content: ""; +} + + hr:after { + display: table; + clear: both; + content: ""; +} + + h1, + h2, + h3, + h4, + h5, + h6 { + margin-top: 15px; + margin-bottom: 15px; + line-height: 1.1; +} + + h1 { + font-size: 30px; +} + + h2 { + font-size: 21px; +} + + h3 { + font-size: 16px; +} + + h4 { + font-size: 14px; +} + + h5 { + font-size: 12px; +} + + h6 { + font-size: 11px; +} + + blockquote { + margin: 0; +} + + ul, + ol { + padding: 0; + margin-top: 0; + margin-bottom: 0; +} + + ol ol, + ul ol { + list-style-type: lower-roman; +} + + ul ul ol, + ul ol ol, + ol ul ol, + ol ol ol { + list-style-type: lower-alpha; +} + + dd { + margin-left: 0; +} + + code { + font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; +} + + pre { + margin-top: 0; + margin-bottom: 0; + font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; +} + + .octicon { + font: normal normal 16px octicons-anchor; + line-height: 1; + display: inline-block; + text-decoration: none; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + + .octicon-link:before { + content: '\f05c'; +} + +>*:first-child { + margin-top: 0 !important; +} + +>*:last-child { + margin-bottom: 0 !important; +} + + .anchor { + position: absolute; + top: 0; + bottom: 0; + left: 0; + display: block; + padding-right: 6px; + padding-left: 30px; + margin-left: -30px; +} + + .anchor:focus { + outline: none; +} + + h1, + h2, + h3, + h4, + h5, + h6 { + position: relative; + margin-top: 1em; + margin-bottom: 16px; + font-weight: bold; + line-height: 1.4; +} + + h1 .octicon-link, + h2 .octicon-link, + h3 .octicon-link, + h4 .octicon-link, + h5 .octicon-link, + h6 .octicon-link { + display: none; + color: #000; + vertical-align: middle; +} + + h1:hover .anchor, + h2:hover .anchor, + h3:hover .anchor, + h4:hover .anchor, + h5:hover .anchor, + h6:hover .anchor { + padding-left: 8px; + margin-left: -30px; + line-height: 1; + text-decoration: none; +} + + h1:hover .anchor .octicon-link, + h2:hover .anchor .octicon-link, + h3:hover .anchor .octicon-link, + h4:hover .anchor .octicon-link, + h5:hover .anchor .octicon-link, + h6:hover .anchor .octicon-link { + display: inline-block; +} + + h1 { + padding-bottom: 0.3em; + font-size: 2.25em; + line-height: 1.2; + border-bottom: 1px solid #eee; +} + + h2 { + padding-bottom: 0.3em; + font-size: 1.75em; + line-height: 1.225; + border-bottom: 1px solid #eee; +} + + h3 { + font-size: 1.5em; + line-height: 1.43; +} + + h4 { + font-size: 1.25em; +} + + h5 { + font-size: 1em; +} + + h6 { + font-size: 1em; + color: #777; +} + + p, + blockquote, + ul, + ol, + dl, + table, + pre { + margin-top: 0; + margin-bottom: 16px; +} + + hr { + height: 4px; + padding: 0; + margin: 16px 0; + background-color: #e7e7e7; + border: 0 none; +} + + ul, + ol { + padding-left: 2em; +} + + ul ul, + ul ol, + ol ol, + ol ul { + margin-top: 0; + margin-bottom: 0; +} + + li>p { + margin-top: 16px; +} + + dl { + padding: 0; +} + + dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: bold; +} + + dl dd { + padding: 0 16px; + margin-bottom: 16px; +} + + blockquote { + padding: 0 15px; + color: #777; + border-left: 4px solid #ddd; +} + + blockquote>:first-child { + margin-top: 0; +} + + blockquote>:last-child { + margin-bottom: 0; +} + + table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; +} + + table th { + font-weight: bold; +} + + table th, + table td { + padding: 6px 13px; + border: 1px solid #ddd; +} + + table tr { + background-color: #fff; + border-top: 1px solid #ccc; +} + + table tr:nth-child(2n) { + background-color: #f8f8f8; +} + + img { + max-width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + + code { + padding: 0; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; + font-size: 85%; + background-color: rgba(0,0,0,0.04); + border-radius: 3px; +} + + code:before, + code:after { + letter-spacing: -0.2em; + content: "\00a0"; +} + + pre>code { + padding: 0; + margin: 0; + font-size: 100%; + word-break: normal; + white-space: pre; + background: transparent; + border: 0; +} + + .highlight { + margin-bottom: 16px; +} + + .highlight pre, + pre { + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: #f7f7f7; + border-radius: 3px; +} + + .highlight pre { + margin-bottom: 0; + word-break: normal; +} + + pre { + word-wrap: normal; +} + + pre code { + display: inline; + max-width: initial; + padding: 0; + margin: 0; + overflow: initial; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; +} + + pre code:before, + pre code:after { + content: normal; +} + + .highlight { + background: #fff; +} + + .highlight .h { + color: #333; + font-style: normal; + font-weight: normal; +} + + .highlight .mf, + .highlight .mh, + .highlight .mi, + .highlight .mo, + .highlight .il, + .highlight .m { + color: #945277; +} + + .highlight .s, + .highlight .sb, + .highlight .sc, + .highlight .sd, + .highlight .s2, + .highlight .se, + .highlight .sh, + .highlight .si, + .highlight .sx, + .highlight .s1 { + color: #df5000; +} + + .highlight .kc, + .highlight .kd, + .highlight .kn, + .highlight .kp, + .highlight .kr, + .highlight .kt, + .highlight .k, + .highlight .o { + font-weight: bold; +} + + .highlight .kt { + color: #458; +} + + .highlight .c, + .highlight .cm, + .highlight .c1 { + color: #998; + font-style: italic; +} + + .highlight .cp, + .highlight .cs, + .highlight .cp .h { + color: #999; + font-weight: bold; +} + + .highlight .cs { + font-style: italic; +} + + .highlight .n { + color: #333; +} + + .highlight .na, + .highlight .nv, + .highlight .vc, + .highlight .vg, + .highlight .vi { + color: #008080; +} + + .highlight .nb { + color: #0086B3; +} + + .highlight .nc { + color: #458; + font-weight: bold; +} + + .highlight .no { + color: #094e99; +} + + .highlight .ni { + color: #800080; +} + + .highlight .ne { + color: #990000; + font-weight: bold; +} + + .highlight .nf { + color: #945277; + font-weight: bold; +} + + .highlight .nn { + color: #555; +} + + .highlight .nt { + color: #000080; +} + + .highlight .err { + color: #a61717; + background-color: #e3d2d2; +} + + .highlight .gd { + color: #000; + background-color: #fdd; +} + + .highlight .gd .x { + color: #000; + background-color: #faa; +} + + .highlight .ge { + font-style: italic; +} + + .highlight .gr { + color: #aa0000; +} + + .highlight .gh { + color: #999; +} + + .highlight .gi { + color: #000; + background-color: #dfd; +} + + .highlight .gi .x { + color: #000; + background-color: #afa; +} + + .highlight .go { + color: #888; +} + + .highlight .gp { + color: #555; +} + + .highlight .gs { + font-weight: bold; +} + + .highlight .gu { + color: #800080; + font-weight: bold; +} + + .highlight .gt { + color: #aa0000; +} + + .highlight .ow { + font-weight: bold; +} + + .highlight .w { + color: #bbb; +} + + .highlight .sr { + color: #017936; +} + + .highlight .ss { + color: #8b467f; +} + + .highlight .bp { + color: #999; +} + + .highlight .gc { + color: #999; + background-color: #EAF2F5; +} + + kbd { + background-color: #e7e7e7; + background-image: -webkit-linear-gradient(#fefefe, #e7e7e7); + background-image: linear-gradient(#fefefe, #e7e7e7); + background-repeat: repeat-x; + display: inline-block; + padding: 3px 5px; + font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + color: #000; + border: 1px solid #cfcfcf; + border-radius: 2px; +} + + .highlight .pl-coc, + .highlight .pl-entm, + .highlight .pl-eoa, + .highlight .pl-mai .pl-sf, + .highlight .pl-pdv, + .highlight .pl-sc, + .highlight .pl-sr, + .highlight .pl-v, + .highlight .pl-vpf { + color: #0086b3; +} + + .highlight .pl-eoac, + .highlight .pl-mdht, + .highlight .pl-mi1, + .highlight .pl-mri, + .highlight .pl-va, + .highlight .pl-vpu { + color: #008080; +} + + .highlight .pl-c, + .highlight .pl-pdc { + color: #b4b7b4; + font-style: italic; +} + + .highlight .pl-k, + .highlight .pl-ko, + .highlight .pl-kolp, + .highlight .pl-mc, + .highlight .pl-mr, + .highlight .pl-ms, + .highlight .pl-s, + .highlight .pl-sok, + .highlight .pl-st { + color: #6e5494; +} + + .highlight .pl-ef, + .highlight .pl-enf, + .highlight .pl-enm, + .highlight .pl-entc, + .highlight .pl-eoi, + .highlight .pl-sf, + .highlight .pl-smc { + color: #d12089; +} + + .highlight .pl-ens, + .highlight .pl-eoai, + .highlight .pl-kos, + .highlight .pl-mh .pl-pdh, + .highlight .pl-mp, + .highlight .pl-pde, + .highlight .pl-stp { + color: #458; +} + + .highlight .pl-enti { + color: #d12089; + font-weight: bold; +} + + .highlight .pl-cce, + .highlight .pl-enc, + .highlight .pl-kou, + .highlight .pl-mq { + color: #f93; +} + + .highlight .pl-mp1 .pl-sf { + color: #458; + font-weight: bold; +} + + .highlight .pl-cos, + .highlight .pl-ent, + .highlight .pl-md, + .highlight .pl-mdhf, + .highlight .pl-ml, + .highlight .pl-pdc1, + .highlight .pl-pds, + .highlight .pl-s1, + .highlight .pl-scp, + .highlight .pl-sol { + color: #df5000; +} + + .highlight .pl-c1, + .highlight .pl-cn, + .highlight .pl-pse, + .highlight .pl-pse .pl-s2, + .highlight .pl-vi { + color: #a31515; +} + + .highlight .pl-mb, + .highlight .pl-pdb { + color: #df5000; + font-weight: bold; +} + + .highlight .pl-mi, + .highlight .pl-pdi { + color: #6e5494; + font-style: italic; +} + + .highlight .pl-ms1 { + background-color: #f5f5f5; +} + + .highlight .pl-mdh, + .highlight .pl-mdi { + font-weight: bold; +} + + .highlight .pl-mdr { + color: #0086b3; + font-weight: bold; +} + + .highlight .pl-s2 { + color: #333; +} + + .highlight .pl-ii { + background-color: #df5000; + color: #fff; +} + + .highlight .pl-ib { + background-color: #f93; +} + + .highlight .pl-id { + background-color: #a31515; + color: #fff; +} + + .highlight .pl-iu { + background-color: #b4b7b4; +} + + .highlight .pl-mo { + color: #969896; +} + + .task-list-item { + list-style-type: none; +} + + .task-list-item+.task-list-item { + margin-top: 3px; +} + + .task-list-item input { + float: left; + margin: 0.3em 0 0.25em -1.6em; + vertical-align: middle; +} diff --git a/init.el b/init.el @@ -0,0 +1,111 @@ +;; Workaround to fix problems with accented characters in Ubuntu 13.10 +(require 'iso-transl) + +;; It adds in a ton of compatibility with Common Lisp, so that you can just use the Common Lisp functions. +(require 'cl) + +;; Coding Systems with Unicode +(prefer-coding-system 'utf-8) +(set-default-coding-systems 'utf-8) +(set-terminal-coding-system 'utf-8) +(set-keyboard-coding-system 'utf-8) +(set-language-environment "UTF-8") + +;; Treat clipboard input as UTF-8 string first; compound text next, etc. +(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) + +;; Ibuffer +(defalias 'list-buffers 'ibuffer) + +;; Set path to dependencies +(setq site-lisp-dir + (expand-file-name "site-lisp" user-emacs-directory)) + +(setq lisp-dir + (expand-file-name "lisp" user-emacs-directory)) + +;; Set up load path +(add-to-list 'load-path site-lisp-dir) +(add-to-list 'load-path lisp-dir) + +;; Add external projects to load path +(dolist (project (directory-files site-lisp-dir t "\\w+")) + (when (file-directory-p project) + (add-to-list 'load-path project))) + +;; Write backup files to own directory +;; (setq backup-directory-alist +;; `(("." . ,(expand-file-name +;; (concat user-emacs-directory "backups"))))) +(setq auto-save-default nil) +(setq make-backup-files nil) + +;; Setup packages +(require 'setup-package) + +;; Setup appearance of Emacs +(require 'setup-appearance) + +;; Setup autopair mode +(require 'setup-autopair-mode) + +;; Setup Magit-Mode +(require 'setup-magit) + +;; Setup Multi-Web-Mode +(require 'setup-multi-web-mode) + +;; Setup Web-Mode +(require 'setup-web-mode) + +;; Setup Org-Mode +(require 'setup-org-mode) + +;; Setup Projectile project manager +(require 'setup-projectile) + +;; Setup CSS-Mode +(require 'setup-css-mode) + +;; Setup Markdown +(require 'setup-markdown-mode) + +;; Setup HELM +(require 'setup-helm-mode) + +;; Setup HTML/SGML +(require 'setup-html-mode) + +;; Setup Yasnippet +(require 'setup-yasnippet) + +;; Setup Macros +(require 'setup-macros) + +;; Setup JavaScript +(require 'setup-js-mode) + +;; Setup Emmet +(require 'setup-emmet-mode) + +;; Setup key bindings +(require 'key-bindings) + +;; Bookmarks +;; To have emacs open bookmarks on startup +(setq inhibit-splash-screen t) +(require 'bookmark) +(bookmark-bmenu-list) +(switch-to-buffer "*Bookmark List*") + +;; Keep emacs Custom-settings in separate file +(setq custom-file + (expand-file-name "custom.el" user-emacs-directory)) +(load custom-file) + +;; Functions (load all files in defuns-dir) +(setq defuns-dir (expand-file-name "defuns" user-emacs-directory)) +(dolist (file (directory-files defuns-dir t "\\w+")) + (when (file-regular-p file) + (load file))) +(put 'upcase-region 'disabled nil) diff --git a/lisp/key-bindings.el b/lisp/key-bindings.el @@ -0,0 +1,54 @@ +;; CUSTOM KEY BINDINGS + +;; Naviguate trough windows +(global-set-key (kbd "C-x <up>") 'windmove-up) +(global-set-key (kbd "C-x <down>") 'windmove-down) +(global-set-key (kbd "C-x <right>") 'windmove-right) +(global-set-key (kbd "C-x <left>") 'windmove-left) + +;; Magit shortcuts +;; Git Status +(global-set-key (kbd "M-g s") 'magit-status) + +;; Bind Dynamic Abbreviations to C-<tab> key instead of M-/ +(global-set-key (kbd "C-<tab>") 'dabbrev-expand) +(define-key minibuffer-local-map (kbd "C-<tab>") 'dabbrev-expand) + +;; Move Current Line Up or Down +(global-set-key [(control shift up)] 'move-line-up) +(global-set-key [(control shift down)] 'move-line-down) + +;; Adjusting interactively the font size +(global-set-key (kbd "C-+") 'text-scale-increase) +(global-set-key (kbd "C--") 'text-scale-decrease) + +;; Duplicate a line +(global-set-key (kbd "M-RET") 'djcb-duplicate-line) + +;; Duplicate a line and comment the first +(global-set-key (kbd "C-c y") (lambda()(interactive)(djcb-duplicate-line t))) + +;; Multiple cursors for emacs +(global-set-key (kbd "C-c m") 'mc/edit-lines) +(global-set-key (kbd "C-c n") 'mc/mark-next-like-this) + +;; Compress a few lines into one +(global-set-key (kbd "M-é") 'top-join-line) + +;; commands to navigate Brackets +(global-set-key (kbd "<home>") 'backward-open-bracket) +(global-set-key (kbd "<end>") 'forward-close-bracket) + +;; Search file by name with dired +(global-set-key (kbd "M-<f1>") 'find-name-dired) + +;; Delete trailing white space or extra empty lines +(global-set-key (kbd "C-x SPC") 'delete-trailing-whitespace) + +;; Remap dired-up-directory +(global-set-key (kbd "M-<up>") 'dired-up-directory) + +;; Undo +(global-set-key (kbd "C-#") 'undo) + +(provide 'key-bindings) diff --git a/lisp/setup-appearance.el b/lisp/setup-appearance.el @@ -0,0 +1,38 @@ +;; Theme +(load-theme 'zenburn t) + +;; Fonts +;; Custom font face (120 === 12pt) +(set-face-attribute 'default nil :font "Terminus" :height 120) + +;; Line number in Emacs +;; Activate the line number script on Emacs boot +(require 'linum) +(global-linum-mode 1) + +;; Disable scroll bars +(scroll-bar-mode -1) + +;; Highlight Current Line +(global-hl-line-mode +1) + +;; Indentation +(custom-set-variables + '(tab-width 4) + '(indent-tabs-mode nil) + ) +;; (setq tab-width 4) ; or any other preferred value +;; (defvaralias 'c-basic-offset 'tab-width) +;; (defvaralias 'cperl-indent-level 'tab-width) + +;; Enlarge the frame automaticly on startup +;; (defun fullscreen (&optional f) +;; (interactive) +;; (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 +;; '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0)) +;; (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 +;; '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))) + +;;(fullscreen()) + +(provide 'setup-appearance) diff --git a/lisp/setup-autopair-mode.el b/lisp/setup-autopair-mode.el @@ -0,0 +1,4 @@ +;; Automagically pair braces and quotes like TextMate +(autopair-global-mode) ;; to enable in all buffers + +(provide 'setup-autopair-mode) diff --git a/lisp/setup-css-mode.el b/lisp/setup-css-mode.el @@ -0,0 +1,9 @@ +;; CSS SETUP FILE +;; SASS+SCSS modes + +;; SCSS Mode +(setq exec-path (cons (expand-file-name "~/.gem/ruby/1.9.1/bin") exec-path)) +(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode)) +(setq scss-compile-at-save nil) + +(provide 'setup-css-mode) diff --git a/lisp/setup-emmet-mode.el b/lisp/setup-emmet-mode.el @@ -0,0 +1,6 @@ +(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes +(add-hook 'html-mode-hook 'emmet-mode) +(add-hook 'css-mode-hook 'emmet-mode) +(add-hook 'scss-mode-hook 'emmet-mode) + +(provide 'setup-emmet-mode) diff --git a/lisp/setup-helm-mode.el b/lisp/setup-helm-mode.el @@ -0,0 +1,3 @@ +(helm-mode 1) + +(provide 'setup-helm-mode) diff --git a/lisp/setup-html-mode.el b/lisp/setup-html-mode.el @@ -0,0 +1,10 @@ +;; After deleting a tag, indent properly +(defadvice sgml-delete-tag (after reindent activate) + (indent-region (point-min) (point-max))) + +;; Activate by default sgml-electric-tag-pair-mode +(add-hook 'sgml-mode-hook 'sgml-electrictagpair-hook) +(defun sgml-electrictagpair-hook () + (sgml-electric-tag-pair-mode 1)) + +(provide 'setup-html-mode) diff --git a/lisp/setup-js-mode.el b/lisp/setup-js-mode.el @@ -0,0 +1,3 @@ +(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) + +(provide 'setup-js-mode) diff --git a/lisp/setup-macros.el b/lisp/setup-macros.el @@ -0,0 +1,36 @@ +;; Personnal Macros + +;; JavaScript +;; console.log() +(fset 'js-consolelog + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("console.log();" 0 "%d")) arg))) + +;; alert() +(fset 'js-alert + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("alert();" 0 "%d")) arg))) + +;; $(document).ready() +(fset 'js-docready + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([36 40 100 111 99 117 109 101 110 116 41 46 114 101 97 100 121 40 102 117 110 99 116 105 111 110 40 41 32 123 125 41 59 2 2 2 return return 16] 0 "%d")) arg))) + +;; $(""); +(fset 'js-jqobject + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("$(\"\");" 0 "%d")) arg))) + +;; var x = function() {}; +(fset 'js-function1 + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([118 97 114 32 120 32 61 32 102 117 110 99 116 105 111 110 40 41 32 123 125 59 2 2 return return 16 16 6 6 6 6] 0 "%d")) arg))) + +;; for( var i = 0; i < 0; i++ ) {} +(fset 'js-for + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([102 111 114 40 32 118 97 114 32 105 32 61 32 48 59 32 105 32 60 32 48 59 32 105 43 43 32 41 32 123 return 125] 0 "%d")) arg))) + +;; CSS +;; .x {} +(fset 'css-class + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote (".x {}" 0 "%d")) arg))) +;; #x {} +(fset 'css-id + (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("#x {}" 0 "%d")) arg))) + +(provide 'setup-macros) diff --git a/lisp/setup-magit.el b/lisp/setup-magit.el @@ -0,0 +1,11 @@ +;; Magit: An Emacs mode for Git. + +;; Change Magit diff colors +(eval-after-load 'magit + '(progn + (set-face-foreground 'magit-diff-add "green3") + (set-face-foreground 'magit-diff-del "#ff4500") + (when (not window-system) + (set-face-background 'magit-item-highlight "black")))) + +(provide 'setup-magit) diff --git a/lisp/setup-markdown-mode.el b/lisp/setup-markdown-mode.el @@ -0,0 +1,9 @@ +;; Markdown Mode + +(setq auto-mode-alist + (cons '("\\.md" . markdown-mode) auto-mode-alist)) + +(setq markdown-command "pandoc -s -f markdown -t html5") +(setq markdown-css-path "/home/hs0ucy/.emacs.d/github-markdown.css") + +(provide 'setup-markdown-mode) diff --git a/lisp/setup-multi-web-mode.el b/lisp/setup-multi-web-mode.el @@ -0,0 +1,9 @@ +;; Multi Web Mode is a minor mode for Web editing +(setq mweb-default-major-mode 'html-mode) +(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>") + (js-mode "<script[^>]*>" "</script>") + (css-mode "<style[^>]*>" "</style>"))) +(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5")) +(multi-web-global-mode 1) + +(provide 'setup-multi-web-mode) diff --git a/lisp/setup-org-mode.el b/lisp/setup-org-mode.el @@ -0,0 +1,28 @@ +;; Org Mode config + +;; Insert a timestamp when a TODO item was finished +(setq org-log-done 'time) + +;; Automatic line wrap in ORG-MODE +(setq org-startup-truncated nil) + +;; CalDav settings +;;(require 'org-caldav) + +;; The CalDAV URL with your full and primary email address at the end. +;; (setq org-caldav-url "https://mail.savoirfairelinux.com/dav/hugo.soucy@savoirfairelinux.com/") + +;; The name of your calendar, typically "Calendar" or similar +;; (setq org-caldav-calendar-id "Calendar") + +;; Local file that gets events from the server +;; (setq org-caldav-inbox "~/Seafile/Ma Bibliothèque/sfl-caldav.org") + +;; List of your org files here +;; (setq org-caldav-files org-agenda-files) + +;; Please make sure to set your correct timezone here +;; (setq org-icalendar-timezone "America/New_York") +;; (setq org-icalendar-date-time-format ";TZID=%Z:%Y%m%dT%H%M%S") + +(provide 'setup-org-mode) diff --git a/lisp/setup-package.el b/lisp/setup-package.el @@ -0,0 +1,8 @@ +(when (>= emacs-major-version 24) + (require 'package) + (package-initialize) + (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) + (provide 'setup-package) + ) + + diff --git a/lisp/setup-projectile.el b/lisp/setup-projectile.el @@ -0,0 +1,4 @@ +;; Manage and navigate projects in Emacs easily +(projectile-global-mode) ;; to enable in all buffers + +(provide 'setup-projectile) diff --git a/lisp/setup-web-mode.el b/lisp/setup-web-mode.el @@ -0,0 +1,18 @@ +;; Web-Mode +;; Is an autonomous emacs major-mode for editing web templates: HTML documents embedding CSS / JavaScript and Server blocks. + +(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.vm\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) + +(defun web-mode-hook () + "Hooks for Web mode." + (setq web-mode-markup-indent-offset 4) ) +(add-hook 'web-mode-hook 'web-mode-hook) + +(provide 'setup-web-mode) diff --git a/lisp/setup-yasnippet.el b/lisp/setup-yasnippet.el @@ -0,0 +1,3 @@ +(yas-global-mode 1) + +(provide 'setup-yasnippet) diff --git a/site-lisp/README.md b/site-lisp/README.md @@ -0,0 +1,6 @@ +This is a place for 3rd party code which isn't available in MELPA or +other package repositories. This directory and its immediate subdirectories +will be added to load-path at start-up time. + +Notably, in Emacs 23.x, a backported package.el is automatically +downloaded and installed here.+ \ No newline at end of file