Mercurial > dotfiles
view .elisp/settings/90.keybindings.el @ 377:117e3c11d953
zprofile: introduce zprofile use
El Capitan (OS X 10.11) introduces a system-level /etc/zprofile which
uses a path_helper thing to mangle $PATH. Unfortunately, the way
path_helper works, it forces /usr/local/bin and /usr/bin to the
*start* of the PATH variable, which means that any PATH mutations I
want have to run after /etc/zprofile calls path_helper. As such, move
my path insertions into .zprofile{,-machine} rather than
.zshenv{,-machine} so that I can still ensure my path entries are at
the start of PATH rather than the end. This works because:
> Commands are then read from $ZDOTDIR/.zshenv. If the shell is a
> login shell, commands are read from /etc/zprofile and then
> $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands
> are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally, if the
> shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are read.
This means that non-login shells no longer pick up my custom PATH
entries, but as I only use OS X as a desktop OS that seems like a
workable tradeoff for now.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sun, 31 Jan 2016 20:46:29 -0500 |
parents | b9c8655f12f0 |
children | 1cda3348f36b |
line wrap: on
line source
;; Key Bindings ; M-backspace kills the current buffer (global-set-key [(meta backspace)] 'kill-this-buffer) (global-set-key "\M-\d" 'kill-this-buffer) ; Save early and often, with only one keystroke (global-set-key [(meta s)] 'save-buffer) ; Typing tab is for lesser editors, make hitting return do that (global-set-key "\C-m" 'indent-new-comment-line) ; M-l makes more sense to me for jumping to a line (global-set-key "\M-l" 'goto-line) ; Sometimes C-h is what Backspace sends in a terminal, and I never use C-h (global-set-key "\C-h" 'backward-delete-char-untabify) ; M-t is what I want for the textmate file finding (global-set-key [(meta t)] 'textmate-goto-file) ; M-p for bouncing to the matching paren (global-set-key [(meta p)] 'bounce-to-other-paren) (global-set-key [(meta control f)] 'textmate-find-in-project-type) (global-set-key [(meta shift f)] 'textmate-find-in-project) (global-set-key [(meta m)] 'iconify-or-deiconify-frame) (global-set-key [(control backspace)] 'kill-word) (global-set-key [f3] 'next-error) (defun af-dwim-f4 () (interactive) (cond ((string-match "\\.t$" buffer-file-name) (textmate-start-compile-in-root (concat "make " (file-name-nondirectory buffer-file-name)))))) (global-set-key [f4] 'af-dwim-f4) (global-set-key [f5] 'diff-apply-hunk) ;; M-j for jump to function definition (global-set-key [(meta j)] 'textmate-goto-symbol) ;; commit emacs heresy? (global-set-key [(meta r)] 'smex) (global-set-key (kbd "M-R") 'smex-major-mode-commands) (global-set-key (kbd "C-x C-b") 'ibuffer) ;; Mac-like keybindings for undo/cut/copy/paste (global-set-key [(meta c)] 'kill-ring-save) (global-set-key [(meta x)] 'kill-region) (global-set-key [(meta z)] 'undo) (global-set-key [(meta v)] 'yank) (global-set-key [M-return] 'fullscreen) (global-set-key [(control v)] 'yank-pop) ;; Fixup hooks for modes that like taking my keys back (add-hook 'text-mode-hook '(lambda () (define-key text-mode-map "\M-s" 'save-buffer))) (add-hook 'comint-mode-hook '(lambda () (local-set-key "\M-r" 'execute-extended-command))) (defun server-save-buffer-and-finish () (interactive) (save-buffer) (if server-buffer-clients (server-edit))) (add-hook 'server-switch-hook '(lambda ()(local-set-key "\M-s" 'server-save-buffer-and-finish )))