diff options
-rw-r--r-- | configs/rcs/emacs.d/config/fcuny-basic-settings.el | 48 | ||||
-rw-r--r-- | configs/rcs/emacs.d/config/fcuny-editor.el | 168 | ||||
-rw-r--r-- | configs/rcs/emacs.d/init.el | 234 |
3 files changed, 215 insertions, 235 deletions
diff --git a/configs/rcs/emacs.d/config/fcuny-basic-settings.el b/configs/rcs/emacs.d/config/fcuny-basic-settings.el index a3469a8..9ab1046 100644 --- a/configs/rcs/emacs.d/config/fcuny-basic-settings.el +++ b/configs/rcs/emacs.d/config/fcuny-basic-settings.el @@ -1,53 +1,5 @@ (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) - -(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-basic-settings) diff --git a/configs/rcs/emacs.d/config/fcuny-editor.el b/configs/rcs/emacs.d/config/fcuny-editor.el deleted file mode 100644 index bc9fbb4..0000000 --- a/configs/rcs/emacs.d/config/fcuny-editor.el +++ /dev/null @@ -1,168 +0,0 @@ -(eval-when-compile - (require 'use-package)) - -(use-package auto-package-update - :ensure t - :config - (setq auto-package-update-delete-old-versions t) - (setq auto-package-update-hide-results t) - (setq auto-package-update-last-update-day-filename (expand-file-name "last-update-day" fcuny-path-emacs-var)) - (auto-package-update-maybe)) - -(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 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)) - -(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)))) - -(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-editor) diff --git a/configs/rcs/emacs.d/init.el b/configs/rcs/emacs.d/init.el index f0d4ac5..a0a1771 100644 --- a/configs/rcs/emacs.d/init.el +++ b/configs/rcs/emacs.d/init.el @@ -34,24 +34,9 @@ (defvar fcuny-path-go-bin (expand-file-name "bin" fcuny-path-go) "Path to the go binaries.") -(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) +(defvar fcuny-path-puppet-linter-svn (expand-file-name "twitter-ops/utilities/puppet/.puppet-lint.rc" fcuny-path-workspace) "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.") @@ -98,13 +83,224 @@ (add-to-list 'load-path path) (add-to-list 'Info-default-directory-list path)))) +;; 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) + +(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))) + +(use-package auto-package-update + :ensure t + :custom + (auto-package-update-delete-old-versions t) + (auto-package-update-hide-results t) + (auto-package-update-last-update-day-filename (expand-file-name "last-package-update-day" fcuny-path-emacs-var)) + :hook + (after-init . auto-package-update-maybe)) + +(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 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)) + +(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)))) + +(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)))) + (fcuny/init-load-path) -(use-package fcuny-basic-settings) (use-package fcuny-darwin :if (memq window-system '(mac ns))) (use-package fcuny-linux :if (string-equal system-type "gnu/linux")) -(use-package fcuny-editor) (use-package fcuny-text) (use-package fcuny-prog) (use-package fcuny-serializers) - |