General cleanup & minor refactoring

This commit is contained in:
Henrik Lissner 2018-12-22 04:01:17 -05:00
parent 3dd34abe61
commit d6cb0ec5f5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 12 additions and 10 deletions

View file

@ -35,7 +35,8 @@
;; Curse Lion and its sudden but inevitable fullscreen mode!
;; NOTE Meaningless to railwaycat's emacs-mac build
ns-use-native-fullscreen nil
;; Don't open files from the workspace in a new frame
;; Visit files opened outside of Emacs in existing frame, rather
;; than a new one
ns-pop-up-frames nil)
;; Fix the clipboard in terminal or daemon Emacs (non-GUI)

View file

@ -47,7 +47,7 @@
(when (and (not (file-exists-p parent-directory))
(y-or-n-p (format "Directory `%s' does not exist! Create it?" parent-directory)))
(make-directory parent-directory t))))
(push #'+dired|create-non-existent-directory find-file-not-found-functions)
(add-to-list 'find-file-not-found-functions '+dired|create-non-existent-directory nil #'eq)
;; Kill buffer when quitting dired buffers
(define-key dired-mode-map [remap quit-window] (λ! (quit-window t))))

View file

@ -3,7 +3,8 @@
(def-package! elixir-mode
:defer t
:init
;; disable default smartparens config
;; Disable default smartparens config; there are too many, they're intrusive
;; and we only want a subset of them (defined below).
(provide 'smartparens-elixir)
:config
;; ...and only complete the basics
@ -15,6 +16,7 @@
:post-handlers '("||\n[i]"))
(sp-local-pair "do " " end" :unless '(sp-in-comment-p sp-in-string-p))
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p))))
(set-pretty-symbols! 'elixir-mode
;; Functional
:def "def"

View file

@ -12,4 +12,3 @@
"Opens a Haskell REPL."
(interactive "P")
(display-buffer (+haskell-repl-buffer arg)))

View file

@ -77,7 +77,7 @@ If no viewers are found, `latex-preview-pane' is used.")
"\\Bigl\\{" "\\Biggl\\{"
"\\lfloor" "\\lceil" "\\langle"
"\\lVert" "\\lvert" "`"))
(sp-local-pair modes open nil :actions nil))
(sp-local-pair modes open nil :actions :rem))
(sp-local-pair modes "``" nil :unless '(:add sp-in-math-p)))))

View file

@ -44,7 +44,7 @@ the first function to return non-nil.")
t))
(advice-add #'org-babel-confirm-evaluate :after-while #'+org*babel-lazy-load-library)
;; I prefer C-c C-c over C-c '
;; I prefer C-c C-c over C-c ' (more consistent)
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
;; `org-babel-get-header' was removed from org in 9.0. Quite a few babel
@ -69,7 +69,7 @@ the first function to return non-nil.")
(setq ob-ipython-resources-dir ".ob-ipython-resrc")
(defun +org|babel-load-ipython (lang)
(and (string-match-p "^jupyter-" (symbol-name lang))
(and (string-prefix-p "jupyter-" (symbol-name lang))
(require 'ob-ipython nil t)))
(add-hook '+org-babel-load-functions #'+org|babel-load-ipython)
:config

View file

@ -45,7 +45,7 @@
(add-hook 'sh-mode-hook #'rainbow-delimiters-mode)
;; autoclose backticks
(sp-local-pair 'sh-mode "`" nil :unless '(sp-point-before-word-p sp-point-before-same-p))
(sp-local-pair 'sh-mode "`" "`" :unless '(sp-point-before-word-p sp-point-before-same-p))
;; sh-mode has file extensions checks for other shells, but not zsh, so...
(defun +sh|detect-zsh ()

View file

@ -24,8 +24,8 @@
;; Code completion with company
(setq ein:completion-backend 'ein:use-company-backend)
(set-company-backend! '(ein:notebook-multilang-mode
ein:notebook-python-mode
ein:notebook-plain-mode)
ein:notebook-python-mode
ein:notebook-plain-mode)
'ein:company-backend))
(after! ein-jupyter