Created
June 4, 2019 01:24
-
-
Save zeta-00/4bf30df7b966d3ba64c97a311ad22c88 to your computer and use it in GitHub Desktop.
.emacs config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(package-initialize 'noactivate) | |
(eval-when-compile (require 'use-package)) | |
(setq use-package-always-ensure nil | |
use-package-ensure-function 'ignore | |
package-archives nil | |
package-enable-at-startup nil | |
package--init-file-ensured t) | |
(package-initialize) | |
;; debugging, shows a stack trace of error(s): | |
;;(setq debug-on-error t) | |
;; set font size | |
(set-face-attribute 'default nil :height 500) | |
;; soft wrap text: | |
(add-hook 'text-mode-hook 'turn-on-visual-line-mode) | |
;; theme | |
(load-theme 'zenburn t) | |
;; read pdf documents | |
(pdf-loader-install) | |
;; forge config: | |
(use-package forge | |
:after magit) | |
;; music: | |
(add-to-list 'load-path "~/elisp/emms/") | |
(require 'emms-setup) | |
(emms-standard) | |
(emms-default-players) | |
(setq emms-source-file-default-directory "~/Music/") | |
(global-set-key (kbd "C-c +") 'emms-volume-mode-plus) | |
(global-set-key (kbd "C-c -") 'emms-volume-mode-minus) | |
;; language server protocol | |
(require 'lsp) | |
(require 'lsp-mode) | |
(require 'lsp-ui) | |
(add-hook 'lsp-mode-hook 'lsp-ui-mode) | |
;; haskell lsp setup: | |
(require 'lsp-haskell) | |
(add-hook 'haskell-mode-hook #'lsp) | |
(add-hook 'haskell-mode-hook 'flycheck-mode) | |
;; (setq lsp-document-sync-method 'full) | |
;; (add-hook 'haskell-mode-hook 'direnv-update-environment) | |
;; java lsp setup: | |
;; (require 'lsp-java) | |
;; (add-hook 'java-mode-hook #'lsp) | |
;; (add-hook 'java-mode-hook 'flycheck-mode) | |
;; haskell repl(ghci, cabal-new-repl): | |
;;(use-package haskell-mode | |
;; :init | |
;; (progn | |
;; (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
;; (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) | |
;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode) | |
;; (setq haskell-process-args-cabal-new-repl | |
;; '("--ghc-options=-ferror-spans -fshow-loaded-modules")) | |
;; (setq haskell-process-type 'cabal-new-repl) | |
;; (setq haskell-stylish-on-save 't) | |
;; (setq haskell-tags-on-save 't) | |
;;)) | |
;; nixos: | |
(require 'company) | |
(global-set-key (kbd "C-c C-S-n") 'helm-nixos-options) | |
(global-set-key (kbd "C-c C-u") 'nix-update-fetch) | |
(global-pretty-sha-path-mode) | |
(add-to-list 'company-backends 'company-cabal) | |
(add-to-list 'company-backends 'company-nixos-options) | |
;; (require 'cl-lib) | |
;; (add-hook 'nix-mode-hook | |
;; (lambda () | |
;; (set (make-local-variable 'company-backends) '(company-nixos-opt;; ions)))) | |
;; flycheck: | |
(setq flycheck-command-wrapper-function | |
(lambda (command) (apply 'nix-shell-command (nix-current-sandbox) command)) | |
flycheck-executable-find | |
(lambda (cmd) (nix-executable-find (nix-current-sandbox) cmd))) | |
;; end flycheck | |
;; haskell-mode for nix: | |
(setq haskell-process-wrapper-function | |
(lambda (args) (apply 'nix-shell-command (nix-current-sandbox) args))) | |
;; end haskell-mode for nix | |
;; end nixos | |
;; rcirc irc setup: | |
(require 'sasl) | |
;; rcirc keybinding: | |
(global-set-key (kbd "C-c i") 'irc) | |
;; rcirc auto-authentication: | |
(setq rcirc-authinfo '(("freenode" nickserv "zeta_0" "FreedomLiberation0"))) | |
;; set rcirc to read authinfo from 'auth-sources' | |
(defadvice rcirc (before rcirc-read-from-authinfo activate) | |
"Allow rcirc to read authinfo from ~/.authinfo.gpg via the auth-source API. | |
This doesn't support the chanserv auth method" | |
(unless arg | |
(dolist (p (auth-source-search :port '("nickserv" "chanserv") | |
:require '(:port :user :secret))) | |
(let ((secret (plist-get p :secret)) | |
(method (intern (plist-get p :port)))) | |
(add-to-list 'rcirc-authinfo | |
(list (plist-get p :host) | |
method | |
(plist-get p :user) | |
(if (functionp secret) | |
(funcall secret) | |
secret))))))) | |
;; rcirc connect to server using ssl/tls: | |
(setq rcirc-server-alist | |
'(("irc.freenode.net" :port 6697 :encryption tls | |
:channels ("#haskell" "#haskell-beginners" "#emacs" "#nixos") | |
)) | |
) | |
;; gnutls security: | |
(setq gnutls-min-prime-bits 1024) | |
;; rcirc irc settings: | |
;; You can autoload, but at the end of this block we'll | |
;; connect to two networks anyway. | |
(require 'rcirc) | |
;; Don't print /away messages. | |
;; This does not require rcirc to be loaded already, | |
;; since rcirc doesn't define a 301 handler (yet). | |
(defun rcirc-handler-301 (process cmd sender args) | |
"/away message handler.") | |
;; Turn on spell checking. | |
(add-hook 'rcirc-mode-hook (lambda () | |
(flyspell-mode 1))) | |
;; Keep input line at bottom: | |
(add-hook 'rcirc-mode-hook | |
(lambda () | |
(set (make-local-variable 'scroll-conservatively) | |
8192))) | |
;; Turn on logging everything to a special buffer, for debugging. | |
(setq rcirc-debug-flag t) | |
;; Adjust the colours of one of the faces. | |
(set-face-foreground 'rcirc-my-nick "red" nil) | |
;; Include date in time stamp. | |
;; (setq rcirc-time-format "%Y-%m-%d %H:%M ") | |
;; Change user info | |
(setq rcirc-default-nick "zeta_0") | |
(setq rcirc-default-user-name "wolf_man") | |
(setq rcirc-default-full-name "zeta_wolf_man") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment