;; now i just have one init file
(unless (equal (user-uid) 0) ; don't make root owned files
(byte-recompile-file (expand-file-name "init.el" init-dir) nil 0)
- (byte-recompile-file "/p/c/mymu4e.el" nil 0)
+ (when (file-exists-p "/p/c/mymu4e.el")
+ (byte-recompile-file "/p/c/mymu4e.el" nil 0))
)
;; load init in `after-init-hook' so all packages are loaded. However, disabled because
;;;; alternate keyboards
;; todo, figure out an easy way to disable this when using external keyboard
- (if (display-graphic-p)
- (setq
- enter-key (kbd "<return>")
- s-enter-key (kbd "<S-return>")
- c-m-enter-key (kbd "<C-M-return>")
- m-enter (kbd "<M-return>")
- c-enter (kbd "<C-return>"))
- (setq
- enter-key (kbd "C-m")
- s-enter-key (kbd "C-8")
- c-m-enter-key (kbd "C-M-8")
- m-enter (kbd "M-m")
- c-enter (kbd "C-8")))
+ ;; (if (display-graphic-p)
+ ;; (setq
+ ;; enter-key (kbd "<return>")
+ ;; s-enter-key (kbd "<S-return>")
+ ;; c-m-enter-key (kbd "<C-M-return>")
+ ;; m-enter (kbd "<M-return>")
+ ;; c-enter (kbd "<C-return>"))
+ ;; (setq
+ ;; enter-key (kbd "C-m")
+ ;; s-enter-key (kbd "C-8")
+ ;; c-m-enter-key (kbd "C-M-8")
+ ;; m-enter (kbd "M-m")
+ ;; c-enter (kbd "C-8")))
(setq tp (string= (system-name) "tp"))
(setq x200 (string= (system-name) "x2"))
(define-key ac-completing-map (kbd "<down>") nil)
(define-key ac-completing-map (kbd "<S-return>") 'ac-expand)
(define-key ac-completing-map "\t" 'ac-complete)
- (define-key ac-completing-map (kbd "<tab>") 'ac-complete)
+ ;;(define-key ac-completing-map (kbd "<tab>") 'ac-complete)
+ (define-key ac-completing-map (kbd "TAB") 'ac-complete)
(add-hook 'shell-mode-hook
(lambda ()
- (define-key shell-mode-map (kbd "<tab>") 'auto-complete)))
+ ;;(define-key shell-mode-map (kbd "<tab>") 'auto-complete)
+ (define-key shell-mode-map (kbd "TAB") 'auto-complete)
+ ))
;;; readline complete fix
;; mu4e-user-mail-address-list
;; and a function
;; inspired by mu4e info manual, search for mu4e-compose-pre-hook.
- (load "/p/c/mymu4e.el")
+ (when (file-exists-p "/p/c/mymu4e.el")
+ (load "/p/c/mymu4e.el"))
(defun my-decrypt ()
;; use for decrypting in mu4e
(add-hook 'haskell-interactive-mode-hook
(lambda ()
(define-key haskell-interactive-mode-map "\r" nil)
- (define-key haskell-interactive-mode-map (kbd "<return>") 'haskell-interactive-mode-return)))
+ (define-key haskell-interactive-mode-map (kbd "RET")
+ 'haskell-interactive-mode-return)))
(add-hook 'haskell-indentation-mode-hook (lambda () (define-key haskell-indentation-mode-map "\r" nil)))
(setq css-indent-offset 2)
- (load-file "/a/h/iank-mod.el")
+ (when (file-exists-p "/a/h/iank-mod.el")
+ (load-file "/a/h/iank-mod.el"))
;; from when i was running my own patches
;;(add-to-list 'load-path "/a/opt/ws-butler")
(defun prog-mode-defaults ()
"Default coding hook, useful with any programming language."
;; so that I can do completion before the dialog pops up
- (local-set-key (kbd "<tab>") 'auto-complete)
+ ;;(local-set-key (kbd "<tab>") 'auto-complete)
+ (local-set-key (kbd "TAB") 'auto-complete)
;; todo, this is causing error message on loading file, prolly not working
;;(flycheck-mode +1)
(setq ac-sources (delq 'ac-source-dictionary ac-sources))
;; when opening a pair, and then inserting a newline, push the closing pair to another newline
(sp-pair "{" nil :post-handlers
'(:add ((lambda (id action context)
- (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
+ (gp/sp/pair-on-newline-and-indent id action context)) (kbd "RET"))))
(sp-pair "[" nil :post-handlers
'(:add ((lambda (id action context)
- (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
+ (gp/sp/pair-on-newline-and-indent id action context)) (kbd "RET"))))
;; in my version, this is not a pairing.
;;;; single/special keys
;;;;; tab - isearch
- (define-key isearch-mode-map (kbd "TAB") 'isearch-query-replace)
+ ;; todo: this doesnt work. needs <tab>, which doesnt work in terminal. fix that.
+ ;; (define-key isearch-mode-map (kbd "TAB") 'isearch-query-replace)
+ (define-key isearch-mode-map (kbd "M-f") 'isearch-query-replace)
;;;;; f12 - isearch-forward
;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
(add-hook 'comint-mode-hook
(lambda ()
(define-key comint-mode-map "\r" nil)
- (define-key comint-mode-map (kbd "<return>") 'comint-send-input)))
+ (define-key comint-mode-map (kbd "RET") 'comint-send-input)))
(add-hook 'comint-mode-hook
(lambda ()
;;;;; C-z - undo-only
(global-set-key (kbd "C-z") 'undo-tree-undo)
;;;;; C-M-z - suspend-frame
- (global-set-key (kbd "C-z") 'suspend-frame)
- ;; previously, i meant to only use gui and ran this to
- ;; be sure it never got ran
- ;;(defun suspend-frame() (interactive))
+ (global-set-key (kbd "C-M-z") 'suspend-frame)
+ ;; this is never good in a gui
+ (when (window-system)
+ (defun suspend-frame() (interactive)))
;;;;; C-x - kill-region
(interactive)
(end-of-line)
(newline-and-indent))
+ ;; todo use alternate keybind make this work for terminal
(global-set-key (kbd "<C-return>") 'newline-anywhere)
(defun plain-newline ()
(interactive)
(insert "\n"))
- (global-set-key (kbd "<M-return>") 'plain-newline)
+ (global-set-key (kbd "M-RET") 'plain-newline)
;;;;; C-space - org-edit-special