summary refs log tree commit diff
path: root/emacs.d/config
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2018-06-29 14:49:44 -0700
committerFranck Cuny <franck.cuny@gmail.com>2018-06-29 14:50:43 -0700
commitc0368d8e65fd15a1f48de6a01adcb8ec786a72a0 (patch)
treec1dc339235ff11476bec01c36b57bd158314fa6a /emacs.d/config
parent[emacs] Move back some configs to init.el (diff)
downloademacs.d-c0368d8e65fd15a1f48de6a01adcb8ec786a72a0.tar.gz
[emacs] Massive rewrite
Diffstat (limited to 'emacs.d/config')
-rw-r--r--emacs.d/config/config-set-path.el9
-rw-r--r--emacs.d/config/fcuny-appearance.el22
-rw-r--r--emacs.d/config/fcuny-basic-settings.el38
-rw-r--r--emacs.d/config/fcuny-basic-settings.el~9
-rw-r--r--emacs.d/config/fcuny-common.el (renamed from emacs.d/config/config-lib.el)11
-rw-r--r--emacs.d/config/fcuny-company.el17
-rw-r--r--emacs.d/config/fcuny-darwin.el14
-rw-r--r--emacs.d/config/fcuny-dired.el15
-rw-r--r--emacs.d/config/fcuny-docker.el7
-rw-r--r--emacs.d/config/fcuny-editor.el55
-rw-r--r--emacs.d/config/fcuny-elisp.el13
-rw-r--r--emacs.d/config/fcuny-flyspell.el9
-rw-r--r--emacs.d/config/fcuny-go.el35
-rw-r--r--emacs.d/config/fcuny-ibuffer.el26
-rw-r--r--emacs.d/config/fcuny-json.el11
-rw-r--r--emacs.d/config/fcuny-magit.el29
-rw-r--r--emacs.d/config/fcuny-make.el9
-rw-r--r--emacs.d/config/fcuny-markdown.el13
-rw-r--r--emacs.d/config/fcuny-pants.el15
-rw-r--r--emacs.d/config/fcuny-paren.el13
-rw-r--r--emacs.d/config/fcuny-project.el84
-rw-r--r--emacs.d/config/fcuny-protobuf.el8
-rw-r--r--emacs.d/config/fcuny-puppet.el12
-rw-r--r--emacs.d/config/fcuny-python.el12
-rw-r--r--emacs.d/config/fcuny-rust.el24
-rw-r--r--emacs.d/config/fcuny-scala.el6
-rw-r--r--emacs.d/config/fcuny-shell.el13
-rw-r--r--emacs.d/config/fcuny-thrift.el10
-rw-r--r--emacs.d/config/fcuny-vars.el35
-rw-r--r--emacs.d/config/fcuny-yaml.el9
30 files changed, 567 insertions, 16 deletions
diff --git a/emacs.d/config/config-set-path.el b/emacs.d/config/config-set-path.el
deleted file mode 100644
index a22416d..0000000
--- a/emacs.d/config/config-set-path.el
+++ /dev/null
@@ -1,9 +0,0 @@
-(paradox-require 'exec-path-from-shell)
-
-(when (memq window-system '(x mac ns))
-  (exec-path-from-shell-initialize)
-  (dolist (var '("GEM_HOME" "GEM_PATH" "MY_RUBY_HOME"))
-    (unless (getenv var)
-      (exec-path-from-shell-copy-env var))))
-
-(provide 'config-set-path)
diff --git a/emacs.d/config/fcuny-appearance.el b/emacs.d/config/fcuny-appearance.el
new file mode 100644
index 0000000..5c65374
--- /dev/null
+++ b/emacs.d/config/fcuny-appearance.el
@@ -0,0 +1,22 @@
+(eval-when-compile
+  (require 'use-package))
+
+;; Set default font.
+(set-face-attribute 'default nil :height 130 :weight 'normal :width 'normal)
+
+(use-package tool-bar
+  :config
+  (tool-bar-mode -1))
+
+(use-package scroll-bar
+  :config
+  (scroll-bar-mode -1))
+
+(use-package frame
+  :bind ("<s-return>" . toggle-frame-fullscreen)
+  :config
+  (blink-cursor-mode -1)
+  (when (eq system-type 'darwin)
+    (setq ns-use-native-fullscreen nil)))
+
+(provide 'fcuny-appearance)
diff --git a/emacs.d/config/fcuny-basic-settings.el b/emacs.d/config/fcuny-basic-settings.el
new file mode 100644
index 0000000..fe05241
--- /dev/null
+++ b/emacs.d/config/fcuny-basic-settings.el
@@ -0,0 +1,38 @@
+(eval-when-compile
+  (require 'use-package))
+
+;; set utf-8 as the default encoding
+(prefer-coding-system 'utf-8-unix)
+(set-terminal-coding-system 'utf-8)
+(set-keyboard-coding-system 'utf-8)
+
+;; alias yes-or-no to y-or-n
+(fset 'yes-or-no-p 'y-or-n-p)
+
+(setq auto-save-default nil)                   ;; don't auto save files
+(setq auto-save-list-file-prefix nil)          ;; no backups
+(setq create-lockfiles nil)                    ;; don't use a lock file
+(setq custom-file fcuny-custom-settings)       ;; where to save custom settings
+(setq inhibit-startup-message t)               ;; Skip the default splash screen
+(setq inhibit-startup-screen t)                ;; I don't want a startup screen
+(setq make-backup-files nil)                   ;; really no backups
+(setq minibuffer-message-timeout 0.5)          ;; How long to display an echo-area message
+(setq next-screen-context-lines 5)             ;; scroll 5 lines at a time
+(setq require-final-newline t)                 ;; ensure newline exists at the end of the file
+(setq ring-bell-function 'ignore)              ;; really no bell
+(setq tab-always-indent 'complete)             ;; when using TAB, always indent
+(setq visible-bell nil)                        ;; no bell
+
+(setq-default indent-tabs-mode nil)            ;; turn off tab indentation
+(setq-default cursor-type 'hbar)               ;; cursor is a horizontal bar
+
+;; size of the fringe
+(fringe-mode '(8 . 8))
+
+;; show column number in the mode line
+(setq column-number-mode t)
+
+;; Remap join-line to M-j where it's easier to get to.
+(global-set-key (kbd "M-j") 'join-line)
+
+(provide 'fcuny-basic-settings)
diff --git a/emacs.d/config/fcuny-basic-settings.el~ b/emacs.d/config/fcuny-basic-settings.el~
new file mode 100644
index 0000000..2dab7f0
--- /dev/null
+++ b/emacs.d/config/fcuny-basic-settings.el~
@@ -0,0 +1,9 @@
+;; set utf-8 as the default encoding
+(prefer-coding-system 'utf-8-unix)
+(set-terminal-coding-system 'utf-8)
+(set-keyboard-coding-system 'utf-8)
+
+;; alias yes-or-no to y-or-n
+(fset 'yes-or-no-p 'y-or-n-p)
+
+(provide 'fcuny-basic-settings)
diff --git a/emacs.d/config/config-lib.el b/emacs.d/config/fcuny-common.el
index 8896d2f..61a2829 100644
--- a/emacs.d/config/config-lib.el
+++ b/emacs.d/config/fcuny-common.el
@@ -1,4 +1,3 @@
-;; rename a buffer
 (defun fc/rename-this-buffer-and-file ()
   "Renames current buffer and file it is visiting."
   (interactive)
@@ -17,16 +16,14 @@
                (set-buffer-modified-p nil)
                (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name))))))))
 
-
-;; predicate for checking style only on python files
 (defun fc/check-source-p ()
   "Finds if the current python file is in the `source' repository."
   (and (executable-find "check.pex")
        (buffer-file-name)
        (string-match "src/source/.*\.py$" (buffer-file-name))))
 
-(defun fc/check-gcp-puppet-p ()
-  "Finds if the current file is in GCP's puppet repository."
-  (string-match "gcp-puppet-manifest/.*$" (buffer-file-name)))
+(defun fc/check-work-machine-p ()
+  "Returns t if this is a work machine"
+  (string-match "tw-mbp.*" (system-name)))
 
-(provide 'config-lib)
+(provide 'fcuny-common)
diff --git a/emacs.d/config/fcuny-company.el b/emacs.d/config/fcuny-company.el
new file mode 100644
index 0000000..62e06de
--- /dev/null
+++ b/emacs.d/config/fcuny-company.el
@@ -0,0 +1,17 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package company
+  :ensure t
+  :diminish company-mode
+  :config
+  (global-company-mode)
+  (setq company-global-modes '(not term-mode)
+        company-idle-delay 0.3
+        company-minimum-prefix-length 3
+        company-selection-wrap-around t
+        company-show-numbers t
+        company-tooltip-align-annotations t
+        company-require-match nil))
+
+(provide 'fcuny-company)
diff --git a/emacs.d/config/fcuny-darwin.el b/emacs.d/config/fcuny-darwin.el
new file mode 100644
index 0000000..fbc95e7
--- /dev/null
+++ b/emacs.d/config/fcuny-darwin.el
@@ -0,0 +1,14 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package exec-path-from-shell
+  :if (memq window-system '(mac ns))
+  :ensure t
+  :config
+  (exec-path-from-shell-initialize)
+  (if (fc/check-work-machine-p)
+      (dolist (var '("GEM_HOME" "GEM_PATH" "MY_RUBY_HOME"))
+        (unless (getenv var)
+          (exec-path-from-shell-copy-env var)))))
+
+(provide 'fcuny-darwin)
diff --git a/emacs.d/config/fcuny-dired.el b/emacs.d/config/fcuny-dired.el
new file mode 100644
index 0000000..8c64c1f
--- /dev/null
+++ b/emacs.d/config/fcuny-dired.el
@@ -0,0 +1,15 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package dired
+  :defer t
+  :bind ("C-x C-d"  . dired)
+  :init
+  (setq-default dired-dwim-target t)
+  (setq dired-recursive-deletes 'always)
+  (setq dired-recursive-copies 'always)
+
+  (let ((gls (executable-find "/opt/twitter/bin/gls")))
+    (when gls (setq insert-directory-program gls))))
+
+(provide 'fcuny-dired)
diff --git a/emacs.d/config/fcuny-docker.el b/emacs.d/config/fcuny-docker.el
new file mode 100644
index 0000000..7ed7b0b
--- /dev/null
+++ b/emacs.d/config/fcuny-docker.el
@@ -0,0 +1,7 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package dockerfile-mode
+  :ensure t)
+
+(provide 'fcuny-docker)
diff --git a/emacs.d/config/fcuny-editor.el b/emacs.d/config/fcuny-editor.el
new file mode 100644
index 0000000..75baa4f
--- /dev/null
+++ b/emacs.d/config/fcuny-editor.el
@@ -0,0 +1,55 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package bookmark
+  :custom
+  (bookmark-default-file fcuny-bookmarks-dir)
+  (bookmark-save-flag 1))
+
+(use-package autorevert
+  :config
+  (global-auto-revert-mode t))
+
+(use-package midnight
+  :config
+  (midnight-mode t))
+
+(use-package autorevert
+  :config
+  (setq global-auto-revert-non-file-buffers t)
+  (setq auto-revert-verbose nil)
+  (global-auto-revert-mode t))
+
+(use-package recentf
+  :config
+  (setq recentf-save-file (expand-file-name "var/recentf" user-emacs-directory)))
+
+(use-package server
+  :if window-system
+  :init
+  (add-hook 'after-init-hook 'server-start))
+
+(use-package hl-line
+  :config
+  (global-hl-line-mode t))
+
+(use-package tramp
+  :custom
+  (tramp-default-method "ssh")
+  (tramp-persistency-file-name (expand-file-name "var/tramp" user-emacs-directory)))
+
+(use-package whitespace
+  :custom
+  (whitespace-style '(face trailing))
+  (show-trailing-whitespace t)
+  :hook (whitespace-mode))
+
+(use-package ispell
+  :ensure t
+  :config
+  (use-package flyspell-correct-ivy :ensure t)
+  (when (executable-find "aspell")
+    (setq ispell-program-name "aspell"
+          ispell-list-command "--list")))
+
+(provide 'fcuny-editor)
diff --git a/emacs.d/config/fcuny-elisp.el b/emacs.d/config/fcuny-elisp.el
new file mode 100644
index 0000000..118eb5b
--- /dev/null
+++ b/emacs.d/config/fcuny-elisp.el
@@ -0,0 +1,13 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package lisp-mode
+  :bind
+  (("C-c C-e" . eval-buffer)
+   ("C-c C-r" . eval-region)))
+
+(use-package eldoc
+  :ensure t
+  :hook (emacs-lisp-mode-hook))
+
+(provide 'fcuny-elisp)
diff --git a/emacs.d/config/fcuny-flyspell.el b/emacs.d/config/fcuny-flyspell.el
new file mode 100644
index 0000000..fe26768
--- /dev/null
+++ b/emacs.d/config/fcuny-flyspell.el
@@ -0,0 +1,9 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package flyspell
+  :ensure t
+  :hook ((text-mode-hook . flyspell-mode)
+         (prog-mode-hook . flyspell-prog-mode)))
+
+(provide 'fcuny-flyspell)
diff --git a/emacs.d/config/fcuny-go.el b/emacs.d/config/fcuny-go.el
new file mode 100644
index 0000000..14acbe4
--- /dev/null
+++ b/emacs.d/config/fcuny-go.el
@@ -0,0 +1,35 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package go-mode
+  :ensure t
+  :init
+  (progn
+    (defun fcuny-go-set-tab-width ()
+      (setq-local tab-width 2))
+    (add-hook 'go-mode-hook 'fcuny-go-set-tab-width))
+
+  :config
+  (use-package go-eldoc
+    :config
+    (add-hook 'go-mode-hook 'go-eldoc-setup))
+
+  (use-package gotest :ensure t)
+
+  (use-package go-guru :ensure t)
+
+  (use-package go-imports :ensure t)
+
+  (use-package golint :ensure t)
+
+  (use-package go-projectile :ensure t)
+
+  (use-package company-go
+    :ensure t
+    :init
+    (progn
+      (setq company-go-show-annotation t))
+    :config
+    (add-hook 'go-mode-hook (lambda() (add-to-list 'company-backends 'company-go)))))
+
+(provide 'fcuny-go)
diff --git a/emacs.d/config/fcuny-ibuffer.el b/emacs.d/config/fcuny-ibuffer.el
new file mode 100644
index 0000000..b949c87
--- /dev/null
+++ b/emacs.d/config/fcuny-ibuffer.el
@@ -0,0 +1,26 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package ibuffer
+  :ensure t
+  :bind ("C-x C-b" . ibuffer))
+
+(use-package flycheck
+  :ensure t
+  :config
+  (progn
+    (add-hook 'prog-mode-hook 'flycheck-mode)
+    (setq flycheck-highlighting-mode 'lines)
+    (setq flycheck-check-syntax-automatically '(mode-enabled save))
+    (setq flycheck-checkers (delq 'emacs-lisp-checkdoc flycheck-checkers))
+    (if (fc/check-work-machine-p)
+      (flycheck-define-checker fc/twitter-source-check
+        "A syntax checker for python source code in Source, using `check.pex'"
+        :command ("check.pex" source)
+        :error-patterns ((error line-start (id (1+ nonl)) ":ERROR" (1+ nonl) ":" line (message) line-end)
+                         (warning line-start (id (1+ nonl)) ":WARNING" (1+ nonl) ":" line (message) line-end))
+        :predicate fc/check-source-p
+        :modes (python-mode))
+      (add-to-list 'flycheck-checkers 'fc/twitter-source-check))))
+
+(provide 'fcuny-ibuffer)
diff --git a/emacs.d/config/fcuny-json.el b/emacs.d/config/fcuny-json.el
new file mode 100644
index 0000000..91c682b
--- /dev/null
+++ b/emacs.d/config/fcuny-json.el
@@ -0,0 +1,11 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package json-mode
+  :ensure t
+  :config
+  (setq json-reformat:indent-width 2)
+  (if (fc/check-work-machine-p)
+    (add-to-list 'auto-mode-alist '("\\.workflow$" . json-mode))))
+
+(provide 'fcuny-json)
diff --git a/emacs.d/config/fcuny-magit.el b/emacs.d/config/fcuny-magit.el
new file mode 100644
index 0000000..b78398c
--- /dev/null
+++ b/emacs.d/config/fcuny-magit.el
@@ -0,0 +1,29 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package magit
+  :mode (("differential-update-comments" . git-commit-mode)
+         ("new-commit"                   . git-commit-mode))
+  :bind (("C-x g s" . magit-status)
+         ("C-x g b" . magit-checkout))
+  :init
+  (progn
+    (setq magit-completing-read-function 'ivy-completing-read))
+
+  :config
+  (progn
+    (global-git-commit-mode)
+
+    ;; I don't care about other VC backend for work
+    (if (fc/check-work-machine-p)
+      (setf vc-handled-backends nil
+            vc-follow-symlinks t))
+
+    (use-package git-commit :ensure t)
+
+    (add-hook 'magit-log-edit-mode-hook
+              #'(lambda ()
+                  (set-fill-column 72)
+                  (flyspell-mode)))))
+
+(provide 'fcuny-magit)
diff --git a/emacs.d/config/fcuny-make.el b/emacs.d/config/fcuny-make.el
new file mode 100644
index 0000000..1218f7a
--- /dev/null
+++ b/emacs.d/config/fcuny-make.el
@@ -0,0 +1,9 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package make-mode
+  :ensure t
+  :config
+  (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2))))
+
+(provide 'fcuny-make)
diff --git a/emacs.d/config/fcuny-markdown.el b/emacs.d/config/fcuny-markdown.el
new file mode 100644
index 0000000..7387a0d
--- /dev/null
+++ b/emacs.d/config/fcuny-markdown.el
@@ -0,0 +1,13 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package markdown-mode
+  :ensure t
+  :mode (("\\.md\\'" . gfm-mode)
+         ("\\.markdown\\'" . gfm-mode))
+  :init (setq markdown-command "pandoc -f markdown_github -c https://goo.gl/OVmlwT --self-contained"
+              markdown-header-scaling 't)
+  :config
+  (add-hook 'gfm-mode-hook 'visual-line-mode))
+
+(provide 'fcuny-markdown)
diff --git a/emacs.d/config/fcuny-pants.el b/emacs.d/config/fcuny-pants.el
new file mode 100644
index 0000000..3ed1ef1
--- /dev/null
+++ b/emacs.d/config/fcuny-pants.el
@@ -0,0 +1,15 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package pants
+  :load-path (lambda () (expand-file-name  "github.com/fcuny/pants.el/" fcuny-path-workspace))
+  :custom
+  (pants-completion-system 'ivy)
+  (pants-source-tree-root (expand-file-name "git.twitter.biz/source" fcuny-path-workspace))
+  (pants-bury-compilation-buffer t)
+  (pants-extra-args "-q")
+  :bind (("C-c b" . pants-find-build-file)
+         ("C-c r" . pants-run-binary)
+         ("C-c t" . pants-run-test)))
+
+(provide 'fcuny-pants)
diff --git a/emacs.d/config/fcuny-paren.el b/emacs.d/config/fcuny-paren.el
new file mode 100644
index 0000000..db6bdeb
--- /dev/null
+++ b/emacs.d/config/fcuny-paren.el
@@ -0,0 +1,13 @@
+(eval-when-compile
+  (require 'use-package))
+
+;; auto close bracket, parenthesis insertion
+(electric-pair-mode 1)
+
+(use-package paren
+  :custom
+  (show-paren-delay 0)
+  :config
+  (show-paren-mode 1))
+
+(provide 'fcuny-paren)
diff --git a/emacs.d/config/fcuny-project.el b/emacs.d/config/fcuny-project.el
new file mode 100644
index 0000000..c94c40b
--- /dev/null
+++ b/emacs.d/config/fcuny-project.el
@@ -0,0 +1,84 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package counsel
+  :ensure t
+  :bind
+  (("M-x"     . counsel-M-x)
+   ("C-s"     . counsel-grep-or-swiper)
+   ("C-x C-f" . counsel-find-file)
+   ("C-x C-r" . counsel-recentf)
+   ("C-c f"   . counsel-git)
+   ("C-c s"   . counsel-git-grep)
+   ("C-c /"   . counsel-ag))
+  :custom
+  (counsel-find-file-at-point t)
+  :config
+  (use-package swiper :ensure t)
+  (use-package counsel-projectile :ensure t))
+
+(use-package ivy
+  :ensure t
+  :diminish (ivy-mode . "")
+  :bind ("C-c m" . ivy-switch-project)
+  :config
+  (ivy-mode 1)
+  (setq ivy-use-virtual-buffers t
+        ivy-height 10
+        ivy-count-format "(%d/%d) "
+        ivy-initial-inputs-alist nil
+        ivy-use-ignore-default 'always
+        ivy-ignore-buffers '("company-statistics-cache.el" "company-statistics-autoload.el")
+        ivy-re-builders-alist '((swiper . ivy--regex-ignore-order)
+                                (t      . ivy--regex-fuzzy)
+                                (t      . ivy--regex-ignore-order)))
+
+  (defun ivy-switch-project ()
+    (interactive)
+    (ivy-read
+     "Switch to project: "
+     (if (projectile-project-p)
+         (cons (abbreviate-file-name (projectile-project-root))
+               (projectile-relevant-known-projects))
+       projectile-known-projects)
+     :action #'projectile-switch-project-by-name))
+
+  (ivy-set-actions
+   'ivy-switch-project
+   '(("d" dired "Open Dired in project's directory")
+     ("v" counsel-projectile "Open project root in vc-dir or magit")
+     ("c" projectile-compile-project "Compile project")
+     ("r" projectile-remove-known-project "Remove project(s)"))))
+
+(use-package projectile
+  :ensure t
+  :diminish projectile-mode
+  :bind-keymap ("C-c p" . projectile-command-map)
+
+  :init
+  (add-hook 'after-init-hook #'projectile-mode)
+
+  :config
+  (setq projectile-switch-project-action 'projectile-dired
+        projectile-enable-caching t
+        projectile-completion-system 'ivy
+        projectile-known-projects-file (expand-file-name "var/projectile-bookmarks.eld" user-emacs-directory)
+        projectile-cache-file (expand-file-name "var/projectile.cache" user-emacs-directory)
+        projectile-globally-ignored-directories (append fcuny-projects-ignored-dirs
+                                                        projectile-globally-ignored-directories)
+        projectile-globally-ignored-files (append 
+                                                  projectile-globally-ignored-files)))
+
+(use-package ag
+  :ensure t
+  :bind (:map ag-mode-map
+              ("p" . compilation-previous-error)
+              ("n" . compilation-next-error)
+              ("N" . compilation-next-file)
+              ("P" . compilation-previous-file))
+  :custom
+  (ag-highlight-search t)
+  (ag-reuse-buffers t)
+  (ag-reuse-window t))
+
+(provide 'fcuny-project)
diff --git a/emacs.d/config/fcuny-protobuf.el b/emacs.d/config/fcuny-protobuf.el
new file mode 100644
index 0000000..a2dedb4
--- /dev/null
+++ b/emacs.d/config/fcuny-protobuf.el
@@ -0,0 +1,8 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package protobuf-mode
+  :ensure t
+  :mode ("\\.proto$" . protobuf-mode))
+
+(provide 'fcuny-protobuf)
diff --git a/emacs.d/config/fcuny-puppet.el b/emacs.d/config/fcuny-puppet.el
new file mode 100644
index 0000000..4a7eb10
--- /dev/null
+++ b/emacs.d/config/fcuny-puppet.el
@@ -0,0 +1,12 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package puppet-mode
+  :ensure t
+  :mode ("\\.pp\\'" . puppet-mode)
+  ;:hook (flycheck-mode)
+  :config
+  (if (fc/check-work-machine-p)
+    (setq flycheck-puppet-lint-rc fcuny-path-puppet-linter-svn)))
+
+(provide 'fcuny-puppet)
diff --git a/emacs.d/config/fcuny-python.el b/emacs.d/config/fcuny-python.el
new file mode 100644
index 0000000..16b4cc1
--- /dev/null
+++ b/emacs.d/config/fcuny-python.el
@@ -0,0 +1,12 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package python
+  :ensure t
+  :mode (("\\.py$" . python-mode)
+         ("^BUILD$" . python-mode)
+         ("\\.aurora$" . python-mode))
+  :custom (python-indent-offset 2)
+  :hook (eldoc-mode))
+
+(provide 'fcuny-python)
diff --git a/emacs.d/config/fcuny-rust.el b/emacs.d/config/fcuny-rust.el
new file mode 100644
index 0000000..8b3fe49
--- /dev/null
+++ b/emacs.d/config/fcuny-rust.el
@@ -0,0 +1,24 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package rust-mode
+  :ensure t
+  :config
+
+  (use-package toml-mode :ensure t)
+
+  (use-package racer :ensure t)
+
+  (use-package company-racer :ensure t)
+
+  (use-package cargo
+    :ensure t
+    :hook ((rust-mode . cargo-minor-mode)
+           (rust-mode . eldoc-mode)
+           (rust-mode . race-mode))
+    :custom
+    (compilation-ask-about-save nil)
+    (rust-format-on-save t)
+    (rust-rustfmt-bin "/Users/fcuny/.cargo/bin/rustfmt")))
+
+(provide 'fcuny-rust)
diff --git a/emacs.d/config/fcuny-scala.el b/emacs.d/config/fcuny-scala.el
new file mode 100644
index 0000000..cfadbd6
--- /dev/null
+++ b/emacs.d/config/fcuny-scala.el
@@ -0,0 +1,6 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package scala-mode :ensure t)
+
+(provide 'fcuny-scala)
diff --git a/emacs.d/config/fcuny-shell.el b/emacs.d/config/fcuny-shell.el
new file mode 100644
index 0000000..01fb075
--- /dev/null
+++ b/emacs.d/config/fcuny-shell.el
@@ -0,0 +1,13 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package sh-script
+  :mode ("bashrc" . sh-mode)
+  :config
+  (defun set-sh-mode-indent ()
+    (setq sh-basic-offset 2
+          sh-indentation 2))
+  (add-hook 'sh-mode-hook 'set-sh-mode-indent)
+  (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p))
+
+(provide 'fcuny-shell)
diff --git a/emacs.d/config/fcuny-thrift.el b/emacs.d/config/fcuny-thrift.el
new file mode 100644
index 0000000..9bfa497
--- /dev/null
+++ b/emacs.d/config/fcuny-thrift.el
@@ -0,0 +1,10 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package thrift
+  :ensure t
+  :mode ("\\.thrift\\'" . thrift-mode)
+  :config
+  (setq thrift-indent-level 2))
+
+(provide 'fcuny-thrift)
diff --git a/emacs.d/config/fcuny-vars.el b/emacs.d/config/fcuny-vars.el
new file mode 100644
index 0000000..cc19201
--- /dev/null
+++ b/emacs.d/config/fcuny-vars.el
@@ -0,0 +1,35 @@
+(defvar fcuny-path-home (getenv "HOME")
+  "Path to the user's home directory.")
+
+(defvar fcuny-path-workspace (expand-file-name "workspace" fcuny-path-home)
+  "Path to the workspace.")
+
+(defvar fcuny-path-git-twitter (expand-file-name "git.twitter.biz" fcuny-path-workspace)
+  "Path to twitter's git repositories.")
+
+(defvar fcuny-path-git-github (expand-file-name "github.com" fcuny-path-workspace)
+  "Path to github's git repositories.")
+
+(defvar fcuny-path-svn-twitter (expand-file-name "svn.twitter.biz" fcuny-path-workspace)
+  "Path to twitter's SVN repositories.")
+
+(defvar fcuny-path-puppet-linter-svn (expand-file-name "twitter-ops/utilities/puppet/.puppet-lint.rc"
+                                                       fcuny-path-svn-twitter)
+  "Path to the linter's configuration for twitter-ops.")
+
+(defvar fcuny-path-emacs-var (expand-file-name "var" user-emacs-directory)
+  "Path to some files for Emacs.")
+
+(defvar fcuny-path-emacs-elpa (expand-file-name "elpa" fcuny-path-emacs-var)
+  "Path to elpa's local files.")
+
+(defvar fcuny-projects-ignored-dirs '(".git" ".svn" "target" "elpa")
+  "Ignore the following directories when browsing with projectile.")
+
+(defvar fcuny-bookmarks-dir (expand-file-name "bookmarks" fcuny-path-emacs-var)
+  "Path to save the bookmarks")
+
+(defvar fcuny-custom-settings (expand-file-name "emacs-custom.el" fcuny-path-emacs-var)
+  "Path to emacs custom variables.")
+
+(provide 'fcuny-vars)
diff --git a/emacs.d/config/fcuny-yaml.el b/emacs.d/config/fcuny-yaml.el
new file mode 100644
index 0000000..7d9ca87
--- /dev/null
+++ b/emacs.d/config/fcuny-yaml.el
@@ -0,0 +1,9 @@
+(eval-when-compile
+  (require 'use-package))
+
+(use-package yaml-mode
+  :ensure t
+;;  :hook (flycheck-mode)
+  :mode ("\\.ya?ml\\'" . yaml-mode))
+
+(provide 'fcuny-yaml)