Customizations from devserver
This commit is contained in:
parent
a89cc66ee3
commit
8f46f8c275
1 changed files with 94 additions and 52 deletions
104
.emacs.d/core.el
104
.emacs.d/core.el
|
|
@ -72,10 +72,6 @@
|
||||||
'(("no_proxy" . "^\\(localhost\\|10.*\\)")
|
'(("no_proxy" . "^\\(localhost\\|10.*\\)")
|
||||||
("http" . "fwdproxy:8080")
|
("http" . "fwdproxy:8080")
|
||||||
("https" . "fwdproxy:8080"))))
|
("https" . "fwdproxy:8080"))))
|
||||||
|
|
||||||
;; Hack support for stuff in www
|
|
||||||
(setq hack-for-hiphop-root (expand-file-name "www" "~"))
|
|
||||||
(load "/home/engshare/tools/hack-for-hiphop")
|
|
||||||
))
|
))
|
||||||
|
|
||||||
;; =================================================================
|
;; =================================================================
|
||||||
|
|
@ -182,57 +178,65 @@
|
||||||
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
||||||
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
|
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
|
||||||
|
|
||||||
;; Consolas. (And, to a lesser extent, Inconsolata.)
|
;; Modeline format:
|
||||||
|
(display-time-mode -1)
|
||||||
|
|
||||||
|
;; ================================================================
|
||||||
|
;; Fonts and windows and the like, only if graphics.
|
||||||
|
;; ================================================================
|
||||||
|
;;
|
||||||
|
;; (I added this because for some reason on 2016-09-26 my emacs started
|
||||||
|
;; segfaulting on my devserver when it called find-font, and I'll be damned
|
||||||
|
;; if I'm going to debug it.)
|
||||||
;;
|
;;
|
||||||
(require 'cl)
|
(require 'cl)
|
||||||
(defun font-candidate (&rest fonts)
|
(if (display-graphic-p)
|
||||||
|
(progn
|
||||||
|
;; Consolas. (And, to a lesser extent, Inconsolata.)
|
||||||
|
;;
|
||||||
|
(defun font-candidate (&rest fonts)
|
||||||
"Return existing font which first match."
|
"Return existing font which first match."
|
||||||
(find-if (lambda (f) (find-font (font-spec :name f))) fonts))
|
(find-if (lambda (f) (find-font (font-spec :name f))) fonts))
|
||||||
|
|
||||||
(setq my-font-choice
|
(setq my-font-choice
|
||||||
(font-candidate
|
(font-candidate
|
||||||
"Input Mono-12:weight=light"
|
"Input Mono-12:weight=light"
|
||||||
"Consolas-10"
|
"Consolas-10"
|
||||||
"Inconsolata-11"))
|
"Inconsolata-11"))
|
||||||
|
|
||||||
;; This is just here for playing with things.
|
;; This is just here for playing with things.
|
||||||
;; (set-frame-font my-font-choice)
|
;; (set-frame-font my-font-choice)
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; To obtain new font string, execute eval-expression, and eval this:
|
;; To obtain new font string, execute eval-expression, and eval this:
|
||||||
;;(insert(prin1-to-string(w32-select-font)))
|
;;(insert(prin1-to-string(w32-select-font)))
|
||||||
;; This will show the required string in the scratch buffer.
|
;; This will show the required string in the scratch buffer.
|
||||||
|
|
||||||
(setq jd-frame-height
|
(setq jd-frame-height
|
||||||
(cond ((> (display-pixel-height) 900) 60)
|
(cond ((> (display-pixel-height) 900) 60)
|
||||||
((> (display-pixel-height) 768) 48)
|
((> (display-pixel-height) 768) 48)
|
||||||
('t 40)))
|
('t 40)))
|
||||||
|
|
||||||
;; frame settings. default-frame-alist controls what a default frame
|
;; frame settings. default-frame-alist controls what a default frame
|
||||||
;; looks like.
|
;; looks like.
|
||||||
(setq default-frame-alist
|
(setq default-frame-alist
|
||||||
`((font . ,my-font-choice)
|
`((font . ,my-font-choice)
|
||||||
(width . 91)
|
(width . 91)
|
||||||
(height . ,jd-frame-height)
|
(height . ,jd-frame-height)
|
||||||
,@default-frame-alist))
|
,@default-frame-alist))
|
||||||
|
|
||||||
;; initial-frame-alist controls what the first frame looks like.
|
;; initial-frame-alist controls what the first frame looks like.
|
||||||
(setq initial-frame-alist
|
(setq initial-frame-alist
|
||||||
`((font . ,my-font-choice)
|
`((font . ,my-font-choice)
|
||||||
(width . 91)
|
(width . 91)
|
||||||
(height . ,jd-frame-height)))
|
(height . ,jd-frame-height)))
|
||||||
|
|
||||||
;; COLORZ!
|
;; COLORZ!
|
||||||
;;
|
;;
|
||||||
(if (display-graphic-p)
|
|
||||||
(progn
|
|
||||||
(require 'color-theme)
|
(require 'color-theme)
|
||||||
(require 'color-theme-solarized)
|
(require 'color-theme-solarized)
|
||||||
(color-theme-solarized)))
|
(color-theme-solarized)))
|
||||||
|
|
||||||
;; Modeline format:
|
|
||||||
(display-time-mode -1)
|
|
||||||
|
|
||||||
;; =================================================================
|
;; =================================================================
|
||||||
;; FUN WITH KEY BINDINGS! YAAAAYYY!!!
|
;; FUN WITH KEY BINDINGS! YAAAAYYY!!!
|
||||||
;; =================================================================
|
;; =================================================================
|
||||||
|
|
@ -403,7 +407,7 @@
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(defun my-c-mode-hook ()
|
(defun my-c-mode-hook ()
|
||||||
(c-set-style "fb-c"))
|
(c-set-style (if is-fb-environment "fb-c" "ms-c")))
|
||||||
|
|
||||||
(add-hook 'c-mode-hook 'my-c-mode-hook)
|
(add-hook 'c-mode-hook 'my-c-mode-hook)
|
||||||
(add-hook 'c++-mode-hook 'my-c-mode-hook)
|
(add-hook 'c++-mode-hook 'my-c-mode-hook)
|
||||||
|
|
@ -771,7 +775,45 @@
|
||||||
(vv (cadr spev)))
|
(vv (cadr spev)))
|
||||||
(setenv vn vv))))
|
(setenv vn vv))))
|
||||||
|
|
||||||
;; Dirty hack but it makes tramp run faster. This is for when you're experimenting with
|
|
||||||
;; using emacs locally but editing files on your FB devserver. Honestly I think you're
|
;; =================================================================
|
||||||
;; better off just using Nuclide and leaving emacs for other stuff.
|
;; PHP stuff
|
||||||
;; (setq vc-handled-backends nil)
|
;; =================================================================
|
||||||
|
(if is-fb-environment
|
||||||
|
(progn
|
||||||
|
;; Hack support for stuff in www
|
||||||
|
(setq hack-for-hiphop-root (expand-file-name "www" "~"))
|
||||||
|
(load "/home/engshare/tools/hack-for-hiphop")
|
||||||
|
|
||||||
|
(load-library (expand-file-name "emacs-packages/hh-client.el" master-dir))
|
||||||
|
(require 'hh-client)
|
||||||
|
|
||||||
|
(defun my-fb-php-hook ()
|
||||||
|
(global-set-key (kbd "M-.") 'hh-client-find-definition))
|
||||||
|
(add-hook 'php-mode-hook 'my-fb-php-hook)
|
||||||
|
))
|
||||||
|
|
||||||
|
(if is-fb-environment
|
||||||
|
(progn
|
||||||
|
|
||||||
|
(flycheck-define-checker python-fb-flake8
|
||||||
|
"A Python syntax and style checker using FB's Flake8."
|
||||||
|
:command ("flake8")
|
||||||
|
:standard-input f
|
||||||
|
:error-filter (lambda (errors)
|
||||||
|
(let ((errors (flycheck-sanitize-errors errors)))
|
||||||
|
(seq-do #'flycheck-flake8-fix-error-level errors)
|
||||||
|
errors))
|
||||||
|
:error-patterns
|
||||||
|
((warning line-start
|
||||||
|
"stdin:" line ":" (optional column ":") " "
|
||||||
|
(id (one-or-more (any alpha)) (one-or-more digit)) " "
|
||||||
|
(message (one-or-more not-newline))
|
||||||
|
line-end))
|
||||||
|
:modes python-mode)
|
||||||
|
|
||||||
|
(add-hook 'python-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(flycheck-select-checker `python-fb-flake8)
|
||||||
|
))
|
||||||
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue