.emacs.d

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

commit 8cb3522689a645d1ea6c2d473582882f05e9808f
parent 7be1cecdbce9617432ed888fc7510f3d57ef5d18
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun, 11 Mar 2018 11:21:50 -0400

Refactor all the `.emacs.d` with `use-package` and `load-file`

Diffstat:
Dgithub-markdown.css | 851-------------------------------------------------------------------------------
Minit.el | 167+++++++++++++++----------------------------------------------------------------
Dlisp/key-bindings.el | 74--------------------------------------------------------------------------
Dlisp/setup-appearance.el | 28----------------------------
Dlisp/setup-auto-complete-mode.el | 4----
Dlisp/setup-autopair-mode.el | 4----
Dlisp/setup-company-mode.el | 32--------------------------------
Dlisp/setup-css-mode.el | 9---------
Dlisp/setup-ediff.el | 37-------------------------------------
Dlisp/setup-editorconfig.el | 8--------
Dlisp/setup-email.el | 46----------------------------------------------
Dlisp/setup-emmet-mode.el | 7-------
Dlisp/setup-eshell.el | 3---
Dlisp/setup-html-mode.el | 10----------
Dlisp/setup-ido-mode.el | 12------------
Dlisp/setup-js-mode.el | 22----------------------
Dlisp/setup-macros.el | 39---------------------------------------
Dlisp/setup-magit.el | 11-----------
Dlisp/setup-markdown-mode.el | 9---------
Dlisp/setup-multi-web-mode.el | 9---------
Dlisp/setup-org-mode.el | 28----------------------------
Dlisp/setup-package.el | 10----------
Dlisp/setup-projectile.el | 4----
Dlisp/setup-undo-tree.el | 6------
Dlisp/setup-web-mode.el | 23-----------------------
Dlisp/setup-yasnippet.el | 3---
Apartials/autocompletion.el | 28++++++++++++++++++++++++++++
Apartials/backups.el | 9+++++++++
Apartials/charset-encoding.el | 15+++++++++++++++
Apartials/custom-settings.el | 7+++++++
Apartials/defuns.el | 9+++++++++
Apartials/diff.el | 35+++++++++++++++++++++++++++++++++++
Apartials/email.el | 32++++++++++++++++++++++++++++++++
Apartials/key-bindings.el | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Apartials/lua.el | 4++++
Apartials/php.el | 17+++++++++++++++++
Apartials/shell.el | 4++++
Apartials/ui.el | 47+++++++++++++++++++++++++++++++++++++++++++++++
Apartials/varia.el | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Apartials/webdev.el | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsite-lisp/README.md | 7-------
41 files changed, 393 insertions(+), 1433 deletions(-)

diff --git a/github-markdown.css b/github-markdown.css @@ -1,851 +0,0 @@ -@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 @@ -1,139 +1,32 @@ -;; Workaround to fix problems with accented characters in Ubuntu 13.10 - -;; Added by Package.el. This must come before configurations of -;; installed packages. Don't delete this line. If you don't want it, -;; just comment it out by adding a semicolon to the start of the line. -;; You may delete these explanatory comments. +;; GNU Emacs Configuration init.el file of hs0ucy. + +;; +;; SET PACKAGE & USE-PACKAGE +;; +(require 'package) +(setq package-enable-at-startup nil) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) +(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) (package-initialize) -(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 t) -(setq make-backup-files t) - -;; Displays available keybindings in popup -(which-key-mode) - -;; Setup packages -(require 'setup-package) - -;; Setup appearance of Emacs -(require 'setup-appearance) - -;; Setup auto-complete mode -(require 'setup-auto-complete-mode) - -;; Setup autopair mode -(require 'setup-autopair-mode) - -;; Setup Magit-Mode -(require 'setup-magit) - -;; 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 HTML/SGML -(require 'setup-html-mode) - -;; Setup for Ido mode -(require 'setup-ido-mode) - -;; Setup Yasnippet -(require 'setup-yasnippet) - -;; Setup Macros -(require 'setup-macros) - -;; Setup JavaScript -(require 'setup-js-mode) - -;; Setup Emmet -(require 'setup-emmet-mode) - -;; Setup Undo-Tree -(require 'setup-undo-tree) - -;; Setup Email -(require 'setup-email) - -;; Setup Editorconfig -(require 'setup-editorconfig) - -;; Setup Company mode -(require 'setup-company-mode) - -;; Setup Company mode -(require 'setup-ediff) - -;; Setup Eshell mode -(require 'setup-eshell) - -;; 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) +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(eval-when-compile + (require 'use-package)) + +(load-file "~/.emacs.d/partials/ui.el") +(load-file "~/.emacs.d/partials/autocompletion.el") +(load-file "~/.emacs.d/partials/backups.el") +(load-file "~/.emacs.d/partials/charset-encoding.el") +(load-file "~/.emacs.d/partials/custom-settings.el") +(load-file "~/.emacs.d/partials/defuns.el") +(load-file "~/.emacs.d/partials/diff.el") +(load-file "~/.emacs.d/partials/email.el") +(load-file "~/.emacs.d/partials/key-bindings.el") +(load-file "~/.emacs.d/partials/lua.el") +(load-file "~/.emacs.d/partials/shell.el") +(load-file "~/.emacs.d/partials/varia.el") +(load-file "~/.emacs.d/partials/webdev.el") diff --git a/lisp/key-bindings.el b/lisp/key-bindings.el @@ -1,74 +0,0 @@ -;; CUSTOM KEY BINDINGS - -;; 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) - -;; Make CTRL-Z Undo -(global-set-key (kbd "C-z") 'undo) - -;; Make CTRL-S-z Redo -(defalias 'redo 'undo-tree-redo) -(global-set-key (kbd "C-S-z") 'redo) - -;; Moving faster between windows -(global-set-key (kbd "C-c <up>") 'windmove-up) -(global-set-key (kbd "C-c <right>") 'windmove-right) -(global-set-key (kbd "C-c <down>") 'windmove-down) -(global-set-key (kbd "C-c <left>") 'windmove-left) - -;; Ediff -;; Press e in dired-mode to immediately ediff two marked files -;;(define-key dired-mode-map "e" 'ora-ediff-files) - -;; Toggle Fullscreen Mode -(global-set-key (kbd "C-c <") 'fullscreen-mode-fullscreen-toggle) - -;; js-mode (which js2 is based on) binds "M-." which conflicts with xref, so -;; unbind it. -(define-key js-mode-map (kbd "M-.") nil) -(define-key js2-mode-map (kbd "C-k") #'js2r-kill) - -;; Disable completion keybindings, as we use xref-js2 instead -;; (define-key tern-mode-keymap (kbd "M-.") nil) -;; (define-key tern-mode-keymap (kbd "M-,") nil) - -(provide 'key-bindings) diff --git a/lisp/setup-appearance.el b/lisp/setup-appearance.el @@ -1,28 +0,0 @@ -;; Theme -(load-theme 'dracula 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) - ) - -;; Fix the indentation for the `switch` statement -(c-set-offset 'case-label '+) - -(provide 'setup-appearance) diff --git a/lisp/setup-auto-complete-mode.el b/lisp/setup-auto-complete-mode.el @@ -1,4 +0,0 @@ -(require 'auto-complete) -(global-auto-complete-mode t) - -(provide 'setup-auto-complete-mode) diff --git a/lisp/setup-autopair-mode.el b/lisp/setup-autopair-mode.el @@ -1,4 +0,0 @@ -;; Automagically pair braces and quotes like TextMate -(autopair-global-mode) ;; to enable in all buffers - -(provide 'setup-autopair-mode) diff --git a/lisp/setup-company-mode.el b/lisp/setup-company-mode.el @@ -1,32 +0,0 @@ -;; COMPANY MODE SETUP FILE - -;; Load company mode -;; and company mode html backend -(require 'company) -(require 'company-tern) -(require 'company-web-html) - -;; Possible improvements of company-mode -(add-to-list 'company-backends 'company-shell) -(add-hook 'js2-mode-hook (lambda () - ;; (tern-mode) - (company-mode))) - -;; Bigger popup window -(setq company-tooltip-limit 20) - -;; Align annotations to the right tooltip border -(setq company-tooltip-align-annotations 't) - -;; Decrease delay before autocompletion popup shows -(setq company-idle-delayq 0.1) - -;; Start autocompletion only after typing -(setq company-begin-commands '(self-insert-command)) - -;; Enabled Company Mode on startup -(add-hook 'after-init-hook 'global-company-mode) - -(setq company-etags-everywhere '(php-mode html-mode web-mode nxml-mode)) - -(provide 'setup-company-mode) diff --git a/lisp/setup-css-mode.el b/lisp/setup-css-mode.el @@ -1,9 +0,0 @@ -;; 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-ediff.el b/lisp/setup-ediff.el @@ -1,37 +0,0 @@ -;; Ediff Config - -;; Source <https://oremacs.com/2015/01/17/setting-up-ediff/> -(defmacro csetq (variable value) - `(funcall (or (get ',variable 'custom-set) - 'set-default) - ',variable ,value)) - -(csetq ediff-window-setup-function 'ediff-setup-windows-plain) -(csetq ediff-split-window-function 'split-window-horizontally) -(csetq ediff-diff-options "-w") -;; (winner-mode) -;; (add-hook 'ediff-after-quit-hook-internal 'winner-undo) - -;; Press e in dired-mode to immediately ediff two marked files -;; -*- lexical-binding: t -*- -(defun ora-ediff-files () - (interactive) - (let ((files (dired-get-marked-files)) - (wnd (current-window-configuration))) - (if (<= (length files) 2) - (let ((file1 (car files)) - (file2 (if (cdr files) - (cadr files) - (read-file-name - "file: " - (dired-dwim-target-directory))))) - (if (file-newer-than-file-p file1 file2) - (ediff-files file2 file1) - (ediff-files file1 file2)) - (add-hook 'ediff-after-quit-hook-internal - (lambda () - (setq ediff-after-quit-hook-internal nil) - (set-window-configuration wnd)))) - (error "no more than 2 files should be marked")))) - -(provide 'setup-ediff) diff --git a/lisp/setup-editorconfig.el b/lisp/setup-editorconfig.el @@ -1,8 +0,0 @@ -;; EditorConfig Setup -;; http://editorconfig.org/ -(require 'editorconfig) - -(editorconfig-mode 1) - -(provide 'setup-editorconfig) - diff --git a/lisp/setup-email.el b/lisp/setup-email.el @@ -1,46 +0,0 @@ -;; EMAIL SETUP FILE -(require 'mu4e) - -;; default -(setq mu4e-maildir (expand-file-name "~/Maildir")) -(setq mu4e-drafts-folder "/[sfl].drafts") -(setq mu4e-sent-folder "/[sfl].Sent") -(setq mu4e-trash-folder "/[sfl].Trash") - -;; don't save message to Sent Messages, GMail/IMAP will take care of this -(setq mu4e-sent-messages-behavior 'delete) - -;; setup some handy shortcuts -(setq mu4e-maildir-shortcuts - '(("/INBOX" . ?i) - ("/[sfl].Sent" . ?s) - ("/[sfl].Trash" . ?t))) - -;; allow for updating mail using 'U' in the main view: -(setq mu4e-get-mail-command "offlineimap") - -;; something about ourselves -;; I don't use a signature... -(setq - user-mail-address "hugo.soucy@savoirfairelinux.com" - user-full-name "Hugo Soucy" -) - -;; sending mail -- replace USERNAME with your gmail username -;; also, make sure the gnutls command line utils are installed -;; package 'gnutls-bin' in Debian/Ubuntu, 'gnutls' in Archlinux. - -(require 'smtpmail) - -(setq message-send-mail-function 'smtpmail-send-it - starttls-use-gnutls t - smtpmail-starttls-credentials - '(("mail.savoirfairelinux.com" 587 nil nil)) - smtpmail-auth-credentials - (expand-file-name "~/.authinfo.gpg") - smtpmail-default-smtp-server "mail.savoirfairelinux.com" - smtpmail-smtp-server "mail.savoirfairelinux.com" - smtpmail-smtp-service 587 - smtpmail-debug-info t) - -(provide 'setup-email) diff --git a/lisp/setup-emmet-mode.el b/lisp/setup-emmet-mode.el @@ -1,7 +0,0 @@ -(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes -(add-hook 'html-mode-hook 'emmet-mode) -(add-hook 'web-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-eshell.el b/lisp/setup-eshell.el @@ -1,3 +0,0 @@ -(setup-esh-help-eldoc) ;; To use eldoc in Eshell - -(provide 'setup-eshell) diff --git a/lisp/setup-html-mode.el b/lisp/setup-html-mode.el @@ -1,10 +0,0 @@ -;; 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-ido-mode.el b/lisp/setup-ido-mode.el @@ -1,12 +0,0 @@ -;; Ido mode configuration -(require 'ido-completing-read+) -(require 'ido-vertical-mode) - -(ido-mode 1) -(ido-everywhere 1) -(ido-ubiquitous-mode 1) -(ido-vertical-mode 1) - -;;(setq ido-vertical-define-keys 'C-n-and-C-p-only) - -(provide 'setup-ido-mode) diff --git a/lisp/setup-js-mode.el b/lisp/setup-js-mode.el @@ -1,22 +0,0 @@ -(require 'js2-mode) -(require 'js2-refactor) -(require 'xref-js2) - -(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) - -;; Fix the indentation for the `switch` statement -(setq js-switch-indent-offset 4) -(setq js2-indent-switch-body t) - -(add-hook 'js2-mode-hook 'ac-js2-mode) - -;; Better imenu -(add-hook 'js2-mode-hook #'js2-imenu-extras-mode) -(add-hook 'js2-mode-hook #'js2-refactor-mode) - -(js2r-add-keybindings-with-prefix "C-c C-r") - -(add-hook 'js2-mode-hook (lambda () - (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t))) - -(provide 'setup-js-mode) diff --git a/lisp/setup-macros.el b/lisp/setup-macros.el @@ -1,39 +0,0 @@ -;; 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))) - -(fset 'bash-var-to-json - [?\C-k ?\C-k ?\{ delete ?\M-> ?\} ?\M-< ?\C-n ?\C- ?\C-n ?\C-n ?\C-n ?\C-c ?m ?\C- ?\M-f ?\" ?: delete ? ?\C-g ?\M-< ?\C-n ?\C- ?\C-n ?\C-n ?\C-n ?\C-p ?\C-c ?m ?\C-e ?, ?\C-g ?\C-x ?h tab ?\C-x ?\C-s]) - -(provide 'setup-macros) diff --git a/lisp/setup-magit.el b/lisp/setup-magit.el @@ -1,11 +0,0 @@ -;; 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 @@ -1,9 +0,0 @@ -;; 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-paths "/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 @@ -1,9 +0,0 @@ -;; 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 @@ -1,28 +0,0 @@ -;; 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 @@ -1,10 +0,0 @@ -(when (>= emacs-major-version 24) - (require 'package) - (package-initialize) - (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) - (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t) - ) - -(provide 'setup-package) - - diff --git a/lisp/setup-projectile.el b/lisp/setup-projectile.el @@ -1,4 +0,0 @@ -;; Manage and navigate projects in Emacs easily -(projectile-global-mode) ;; to enable in all buffers - -(provide 'setup-projectile) diff --git a/lisp/setup-undo-tree.el b/lisp/setup-undo-tree.el @@ -1,6 +0,0 @@ -;; Undo Tree Mode - -;; Turn on everywhere -(global-undo-tree-mode 1) - -(provide 'setup-undo-tree) diff --git a/lisp/setup-web-mode.el b/lisp/setup-web-mode.el @@ -1,23 +0,0 @@ -;; Web-Mode Is an autonomous emacs major-mode for editing web -;; templates: HTML documents embedding CSS / JavaScript and Server -;; blocks. - -;; To set engine on the fly : -;; `M-x web-mode-set-engine` -;; Then indicate the name of the engine - -(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.xhtml\\'" . web-mode)) -(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 '("\\.tpl\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.ftl\\'" . 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)) -(add-to-list 'auto-mode-alist '("\\.twig\\'" . web-mode)) - -(provide 'setup-web-mode) diff --git a/lisp/setup-yasnippet.el b/lisp/setup-yasnippet.el @@ -1,3 +0,0 @@ -(yas-global-mode 1) - -(provide 'setup-yasnippet) diff --git a/partials/autocompletion.el b/partials/autocompletion.el @@ -0,0 +1,28 @@ +;; Autocompletion +;; +(use-package auto-complete + ;; Auto Completion for GNU Emacs. + :ensure t + :pin melpa + :requires + (ac-html ac-html-csswatcher ac-js2 ac-php ac-php-core) + :config + (global-auto-complete-mode t)) + +(use-package company + ;; Modular text completion framework. + :ensure t + :pin gnu + :requires + (tern-mode company-backends company-lua company-php company-shell company-tern company-web) + :config + (add-to-list 'company-backends 'company-shell) + (add-hook 'js2-mode-hook (lambda () + (tern-mode) + (company-mode))) + (add-hook 'after-init-hook 'global-company-mode) + (setq company-tooltip-limit 20) + (setq company-tooltip-align-annotations 't) + (setq company-idle-delayq 0.1) + (setq company-begin-commands '(self-insert-command)) + (setq company-etags-everywhere '(php-mode html-mode web-mode nxml-mode))) diff --git a/partials/backups.el b/partials/backups.el @@ -0,0 +1,9 @@ +;; +;; BACKUPS +;; +;; Write backup files to own directory +(setq backup-directory-alist + `(("." . ,(expand-file-name + (concat user-emacs-directory "backups"))))) +(setq auto-save-default t) +(setq make-backup-files t) diff --git a/partials/charset-encoding.el b/partials/charset-encoding.el @@ -0,0 +1,15 @@ +;; +;; CHARSET & UTF-8 +;; +(require 'iso-transl) + +;; 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)) diff --git a/partials/custom-settings.el b/partials/custom-settings.el @@ -0,0 +1,7 @@ +;; +;; CUSTOM SETTINGS +;; +;; Keep emacs Custom-settings in separate file +(setq custom-file + (expand-file-name "custom.el" user-emacs-directory)) +(load custom-file) diff --git a/partials/defuns.el b/partials/defuns.el @@ -0,0 +1,9 @@ +;; +;; DEFUNS-DIR +;; +;; 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/partials/diff.el b/partials/diff.el @@ -0,0 +1,35 @@ +;; Ediff +;; +;; Source <https://oremacs.com/2015/01/17/setting-up-ediff/> +(defmacro csetq (variable value) + `(funcall (or (get ',variable 'custom-set) + 'set-default) + ',variable ,value)) + +(csetq ediff-window-setup-function 'ediff-setup-windows-plain) +(csetq ediff-split-window-function 'split-window-horizontally) +(csetq ediff-diff-options "-w") +;; (winner-mode) +;; (add-hook 'ediff-after-quit-hook-internal 'winner-undo) + +;; Press e in dired-mode to immediately ediff two marked files +;; -*- lexical-binding: t -*- +(defun ora-ediff-files () + (interactive) + (let ((files (dired-get-marked-files)) + (wnd (current-window-configuration))) + (if (<= (length files) 2) + (let ((file1 (car files)) + (file2 (if (cdr files) + (cadr files) + (read-file-name + "file: " + (dired-dwim-target-directory))))) + (if (file-newer-than-file-p file1 file2) + (ediff-files file2 file1) + (ediff-files file1 file2)) + (add-hook 'ediff-after-quit-hook-internal + (lambda () + (setq ediff-after-quit-hook-internal nil) + (set-window-configuration wnd)))) + (error "no more than 2 files should be marked")))) diff --git a/partials/email.el b/partials/email.el @@ -0,0 +1,32 @@ +;; EMAIL SETUP FILE +(require 'mu4e) + +;; location of my maildir +(setq mu4e-maildir (expand-file-name "~/Maildir")) +(setq mu4e-sent-folder "/Sent") +(setq mu4e-drafts-folder "/Drafts") +(setq mu4e-trash-folder "/Trash") +(setq message-signature-file "~/.signature") + +;; command used to get mail +;; use this to sync with mbsync +(setq mu4e-get-mail-command "mbsync hugosoucycc") +;; use this for testing +;; (setq mu4e-get-mail-command "true") + +;;rename files when moving +;;NEEDED FOR MBSYNC +(setq mu4e-change-filenames-when-moving t) + +;; Send +(require 'smtpmail) + +(setq message-send-mail-function 'smtpmail-send-it + starttls-use-gnutls t + mu4e-sent-messages-behavior 'sent + smtpmail-default-smtp-server "mail63.csoft.net" + smtpmail-smtp-user "hs0ucy" + smtpmail-smtp-server "mail63.csoft.net" + smtpmail-stream-type 'starttls + smtpmail-smtp-service 587 + smtpmail-debug-info t) diff --git a/partials/key-bindings.el b/partials/key-bindings.el @@ -0,0 +1,49 @@ +;; +;; CUSTOM KEY BINDINGS +;; +;; 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))) + +;; 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) + +;; Make CTRL-Z Undo +(global-set-key (kbd "C-z") 'undo) + +;; Make CTRL-S-z Redo +(defalias 'redo 'undo-tree-redo) +(global-set-key (kbd "C-S-z") 'redo) + +;; Moving faster between windows +(global-set-key (kbd "C-c <up>") 'windmove-up) +(global-set-key (kbd "C-c <right>") 'windmove-right) +(global-set-key (kbd "C-c <down>") 'windmove-down) +(global-set-key (kbd "C-c <left>") 'windmove-left) diff --git a/partials/lua.el b/partials/lua.el @@ -0,0 +1,4 @@ +(use-package lua-mode + ;; a major-mode for editing Lua scripts. + :ensure t + :pin melpa) diff --git a/partials/php.el b/partials/php.el @@ -0,0 +1,17 @@ +;; +;; PHP +;; +(use-package php-mode + ;; a major-mode for editing PHP scripts. + :ensure t + :pin melpa) + +(use-package php-extras + ;; Extra features for `php-mode'. + :ensure t + :pin marmalade) + +(use-package php-refactor-mode + ;; Minor mode to quickly and safely perform common refactorings. + :ensure t + :pin melpa) diff --git a/partials/shell.el b/partials/shell.el @@ -0,0 +1,4 @@ +;; Eshell +;; + + diff --git a/partials/ui.el b/partials/ui.el @@ -0,0 +1,47 @@ +;; +;; USER INTERFACE CONFIGS +;; +(use-package dracula-theme + ;; Dracula Theme. + :ensure t + :pin melpa + :config + (load-theme 'dracula t)) + +(use-package which-key + ;; Display available keybindings in popup. + :ensure t + :pin gnu + :config + (which-key-mode)) + +;; Disable the ToolBar +(tool-bar-mode -1) + +;; Fonts +;; Custom font face (120 === 12pt) +;; (set-face-attribute 'default nil :font "Terminus" :height 120) + +;; Ibuffer +;; By default Buffer List with Ibuffer +(defalias 'list-buffers 'ibuffer) + +;; 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) + +;; Fix the indentation for the `switch` statement +(c-set-offset 'case-label '+) + +;; To have emacs open bookmarks on startup +(setq inhibit-splash-screen t) +(require 'bookmark) +(bookmark-bmenu-list) +(switch-to-buffer "*Bookmark List*") diff --git a/partials/varia.el b/partials/varia.el @@ -0,0 +1,53 @@ +;; +;; VARIA +;; +;; Common Lisp +;; It adds in a ton of compatibility with Common Lisp, so that you can +;; just use the Common Lisp functions. +(require 'cl) + +(use-package undo-tree + ;; Treat undo history as a tree. + :ensure t + :pin gnu + :config + (global-undo-tree-mode 1)) + +(use-package sudo-edit + ;; Open files as another user. + :ensure t + :pin melpa) + +(use-package autopair + ;; Automagically pair braces and quotes like TextMate. + :ensure t + :pin melpa + :config + (autopair-global-mode)) + +(use-package magit + ;; A Git porcelain inside Emacs. + :ensure t + :pin melpa + :bind (("M-g s" . magit-status))) + +(use-package projectile + ;; Manage and navigate projects in Emacs easily. + :ensure t + :pin melpa + :config + (projectile-global-mode)) + +(use-package editorconfig + ;; EditorConfig Emacs Plugin + :ensure t + :pin melpa + :config + (editorconfig-mode 1)) + +(use-package multiple-cursors + ;; Multiple cursors for Emacs. + :ensure t + :pin melpa + :bind (("C-c m" . mc/edit-lines) + ("C-c n" . mc/mark-next-like-this))) diff --git a/partials/webdev.el b/partials/webdev.el @@ -0,0 +1,54 @@ +;; WEBDEV +;; +(use-package js2-mode + ;; Improved JavaScript editing mode. + :ensure t + :pin melpa + :config + (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) + (add-hook 'js2-mode-hook 'ac-js2-mode) + (add-hook 'js2-mode-hook #'js2-imenu-extras-mode) + (add-hook 'js2-mode-hook #'js2-refactor-mode)) + +(use-package js2-refactor + ;; A JavaScript refactoring library for emacs. + :ensure t + :pin melpa) + +(use-package web-mode + ;; major mode for editing web templates. + ;; To set engine on the fly : + ;; `M-x web-mode-set-engine` + ;; Then indicate the name of the engine + :ensure t + :pin melpa + :config + (add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.xhtml\\'" . web-mode)) + (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 '("\\.tpl\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.ftl\\'" . 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)) + (add-to-list 'auto-mode-alist '("\\.twig\\'" . web-mode))) + +(use-package markdown-mode + ;; Major mode for Markdown-formatted text. + :ensure t + :pin melpa) + +(use-package emmet-mode + ;; Unofficial Emmet's support for emacs. + :ensure t + :pin melpa + :config + (add-hook 'sgml-mode-hook 'emmet-mode) + (add-hook 'html-mode-hook 'emmet-mode) + (add-hook 'web-mode-hook 'emmet-mode) + (add-hook 'css-mode-hook 'emmet-mode) + (add-hook 'scss-mode-hook 'emmet-mode)) diff --git a/site-lisp/README.md b/site-lisp/README.md @@ -1,6 +0,0 @@ -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