Nuova configurazione Emacs con Orgmode
This commit is contained in:
72
.emacs
72
.emacs
@@ -1,72 +0,0 @@
|
|||||||
;;; RCs
|
|
||||||
|
|
||||||
(package-initialize) ;Package.el won't shut up
|
|
||||||
;without this line being
|
|
||||||
;specificaly here and not
|
|
||||||
;anywhere else ~_~
|
|
||||||
|
|
||||||
(load "~/.emacs.rc/rc.el") ;It MUST keep here
|
|
||||||
|
|
||||||
(load "~/.emacs.rc/alchemist.el")
|
|
||||||
(load "~/.emacs.rc/appearance-rc.el")
|
|
||||||
(load "~/.emacs.rc/autocommit-rc.el")
|
|
||||||
(load "~/.emacs.rc/ccmode-rc.el")
|
|
||||||
(load "~/.emacs.rc/clojure-rc.el")
|
|
||||||
(load "~/.emacs.rc/company-rc.el")
|
|
||||||
(load "~/.emacs.rc/dired-rc.el")
|
|
||||||
(load "~/.emacs.rc/editorconfig-rc.el")
|
|
||||||
(load "~/.emacs.rc/emacs-lisp-rc.el")
|
|
||||||
(load "~/.emacs.rc/eldoc-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/erlang-rc.el")
|
|
||||||
(load "~/.emacs.rc/haskell-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/ido-smex-rc.el")
|
|
||||||
(load "~/.emacs.rc/js2-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/latex-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/magit-rc.el")
|
|
||||||
(load "~/.emacs.rc/misc-rc.el")
|
|
||||||
(load "~/.emacs.rc/move-text-rc.el")
|
|
||||||
(load "~/.emacs.rc/multiple-cursors-rc.el")
|
|
||||||
(load "~/.emacs.rc/nasm-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/nxml-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/openwith-rc.el")
|
|
||||||
(load "~/.emacs.rc/org-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/org-cliplink-rc.el")
|
|
||||||
(load "~/.emacs.rc/org-babel-rc.el")
|
|
||||||
(load "~/.emacs.rc/org-capture-rc.el")
|
|
||||||
(load "~/.emacs.rc/paredit-rc.el")
|
|
||||||
(load "~/.emacs.rc/rainbow-rc.el")
|
|
||||||
(load "~/.emacs.rc/recentf-mode-rc.el")
|
|
||||||
(load "~/.emacs.rc/shell-integration-rc.el")
|
|
||||||
(load "~/.emacs.rc/tide-rc.el")
|
|
||||||
(load "~/.emacs.rc/tramp-rc.el")
|
|
||||||
(load "~/.emacs.rc/word-wrap-rc.el")
|
|
||||||
(load "~/.emacs.rc/yasnippet-rc.el")
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.ebi\\'" . lisp-mode))
|
|
||||||
|
|
||||||
;;; Packages that don't require configuration
|
|
||||||
(rc/require
|
|
||||||
'elixir-mode
|
|
||||||
'yaml-mode
|
|
||||||
'glsl-mode
|
|
||||||
'tuareg
|
|
||||||
'less-css-mode
|
|
||||||
'graphviz-dot-mode
|
|
||||||
'clojure-mode
|
|
||||||
'cmake-mode
|
|
||||||
'jinja2-mode
|
|
||||||
'markdown-mode
|
|
||||||
'nix-mode
|
|
||||||
'dockerfile-mode
|
|
||||||
'love-minor-mode
|
|
||||||
'toml-mode
|
|
||||||
'ag
|
|
||||||
'hindent
|
|
||||||
'elpy
|
|
||||||
'typescript-mode
|
|
||||||
)
|
|
||||||
|
|
||||||
(load "~/.emacs.shadow/shadow-rc.el" t)
|
|
||||||
|
|
||||||
(setq custom-file "~/.emacs-custom.el")
|
|
||||||
(load custom-file)
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
(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.
|
|
||||||
'(org-agenda-dim-blocked-tasks nil)
|
|
||||||
'(org-agenda-exporter-settings (quote ((org-agenda-tag-filter-preset (list "+personal")))))
|
|
||||||
'(org-cliplink-transport-implementation (quote url-el))
|
|
||||||
'(org-enforce-todo-dependencies nil)
|
|
||||||
'(org-modules
|
|
||||||
(quote
|
|
||||||
(org-bbdb org-bibtex org-docview org-gnus org-habit org-info org-irc org-mhe org-rmail org-w3m)))
|
|
||||||
'(org-refile-use-outline-path (quote file))
|
|
||||||
'(package-selected-packages
|
|
||||||
(quote
|
|
||||||
(flycheck-rebar3 clj-refactor clojure-snippets cider cider-decompile cider-eval-sexp-fu cider-hydra atom-one-dark-theme alchemist company-c-headers company-cabal company-ctags company-ghc company-ghci company-go company-shell company-web company-erlang wombat-theme darcula-theme darcula-theme-theme zeal-at-point yaml-mode xquery-mode uuidgen tuareg tt-mode toml-mode tide smex slime rtags rainbow-mode racket-mode racer qml-mode purescript-mode powershell picolisp-mode php-mode paredit pacmacs package-lint org-pomodoro org-cliplink openwith nsis-mode nodejs-repl nix-mode nim-mode nginx-mode neotree nasm-mode multiple-cursors morganey-mode markdown-mode magit love-minor-mode less-css-mode kotlin-mode js2-mode jira-markup-mode jinja2-mode jade-mode jabber ido-ubiquitous htmlize helm-ls-git helm-git-grep helm-cmd-t haskell-mode handlebars-mode gruber-darker-theme groovy-mode graphviz-dot-mode gradle-mode google-translate go-mode glsl-mode ggtags fsharp-mode flycheck-rust fixmee evil erlang ensime emojify elpy elm-mode elfeed editorconfig dropdown-list dockerfile-mode d-mode csv-nav csharp-mode crux cmake-mode clojure-mode cil-mode buffer-move bnfc batch-mode ag ack)))
|
|
||||||
'(safe-local-variable-values
|
|
||||||
(quote
|
|
||||||
((haskell-process-args-cabal-new-repl "--ghc-option=-ferror-spans" "--ghc-option=-Wno-missing-home-modules" "exe:HyperNerd")
|
|
||||||
(haskell-process-args-cabal-repl "--ghc-option=-ferror-spans" "--ghc-option=-Wno-missing-home-modules" "exe:poutro")
|
|
||||||
(haskell-process-args-cabal-repl "--ghc-option=-ferror-spans" "--ghc-option=-Wno-missing-home-modules" "exe:HyperNerd")
|
|
||||||
(fixmee-mode . t)
|
|
||||||
(eval progn
|
|
||||||
(auto-revert-mode 1)
|
|
||||||
(rc/autopull-changes)
|
|
||||||
(add-hook
|
|
||||||
(quote after-save-hook)
|
|
||||||
(quote rc/autocommit-changes)
|
|
||||||
nil
|
|
||||||
(quote make-it-local)))
|
|
||||||
(eval progn
|
|
||||||
(rc/autopull-changes)
|
|
||||||
(add-hook
|
|
||||||
(quote after-save-hook)
|
|
||||||
(quote rc/autocommit-changes)
|
|
||||||
nil
|
|
||||||
(quote make-it-local)))
|
|
||||||
(eval when
|
|
||||||
(eq system-type
|
|
||||||
(quote gnu/linux))
|
|
||||||
(rc/autopull-changes)
|
|
||||||
(add-hook
|
|
||||||
(quote after-save-hook)
|
|
||||||
(quote rc/autocommit-changes)
|
|
||||||
nil
|
|
||||||
(quote make-it-local)))
|
|
||||||
(eval rc/autocommit-dir-locals)
|
|
||||||
(eval when
|
|
||||||
(fboundp
|
|
||||||
(quote flymake-mode))
|
|
||||||
(flymake-mode 1))
|
|
||||||
(eval when
|
|
||||||
(fboundp
|
|
||||||
(quote rainbow-mode))
|
|
||||||
(rainbow-mode 1)))))
|
|
||||||
'(whitespace-style
|
|
||||||
(quote
|
|
||||||
(face tabs spaces trailing space-before-tab newline indentation empty space-after-tab space-mark tab-mark))))
|
|
||||||
(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.
|
|
||||||
)
|
|
||||||
101
.emacs.d/init.el
Normal file
101
.emacs.d/init.el
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
;; Added by Package.el. This must come before configurations of
|
||||||
|
;; installed packages. Don't delete this line. If you don't want it,
|
||||||
|
;; just comment it out by adding a semicolon to the start of the line.
|
||||||
|
;; You may delete these explanatory comments.
|
||||||
|
(package-initialize)
|
||||||
|
|
||||||
|
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
||||||
|
("melpa" . "https://melpa.org/packages/")))
|
||||||
|
|
||||||
|
;; Funzioni di servizio
|
||||||
|
(defvar rc/package-contents-refreshed nil)
|
||||||
|
(defvar rc/required-packages nil)
|
||||||
|
|
||||||
|
(defun rc/package-refresh-contents-once ()
|
||||||
|
(when (not rc/package-contents-refreshed)
|
||||||
|
(setq rc/package-contents-refreshed t)
|
||||||
|
(package-refresh-contents)))
|
||||||
|
|
||||||
|
(defun rc/require-one-package (package)
|
||||||
|
(push package rc/required-packages)
|
||||||
|
(when (not (package-installed-p package))
|
||||||
|
(rc/package-refresh-contents-once)
|
||||||
|
(package-install package)))
|
||||||
|
|
||||||
|
(defun rc/require (&rest packages)
|
||||||
|
(dolist (package packages)
|
||||||
|
(rc/require-one-package package)))
|
||||||
|
|
||||||
|
(defun rc/require-theme (theme)
|
||||||
|
(let ((theme-package (->> theme
|
||||||
|
(symbol-name)
|
||||||
|
(funcall (-flip #'concat) "-theme")
|
||||||
|
(intern))))
|
||||||
|
(rc/require theme-package)
|
||||||
|
(load-theme theme t)))
|
||||||
|
|
||||||
|
(rc/require 'dash)
|
||||||
|
(require 'dash)
|
||||||
|
|
||||||
|
(rc/require 'dash-functional)
|
||||||
|
(require 'dash-functional)
|
||||||
|
|
||||||
|
(defun rc/package-reqs (package)
|
||||||
|
(let ((package-desc
|
||||||
|
(->> package-alist
|
||||||
|
(alist-get package)
|
||||||
|
(car))))
|
||||||
|
(when package-desc
|
||||||
|
(package-desc-reqs package-desc))))
|
||||||
|
|
||||||
|
(defun rc/package-dependencies (package)
|
||||||
|
(->> package
|
||||||
|
(rc/package-reqs)
|
||||||
|
(-map #'car)
|
||||||
|
(cons package)))
|
||||||
|
|
||||||
|
(defun rc/package-expand-dependencies (packages)
|
||||||
|
(->> packages
|
||||||
|
(-map #'rc/package-dependencies)
|
||||||
|
(-flatten)
|
||||||
|
(remove-duplicates)))
|
||||||
|
|
||||||
|
(defun rc/unused-packages ()
|
||||||
|
(let ((all-package (rc/package-expand-dependencies rc/required-packages)))
|
||||||
|
(->> package-alist
|
||||||
|
(-map #'car)
|
||||||
|
(-filter (-lambda (package)
|
||||||
|
(not (-contains? all-package package)))))))
|
||||||
|
|
||||||
|
(defun rc/remove-unused-packages ()
|
||||||
|
(interactive)
|
||||||
|
(message "Unused packages: %s" (rc/unused-packages)))
|
||||||
|
|
||||||
|
;; Carica il file con delle configurazioni,
|
||||||
|
;; la configurazione è un file scritto con org-mode.
|
||||||
|
(require 'org)
|
||||||
|
(org-babel-load-file
|
||||||
|
(expand-file-name "settings.org"
|
||||||
|
user-emacs-directory))
|
||||||
|
|
||||||
|
(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.
|
||||||
|
'(org-agenda-dim-blocked-tasks nil)
|
||||||
|
'(org-agenda-exporter-settings (quote ((org-agenda-tag-filter-preset (list "+personal")))))
|
||||||
|
'(org-enforce-todo-dependencies nil)
|
||||||
|
'(org-modules
|
||||||
|
(quote
|
||||||
|
(org-bbdb org-bibtex org-docview org-gnus org-habit org-info org-irc org-mhe org-rmail org-w3m)))
|
||||||
|
'(org-refile-use-outline-path (quote file))
|
||||||
|
'(package-selected-packages
|
||||||
|
(quote
|
||||||
|
(exec-path-from-shell yasnippet rainbow-mode org-cliplink openwith nasm-mode multiple-cursors move-text ido-completing-read+ smex editorconfig company atom-one-dark-theme paredit material-theme magit lsp-mode))))
|
||||||
|
(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.
|
||||||
|
)
|
||||||
710
.emacs.d/settings.org
Normal file
710
.emacs.d/settings.org
Normal file
@@ -0,0 +1,710 @@
|
|||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(when (executable-find "agda-mode")
|
||||||
|
(load-file (let ((coding-system-for-read 'utf-8))
|
||||||
|
(shell-command-to-string "agda-mode locate"))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
;;; Fonts
|
||||||
|
(defun rc/get-default-font ()
|
||||||
|
(cond
|
||||||
|
((eq system-type 'windows-nt) "Consolas-13")
|
||||||
|
((eq system-type 'gnu/linux) "Fira Code-12")
|
||||||
|
((eq system-type 'darwin) "Monaco-14")))
|
||||||
|
|
||||||
|
(add-to-list 'default-frame-alist `(font . ,(rc/get-default-font)))
|
||||||
|
|
||||||
|
(when (display-graphic-p)
|
||||||
|
(set-face-attribute 'fixed-pitch nil :family (rc/get-default-font)))
|
||||||
|
|
||||||
|
;;; GUI
|
||||||
|
(tool-bar-mode 0)
|
||||||
|
(menu-bar-mode 0)
|
||||||
|
(scroll-bar-mode 0)
|
||||||
|
(column-number-mode 1)
|
||||||
|
(show-paren-mode 1)
|
||||||
|
(setq frame-title-format "Emacs")
|
||||||
|
(set-default 'cursor-type 'hbar)
|
||||||
|
(global-hl-line-mode)
|
||||||
|
(winner-mode t)
|
||||||
|
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||||
|
(windmove-default-keybindings)
|
||||||
|
|
||||||
|
;;; Themes
|
||||||
|
(rc/require-theme 'atom-one-dark)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
;;; TODO(c3bdae31-4329-4217-98a0-743b9dcbb6d2): extract autocommit into a separate package
|
||||||
|
;;;
|
||||||
|
;;; Once e266bfaa-2a01-4881-9e7f-ce2c592f7cdd is done, I think we can do that.
|
||||||
|
|
||||||
|
(defvar rc/autocommit-local-locks
|
||||||
|
(make-hash-table :test 'equal))
|
||||||
|
|
||||||
|
(defun rc/file-truename-nilable (filename)
|
||||||
|
(when filename
|
||||||
|
(file-truename filename)))
|
||||||
|
|
||||||
|
(defun rc/autocommit--id ()
|
||||||
|
(let ((id (-> default-directory
|
||||||
|
(locate-dominating-file ".git")
|
||||||
|
(rc/file-truename-nilable))))
|
||||||
|
(when (not id)
|
||||||
|
(error "%s is not inside of a git repository" default-directory))
|
||||||
|
(unless (gethash id rc/autocommit-local-locks)
|
||||||
|
(puthash id nil rc/autocommit-local-locks))
|
||||||
|
id))
|
||||||
|
|
||||||
|
(defun rc/autocommit--get-lock (lock)
|
||||||
|
(-> (rc/autocommit--id)
|
||||||
|
(gethash rc/autocommit-local-locks)
|
||||||
|
(plist-get lock)))
|
||||||
|
|
||||||
|
(defun rc/autocommit--set-lock (lock value)
|
||||||
|
(puthash (rc/autocommit--id)
|
||||||
|
(-> (rc/autocommit--id)
|
||||||
|
(gethash rc/autocommit-local-locks)
|
||||||
|
(plist-put lock value))
|
||||||
|
rc/autocommit-local-locks))
|
||||||
|
|
||||||
|
(defun rc/autocommit--toggle-lock (lock)
|
||||||
|
(-> lock
|
||||||
|
(rc/autocommit--get-lock)
|
||||||
|
(not)
|
||||||
|
(rc/autocommit--set-lock)))
|
||||||
|
|
||||||
|
(defun rc/autocommit--create-dir-locals (file-name)
|
||||||
|
(write-region "((nil . ((eval . (rc/autocommit-dir-locals)))))"
|
||||||
|
nil file-name))
|
||||||
|
|
||||||
|
(defun rc/y-or-n-if (predicate question action)
|
||||||
|
(when (or (not (funcall predicate))
|
||||||
|
(y-or-n-p question))
|
||||||
|
(funcall action)))
|
||||||
|
|
||||||
|
;;; TODO(4229cf9a-4768-4f5e-aca1-865256c64a23): rc/autocommit-init-dir should modify dir locals file on AST level
|
||||||
|
;;;
|
||||||
|
;;; Right know it just overrides .dir-locals file on text level. I
|
||||||
|
;;; want it to
|
||||||
|
;;; - read .dir-locals,
|
||||||
|
;;; - parse the assoc list,
|
||||||
|
;;; - check if there is already autocommit stuff
|
||||||
|
;;; - add autocommit stuff to the assoc list if needed
|
||||||
|
;;; - and write it back to the file
|
||||||
|
;;;
|
||||||
|
;;; That will enable us with modifying dir locals that contains custom
|
||||||
|
;;; stuff unrelated to autocommit
|
||||||
|
(defun rc/autocommit-init-dir (&optional dir)
|
||||||
|
"Initialize autocommit folder."
|
||||||
|
(interactive "DAutocommit directory: ")
|
||||||
|
(let* ((autocommit-dir (if dir dir default-directory))
|
||||||
|
(file-name (concat autocommit-dir
|
||||||
|
dir-locals-file)))
|
||||||
|
(rc/y-or-n-if (-partial #'file-exists-p file-name)
|
||||||
|
(format "%s already exists. Replace it?" file-name)
|
||||||
|
(-partial #'rc/autocommit--create-dir-locals file-name))))
|
||||||
|
|
||||||
|
(defun rc/autocommit-dir-locals ()
|
||||||
|
"The function that has to be put into the .dir-locals.el file
|
||||||
|
of the autocommit folder as evaluated for any mode."
|
||||||
|
(interactive)
|
||||||
|
(auto-revert-mode 1)
|
||||||
|
(rc/autopull-changes)
|
||||||
|
(add-hook 'after-save-hook
|
||||||
|
'rc/autocommit-changes
|
||||||
|
nil 'make-it-local))
|
||||||
|
|
||||||
|
;;; TODO: rc/toggle-autocommit-offline doesn't work correctly
|
||||||
|
;;;
|
||||||
|
;;; It should toggle offline for all of the folders at once
|
||||||
|
(defun rc/toggle-autocommit-offline ()
|
||||||
|
"Toggle between OFFLINE and ONLINE modes.
|
||||||
|
|
||||||
|
Autocommit can be in two modes: OFFLINE and ONLINE. When ONLINE
|
||||||
|
rc/autocommit-changes does `git commit && git push'. When OFFLINE
|
||||||
|
rc/autocommit does only `git commit'."
|
||||||
|
(interactive)
|
||||||
|
(rc/autocommit--toggle-lock 'autocommit-offline)
|
||||||
|
(if (rc/autocommit--get-lock 'autocommit-offline)
|
||||||
|
(message "[OFFLINE] Autocommit Mode")
|
||||||
|
(message "[ONLINE] Autocommit Mode")))
|
||||||
|
|
||||||
|
(defun rc/autopull-changes ()
|
||||||
|
"Pull the recent changes.
|
||||||
|
|
||||||
|
Should be invoked once before working with the content under
|
||||||
|
autocommit. Usually put into the dir locals file."
|
||||||
|
(interactive)
|
||||||
|
(when (not (rc/autocommit--get-lock 'autopull-lock))
|
||||||
|
(rc/autocommit--set-lock 'autopull-lock t)
|
||||||
|
(if (rc/autocommit--get-lock 'autocommit-offline)
|
||||||
|
(message "[OFFLINE] NOT Syncing the Agenda")
|
||||||
|
(if (y-or-n-p (format "Sync the Agenda? [%s]" (rc/autocommit--id)))
|
||||||
|
(progn
|
||||||
|
(message (format "Syncing the Agenda [%s]" (rc/autocommit--id)))
|
||||||
|
(shell-command "git pull"))
|
||||||
|
(progn
|
||||||
|
(rc/autocommit--set-lock 'autocommit-offline t)
|
||||||
|
(message (format "[OFFLINE] NOT Syncing the Agenda [%s]"
|
||||||
|
(rc/autocommit--id))))))))
|
||||||
|
|
||||||
|
(defun rc/autocommit-changes ()
|
||||||
|
"Commit all of the changes under the autocommit folder.
|
||||||
|
|
||||||
|
Should be invoked each time a change is made. Usually put into
|
||||||
|
dir locals file."
|
||||||
|
(interactive)
|
||||||
|
(if (rc/autocommit--get-lock 'autocommit-lock)
|
||||||
|
(rc/autocommit--set-lock 'autocommit-changed t)
|
||||||
|
(rc/autocommit--set-lock 'autocommit-lock t)
|
||||||
|
(rc/autocommit--set-lock 'autocommit-changed nil)
|
||||||
|
(set-process-sentinel (rc/run-commit-process (rc/autocommit--id))
|
||||||
|
(-partial 'rc/autocommit-beat (rc/autocommit--id)))))
|
||||||
|
|
||||||
|
(defun rc/run-commit-process (autocommit-directory)
|
||||||
|
(let ((default-directory autocommit-directory))
|
||||||
|
(let ((autocommit-message (format-time-string "Autocommit %s")))
|
||||||
|
(start-process-shell-command
|
||||||
|
(format "Autocommit-%s" autocommit-directory)
|
||||||
|
(format "*Autocommit-%s*" autocommit-directory)
|
||||||
|
(format (if (rc/autocommit--get-lock 'autocommit-offline)
|
||||||
|
"git add -A && git commit -m \"%s\""
|
||||||
|
"git add -A && git commit -m \"%s\" && git push origin master")
|
||||||
|
autocommit-message)))))
|
||||||
|
|
||||||
|
(defun rc/autocommit-beat (autocommit-directory process event)
|
||||||
|
(let ((default-directory autocommit-directory))
|
||||||
|
(message (if (rc/autocommit--get-lock 'autocommit-offline)
|
||||||
|
"[OFFLINE] Autocommit: %s"
|
||||||
|
"Autocommit: %s")
|
||||||
|
event)
|
||||||
|
(if (not (rc/autocommit--get-lock 'autocommit-changed))
|
||||||
|
(rc/autocommit--set-lock 'autocommit-lock nil)
|
||||||
|
(rc/autocommit--set-lock 'autocommit-changed nil)
|
||||||
|
(set-process-sentinel (rc/run-commit-process autocommit-directory)
|
||||||
|
(-partial 'rc/autocommit-beat autocommit-directory)))))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(setq-default c-basic-offset 4
|
||||||
|
c-default-style '((java-mode . "java")
|
||||||
|
(awk-mode . "awk")
|
||||||
|
(other . "bsd")))
|
||||||
|
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
|
||||||
|
|
||||||
|
(add-hook 'c-mode-hook (lambda ()
|
||||||
|
(interactive)
|
||||||
|
(c-toggle-comment-style -1)))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'company)
|
||||||
|
(require 'company)
|
||||||
|
|
||||||
|
(global-company-mode)
|
||||||
|
|
||||||
|
(add-hook 'tuareg-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(company-mode 0)))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(require 'dired-x)
|
||||||
|
(setq dired-omit-files
|
||||||
|
(concat dired-omit-files "\\|^\\..+$"))
|
||||||
|
(setq-default dired-dwim-target t)
|
||||||
|
(setq dired-listing-switches "-alh")
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'editorconfig)
|
||||||
|
(editorconfig-mode 1)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(defun rc/turn-on-eldoc-mode ()
|
||||||
|
(interactive)
|
||||||
|
(eldoc-mode 1))
|
||||||
|
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-eldoc-mode)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(add-hook 'emacs-lisp-mode-hook
|
||||||
|
'(lambda ()
|
||||||
|
(local-set-key (kbd "C-c C-j")
|
||||||
|
(quote eval-print-last-sexp))))
|
||||||
|
(add-to-list 'auto-mode-alist '("Cask" . emacs-lisp-mode))
|
||||||
|
|
||||||
|
;; Automatically load paredit when editing a lisp file
|
||||||
|
;; More at http://www.emacswiki.org/emacs/ParEdit
|
||||||
|
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
|
||||||
|
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
|
||||||
|
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
|
||||||
|
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
|
||||||
|
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
|
||||||
|
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
|
||||||
|
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
|
||||||
|
|
||||||
|
;; eldoc-mode shows documentation in the minibuffer when writing code
|
||||||
|
;; http://www.emacswiki.org/emacs/ElDoc
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'smex 'ido-completing-read+)
|
||||||
|
|
||||||
|
(require 'ido-completing-read+)
|
||||||
|
|
||||||
|
(ido-mode 1)
|
||||||
|
(ido-everywhere 1)
|
||||||
|
(ido-ubiquitous-mode 1)
|
||||||
|
|
||||||
|
(global-set-key (kbd "M-x") 'smex)
|
||||||
|
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
;; magit requres this lib, but it is not installed automatically on
|
||||||
|
;; Windows.
|
||||||
|
(rc/require 'cl-lib)
|
||||||
|
(rc/require 'magit)
|
||||||
|
|
||||||
|
(setq magit-auto-revert-mode nil)
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-c m s") 'magit-status)
|
||||||
|
(global-set-key (kbd "C-c m l") 'magit-log)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(require 'ansi-color)
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-c p") 'find-file-at-point)
|
||||||
|
(global-set-key (kbd "C-c i m") 'imenu)
|
||||||
|
|
||||||
|
(setq-default inhibit-splash-screen t
|
||||||
|
make-backup-files nil
|
||||||
|
tab-width 4
|
||||||
|
indent-tabs-mode nil
|
||||||
|
compilation-scroll-output t
|
||||||
|
;; default-input-method "russian-computer"
|
||||||
|
visible-bell (equal system-type 'windows-nt))
|
||||||
|
|
||||||
|
(defun rc/colorize-compilation-buffer ()
|
||||||
|
(read-only-mode)
|
||||||
|
(ansi-color-apply-on-region compilation-filter-start (point))
|
||||||
|
(read-only-mode))
|
||||||
|
(add-hook 'compilation-filter-hook 'rc/colorize-compilation-buffer)
|
||||||
|
|
||||||
|
(defun rc/buffer-file-name ()
|
||||||
|
(if (equal major-mode 'dired-mode)
|
||||||
|
default-directory
|
||||||
|
(buffer-file-name)))
|
||||||
|
|
||||||
|
(defun rc/parent-directory (path)
|
||||||
|
(file-name-directory (directory-file-name path)))
|
||||||
|
|
||||||
|
(defun rc/root-anchor (path anchor)
|
||||||
|
(cond
|
||||||
|
((string= anchor "") nil)
|
||||||
|
((file-exists-p (concat (file-name-as-directory path) anchor)) path)
|
||||||
|
((string-equal path "/") nil)
|
||||||
|
(t (rc/root-anchor (rc/parent-directory path) anchor))))
|
||||||
|
|
||||||
|
(defun rc/clipboard-org-mode-file-link (anchor)
|
||||||
|
(interactive "sRoot anchor: ")
|
||||||
|
(let* ((root-dir (rc/root-anchor default-directory anchor))
|
||||||
|
(org-mode-file-link (format "file:%s::%d"
|
||||||
|
(if root-dir
|
||||||
|
(file-relative-name (rc/buffer-file-name) root-dir)
|
||||||
|
(rc/buffer-file-name))
|
||||||
|
(line-number-at-pos))))
|
||||||
|
(kill-new org-mode-file-link)
|
||||||
|
(message org-mode-file-link)))
|
||||||
|
|
||||||
|
;;; Taken from here:
|
||||||
|
;;; http://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs
|
||||||
|
(defun rc/put-file-name-on-clipboard ()
|
||||||
|
"Put the current file name on the clipboard"
|
||||||
|
(interactive)
|
||||||
|
(let ((filename (rc/buffer-file-name)))
|
||||||
|
(when filename
|
||||||
|
(kill-new filename)
|
||||||
|
(message filename))))
|
||||||
|
|
||||||
|
(defun rc/put-buffer-name-on-clipboard ()
|
||||||
|
"Put the current buffer name on the clipboard"
|
||||||
|
(interactive)
|
||||||
|
(kill-new (buffer-name))
|
||||||
|
(message (buffer-name)))
|
||||||
|
|
||||||
|
(defun rc/kill-autoloads-buffers ()
|
||||||
|
(interactive)
|
||||||
|
(dolist (buffer (buffer-list))
|
||||||
|
(let ((name (buffer-name buffer)))
|
||||||
|
(when (string-match-p "-autoloads.el" name)
|
||||||
|
(kill-buffer buffer)
|
||||||
|
(message "Killed autoloads buffer %s" name)))))
|
||||||
|
|
||||||
|
(defun rc/start-python-simple-http-server ()
|
||||||
|
(interactive)
|
||||||
|
(shell-command "python -m SimpleHTTPServer 3001 &"
|
||||||
|
"*Simple Python HTTP Server*"))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-x p s") 'rc/start-python-simple-http-server)
|
||||||
|
|
||||||
|
;;; Taken from here:
|
||||||
|
;;; http://blog.bookworm.at/2007/03/pretty-print-xml-with-emacs.html
|
||||||
|
(defun bf-pretty-print-xml-region (begin end)
|
||||||
|
"Pretty format XML markup in region. You need to have nxml-mode
|
||||||
|
http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do
|
||||||
|
this. The function inserts linebreaks to separate tags that have
|
||||||
|
nothing but whitespace between them. It then indents the markup
|
||||||
|
by using nxml's indentation rules."
|
||||||
|
(interactive "r")
|
||||||
|
(save-excursion
|
||||||
|
(nxml-mode)
|
||||||
|
(goto-char begin)
|
||||||
|
(while (search-forward-regexp "\>[ \\t]*\<" nil t)
|
||||||
|
(backward-char) (insert "\n"))
|
||||||
|
(indent-region begin end))
|
||||||
|
(message "Ah, much better!"))
|
||||||
|
|
||||||
|
;;; Stolen from http://ergoemacs.org/emacs/emacs_unfill-paragraph.html
|
||||||
|
(defun rc/unfill-paragraph ()
|
||||||
|
"Replace newline chars in current paragraph by single spaces.
|
||||||
|
This command does the inverse of `fill-paragraph'."
|
||||||
|
(interactive)
|
||||||
|
(let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum'
|
||||||
|
(fill-paragraph nil)))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-c M-q") 'rc/unfill-paragraph)
|
||||||
|
|
||||||
|
(defun rc/load-path-here ()
|
||||||
|
(interactive)
|
||||||
|
(add-to-list 'load-path default-directory))
|
||||||
|
|
||||||
|
(defconst rc/frame-transparency 85)
|
||||||
|
|
||||||
|
(defun rc/toggle-transparency ()
|
||||||
|
(interactive)
|
||||||
|
(let ((frame-alpha (frame-parameter nil 'alpha)))
|
||||||
|
(if (or (not frame-alpha)
|
||||||
|
(= (cadr frame-alpha) 100))
|
||||||
|
(set-frame-parameter nil 'alpha
|
||||||
|
`(,rc/frame-transparency
|
||||||
|
,rc/frame-transparency))
|
||||||
|
(set-frame-parameter nil 'alpha '(100 100)))))
|
||||||
|
|
||||||
|
(defun rc/duplicate-line ()
|
||||||
|
"Duplicate current line"
|
||||||
|
(interactive)
|
||||||
|
(move-beginning-of-line 1)
|
||||||
|
(kill-line)
|
||||||
|
(yank)
|
||||||
|
(newline)
|
||||||
|
(yank))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-,") 'rc/duplicate-line)
|
||||||
|
|
||||||
|
;;; A little hack which fixes a problem with meta key in fluxbox under VNC.
|
||||||
|
(setq x-alt-keysym 'meta)
|
||||||
|
|
||||||
|
(setq confirm-kill-emacs 'y-or-n-p)
|
||||||
|
;; Changes all yes/no questions to y/n type
|
||||||
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
|
;; shell scripts
|
||||||
|
(setq-default sh-basic-offset 2)
|
||||||
|
(setq-default sh-indentation 2)
|
||||||
|
|
||||||
|
;; No need for ~ files when editing
|
||||||
|
(setq create-lockfiles nil)
|
||||||
|
|
||||||
|
;; Go straight to scratch buffer on startup
|
||||||
|
(setq inhibit-startup-message t)
|
||||||
|
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(message "Emacs ready in %s with %d garbage collections."
|
||||||
|
(format "%.2f seconds"
|
||||||
|
(float-time (time-subtract after-init-time before-init-time)))
|
||||||
|
gcs-done)))
|
||||||
|
|
||||||
|
|
||||||
|
(server-start)
|
||||||
|
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'move-text)
|
||||||
|
(global-set-key (kbd "M-p") 'move-text-up)
|
||||||
|
(global-set-key (kbd "M-n") 'move-text-down)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'multiple-cursors)
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
||||||
|
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
||||||
|
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
||||||
|
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
||||||
|
(global-set-key (kbd "C-\"") 'mc/skip-to-next-like-this)
|
||||||
|
(global-set-key (kbd "C-:") 'mc/skip-to-previous-like-this)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'nasm-mode)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.asm\\'" . nasm-mode))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode))
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.xsd\\'" . nxml-mode))
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.ant\\'" . nxml-mode))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'openwith)
|
||||||
|
|
||||||
|
(openwith-mode 1)
|
||||||
|
|
||||||
|
|
||||||
|
(setq openwith-associations
|
||||||
|
(append
|
||||||
|
(when (eq system-type 'gnu/linux)
|
||||||
|
'(("\\.pdf\\'" "evince" (file))
|
||||||
|
("\\.djvu\\'" "evince" (file))))
|
||||||
|
'(("\\.docx\\'" "libreoffice" (file))
|
||||||
|
("\\.xlsx\\'" "libreoffice" (file))
|
||||||
|
("\\.doc\\'" "libreoffice" (file))
|
||||||
|
("\\.rtf\\'" "libreoffice" (file))
|
||||||
|
("\\.ods\\'" "libreoffice" (file))
|
||||||
|
("\\.mp3\\'" "vlc" (file)))))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(require 'ob-python)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(setq org-capture-templates
|
||||||
|
'(("p" "Capture task" entry (file "~/Documents/Agenda/Tasks.org")
|
||||||
|
"* TODO %?\n SCHEDULED: %t\n")
|
||||||
|
("K" "Cliplink capture task" entry (file "~/Documents/Agenda/Tasks.org")
|
||||||
|
"* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 1)))
|
||||||
|
(define-key global-map "\C-cc" 'org-capture)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'org-cliplink)
|
||||||
|
|
||||||
|
(when (eq system-type 'gnu/linux)
|
||||||
|
(custom-set-variables
|
||||||
|
'(org-cliplink-transport-implementation (quote url-el))))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-x p i") 'org-cliplink)
|
||||||
|
|
||||||
|
(defun rc/cliplink-task ()
|
||||||
|
(interactive)
|
||||||
|
(org-cliplink-retrieve-title
|
||||||
|
(substring-no-properties (current-kill 0))
|
||||||
|
'(lambda (url title)
|
||||||
|
(insert (if title
|
||||||
|
(concat "* TODO " title
|
||||||
|
"\n [[" url "][" title "]]")
|
||||||
|
(concat "* TODO " url
|
||||||
|
"\n [[" url "]]"))))))
|
||||||
|
(global-set-key (kbd "C-x p t") 'rc/cliplink-task)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-x a") 'org-agenda)
|
||||||
|
(global-set-key (kbd "C-c C-x j") #'org-clock-jump-to-current-clock)
|
||||||
|
|
||||||
|
(setq org-agenda-files (list "~/Documents/Agenda/"))
|
||||||
|
|
||||||
|
(setq org-export-backends '(md))
|
||||||
|
|
||||||
|
(custom-set-variables
|
||||||
|
'(org-modules
|
||||||
|
(quote
|
||||||
|
(org-bbdb
|
||||||
|
org-bibtex
|
||||||
|
org-docview
|
||||||
|
org-gnus
|
||||||
|
org-habit
|
||||||
|
org-info
|
||||||
|
org-irc
|
||||||
|
org-mhe
|
||||||
|
org-rmail
|
||||||
|
org-w3m)))
|
||||||
|
'(org-enforce-todo-dependencies nil)
|
||||||
|
'(org-agenda-dim-blocked-tasks nil)
|
||||||
|
'(org-agenda-exporter-settings
|
||||||
|
(quote ((org-agenda-tag-filter-preset (list "+personal")))))
|
||||||
|
'(org-refile-use-outline-path (quote file)))
|
||||||
|
|
||||||
|
(defun rc/org-increment-move-counter ()
|
||||||
|
(interactive)
|
||||||
|
|
||||||
|
(defun default (x d)
|
||||||
|
(if x x d))
|
||||||
|
|
||||||
|
(let* ((point (point))
|
||||||
|
(move-counter-name "MOVE_COUNTER")
|
||||||
|
(move-counter-value (-> (org-entry-get point move-counter-name)
|
||||||
|
(default "0")
|
||||||
|
(string-to-number)
|
||||||
|
(1+))))
|
||||||
|
(org-entry-put point move-counter-name
|
||||||
|
(number-to-string move-counter-value)))
|
||||||
|
nil)
|
||||||
|
|
||||||
|
(defun rc/org-get-heading-name ()
|
||||||
|
(nth 4 (org-heading-components)))
|
||||||
|
|
||||||
|
(defun rc/org-kill-heading-name-save ()
|
||||||
|
(interactive)
|
||||||
|
(let ((heading-name (rc/org-get-heading-name)))
|
||||||
|
(kill-new heading-name)
|
||||||
|
(message "Kill \"%s\"" heading-name)))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-x p w") 'rc/org-kill-heading-name-save)
|
||||||
|
|
||||||
|
(setq org-agenda-custom-commands
|
||||||
|
'(("u" "Unscheduled" tags "+personal-SCHEDULED={.+}-DEADLINE={.+}/!+TODO"
|
||||||
|
((org-agenda-sorting-strategy '(priority-down))))
|
||||||
|
("p" "Personal" ((agenda "" ((org-agenda-tag-filter-preset (list "+personal"))))))
|
||||||
|
("w" "Work" ((agenda "" ((org-agenda-tag-filter-preset (list "+work"))))))
|
||||||
|
))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'paredit)
|
||||||
|
|
||||||
|
(defun rc/turn-on-paredit ()
|
||||||
|
(interactive)
|
||||||
|
(paredit-mode 1))
|
||||||
|
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-paredit)
|
||||||
|
(add-hook 'clojure-mode-hook 'rc/turn-on-paredit)
|
||||||
|
(add-hook 'lisp-mode-hook 'rc/turn-on-paredit)
|
||||||
|
(add-hook 'common-lisp-mode-hook 'rc/turn-on-paredit)
|
||||||
|
(add-hook 'scheme-mode-hook 'rc/turn-on-paredit)
|
||||||
|
(add-hook 'racket-mode-hook 'rc/turn-on-paredit)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'rainbow-mode)
|
||||||
|
|
||||||
|
(defun rc/turn-on-rainbow-mode ()
|
||||||
|
(interactive)
|
||||||
|
(rainbow-mode 1))
|
||||||
|
|
||||||
|
(add-hook 'html-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
(add-hook 'css-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
(add-hook 'js-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
(add-hook 'nxml-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
(add-hook 'conf-xdefaults-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
(add-hook 'typescript-mode-hook 'rc/turn-on-rainbow-mode)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(require 'recentf)
|
||||||
|
(recentf-mode 1)
|
||||||
|
(setq recentf-max-menu-items 25)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
;; Sets up exec-path-from shell
|
||||||
|
;; https://github.com/purcell/exec-path-from-
|
||||||
|
(require 'exec-path-from-shell)
|
||||||
|
(when (memq window-system '(mac ns))
|
||||||
|
(exec-path-from-shell-initialize)
|
||||||
|
(exec-path-from-shell-copy-envs
|
||||||
|
'("PATH")))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
;;; http://stackoverflow.com/questions/13794433/how-to-disable-autosave-for-tramp-buffers-in-emacs
|
||||||
|
(setq tramp-auto-save-directory "/tmp")
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(defun rc/enable-word-wrap ()
|
||||||
|
(interactive)
|
||||||
|
(toggle-word-wrap 1))
|
||||||
|
|
||||||
|
(add-hook 'markdown-mode-hook 'rc/enable-word-wrap)
|
||||||
|
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(rc/require 'yasnippet)
|
||||||
|
|
||||||
|
(require 'yasnippet)
|
||||||
|
|
||||||
|
(setq yas/triggers-in-field nil)
|
||||||
|
(setq yas-snippet-dirs '("~/.emacs.snippets/"))
|
||||||
|
|
||||||
|
(yas-global-mode 1)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
(when (executable-find "agda-mode")
|
|
||||||
(load-file (let ((coding-system-for-read 'utf-8))
|
|
||||||
(shell-command-to-string "agda-mode locate"))))
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
(setq alchemist-mix-command "/usr/bin/mix")
|
|
||||||
|
|
||||||
(setq alchemist-iex-program-name "/usr/bin/iex") ;; default: iex
|
|
||||||
(setq alchemist-execute-command "/usr/bin/elixir") ;; default: elixir
|
|
||||||
(setq alchemist-compile-command "/usr/bin/elixirc") ;; default: elixirc
|
|
||||||
|
|
||||||
(setq alchemist-test-display-compilation-output t)
|
|
||||||
(setq alchemist-hooks-compile-on-save t)
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
;;; Fonts
|
|
||||||
(defun rc/get-default-font ()
|
|
||||||
(cond
|
|
||||||
((eq system-type 'windows-nt) "Consolas-13")
|
|
||||||
((eq system-type 'gnu/linux) "Fira Code-12")))
|
|
||||||
|
|
||||||
(add-to-list 'default-frame-alist `(font . ,(rc/get-default-font)))
|
|
||||||
|
|
||||||
(when (display-graphic-p)
|
|
||||||
(set-face-attribute 'fixed-pitch nil :family (rc/get-default-font)))
|
|
||||||
|
|
||||||
;;; GUI
|
|
||||||
(tool-bar-mode 0)
|
|
||||||
(menu-bar-mode 0)
|
|
||||||
(scroll-bar-mode 0)
|
|
||||||
(column-number-mode 1)
|
|
||||||
(show-paren-mode 1)
|
|
||||||
(setq frame-title-format "Emacs")
|
|
||||||
(set-default 'cursor-type 'hbar)
|
|
||||||
(global-hl-line-mode)
|
|
||||||
(winner-mode t)
|
|
||||||
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
|
||||||
(windmove-default-keybindings)
|
|
||||||
|
|
||||||
;;; Themes
|
|
||||||
(rc/require-theme 'atom-one-dark)
|
|
||||||
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
;;; TODO(c3bdae31-4329-4217-98a0-743b9dcbb6d2): extract autocommit into a separate package
|
|
||||||
;;;
|
|
||||||
;;; Once e266bfaa-2a01-4881-9e7f-ce2c592f7cdd is done, I think we can do that.
|
|
||||||
|
|
||||||
(defvar rc/autocommit-local-locks
|
|
||||||
(make-hash-table :test 'equal))
|
|
||||||
|
|
||||||
(defun rc/file-truename-nilable (filename)
|
|
||||||
(when filename
|
|
||||||
(file-truename filename)))
|
|
||||||
|
|
||||||
(defun rc/autocommit--id ()
|
|
||||||
(let ((id (-> default-directory
|
|
||||||
(locate-dominating-file ".git")
|
|
||||||
(rc/file-truename-nilable))))
|
|
||||||
(when (not id)
|
|
||||||
(error "%s is not inside of a git repository" default-directory))
|
|
||||||
(unless (gethash id rc/autocommit-local-locks)
|
|
||||||
(puthash id nil rc/autocommit-local-locks))
|
|
||||||
id))
|
|
||||||
|
|
||||||
(defun rc/autocommit--get-lock (lock)
|
|
||||||
(-> (rc/autocommit--id)
|
|
||||||
(gethash rc/autocommit-local-locks)
|
|
||||||
(plist-get lock)))
|
|
||||||
|
|
||||||
(defun rc/autocommit--set-lock (lock value)
|
|
||||||
(puthash (rc/autocommit--id)
|
|
||||||
(-> (rc/autocommit--id)
|
|
||||||
(gethash rc/autocommit-local-locks)
|
|
||||||
(plist-put lock value))
|
|
||||||
rc/autocommit-local-locks))
|
|
||||||
|
|
||||||
(defun rc/autocommit--toggle-lock (lock)
|
|
||||||
(-> lock
|
|
||||||
(rc/autocommit--get-lock)
|
|
||||||
(not)
|
|
||||||
(rc/autocommit--set-lock)))
|
|
||||||
|
|
||||||
(defun rc/autocommit--create-dir-locals (file-name)
|
|
||||||
(write-region "((nil . ((eval . (rc/autocommit-dir-locals)))))"
|
|
||||||
nil file-name))
|
|
||||||
|
|
||||||
(defun rc/y-or-n-if (predicate question action)
|
|
||||||
(when (or (not (funcall predicate))
|
|
||||||
(y-or-n-p question))
|
|
||||||
(funcall action)))
|
|
||||||
|
|
||||||
;;; TODO(4229cf9a-4768-4f5e-aca1-865256c64a23): rc/autocommit-init-dir should modify dir locals file on AST level
|
|
||||||
;;;
|
|
||||||
;;; Right know it just overrides .dir-locals file on text level. I
|
|
||||||
;;; want it to
|
|
||||||
;;; - read .dir-locals,
|
|
||||||
;;; - parse the assoc list,
|
|
||||||
;;; - check if there is already autocommit stuff
|
|
||||||
;;; - add autocommit stuff to the assoc list if needed
|
|
||||||
;;; - and write it back to the file
|
|
||||||
;;;
|
|
||||||
;;; That will enable us with modifying dir locals that contains custom
|
|
||||||
;;; stuff unrelated to autocommit
|
|
||||||
(defun rc/autocommit-init-dir (&optional dir)
|
|
||||||
"Initialize autocommit folder."
|
|
||||||
(interactive "DAutocommit directory: ")
|
|
||||||
(let* ((autocommit-dir (if dir dir default-directory))
|
|
||||||
(file-name (concat autocommit-dir
|
|
||||||
dir-locals-file)))
|
|
||||||
(rc/y-or-n-if (-partial #'file-exists-p file-name)
|
|
||||||
(format "%s already exists. Replace it?" file-name)
|
|
||||||
(-partial #'rc/autocommit--create-dir-locals file-name))))
|
|
||||||
|
|
||||||
(defun rc/autocommit-dir-locals ()
|
|
||||||
"The function that has to be put into the .dir-locals.el file
|
|
||||||
of the autocommit folder as evaluated for any mode."
|
|
||||||
(interactive)
|
|
||||||
(auto-revert-mode 1)
|
|
||||||
(rc/autopull-changes)
|
|
||||||
(add-hook 'after-save-hook
|
|
||||||
'rc/autocommit-changes
|
|
||||||
nil 'make-it-local))
|
|
||||||
|
|
||||||
;;; TODO: rc/toggle-autocommit-offline doesn't work correctly
|
|
||||||
;;;
|
|
||||||
;;; It should toggle offline for all of the folders at once
|
|
||||||
(defun rc/toggle-autocommit-offline ()
|
|
||||||
"Toggle between OFFLINE and ONLINE modes.
|
|
||||||
|
|
||||||
Autocommit can be in two modes: OFFLINE and ONLINE. When ONLINE
|
|
||||||
rc/autocommit-changes does `git commit && git push'. When OFFLINE
|
|
||||||
rc/autocommit does only `git commit'."
|
|
||||||
(interactive)
|
|
||||||
(rc/autocommit--toggle-lock 'autocommit-offline)
|
|
||||||
(if (rc/autocommit--get-lock 'autocommit-offline)
|
|
||||||
(message "[OFFLINE] Autocommit Mode")
|
|
||||||
(message "[ONLINE] Autocommit Mode")))
|
|
||||||
|
|
||||||
(defun rc/autopull-changes ()
|
|
||||||
"Pull the recent changes.
|
|
||||||
|
|
||||||
Should be invoked once before working with the content under
|
|
||||||
autocommit. Usually put into the dir locals file."
|
|
||||||
(interactive)
|
|
||||||
(when (not (rc/autocommit--get-lock 'autopull-lock))
|
|
||||||
(rc/autocommit--set-lock 'autopull-lock t)
|
|
||||||
(if (rc/autocommit--get-lock 'autocommit-offline)
|
|
||||||
(message "[OFFLINE] NOT Syncing the Agenda")
|
|
||||||
(if (y-or-n-p (format "Sync the Agenda? [%s]" (rc/autocommit--id)))
|
|
||||||
(progn
|
|
||||||
(message (format "Syncing the Agenda [%s]" (rc/autocommit--id)))
|
|
||||||
(shell-command "git pull"))
|
|
||||||
(progn
|
|
||||||
(rc/autocommit--set-lock 'autocommit-offline t)
|
|
||||||
(message (format "[OFFLINE] NOT Syncing the Agenda [%s]"
|
|
||||||
(rc/autocommit--id))))))))
|
|
||||||
|
|
||||||
(defun rc/autocommit-changes ()
|
|
||||||
"Commit all of the changes under the autocommit folder.
|
|
||||||
|
|
||||||
Should be invoked each time a change is made. Usually put into
|
|
||||||
dir locals file."
|
|
||||||
(interactive)
|
|
||||||
(if (rc/autocommit--get-lock 'autocommit-lock)
|
|
||||||
(rc/autocommit--set-lock 'autocommit-changed t)
|
|
||||||
(rc/autocommit--set-lock 'autocommit-lock t)
|
|
||||||
(rc/autocommit--set-lock 'autocommit-changed nil)
|
|
||||||
(set-process-sentinel (rc/run-commit-process (rc/autocommit--id))
|
|
||||||
(-partial 'rc/autocommit-beat (rc/autocommit--id)))))
|
|
||||||
|
|
||||||
(defun rc/run-commit-process (autocommit-directory)
|
|
||||||
(let ((default-directory autocommit-directory))
|
|
||||||
(let ((autocommit-message (format-time-string "Autocommit %s")))
|
|
||||||
(start-process-shell-command
|
|
||||||
(format "Autocommit-%s" autocommit-directory)
|
|
||||||
(format "*Autocommit-%s*" autocommit-directory)
|
|
||||||
(format (if (rc/autocommit--get-lock 'autocommit-offline)
|
|
||||||
"git add -A && git commit -m \"%s\""
|
|
||||||
"git add -A && git commit -m \"%s\" && git push origin master")
|
|
||||||
autocommit-message)))))
|
|
||||||
|
|
||||||
(defun rc/autocommit-beat (autocommit-directory process event)
|
|
||||||
(let ((default-directory autocommit-directory))
|
|
||||||
(message (if (rc/autocommit--get-lock 'autocommit-offline)
|
|
||||||
"[OFFLINE] Autocommit: %s"
|
|
||||||
"Autocommit: %s")
|
|
||||||
event)
|
|
||||||
(if (not (rc/autocommit--get-lock 'autocommit-changed))
|
|
||||||
(rc/autocommit--set-lock 'autocommit-lock nil)
|
|
||||||
(rc/autocommit--set-lock 'autocommit-changed nil)
|
|
||||||
(set-process-sentinel (rc/run-commit-process autocommit-directory)
|
|
||||||
(-partial 'rc/autocommit-beat autocommit-directory)))))
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
(setq-default c-basic-offset 4
|
|
||||||
c-default-style '((java-mode . "java")
|
|
||||||
(awk-mode . "awk")
|
|
||||||
(other . "bsd")))
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
|
|
||||||
|
|
||||||
(add-hook 'c-mode-hook (lambda ()
|
|
||||||
(interactive)
|
|
||||||
(c-toggle-comment-style -1)))
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
;;;;
|
|
||||||
;; Clojure
|
|
||||||
;;;;
|
|
||||||
|
|
||||||
;; Enable paredit for Clojure
|
|
||||||
(add-hook 'clojure-mode-hook 'enable-paredit-mode)
|
|
||||||
|
|
||||||
;; This is useful for working with camel-case tokens, like names of
|
|
||||||
;; Java classes (e.g. JavaClassName)
|
|
||||||
(add-hook 'clojure-mode-hook 'subword-mode)
|
|
||||||
|
|
||||||
;; A little more syntax highlighting
|
|
||||||
(require 'clojure-mode-extra-font-locking)
|
|
||||||
|
|
||||||
;; syntax hilighting for midje
|
|
||||||
(add-hook 'clojure-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(setq inferior-lisp-program "lein repl")
|
|
||||||
(font-lock-add-keywords
|
|
||||||
nil
|
|
||||||
'(("(\\(facts?\\)"
|
|
||||||
(1 font-lock-keyword-face))
|
|
||||||
("(\\(background?\\)"
|
|
||||||
(1 font-lock-keyword-face))))
|
|
||||||
(define-clojure-indent (fact 1))
|
|
||||||
(define-clojure-indent (facts 1))
|
|
||||||
(rainbow-delimiters-mode)))
|
|
||||||
|
|
||||||
;;;;
|
|
||||||
;; Cider
|
|
||||||
;;;;
|
|
||||||
|
|
||||||
;; provides minibuffer documentation for the code you're typing into the repl
|
|
||||||
(add-hook 'cider-mode-hook 'eldoc-mode)
|
|
||||||
|
|
||||||
;; go right to the REPL buffer when it's finished connecting
|
|
||||||
(setq cider-repl-pop-to-buffer-on-connect t)
|
|
||||||
|
|
||||||
;; When there's a cider error, show its buffer and switch to it
|
|
||||||
(setq cider-show-error-buffer t)
|
|
||||||
(setq cider-auto-select-error-buffer t)
|
|
||||||
|
|
||||||
;; Where to store the cider history.
|
|
||||||
(setq cider-repl-history-file "~/.emacs.d/cider-history")
|
|
||||||
|
|
||||||
;; Wrap when navigating history.
|
|
||||||
(setq cider-repl-wrap-history t)
|
|
||||||
|
|
||||||
;; enable paredit in your REPL
|
|
||||||
(add-hook 'cider-repl-mode-hook 'paredit-mode)
|
|
||||||
|
|
||||||
;; Use clojure mode for other extensions
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.edn$" . clojure-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.boot$" . clojure-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.cljs.*$" . clojure-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("lein-env" . enh-ruby-mode))
|
|
||||||
|
|
||||||
|
|
||||||
;; key bindings
|
|
||||||
;; these help me out with the way I usually develop web apps
|
|
||||||
(defun cider-start-http-server ()
|
|
||||||
(interactive)
|
|
||||||
(cider-load-current-buffer)
|
|
||||||
(let ((ns (cider-current-ns)))
|
|
||||||
(cider-repl-set-ns ns)
|
|
||||||
(cider-interactive-eval (format "(println '(def server (%s/start))) (println 'server)" ns))
|
|
||||||
(cider-interactive-eval (format "(def server (%s/start)) (println server)" ns))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun cider-refresh ()
|
|
||||||
(interactive)
|
|
||||||
(cider-interactive-eval (format "(user/reset)")))
|
|
||||||
|
|
||||||
(defun cider-user-ns ()
|
|
||||||
(interactive)
|
|
||||||
(cider-repl-set-ns "user"))
|
|
||||||
|
|
||||||
(eval-after-load 'cider
|
|
||||||
'(progn
|
|
||||||
(define-key clojure-mode-map (kbd "C-c C-v") 'cider-start-http-server)
|
|
||||||
(define-key clojure-mode-map (kbd "C-M-r") 'cider-refresh)
|
|
||||||
(define-key clojure-mode-map (kbd "C-c u") 'cider-user-ns)
|
|
||||||
(define-key cider-mode-map (kbd "C-c u") 'cider-user-ns)))
|
|
||||||
|
|
||||||
;; Customizations relating to editing a buffer.
|
|
||||||
|
|
||||||
;; Key binding to use "hippie expand" for text autocompletion
|
|
||||||
;; http://www.emacswiki.org/emacs/HippieExpand
|
|
||||||
(global-set-key (kbd "M-/") 'hippie-expand)
|
|
||||||
|
|
||||||
;; Lisp-friendly hippie expand
|
|
||||||
(setq hippie-expand-try-functions-list
|
|
||||||
'(try-expand-dabbrev
|
|
||||||
try-expand-dabbrev-all-buffers
|
|
||||||
try-expand-dabbrev-from-kill
|
|
||||||
try-complete-lisp-symbol-partially
|
|
||||||
try-complete-lisp-symbol))
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
(rc/require 'company)
|
|
||||||
(require 'company)
|
|
||||||
|
|
||||||
(global-company-mode)
|
|
||||||
|
|
||||||
(add-hook 'tuareg-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(interactive)
|
|
||||||
(company-mode 0)))
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
(require 'dired-x)
|
|
||||||
(setq dired-omit-files
|
|
||||||
(concat dired-omit-files "\\|^\\..+$"))
|
|
||||||
(setq-default dired-dwim-target t)
|
|
||||||
(setq dired-listing-switches "-alh")
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
(rc/require 'editorconfig)
|
|
||||||
(editorconfig-mode 1)
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
(defun rc/turn-on-eldoc-mode ()
|
|
||||||
(interactive)
|
|
||||||
(eldoc-mode 1))
|
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-eldoc-mode)
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
(add-hook 'emacs-lisp-mode-hook
|
|
||||||
'(lambda ()
|
|
||||||
(local-set-key (kbd "C-c C-j")
|
|
||||||
(quote eval-print-last-sexp))))
|
|
||||||
(add-to-list 'auto-mode-alist '("Cask" . emacs-lisp-mode))
|
|
||||||
|
|
||||||
;; Automatically load paredit when editing a lisp file
|
|
||||||
;; More at http://www.emacswiki.org/emacs/ParEdit
|
|
||||||
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
|
|
||||||
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
|
|
||||||
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
|
|
||||||
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
|
|
||||||
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
|
|
||||||
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
|
|
||||||
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
|
|
||||||
|
|
||||||
;; eldoc-mode shows documentation in the minibuffer when writing code
|
|
||||||
;; http://www.emacswiki.org/emacs/ElDoc
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
|
||||||
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
|
|
||||||
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
(use-package ivy-erlang-complete
|
|
||||||
:ensure t)
|
|
||||||
|
|
||||||
(use-package flycheck
|
|
||||||
:ensure t
|
|
||||||
:delight
|
|
||||||
:config (global-flycheck-mode))
|
|
||||||
|
|
||||||
(use-package hydra
|
|
||||||
:defer 2
|
|
||||||
:bind ("C-c f" . hydra-flycheck/body))
|
|
||||||
|
|
||||||
(defhydra hydra-flycheck (:color blue)
|
|
||||||
"
|
|
||||||
^
|
|
||||||
^Errors^
|
|
||||||
^──────^
|
|
||||||
_<_ previous
|
|
||||||
_>_ next
|
|
||||||
_l_ list
|
|
||||||
_q_ quit
|
|
||||||
^^
|
|
||||||
"
|
|
||||||
("q" nil)
|
|
||||||
("<" flycheck-previous-error :color pink)
|
|
||||||
(">" flycheck-next-error :color pink)
|
|
||||||
("l" flycheck-list-errors))
|
|
||||||
|
|
||||||
(use-package erlang
|
|
||||||
:load-path ("/usr/lib/erlang/lib/tools-3.3/emacs/")
|
|
||||||
:mode (("\\.erl?$" . erlang-mode)
|
|
||||||
("rebar\\.config$" . erlang-mode)
|
|
||||||
("relx\\.config$" . erlang-mode)
|
|
||||||
("sys\\.config\\.src$" . erlang-mode)
|
|
||||||
("sys\\.config$" . erlang-mode)
|
|
||||||
("\\.config\\.src?$" . erlang-mode)
|
|
||||||
("\\.config\\.script?$" . erlang-mode)
|
|
||||||
("\\.hrl?$" . erlang-mode)
|
|
||||||
("\\.app?$" . erlang-mode)
|
|
||||||
("\\.app.src?$" . erlang-mode)
|
|
||||||
("\\Emakefile" . erlang-mode)))
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
(rc/require 'haskell-mode)
|
|
||||||
|
|
||||||
(setq haskell-process-type 'cabal-new-repl)
|
|
||||||
(setq haskell-process-log t)
|
|
||||||
|
|
||||||
(add-hook 'haskell-mode-hook 'haskell-indent-mode)
|
|
||||||
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
|
|
||||||
(add-hook 'haskell-mode-hook 'haskell-doc-mode)
|
|
||||||
(add-hook 'haskell-mode-hook 'hindent-mode)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
(rc/require 'helm 'helm-cmd-t 'helm-git-grep 'helm-ls-git)
|
|
||||||
|
|
||||||
(setq helm-ff-transformer-show-only-basename nil)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-c h t") 'helm-cmd-t)
|
|
||||||
(global-set-key (kbd "C-c h g g") 'helm-git-grep)
|
|
||||||
(global-set-key (kbd "C-c h g l") 'helm-ls-git-ls)
|
|
||||||
(global-set-key (kbd "C-c h f") 'helm-find)
|
|
||||||
(global-set-key (kbd "C-c h a") 'helm-org-agenda-files-headings)
|
|
||||||
(global-set-key (kbd "C-c h r") 'helm-recentf)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
(rc/require 'smex 'ido-completing-read+)
|
|
||||||
|
|
||||||
(require 'ido-completing-read+)
|
|
||||||
|
|
||||||
(ido-mode 1)
|
|
||||||
(ido-everywhere 1)
|
|
||||||
(ido-ubiquitous-mode 1)
|
|
||||||
|
|
||||||
(global-set-key (kbd "M-x") 'smex)
|
|
||||||
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
(rc/require 'js2-mode)
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
|
|
||||||
(add-to-list 'interpreter-mode-alist '("node" . js2-mode))
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . js2-jsx-mode))
|
|
||||||
(add-to-list 'interpreter-mode-alist '("node". js2-jsx-mode))
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
(add-hook 'tex-mode-hook (lambda ()
|
|
||||||
(interactive)
|
|
||||||
(add-to-list 'tex-verbatim-environments "code")))
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
;; magit requres this lib, but it is not installed automatically on
|
|
||||||
;; Windows.
|
|
||||||
(rc/require 'cl-lib)
|
|
||||||
(rc/require 'magit)
|
|
||||||
|
|
||||||
(setq magit-auto-revert-mode nil)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-c m s") 'magit-status)
|
|
||||||
(global-set-key (kbd "C-c m l") 'magit-log)
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
(require 'package)
|
|
||||||
|
|
||||||
;; Install use-package if not already installed
|
|
||||||
(unless (package-installed-p 'use-package)
|
|
||||||
(package-refresh-contents)
|
|
||||||
(package-install 'use-package))
|
|
||||||
|
|
||||||
(require 'use-package)
|
|
||||||
|
|
||||||
;; Enable defer and ensure by default for use-package
|
|
||||||
(setq use-package-always-defer t
|
|
||||||
use-package-always-ensure t)
|
|
||||||
|
|
||||||
;; Enable scala-mode and sbt-mode
|
|
||||||
(use-package scala-mode
|
|
||||||
:mode "\\.s\\(cala\\|bt\\)$")
|
|
||||||
|
|
||||||
(use-package sbt-mode
|
|
||||||
:commands sbt-start sbt-command
|
|
||||||
:config
|
|
||||||
;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31
|
|
||||||
;; allows using SPACE when in the minibuffer
|
|
||||||
(substitute-key-definition
|
|
||||||
'minibuffer-complete-word
|
|
||||||
'self-insert-command
|
|
||||||
minibuffer-local-completion-map))
|
|
||||||
|
|
||||||
;; Enable nice rendering of diagnostincs like compile errors.
|
|
||||||
(use-package flycheck
|
|
||||||
:init (global-flycheck-mode))
|
|
||||||
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
|
|
||||||
|
|
||||||
(use-package lsp-mode
|
|
||||||
;; Optional - enable lsp-mode automatically in scala files
|
|
||||||
:hook (scala-mode . lsp)
|
|
||||||
:config (setq lsp-prefer-flymake nil))
|
|
||||||
|
|
||||||
(use-package lsp-ui)
|
|
||||||
|
|
||||||
;; Add company-lsp backend for metals
|
|
||||||
(use-package company-lsp)
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
(require 'ansi-color)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-c p") 'find-file-at-point)
|
|
||||||
(global-set-key (kbd "C-c i m") 'imenu)
|
|
||||||
|
|
||||||
(setq-default inhibit-splash-screen t
|
|
||||||
make-backup-files nil
|
|
||||||
tab-width 4
|
|
||||||
indent-tabs-mode nil
|
|
||||||
compilation-scroll-output t
|
|
||||||
;; default-input-method "russian-computer"
|
|
||||||
visible-bell (equal system-type 'windows-nt))
|
|
||||||
|
|
||||||
(defun rc/colorize-compilation-buffer ()
|
|
||||||
(read-only-mode)
|
|
||||||
(ansi-color-apply-on-region compilation-filter-start (point))
|
|
||||||
(read-only-mode))
|
|
||||||
(add-hook 'compilation-filter-hook 'rc/colorize-compilation-buffer)
|
|
||||||
|
|
||||||
(defun rc/buffer-file-name ()
|
|
||||||
(if (equal major-mode 'dired-mode)
|
|
||||||
default-directory
|
|
||||||
(buffer-file-name)))
|
|
||||||
|
|
||||||
(defun rc/parent-directory (path)
|
|
||||||
(file-name-directory (directory-file-name path)))
|
|
||||||
|
|
||||||
(defun rc/root-anchor (path anchor)
|
|
||||||
(cond
|
|
||||||
((string= anchor "") nil)
|
|
||||||
((file-exists-p (concat (file-name-as-directory path) anchor)) path)
|
|
||||||
((string-equal path "/") nil)
|
|
||||||
(t (rc/root-anchor (rc/parent-directory path) anchor))))
|
|
||||||
|
|
||||||
(defun rc/clipboard-org-mode-file-link (anchor)
|
|
||||||
(interactive "sRoot anchor: ")
|
|
||||||
(let* ((root-dir (rc/root-anchor default-directory anchor))
|
|
||||||
(org-mode-file-link (format "file:%s::%d"
|
|
||||||
(if root-dir
|
|
||||||
(file-relative-name (rc/buffer-file-name) root-dir)
|
|
||||||
(rc/buffer-file-name))
|
|
||||||
(line-number-at-pos))))
|
|
||||||
(kill-new org-mode-file-link)
|
|
||||||
(message org-mode-file-link)))
|
|
||||||
|
|
||||||
;;; Taken from here:
|
|
||||||
;;; http://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs
|
|
||||||
(defun rc/put-file-name-on-clipboard ()
|
|
||||||
"Put the current file name on the clipboard"
|
|
||||||
(interactive)
|
|
||||||
(let ((filename (rc/buffer-file-name)))
|
|
||||||
(when filename
|
|
||||||
(kill-new filename)
|
|
||||||
(message filename))))
|
|
||||||
|
|
||||||
(defun rc/put-buffer-name-on-clipboard ()
|
|
||||||
"Put the current buffer name on the clipboard"
|
|
||||||
(interactive)
|
|
||||||
(kill-new (buffer-name))
|
|
||||||
(message (buffer-name)))
|
|
||||||
|
|
||||||
(defun rc/kill-autoloads-buffers ()
|
|
||||||
(interactive)
|
|
||||||
(dolist (buffer (buffer-list))
|
|
||||||
(let ((name (buffer-name buffer)))
|
|
||||||
(when (string-match-p "-autoloads.el" name)
|
|
||||||
(kill-buffer buffer)
|
|
||||||
(message "Killed autoloads buffer %s" name)))))
|
|
||||||
|
|
||||||
(defun rc/start-python-simple-http-server ()
|
|
||||||
(interactive)
|
|
||||||
(shell-command "python -m SimpleHTTPServer 3001 &"
|
|
||||||
"*Simple Python HTTP Server*"))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x p s") 'rc/start-python-simple-http-server)
|
|
||||||
|
|
||||||
;;; Taken from here:
|
|
||||||
;;; http://blog.bookworm.at/2007/03/pretty-print-xml-with-emacs.html
|
|
||||||
(defun bf-pretty-print-xml-region (begin end)
|
|
||||||
"Pretty format XML markup in region. You need to have nxml-mode
|
|
||||||
http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do
|
|
||||||
this. The function inserts linebreaks to separate tags that have
|
|
||||||
nothing but whitespace between them. It then indents the markup
|
|
||||||
by using nxml's indentation rules."
|
|
||||||
(interactive "r")
|
|
||||||
(save-excursion
|
|
||||||
(nxml-mode)
|
|
||||||
(goto-char begin)
|
|
||||||
(while (search-forward-regexp "\>[ \\t]*\<" nil t)
|
|
||||||
(backward-char) (insert "\n"))
|
|
||||||
(indent-region begin end))
|
|
||||||
(message "Ah, much better!"))
|
|
||||||
|
|
||||||
;;; Stolen from http://ergoemacs.org/emacs/emacs_unfill-paragraph.html
|
|
||||||
(defun rc/unfill-paragraph ()
|
|
||||||
"Replace newline chars in current paragraph by single spaces.
|
|
||||||
This command does the inverse of `fill-paragraph'."
|
|
||||||
(interactive)
|
|
||||||
(let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum'
|
|
||||||
(fill-paragraph nil)))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-c M-q") 'rc/unfill-paragraph)
|
|
||||||
|
|
||||||
(defun rc/load-path-here ()
|
|
||||||
(interactive)
|
|
||||||
(add-to-list 'load-path default-directory))
|
|
||||||
|
|
||||||
(defconst rc/frame-transparency 85)
|
|
||||||
|
|
||||||
(defun rc/toggle-transparency ()
|
|
||||||
(interactive)
|
|
||||||
(let ((frame-alpha (frame-parameter nil 'alpha)))
|
|
||||||
(if (or (not frame-alpha)
|
|
||||||
(= (cadr frame-alpha) 100))
|
|
||||||
(set-frame-parameter nil 'alpha
|
|
||||||
`(,rc/frame-transparency
|
|
||||||
,rc/frame-transparency))
|
|
||||||
(set-frame-parameter nil 'alpha '(100 100)))))
|
|
||||||
|
|
||||||
(defun rc/duplicate-line ()
|
|
||||||
"Duplicate current line"
|
|
||||||
(interactive)
|
|
||||||
(move-beginning-of-line 1)
|
|
||||||
(kill-line)
|
|
||||||
(yank)
|
|
||||||
(newline)
|
|
||||||
(yank))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-,") 'rc/duplicate-line)
|
|
||||||
|
|
||||||
;;; A little hack which fixes a problem with meta key in fluxbox under VNC.
|
|
||||||
(setq x-alt-keysym 'meta)
|
|
||||||
|
|
||||||
(setq confirm-kill-emacs 'y-or-n-p)
|
|
||||||
;; Changes all yes/no questions to y/n type
|
|
||||||
(fset 'yes-or-no-p 'y-or-n-p)
|
|
||||||
|
|
||||||
;; shell scripts
|
|
||||||
(setq-default sh-basic-offset 2)
|
|
||||||
(setq-default sh-indentation 2)
|
|
||||||
|
|
||||||
;; No need for ~ files when editing
|
|
||||||
(setq create-lockfiles nil)
|
|
||||||
|
|
||||||
;; Go straight to scratch buffer on startup
|
|
||||||
(setq inhibit-startup-message t)
|
|
||||||
|
|
||||||
(add-hook 'emacs-startup-hook
|
|
||||||
(lambda ()
|
|
||||||
(message "Emacs ready in %s with %d garbage collections."
|
|
||||||
(format "%.2f seconds"
|
|
||||||
(float-time (time-subtract after-init-time before-init-time)))
|
|
||||||
gcs-done)))
|
|
||||||
|
|
||||||
|
|
||||||
(server-start)
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
(rc/require 'move-text)
|
|
||||||
(global-set-key (kbd "M-p") 'move-text-up)
|
|
||||||
(global-set-key (kbd "M-n") 'move-text-down)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
(rc/require 'multiple-cursors)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
|
||||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
|
||||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
|
||||||
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
|
||||||
(global-set-key (kbd "C-\"") 'mc/skip-to-next-like-this)
|
|
||||||
(global-set-key (kbd "C-:") 'mc/skip-to-previous-like-this)
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
(rc/require 'nasm-mode)
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.asm\\'" . nasm-mode))
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
(require 'neotree)
|
|
||||||
|
|
||||||
(global-set-key [f8] 'neotree-toggle)
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
(add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.xsd\\'" . nxml-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.ant\\'" . nxml-mode))
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
(rc/require 'openwith)
|
|
||||||
|
|
||||||
(openwith-mode 1)
|
|
||||||
|
|
||||||
|
|
||||||
(setq openwith-associations
|
|
||||||
(append
|
|
||||||
(when (eq system-type 'gnu/linux)
|
|
||||||
'(("\\.pdf\\'" "evince" (file))
|
|
||||||
("\\.djvu\\'" "evince" (file))))
|
|
||||||
'(("\\.docx\\'" "libreoffice" (file))
|
|
||||||
("\\.xlsx\\'" "libreoffice" (file))
|
|
||||||
("\\.doc\\'" "libreoffice" (file))
|
|
||||||
("\\.rtf\\'" "libreoffice" (file))
|
|
||||||
("\\.ods\\'" "libreoffice" (file))
|
|
||||||
("\\.mp3\\'" "vlc" (file)))))
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
(require 'ob-python)
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
(setq org-capture-templates
|
|
||||||
'(("p" "Capture task" entry (file "~/Documents/Agenda/Tasks.org")
|
|
||||||
"* TODO %?\n SCHEDULED: %t\n")
|
|
||||||
("K" "Cliplink capture task" entry (file "~/Documents/Agenda/Tasks.org")
|
|
||||||
"* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 1)))
|
|
||||||
(define-key global-map "\C-cc" 'org-capture)
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
(rc/require 'org-cliplink)
|
|
||||||
|
|
||||||
(when (eq system-type 'gnu/linux)
|
|
||||||
(custom-set-variables
|
|
||||||
'(org-cliplink-transport-implementation (quote url-el))))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x p i") 'org-cliplink)
|
|
||||||
|
|
||||||
(defun rc/cliplink-task ()
|
|
||||||
(interactive)
|
|
||||||
(org-cliplink-retrieve-title
|
|
||||||
(substring-no-properties (current-kill 0))
|
|
||||||
'(lambda (url title)
|
|
||||||
(insert (if title
|
|
||||||
(concat "* TODO " title
|
|
||||||
"\n [[" url "][" title "]]")
|
|
||||||
(concat "* TODO " url
|
|
||||||
"\n [[" url "]]"))))))
|
|
||||||
(global-set-key (kbd "C-x p t") 'rc/cliplink-task)
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
(global-set-key (kbd "C-x a") 'org-agenda)
|
|
||||||
(global-set-key (kbd "C-c C-x j") #'org-clock-jump-to-current-clock)
|
|
||||||
|
|
||||||
(setq org-agenda-files (list "~/Documents/Agenda/"))
|
|
||||||
|
|
||||||
(setq org-export-backends '(md))
|
|
||||||
|
|
||||||
(custom-set-variables
|
|
||||||
'(org-modules
|
|
||||||
(quote
|
|
||||||
(org-bbdb
|
|
||||||
org-bibtex
|
|
||||||
org-docview
|
|
||||||
org-gnus
|
|
||||||
org-habit
|
|
||||||
org-info
|
|
||||||
org-irc
|
|
||||||
org-mhe
|
|
||||||
org-rmail
|
|
||||||
org-w3m)))
|
|
||||||
'(org-enforce-todo-dependencies nil)
|
|
||||||
'(org-agenda-dim-blocked-tasks nil)
|
|
||||||
'(org-agenda-exporter-settings
|
|
||||||
(quote ((org-agenda-tag-filter-preset (list "+personal")))))
|
|
||||||
'(org-refile-use-outline-path (quote file)))
|
|
||||||
|
|
||||||
(defun rc/org-increment-move-counter ()
|
|
||||||
(interactive)
|
|
||||||
|
|
||||||
(defun default (x d)
|
|
||||||
(if x x d))
|
|
||||||
|
|
||||||
(let* ((point (point))
|
|
||||||
(move-counter-name "MOVE_COUNTER")
|
|
||||||
(move-counter-value (-> (org-entry-get point move-counter-name)
|
|
||||||
(default "0")
|
|
||||||
(string-to-number)
|
|
||||||
(1+))))
|
|
||||||
(org-entry-put point move-counter-name
|
|
||||||
(number-to-string move-counter-value)))
|
|
||||||
nil)
|
|
||||||
|
|
||||||
(defun rc/org-get-heading-name ()
|
|
||||||
(nth 4 (org-heading-components)))
|
|
||||||
|
|
||||||
(defun rc/org-kill-heading-name-save ()
|
|
||||||
(interactive)
|
|
||||||
(let ((heading-name (rc/org-get-heading-name)))
|
|
||||||
(kill-new heading-name)
|
|
||||||
(message "Kill \"%s\"" heading-name)))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x p w") 'rc/org-kill-heading-name-save)
|
|
||||||
|
|
||||||
(setq org-agenda-custom-commands
|
|
||||||
'(("u" "Unscheduled" tags "+personal-SCHEDULED={.+}-DEADLINE={.+}/!+TODO"
|
|
||||||
((org-agenda-sorting-strategy '(priority-down))))
|
|
||||||
("p" "Personal" ((agenda "" ((org-agenda-tag-filter-preset (list "+personal"))))))
|
|
||||||
("w" "Work" ((agenda "" ((org-agenda-tag-filter-preset (list "+work"))))))
|
|
||||||
))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
(rc/require 'paredit)
|
|
||||||
|
|
||||||
(defun rc/turn-on-paredit ()
|
|
||||||
(interactive)
|
|
||||||
(paredit-mode 1))
|
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-paredit)
|
|
||||||
(add-hook 'clojure-mode-hook 'rc/turn-on-paredit)
|
|
||||||
(add-hook 'lisp-mode-hook 'rc/turn-on-paredit)
|
|
||||||
(add-hook 'common-lisp-mode-hook 'rc/turn-on-paredit)
|
|
||||||
(add-hook 'scheme-mode-hook 'rc/turn-on-paredit)
|
|
||||||
(add-hook 'racket-mode-hook 'rc/turn-on-paredit)
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
(rc/require 'powershell)
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.ps1\\'" . powershell-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.psm1\\'" . powershell-mode))
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
(package-initialize)
|
|
||||||
|
|
||||||
(projectile-mode +1)
|
|
||||||
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
|
|
||||||
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
(rc/require 'rainbow-mode)
|
|
||||||
|
|
||||||
(defun rc/turn-on-rainbow-mode ()
|
|
||||||
(interactive)
|
|
||||||
(rainbow-mode 1))
|
|
||||||
|
|
||||||
(add-hook 'html-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
(add-hook 'css-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
(add-hook 'js-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
(add-hook 'nxml-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
(add-hook 'conf-xdefaults-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
(add-hook 'typescript-mode-hook 'rc/turn-on-rainbow-mode)
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
(add-to-list 'package-archives
|
|
||||||
'("melpa" . "https://melpa.org/packages/") t)
|
|
||||||
;; (add-to-list 'package-archives
|
|
||||||
;; '("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
|
||||||
|
|
||||||
(defvar rc/package-contents-refreshed nil)
|
|
||||||
(defvar rc/required-packages nil)
|
|
||||||
|
|
||||||
(defun rc/package-refresh-contents-once ()
|
|
||||||
(when (not rc/package-contents-refreshed)
|
|
||||||
(setq rc/package-contents-refreshed t)
|
|
||||||
(package-refresh-contents)))
|
|
||||||
|
|
||||||
(defun rc/require-one-package (package)
|
|
||||||
(push package rc/required-packages)
|
|
||||||
(when (not (package-installed-p package))
|
|
||||||
(rc/package-refresh-contents-once)
|
|
||||||
(package-install package)))
|
|
||||||
|
|
||||||
(defun rc/require (&rest packages)
|
|
||||||
(dolist (package packages)
|
|
||||||
(rc/require-one-package package)))
|
|
||||||
|
|
||||||
(defun rc/require-theme (theme)
|
|
||||||
(let ((theme-package (->> theme
|
|
||||||
(symbol-name)
|
|
||||||
(funcall (-flip #'concat) "-theme")
|
|
||||||
(intern))))
|
|
||||||
(rc/require theme-package)
|
|
||||||
(load-theme theme t)))
|
|
||||||
|
|
||||||
(rc/require 'dash)
|
|
||||||
(require 'dash)
|
|
||||||
|
|
||||||
(rc/require 'dash-functional)
|
|
||||||
(require 'dash-functional)
|
|
||||||
|
|
||||||
(defun rc/package-reqs (package)
|
|
||||||
(let ((package-desc
|
|
||||||
(->> package-alist
|
|
||||||
(alist-get package)
|
|
||||||
(car))))
|
|
||||||
(when package-desc
|
|
||||||
(package-desc-reqs package-desc))))
|
|
||||||
|
|
||||||
(defun rc/package-dependencies (package)
|
|
||||||
(->> package
|
|
||||||
(rc/package-reqs)
|
|
||||||
(-map #'car)
|
|
||||||
(cons package)))
|
|
||||||
|
|
||||||
(defun rc/package-expand-dependencies (packages)
|
|
||||||
(->> packages
|
|
||||||
(-map #'rc/package-dependencies)
|
|
||||||
(-flatten)
|
|
||||||
(remove-duplicates)))
|
|
||||||
|
|
||||||
(defun rc/unused-packages ()
|
|
||||||
(let ((all-package (rc/package-expand-dependencies rc/required-packages)))
|
|
||||||
(->> package-alist
|
|
||||||
(-map #'car)
|
|
||||||
(-filter (-lambda (package)
|
|
||||||
(not (-contains? all-package package)))))))
|
|
||||||
|
|
||||||
(defun rc/remove-unused-packages ()
|
|
||||||
(interactive)
|
|
||||||
(message "Unused packages: %s" (rc/unused-packages)))
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
(require 'recentf)
|
|
||||||
(recentf-mode 1)
|
|
||||||
(setq recentf-max-menu-items 25)
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
;; Sets up exec-path-from shell
|
|
||||||
;; https://github.com/purcell/exec-path-from-shell
|
|
||||||
(when (memq window-system '(mac ns))
|
|
||||||
(exec-path-from-shell-initialize)
|
|
||||||
(exec-path-from-shell-copy-envs
|
|
||||||
'("PATH")))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
(rc/require 'tide)
|
|
||||||
|
|
||||||
(defun rc/turn-on-tide ()
|
|
||||||
(interactive)
|
|
||||||
(tide-setup))
|
|
||||||
|
|
||||||
(add-hook 'typescript-mode-hook 'rc/turn-on-tide)
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
;;; http://stackoverflow.com/questions/13794433/how-to-disable-autosave-for-tramp-buffers-in-emacs
|
|
||||||
(setq tramp-auto-save-directory "/tmp")
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
(defun rc/set-up-whitespace-handling ()
|
|
||||||
(interactive)
|
|
||||||
(whitespace-mode 1)
|
|
||||||
(add-to-list 'write-file-functions 'delete-trailing-whitespace))
|
|
||||||
|
|
||||||
(custom-set-variables
|
|
||||||
'(whitespace-style (quote (face tabs spaces trailing space-before-tab
|
|
||||||
newline indentation empty space-after-tab
|
|
||||||
space-mark tab-mark))))
|
|
||||||
|
|
||||||
(let ((whitespace-enabled-modes
|
|
||||||
'(
|
|
||||||
tuareg-mode-hook
|
|
||||||
c++-mode-hook
|
|
||||||
c-mode-hook
|
|
||||||
emacs-lisp-mode
|
|
||||||
java-mode-hook
|
|
||||||
lua-mode-hook
|
|
||||||
rust-mode-hook
|
|
||||||
scala-mode-hook
|
|
||||||
markdown-mode-hook
|
|
||||||
js2-mode-hook
|
|
||||||
haskell-mode-hook
|
|
||||||
python-mode-hook
|
|
||||||
erlang-mode-hook
|
|
||||||
asm-mode-hook
|
|
||||||
nasm-mode-hook
|
|
||||||
go-mode-hook
|
|
||||||
nim-mode-hook
|
|
||||||
)))
|
|
||||||
(dolist (mode whitespace-enabled-modes)
|
|
||||||
(add-hook mode 'rc/set-up-whitespace-handling)))
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
(defun rc/enable-word-wrap ()
|
|
||||||
(interactive)
|
|
||||||
(toggle-word-wrap 1))
|
|
||||||
|
|
||||||
(add-hook 'markdown-mode-hook 'rc/enable-word-wrap)
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
(rc/require 'yasnippet)
|
|
||||||
|
|
||||||
(require 'yasnippet)
|
|
||||||
|
|
||||||
(setq yas/triggers-in-field nil)
|
|
||||||
(setq yas-snippet-dirs '("~/.emacs.snippets/"))
|
|
||||||
|
|
||||||
(yas-global-mode 1)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-mode
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: catch (...) { ... }
|
|
||||||
# key: catch
|
|
||||||
# --
|
|
||||||
catch ($1) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: for (...: ...) { ... }
|
|
||||||
# key: fore
|
|
||||||
# --
|
|
||||||
for ($1: $2) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: namespace Namespace
|
|
||||||
# key: ns
|
|
||||||
# --
|
|
||||||
namespace ${1:Namespace} {
|
|
||||||
$0
|
|
||||||
} // namespace $1
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: #ifndef XXX; #define XXX; #endif
|
|
||||||
# key: once
|
|
||||||
# --
|
|
||||||
#ifndef ${1:`(upcase (replace-regexp-in-string "\\." "_" (file-name-nondirectory (buffer-file-name))))`_}
|
|
||||||
#define $1
|
|
||||||
|
|
||||||
$0
|
|
||||||
|
|
||||||
#endif // $1
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: qdebug
|
|
||||||
# key: qdebug
|
|
||||||
# --
|
|
||||||
qDebug() << "----------------------------------------";
|
|
||||||
qDebug() << "$0";
|
|
||||||
qDebug() << "----------------------------------------";
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: try { ... }
|
|
||||||
# key: try
|
|
||||||
# --
|
|
||||||
try {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: using namespace std;
|
|
||||||
# key: uns
|
|
||||||
# --
|
|
||||||
using namespace std;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: std::vector<T>
|
|
||||||
# key: vec
|
|
||||||
# --
|
|
||||||
std::vector<$1> $2;$0
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: { ... }
|
|
||||||
# key: {
|
|
||||||
# --
|
|
||||||
{
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: else if (...) { ... }
|
|
||||||
# key: elif
|
|
||||||
# --
|
|
||||||
else if (${1:condition}) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: else { ... }
|
|
||||||
# key: else
|
|
||||||
# --
|
|
||||||
else {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: for (...; ...; ...) { ... }
|
|
||||||
# key: for
|
|
||||||
# --
|
|
||||||
for (${1:init}; ${2:condition}; ${3:increment}) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: if (...) { ... }
|
|
||||||
# key: if
|
|
||||||
# --
|
|
||||||
if (${1:condition}) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: while (...) { ... }
|
|
||||||
# key: while
|
|
||||||
# --
|
|
||||||
while (${1:condition}) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-like-syntax
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: #include <...>
|
|
||||||
# key: inc
|
|
||||||
# --
|
|
||||||
#include <$0>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: #include "..."
|
|
||||||
# key: incq
|
|
||||||
# --
|
|
||||||
#include "$0"
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: int main(argc, argv) { ... }
|
|
||||||
# key: main
|
|
||||||
# --
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
$0
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: background-color: ...
|
|
||||||
# key: bg
|
|
||||||
# --
|
|
||||||
background-color: #${1:DDD};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: background-image: ...
|
|
||||||
# key: bgi
|
|
||||||
# --
|
|
||||||
background-image: url($1);
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: border size style color
|
|
||||||
# key: bor
|
|
||||||
# --
|
|
||||||
border: ${1:1px} ${2:solid} #${3:999};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: clear: ...
|
|
||||||
# key: cl
|
|
||||||
# --
|
|
||||||
clear: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: display: block
|
|
||||||
# key: dispb
|
|
||||||
# --
|
|
||||||
display: block;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: display: inline
|
|
||||||
# key: dispi
|
|
||||||
# --
|
|
||||||
display: inline;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: display: none
|
|
||||||
# key: dispn
|
|
||||||
# --
|
|
||||||
display: none;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: font-family: ...
|
|
||||||
# key: ff
|
|
||||||
# --
|
|
||||||
font-family: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: font-size: ...
|
|
||||||
# key: fs
|
|
||||||
# --
|
|
||||||
font-size: ${12px};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: margin: ...
|
|
||||||
# key: mar
|
|
||||||
# --
|
|
||||||
margin: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: margin-bottom: ...
|
|
||||||
# key: marb
|
|
||||||
# --
|
|
||||||
margin-bottom: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: margin-left: ...
|
|
||||||
# key: marl
|
|
||||||
# --
|
|
||||||
margin-left: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: margin-right: ...
|
|
||||||
# key: marr
|
|
||||||
# --
|
|
||||||
margin-right: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: margin-top: ...
|
|
||||||
# key: mart
|
|
||||||
# --
|
|
||||||
margin-top: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: padding: ...
|
|
||||||
# key: pad
|
|
||||||
# --
|
|
||||||
padding: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: padding-bottom: ...
|
|
||||||
# key: padb
|
|
||||||
# --
|
|
||||||
padding-bottom: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: padding-left: ...
|
|
||||||
# key: padl
|
|
||||||
# --
|
|
||||||
padding-left: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: padding-right: ...
|
|
||||||
# key: padr
|
|
||||||
# --
|
|
||||||
padding-right: $1;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: padding-top: ...
|
|
||||||
# key: padt
|
|
||||||
# --
|
|
||||||
padding-top: $1;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-like-syntax
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: immutable
|
|
||||||
# key: imm
|
|
||||||
# --
|
|
||||||
immutable $0
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: import <...>;
|
|
||||||
# key: imp
|
|
||||||
# --
|
|
||||||
import $0;
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: emacs lisp module skeleton
|
|
||||||
# key: emacs-lisp-module
|
|
||||||
# --
|
|
||||||
;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- ${2:Package Description} -*- lexical-binding: t -*-
|
|
||||||
|
|
||||||
;; Copyright (C) `(format-time-string "%Y" (current-time))` ${3:Alexey Kutepov <reximkut@gmail.com>}
|
|
||||||
|
|
||||||
;; Author: $3
|
|
||||||
;; URL: $4
|
|
||||||
|
|
||||||
;; Permission is hereby granted, free of charge, to any person
|
|
||||||
;; obtaining a copy of this software and associated documentation
|
|
||||||
;; files (the "Software"), to deal in the Software without
|
|
||||||
;; restriction, including without limitation the rights to use, copy,
|
|
||||||
;; modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
;; of the Software, and to permit persons to whom the Software is
|
|
||||||
;; furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
;; The above copyright notice and this permission notice shall be
|
|
||||||
;; included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
||||||
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
||||||
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
;; SOFTWARE.
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;; $5
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
$0
|
|
||||||
|
|
||||||
(provide '${6:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`})
|
|
||||||
|
|
||||||
;;; $1 ends here
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: pacmacs module skeleton
|
|
||||||
# key: pacmacs-module
|
|
||||||
# --
|
|
||||||
;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- Pacman for Emacs -*- lexical-binding: t -*-
|
|
||||||
|
|
||||||
;; Copyright (C) `(format-time-string "%Y" (current-time))` Codingteam
|
|
||||||
|
|
||||||
;; Author: Codingteam <codingteam@conference.jabber.ru>
|
|
||||||
;; Maintainer: Alexey Kutepov <reximkut@gmail.com>
|
|
||||||
;; URL: http://github.com/rexim/pacmacs.el
|
|
||||||
|
|
||||||
;; Permission is hereby granted, free of charge, to any person
|
|
||||||
;; obtaining a copy of this software and associated documentation
|
|
||||||
;; files (the "Software"), to deal in the Software without
|
|
||||||
;; restriction, including without limitation the rights to use, copy,
|
|
||||||
;; modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
;; of the Software, and to permit persons to whom the Software is
|
|
||||||
;; furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
;; The above copyright notice and this permission notice shall be
|
|
||||||
;; included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
||||||
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
||||||
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
;; SOFTWARE.
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;; $2
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
$0
|
|
||||||
|
|
||||||
;;; $1 ends here
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-like-syntax
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-like-syntax
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: public static
|
|
||||||
# key: ps
|
|
||||||
# --
|
|
||||||
public static
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: public static void
|
|
||||||
# key: psv
|
|
||||||
# --
|
|
||||||
public static void
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
c-like-syntax
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: item
|
|
||||||
# key: item
|
|
||||||
# --
|
|
||||||
${1:Item} {
|
|
||||||
$0
|
|
||||||
} // $1
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: \begin{environment} ... \end{environment}
|
|
||||||
# key: begin
|
|
||||||
# --
|
|
||||||
\begin{${1:environment}}
|
|
||||||
$0
|
|
||||||
\end{$1}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# -*- mode: snippet -*-
|
|
||||||
# name: todo
|
|
||||||
# key: todo
|
|
||||||
# type: command
|
|
||||||
# binding: C-x t
|
|
||||||
# --
|
|
||||||
(if (region-active-p)
|
|
||||||
(yas-expand-snippet "<!--TODO:-->`yas-selected-text`<!--$0-->")
|
|
||||||
(yas-expand-snippet "<!--TODO: $0 -->"))
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user