| /image-dired/ | /image-dired/ | ||||
| /eshell | /eshell | ||||
| lisp/init-local.el | |||||
| #lisp/init-local.el | |||||
| session* | session* | ||||
| .#.smex-items | .#.smex-items |
| (require 'init-recentf) | (require 'init-recentf) | ||||
| (require 'init-ido) | (require 'init-ido) | ||||
| (require 'init-auto-complete) | (require 'init-auto-complete) | ||||
| (require 'init-windows) | |||||
| (require 'init-editing-utils) | (require 'init-editing-utils) | ||||
| ;(require 'init-git) | |||||
| ;(require 'init-github) | |||||
| (require 'init-crontab) | (require 'init-crontab) | ||||
| (require 'init-markdown) | (require 'init-markdown) | ||||
| (require 'init-csv) | (require 'init-csv) | ||||
| (require 'init-css) | (require 'init-css) | ||||
| (require 'init-python-mode) | (require 'init-python-mode) | ||||
| (require 'init-sql) | (require 'init-sql) | ||||
| (require 'init-octave) | |||||
| (when *spell-check-support-enabled* | (when *spell-check-support-enabled* | ||||
| (require 'init-spelling)) | (require 'init-spelling)) |
| ;; TODO: link commits from vc-log to magit-show-commit | |||||
| ;; TODO: smerge-mode | |||||
| (require-package 'magit) | |||||
| (require-package 'git-blame) | |||||
| (require-package 'git-commit-mode) | |||||
| (require-package 'git-rebase-mode) | |||||
| (require-package 'gitignore-mode) | |||||
| (require-package 'gitconfig-mode) | |||||
| (require-package 'git-messenger) ;; Though see also vc-annotate's "n" & "p" bindings | |||||
| (require-package 'git-timemachine) | |||||
| (setq-default | |||||
| magit-save-some-buffers nil | |||||
| magit-process-popup-time 10 | |||||
| magit-diff-refine-hunk t | |||||
| magit-completing-read-function 'magit-ido-completing-read) | |||||
| ;; Hint: customize `magit-repo-dirs' so that you can use C-u M-F12 to | |||||
| ;; quickly open magit on any one of your projects. | |||||
| (global-set-key [(meta f12)] 'magit-status) | |||||
| (after-load 'magit | |||||
| (define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-goto-parent-section)) | |||||
| (require-package 'fullframe) | |||||
| (after-load 'magit | |||||
| (fullframe magit-status magit-mode-quit-window)) | |||||
| (add-hook 'git-commit-mode-hook 'goto-address-mode) | |||||
| (after-load 'session | |||||
| (add-to-list 'session-mode-disable-list 'git-commit-mode)) | |||||
| ;;; When we start working on git-backed files, use git-wip if available | |||||
| (after-load 'magit | |||||
| (global-magit-wip-save-mode) | |||||
| (diminish 'magit-wip-save-mode)) | |||||
| (after-load 'magit | |||||
| (diminish 'magit-auto-revert-mode)) | |||||
| (when *is-a-mac* | |||||
| (after-load 'magit | |||||
| (add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)]))))) | |||||
| ;; Convenient binding for vc-git-grep | |||||
| (global-set-key (kbd "C-x v f") 'vc-git-grep) | |||||
| ;;; git-svn support | |||||
| (require-package 'magit-svn) | |||||
| (autoload 'magit-svn-enabled "magit-svn") | |||||
| (defun sanityinc/maybe-enable-magit-svn-mode () | |||||
| (when (magit-svn-enabled) | |||||
| (magit-svn-mode))) | |||||
| (add-hook 'magit-status-mode-hook #'sanityinc/maybe-enable-magit-svn-mode) | |||||
| (after-load 'compile | |||||
| (dolist (defn (list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1) | |||||
| '(git-svn-needs-update "^\\(.*\\): needs update$" 1 nil nil 2 1))) | |||||
| (add-to-list 'compilation-error-regexp-alist-alist defn) | |||||
| (add-to-list 'compilation-error-regexp-alist (car defn)))) | |||||
| (defvar git-svn--available-commands nil "Cached list of git svn subcommands") | |||||
| (defun git-svn (dir) | |||||
| "Run a git svn subcommand in DIR." | |||||
| (interactive "DSelect directory: ") | |||||
| (unless git-svn--available-commands | |||||
| (setq git-svn--available-commands | |||||
| (sanityinc/string-all-matches | |||||
| "^ \\([a-z\\-]+\\) +" | |||||
| (shell-command-to-string "git svn help") 1))) | |||||
| (let* ((default-directory (vc-git-root dir)) | |||||
| (compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*"))) | |||||
| (compile (concat "git svn " | |||||
| (ido-completing-read "git-svn command: " git-svn--available-commands nil t))))) | |||||
| (require-package 'git-messenger) | |||||
| (global-set-key (kbd "C-x v p") #'git-messenger:popup-message) | |||||
| (provide 'init-git) |
| (require 'init-git) | |||||
| (require-package 'yagist) | |||||
| (require-package 'github-browse-file) | |||||
| (require-package 'bug-reference-github) | |||||
| (add-hook 'prog-mode-hook 'bug-reference-prog-mode) | |||||
| (when (eval-when-compile (> emacs-major-version 23)) | |||||
| (require-package 'github-clone) | |||||
| (require-package 'magit-gh-pulls)) | |||||
| (provide 'init-github) |
| :type 'symbol | :type 'symbol | ||||
| :group 'programming | :group 'programming | ||||
| :options '(js2-mode js-mode)) | :options '(js2-mode js-mode)) | ||||
| (defvar preferred-javascript-indent-level 4) | |||||
| (defvar preferred-javascript-indent-level 2) | |||||
| ;; Need to first remove from list if present, since elpa adds entries too, which | ;; Need to first remove from list if present, since elpa adds entries too, which | ||||
| ;; may be in an arbitrary order | ;; may be in an arbitrary order |
| (global-set-key (kbd "S-s-<up>") 'windmove-up) | |||||
| (global-set-key (kbd "S-s-<down>") 'windmove-down) | |||||
| (global-set-key (kbd "S-s-<right>") 'windmove-right) | |||||
| (global-set-key (kbd "S-s-<left>") 'windmove-left) | |||||
| ;; linum-mode by default | |||||
| (require ‘linum) | |||||
| (global-linum-mode 1) | |||||
| (provide 'init-local) | |||||
| (autoload 'octave-mode "octave-mod" nil t) | |||||
| (setq auto-mode-alist | |||||
| (cons '("\\.m$" . octave-mode) auto-mode-alist)) | |||||
| (add-hook 'octave-mode-hook | |||||
| (lambda () | |||||
| (abbrev-mode 1) | |||||
| (auto-fill-mode 1) | |||||
| (if (eq window-system 'x) | |||||
| (font-lock-mode 1)))) | |||||
| (provide 'init-octave) |
| ;;---------------------------------------------------------------------------- | |||||
| ;; Navigate window layouts with "C-c <left>" and "C-c <right>" | |||||
| ;;---------------------------------------------------------------------------- | |||||
| (winner-mode 1) | |||||
| ;; Make "C-x o" prompt for a target window when there are more than 2 | |||||
| (require-package 'switch-window) | |||||
| (require 'switch-window) | |||||
| ;;(setq switch-window-shortcut-style 'alphabet) | |||||
| (setq switch-window-shortcut-style 'qwerty) | |||||
| (global-set-key (kbd "C-x o") 'switch-window) | |||||
| ;;---------------------------------------------------------------------------- | |||||
| ;; When splitting window, show (other-buffer) in the new window | |||||
| ;;---------------------------------------------------------------------------- | |||||
| (defun split-window-func-with-other-buffer (split-function) | |||||
| (lexical-let ((s-f split-function)) | |||||
| (lambda () | |||||
| (interactive) | |||||
| (funcall s-f) | |||||
| (set-window-buffer (next-window) (other-buffer))))) | |||||
| (global-set-key "\C-x2" (split-window-func-with-other-buffer 'split-window-vertically)) | |||||
| (global-set-key "\C-x3" (split-window-func-with-other-buffer 'split-window-horizontally)) | |||||
| (defun sanityinc/toggle-delete-other-windows () | |||||
| "Delete other windows in frame if any, or restore previous window config." | |||||
| (interactive) | |||||
| (if (and winner-mode | |||||
| (equal (selected-window) (next-window))) | |||||
| (winner-undo) | |||||
| (delete-other-windows))) | |||||
| (global-set-key "\C-x1" 'sanityinc/toggle-delete-other-windows) | |||||
| ;;---------------------------------------------------------------------------- | |||||
| ;; Rearrange split windows | |||||
| ;;---------------------------------------------------------------------------- | |||||
| (defun split-window-horizontally-instead () | |||||
| (interactive) | |||||
| (save-excursion | |||||
| (delete-other-windows) | |||||
| (funcall (split-window-func-with-other-buffer 'split-window-horizontally)))) | |||||
| (defun split-window-vertically-instead () | |||||
| (interactive) | |||||
| (save-excursion | |||||
| (delete-other-windows) | |||||
| (funcall (split-window-func-with-other-buffer 'split-window-vertically)))) | |||||
| (global-set-key "\C-x|" 'split-window-horizontally-instead) | |||||
| (global-set-key "\C-x_" 'split-window-vertically-instead) | |||||
| ;; Borrowed from http://postmomentum.ch/blog/201304/blog-on-emacs | |||||
| (defun sanityinc/split-window() | |||||
| "Split the window to see the most recent buffer in the other window. | |||||
| Call a second time to restore the original window configuration." | |||||
| (interactive) | |||||
| (if (eq last-command 'sanityinc/split-window) | |||||
| (progn | |||||
| (jump-to-register :sanityinc/split-window) | |||||
| (setq this-command 'sanityinc/unsplit-window)) | |||||
| (window-configuration-to-register :sanityinc/split-window) | |||||
| (switch-to-buffer-other-window nil))) | |||||
| (global-set-key (kbd "<f7>") 'sanityinc/split-window) | |||||
| (global-set-key (kbd "<f6>") | |||||
| (lambda () | |||||
| (interactive) | |||||
| (switch-to-buffer nil))) | |||||
| (provide 'init-windows) |