2016-09-29 08:50:50 +00:00
|
|
|
|
;; Initialize the package system
|
2016-08-18 20:01:20 +00:00
|
|
|
|
(package-initialize)
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Add path to my custom lisp functions
|
2016-09-15 14:08:54 +00:00
|
|
|
|
(add-to-list 'load-path (concat
|
|
|
|
|
user-emacs-directory
|
|
|
|
|
(convert-standard-filename "lisp/")))
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Load xdg-paths; it is needed to set `org-directory'
|
2016-09-15 14:21:17 +00:00
|
|
|
|
(require 'xdg-paths)
|
2016-09-15 14:08:54 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Custom stuff
|
2014-10-05 12:57:41 +00:00
|
|
|
|
(custom-set-variables
|
|
|
|
|
;; custom-set-variables was added by Custom.
|
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
|
;; If there is more than one, they won't work right.
|
|
|
|
|
'(background-color "#7f7f7f")
|
|
|
|
|
'(background-mode dark)
|
|
|
|
|
'(blink-cursor-mode t)
|
|
|
|
|
'(column-number-mode t)
|
|
|
|
|
'(cursor-color "#5c5cff")
|
2015-05-04 09:45:55 +00:00
|
|
|
|
'(cursor-type (quote bar))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(custom-enabled-themes (quote (tango-dark)))
|
2015-05-04 09:45:55 +00:00
|
|
|
|
'(custom-safe-themes
|
|
|
|
|
(quote
|
2016-10-10 12:55:07 +00:00
|
|
|
|
("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279"
|
|
|
|
|
"c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223"
|
|
|
|
|
"3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa"
|
|
|
|
|
"a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e"
|
|
|
|
|
"1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365"
|
|
|
|
|
"fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6"
|
|
|
|
|
default)))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(ediff-merge-split-window-function (quote split-window-horizontally))
|
|
|
|
|
'(ediff-split-window-function (quote split-window-vertically))
|
2016-10-05 11:57:23 +00:00
|
|
|
|
'(ediff-window-setup-function (quote ediff-setup-windows-plain))
|
2016-10-10 12:49:02 +00:00
|
|
|
|
'(eww-search-prefix "https://www.google.com/?q=")
|
2015-08-24 06:21:44 +00:00
|
|
|
|
'(fiplr-ignored-globs
|
|
|
|
|
(quote
|
|
|
|
|
((directories
|
|
|
|
|
(".git" ".svn" ".hg" ".bzr"))
|
|
|
|
|
(files
|
|
|
|
|
(".#*" "*.so" "*~")))))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(foreground-color "#5c5cff")
|
2014-10-05 20:56:23 +00:00
|
|
|
|
'(global-hl-line-mode t)
|
2014-10-06 08:26:22 +00:00
|
|
|
|
'(global-whitespace-mode t)
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(helm-gtags-auto-update t)
|
|
|
|
|
'(helm-gtags-ignore-case t)
|
|
|
|
|
'(helm-gtags-path-style (quote relative))
|
2016-10-05 07:44:40 +00:00
|
|
|
|
'(indicate-empty-lines t)
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(inhibit-startup-screen t)
|
2016-10-05 07:44:40 +00:00
|
|
|
|
'(initial-scratch-message nil)
|
2016-04-21 22:34:54 +00:00
|
|
|
|
'(jekyll-directory "~/Projektek/jekyll/gergely.polonkai.eu")
|
2014-10-05 12:57:41 +00:00
|
|
|
|
'(nxml-attribute-indent 4)
|
|
|
|
|
'(nxml-child-indent 2)
|
|
|
|
|
'(nxml-outline-child-indent 4)
|
2016-09-27 14:29:42 +00:00
|
|
|
|
'(nyan-animate-nyancat t)
|
2014-10-05 20:56:23 +00:00
|
|
|
|
'(nyan-wavy-trail t)
|
2016-09-15 14:06:52 +00:00
|
|
|
|
'(org-crypt-key "B0740C4C")
|
2016-09-16 14:36:22 +00:00
|
|
|
|
'(org-default-notes-file
|
|
|
|
|
(concat user-documents-directory
|
|
|
|
|
(convert-standard-filename "/orgmode/notes.org")))
|
|
|
|
|
'(org-directory
|
|
|
|
|
(concat user-documents-directory
|
|
|
|
|
(convert-standard-filename "/orgmode/")))
|
2016-10-05 21:02:04 +00:00
|
|
|
|
'(org-agenda-files
|
|
|
|
|
(concat user-documents-directory
|
|
|
|
|
(convert-standard-filename "/orgmode/agenda_files")))
|
2016-09-15 14:06:52 +00:00
|
|
|
|
'(org-ellipsis "…#")
|
2016-09-16 14:36:22 +00:00
|
|
|
|
'(org-mobile-directory
|
|
|
|
|
(concat user-documents-directory
|
2016-10-10 08:46:15 +00:00
|
|
|
|
(convert-standard-filename "/orgmode/mobile/")))
|
2016-09-16 14:36:22 +00:00
|
|
|
|
'(org-mobile-inbox-for-pull
|
|
|
|
|
(concat user-documents-directory
|
|
|
|
|
(convert-standard-filename "/orgmode/from-mobile.org")))
|
2016-09-15 14:06:52 +00:00
|
|
|
|
'(org-startup-folded (quote content))
|
2015-05-04 09:45:55 +00:00
|
|
|
|
'(package-archives
|
|
|
|
|
(quote
|
|
|
|
|
(("gnu" . "http://elpa.gnu.org/packages/")
|
2016-02-24 17:52:06 +00:00
|
|
|
|
("melpa" . "https://melpa.org/packages/")
|
2015-05-04 09:45:55 +00:00
|
|
|
|
("e6h" . "http://www.e6h.org/packages/"))))
|
2016-08-18 20:01:20 +00:00
|
|
|
|
'(package-selected-packages
|
|
|
|
|
(quote
|
2016-10-10 12:55:07 +00:00
|
|
|
|
(ag
|
|
|
|
|
buffer-move
|
|
|
|
|
coffee-mode
|
|
|
|
|
command-log-mode
|
|
|
|
|
company-c-headers
|
|
|
|
|
company-quickhelp
|
|
|
|
|
company-shell
|
|
|
|
|
django-manage
|
|
|
|
|
django-mode
|
|
|
|
|
drag-stuff
|
|
|
|
|
electric-case
|
|
|
|
|
electric-spacing
|
|
|
|
|
emamux
|
|
|
|
|
erlang
|
|
|
|
|
fiplr
|
|
|
|
|
flycheck
|
|
|
|
|
flycheck-pkg-config
|
|
|
|
|
focus
|
|
|
|
|
ggtags
|
|
|
|
|
gh
|
|
|
|
|
git-gutter
|
|
|
|
|
git-messenger
|
|
|
|
|
git-timemachine
|
|
|
|
|
gitconfig
|
|
|
|
|
gitconfig-mode
|
|
|
|
|
github-notifier
|
|
|
|
|
gitignore-mode
|
|
|
|
|
gnome-calendar
|
|
|
|
|
gnugo
|
|
|
|
|
go-mode
|
|
|
|
|
gobgen
|
|
|
|
|
google
|
|
|
|
|
goto-last-change
|
|
|
|
|
helm-ag
|
|
|
|
|
helm-chrome
|
|
|
|
|
helm-company
|
|
|
|
|
helm-flycheck
|
|
|
|
|
helm-flyspell
|
|
|
|
|
helm-google
|
|
|
|
|
helm-gtags
|
|
|
|
|
helm-make
|
|
|
|
|
helm-projectile
|
|
|
|
|
helm-spotify
|
|
|
|
|
helm-swoop
|
|
|
|
|
helm-unicode
|
|
|
|
|
ht
|
|
|
|
|
hyde
|
|
|
|
|
id-manager
|
|
|
|
|
identica-mode
|
|
|
|
|
jinja2-mode
|
|
|
|
|
js2-mode
|
|
|
|
|
json-mode
|
|
|
|
|
logito
|
|
|
|
|
magit-gerrit
|
|
|
|
|
magithub
|
|
|
|
|
mark
|
|
|
|
|
markdown-mode
|
|
|
|
|
marshal
|
|
|
|
|
mc-extras
|
|
|
|
|
multiple-cursors
|
|
|
|
|
muse
|
|
|
|
|
ng2-mode
|
|
|
|
|
nyan-mode
|
|
|
|
|
nyan-prompt
|
|
|
|
|
org-bullets
|
|
|
|
|
org-jekyll
|
|
|
|
|
org-jira
|
|
|
|
|
org-projectile
|
|
|
|
|
origami
|
|
|
|
|
pcache
|
|
|
|
|
projectile-direnv
|
|
|
|
|
queue
|
|
|
|
|
sass-mode
|
|
|
|
|
smart-mode-line-powerline-theme
|
|
|
|
|
smartparens
|
|
|
|
|
spinner
|
|
|
|
|
sx
|
|
|
|
|
typescript-mode
|
|
|
|
|
use-package
|
|
|
|
|
vala-mode
|
|
|
|
|
wakatime-mode
|
|
|
|
|
xlicense
|
|
|
|
|
yaml-mode
|
|
|
|
|
zone-nyan)))
|
2016-09-16 14:36:22 +00:00
|
|
|
|
'(savehist-mode t)
|
2015-05-04 09:45:55 +00:00
|
|
|
|
'(sgml-basic-offset 4)
|
2014-10-06 08:26:22 +00:00
|
|
|
|
'(show-trailing-whitespace t)
|
2016-09-26 15:10:08 +00:00
|
|
|
|
'(sml/theme (quote powerline))
|
2014-11-10 15:37:48 +00:00
|
|
|
|
'(tab-width 4)
|
2016-09-29 08:52:16 +00:00
|
|
|
|
'(wakatime-cli-path "/usr/local/bin/wakatime")
|
|
|
|
|
'(zone-nyan-hide-progress t))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Custom face settings
|
2014-10-05 14:27:20 +00:00
|
|
|
|
(custom-set-faces
|
|
|
|
|
;; custom-set-faces was added by Custom.
|
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
|
;; If there is more than one, they won't work right.
|
2014-10-05 20:56:23 +00:00
|
|
|
|
'(hl-line ((t (:inherit nil :background "gray25"))))
|
2014-10-06 08:26:22 +00:00
|
|
|
|
'(trailing-whitespace ((t (:inherit nil :background "red1"))))
|
|
|
|
|
'(whitespace-line ((t (:inherit nil :background "orange")))))
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(set-face-attribute 'default t :font "Hack-10")
|
|
|
|
|
(set-frame-font "Hack-10" nil t)
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Some personal stuff
|
|
|
|
|
(setq user-mail-address "gergely@polonkai.eu")
|
2014-10-05 14:27:20 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Load some custom libraries
|
|
|
|
|
(require 'thingatpt)
|
|
|
|
|
(require 'helm-config)
|
|
|
|
|
(require 'xlicense)
|
|
|
|
|
(require 'linum)
|
|
|
|
|
(require 'zone)
|
|
|
|
|
(require 'magithub)
|
2016-10-03 11:38:06 +00:00
|
|
|
|
(require 'origami)
|
2016-10-10 13:30:24 +00:00
|
|
|
|
|
|
|
|
|
;; Whitespace mode
|
|
|
|
|
;;
|
|
|
|
|
;; It is turned on by default, and can be toggled with F10
|
|
|
|
|
(use-package whitespace
|
|
|
|
|
:config
|
|
|
|
|
(global-whitespace-mode t)
|
|
|
|
|
:bind
|
|
|
|
|
(([f10] . global-whitespace-mode)))
|
2016-10-10 13:32:28 +00:00
|
|
|
|
|
|
|
|
|
;; Multiple cursors
|
|
|
|
|
(use-package multiple-cursors
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'multiple-cursors-mode-enabled-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setq blink-matching-paren nil)))
|
|
|
|
|
(add-hook 'multiple-cursors-mode-disabled-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setq blink-matching-paren t)))
|
|
|
|
|
:bind (("C-S-c C-S-c" . mc/edit-lines)
|
|
|
|
|
("C->" . mc/mark-next-like-this)
|
|
|
|
|
("C-<" . mc/mark-previous-like-this)
|
|
|
|
|
("C-c C-<" . mc/mark-all-like-this)))
|
2016-10-10 13:33:12 +00:00
|
|
|
|
|
|
|
|
|
;; Save place
|
|
|
|
|
(use-package saveplace
|
|
|
|
|
:config
|
|
|
|
|
(setq-default save-place t)
|
|
|
|
|
(setq save-place-file (expand-file-name ".places" user-emacs-directory)))
|
2016-10-10 12:47:04 +00:00
|
|
|
|
(use-package smartparens-config
|
2016-10-10 18:40:03 +00:00
|
|
|
|
:ensure smartparens
|
|
|
|
|
:config
|
|
|
|
|
(show-smartparens-global-mode t)
|
|
|
|
|
(add-hook 'prog-mode-hook
|
|
|
|
|
'turn-on-smartparens-strict-mode)
|
|
|
|
|
(add-hook 'markdown-mode-hook
|
|
|
|
|
'turn-on-smartparens-strict-mode))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Load my own functions
|
2016-09-15 14:08:54 +00:00
|
|
|
|
(load "gnu-c-header.el")
|
|
|
|
|
(load "toggle-window-split.el")
|
|
|
|
|
(load "round-number-to-decimals.el")
|
|
|
|
|
(load "transpose-windows.el")
|
|
|
|
|
(load "zim.el")
|
|
|
|
|
(load "clearcase.el")
|
|
|
|
|
(load "jekyll.el")
|
2016-09-23 12:58:35 +00:00
|
|
|
|
(load "enclose-string.el")
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(load "buf-manipulation.el")
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Define aliases
|
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
|
|
|
|
|
;; Magit settings
|
|
|
|
|
(setq magit-auto-revert-mode nil)
|
|
|
|
|
(setq magit-last-seen-setup-instructions "1.4.0")
|
|
|
|
|
(setq-default magit-gerrit-remote "gerrit")
|
|
|
|
|
(add-hook 'after-init-hook (lambda () (require 'magit-gerrit)))
|
2014-11-16 15:41:42 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Helm settings
|
|
|
|
|
(setq helm-M-x-fuzzy-match t
|
|
|
|
|
helm-buffers-fuzzy-matching t
|
|
|
|
|
helm-recentf-fuzzy-match t)
|
2014-10-05 12:57:41 +00:00
|
|
|
|
(eval-after-load "helm-gtags"
|
|
|
|
|
'(progn
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
|
|
|
|
|
(define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack)))
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(helm-mode 1)
|
|
|
|
|
(eval-after-load 'company
|
|
|
|
|
'(progn
|
|
|
|
|
(define-key company-mode-map (kbd "C-:") 'helm-company)
|
|
|
|
|
(define-key company-active-map (kbd "C-:") 'helm-company)))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
; Nyanyanyanyanya
|
|
|
|
|
(add-hook 'after-init-hook 'nyan-mode)
|
|
|
|
|
|
|
|
|
|
(add-hook 'eshell-load-hook 'nyan-prompt-enable)
|
|
|
|
|
|
|
|
|
|
(setq zone-programs [zone-nyan])
|
2016-10-05 21:02:46 +00:00
|
|
|
|
(zone-when-idle 60)
|
2014-10-07 20:17:48 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Waka-waka
|
|
|
|
|
(add-hook 'after-init-hook 'global-wakatime-mode)
|
|
|
|
|
|
|
|
|
|
;; `c-mode' settings
|
|
|
|
|
(add-hook 'c-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(helm-gtags-mode t)
|
|
|
|
|
(ggtags-mode 1)
|
|
|
|
|
(which-func-mode)
|
|
|
|
|
(flyspell-prog-mode)))
|
|
|
|
|
(add-hook 'c-mode-common-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(local-set-key (kbd "C-c o") 'ff-find-other-file)
|
|
|
|
|
(c-set-style "PERSONAL")
|
|
|
|
|
(setq tab-width 4
|
|
|
|
|
indent-tabs-mode nil)
|
|
|
|
|
(c-toggle-auto-newline 1)
|
|
|
|
|
(when (derived-mode-p 'c-mode 'c++-mode 'java-mode)
|
|
|
|
|
(ggtags-mode 1))))
|
|
|
|
|
(add-hook 'c-initialization-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(define-key c-mode-base-map (kbd "C-m") 'c-context-line-break)))
|
|
|
|
|
(defvaralias 'c-basic-offset 'tab-width)
|
|
|
|
|
(defvaralias 'cperl-indent-level 'tab-width)
|
2014-10-07 20:17:48 +00:00
|
|
|
|
(defconst my-c-style
|
|
|
|
|
'((c-tab-always-indent . t)
|
|
|
|
|
(c-comment-only-line-offset . 4)
|
|
|
|
|
(c-hanging-braces-alist . ((substatement-open after)
|
|
|
|
|
(brace-list-open)))
|
|
|
|
|
(c-hanging-colons-alist . ((member-init-intro before)
|
|
|
|
|
(inher-intro)
|
|
|
|
|
(case-label after)
|
|
|
|
|
(label after)
|
|
|
|
|
(access-label after)))
|
|
|
|
|
(c-cleanup-list . (scope-operator
|
|
|
|
|
empty-defun-braces
|
|
|
|
|
defun-close-semi))
|
|
|
|
|
(c-offsets-alist . ((arglist-close . +)
|
|
|
|
|
(arglist-intro . ++)
|
|
|
|
|
(substatement-open . 0)
|
|
|
|
|
(case-label . 4)
|
|
|
|
|
(block-open . 0)
|
2014-11-16 15:42:08 +00:00
|
|
|
|
(knr-argdecl-intro . -)
|
|
|
|
|
(comment-intro . 0)))
|
2014-10-07 20:17:48 +00:00
|
|
|
|
(c-echo-syntactic-information-p . t))
|
|
|
|
|
"My C Programming Style")
|
|
|
|
|
(c-add-style "PERSONAL" my-c-style)
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(setq c-offset-alist '((member-init-intro . ++)))
|
2016-02-16 08:12:19 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Custom key bindings
|
|
|
|
|
(global-set-key (kbd "C-x _") 'maximize-window)
|
|
|
|
|
;; Some terminals don’t interpret Alt-Up/Down as M-<up/down>.
|
2016-02-16 08:12:19 +00:00
|
|
|
|
(global-set-key (kbd "C-c C-y") 'duplicate-line)
|
2016-09-15 15:49:29 +00:00
|
|
|
|
(global-set-key (kbd "M-x") 'helm-M-x)
|
|
|
|
|
(global-set-key (kbd "C-x C-f") 'helm-find-files)
|
|
|
|
|
(global-set-key (kbd "C-x b") 'helm-mini)
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(global-set-key (kbd "M-i") 'helm-swoop)
|
|
|
|
|
(global-set-key (kbd "M-(") 'æ-enclose-region)
|
|
|
|
|
(global-set-key (kbd "C-x w") 'webjump)
|
|
|
|
|
(global-set-key (kbd "<C-return>") 'open-line-below)
|
|
|
|
|
(global-set-key (kbd "<C-S-return>") 'open-line-above)
|
|
|
|
|
(global-set-key (kbd "C-x C-r") 'rename-current-buffer-file)
|
|
|
|
|
(global-set-key (kbd "C-x C-d") 'delete-current-buffer-file)
|
|
|
|
|
(global-set-key (kbd "C-x g") 'magit-status)
|
|
|
|
|
(global-set-key (kbd "C-x ~") 'toggle-char-case)
|
|
|
|
|
(global-set-key (kbd "C-x M-a") 'ag)
|
|
|
|
|
(global-set-key (kbd "C-x C-M-a") 'ag-regexp)
|
2016-09-15 15:49:29 +00:00
|
|
|
|
|
2016-10-03 11:38:06 +00:00
|
|
|
|
;; Origami mode keys
|
|
|
|
|
(define-key global-map (kbd "C-x C-z") 'origami-mode-map)
|
|
|
|
|
(define-prefix-command 'origami-mode-map)
|
|
|
|
|
(define-key origami-mode-map (kbd "o") 'origami-open-node)
|
|
|
|
|
(define-key origami-mode-map (kbd "O") 'origami-open-node-recursively)
|
|
|
|
|
(define-key origami-mode-map (kbd "c") 'origami-close-node)
|
|
|
|
|
(define-key origami-mode-map (kbd "C") 'origami-close-node-recursively)
|
|
|
|
|
(define-key origami-mode-map (kbd "a") 'origami-toggle-node)
|
|
|
|
|
(define-key origami-mode-map (kbd "A") 'origami-recursively-toggle-node)
|
|
|
|
|
(define-key origami-mode-map (kbd "R") 'origami-open-all-nodes)
|
|
|
|
|
(define-key origami-mode-map (kbd "M") 'origami-close-all-nodes)
|
|
|
|
|
(define-key origami-mode-map (kbd "v") 'origami-show-only-node)
|
|
|
|
|
(define-key origami-mode-map (kbd "k") 'origami-previous-fold)
|
|
|
|
|
(define-key origami-mode-map (kbd "j") 'origami-forward-fold)
|
|
|
|
|
(define-key origami-mode-map (kbd "x") 'origami-reset)
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Set up some global minor modes
|
|
|
|
|
(add-hook 'after-init-hook 'global-company-mode)
|
2016-09-16 14:36:22 +00:00
|
|
|
|
(global-origami-mode t)
|
|
|
|
|
(show-paren-mode t)
|
2016-09-16 16:10:13 +00:00
|
|
|
|
(projectile-global-mode)
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(global-git-gutter-mode t)
|
|
|
|
|
(sml/setup)
|
|
|
|
|
(global-prettify-symbols-mode t)
|
|
|
|
|
(drag-stuff-global-mode t)
|
|
|
|
|
|
|
|
|
|
;; Projectile settings
|
2016-09-16 16:10:13 +00:00
|
|
|
|
(setq projectile-completion-system 'helm)
|
|
|
|
|
(helm-projectile-on)
|
2016-09-16 16:35:20 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Don’t allow tabs to be inserted during indentation
|
|
|
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
|
|
|
|
|
|
;; Enable some functions
|
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
|
|
|
(put 'upcase-region 'disabled nil)
|
|
|
|
|
|
|
|
|
|
;; org-mode settings
|
2016-09-23 11:50:53 +00:00
|
|
|
|
(add-hook 'org-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(if (display-graphic-p) (org-bullets-mode t))))
|
2016-09-23 12:58:35 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; text-mode settings
|
2016-09-26 08:15:12 +00:00
|
|
|
|
(add-hook 'text-mode-hook (lambda () (visual-line-mode t)))
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; UI hacks: turn off scroll bar (that’s why Nyan-cat is here) and the
|
|
|
|
|
;; toolbar (I don’t really use it)
|
|
|
|
|
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
|
|
|
|
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
2016-09-23 13:21:53 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Add some symbols to be prettified
|
|
|
|
|
(setq prettify-symbols-alist
|
|
|
|
|
'(("lambda" . 955) ; λ
|
|
|
|
|
("->" . 8594) ; →
|
|
|
|
|
("=>" . 8658) ; ⇒
|
|
|
|
|
("map" . 8614))) ; ↦
|
|
|
|
|
;; …and some pairs to complete
|
2016-09-23 13:21:53 +00:00
|
|
|
|
;; TODO: maybe add-to-list is a better way to do it
|
|
|
|
|
(setq insert-pair-alist
|
|
|
|
|
'(
|
|
|
|
|
(40 41) ; ()
|
|
|
|
|
(91 93) ; []
|
|
|
|
|
(123 125) ; {}
|
|
|
|
|
(60 62) ; <>
|
|
|
|
|
(34 34) ; ""
|
|
|
|
|
(39 39) ; ''
|
|
|
|
|
(96 39) ; `'
|
|
|
|
|
(8220 8221) ; “”
|
|
|
|
|
(8222 8221) ; „”
|
|
|
|
|
(8216 8217) ; ‘’
|
|
|
|
|
(8249 8250) ; ‹›
|
|
|
|
|
(8250 8249) ; ›‹
|
|
|
|
|
(171 187) ; «»
|
|
|
|
|
(187 171) ; »«
|
|
|
|
|
))
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Setup eshell
|
|
|
|
|
(add-hook 'eshell-mode-hook
|
|
|
|
|
(lambda () (local-set-key (kbd "C-d") #'eshell-C-d)))
|
2016-09-26 12:18:55 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Stuff to do after initialization is done
|
2016-09-26 12:55:53 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; TODO: Unordered stuff
|
|
|
|
|
(add-hook 'after-init-hook 'fiplr-clear-cache)
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.vala\\'" . vala-mode))
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.erl\\'" . erlang-mode))
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
|
2016-09-26 13:32:34 +00:00
|
|
|
|
|
|
|
|
|
; Temporary show line numbers while in the goto minibuffer. Copied
|
|
|
|
|
; from http://whattheemacsd.com/key-bindings.el-01.html
|
|
|
|
|
(global-set-key [remap goto-line] 'goto-line-with-feedback)
|
|
|
|
|
|
|
|
|
|
; TODO git-gutter-mode and linum-mode don’t play together well. This
|
|
|
|
|
; is an attempt to make them nice to each other, but it seems futile.
|
|
|
|
|
(defun æ-restore-goto-modes (linum-state gitgutter-state)
|
|
|
|
|
(linum-mode -1)
|
|
|
|
|
(git-gutter-mode -1)
|
|
|
|
|
(linum-mode linum-state)
|
|
|
|
|
(git-gutter-mode gitgutter-state))
|
|
|
|
|
|
|
|
|
|
(defun goto-line-with-feedback ()
|
|
|
|
|
"Show line numbers temporarily, while prompting for the line
|
|
|
|
|
number input"
|
|
|
|
|
|
|
|
|
|
(interactive)
|
|
|
|
|
|
|
|
|
|
(let ((old-linum-mode linum-mode)
|
|
|
|
|
(old-gitgutter-mode git-gutter-mode))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn
|
|
|
|
|
; Stay safe with git-gutter turned off
|
|
|
|
|
(git-gutter-mode -1)
|
|
|
|
|
; Turn on linum, before asking for the line number
|
|
|
|
|
(linum-mode 1)
|
|
|
|
|
(goto-line (read-number "Goto line: "))
|
|
|
|
|
(æ-restore-goto-modes old-linum-mode old-gitgutter-mode))
|
|
|
|
|
(æ-restore-goto-modes old-linum-mode old-gitgutter-mode))))
|