Skip to content

Instantly share code, notes, and snippets.

@DrBluefall
Created June 3, 2020 06:44
Show Gist options
  • Save DrBluefall/d8fd48ff9dfcc11120b3517b203816a8 to your computer and use it in GitHub Desktop.
Save DrBluefall/d8fd48ff9dfcc11120b3517b203816a8 to your computer and use it in GitHub Desktop.
;; PACKAGE PRELUDE ;;
(add-to-list 'load-path "~/.emacs.d/lisp/")
(require 'prelude)
(require 'package-list)
(require 'company-capf)
(require 'server)
;; THEME CONFIG ;;
(load-theme 'doom-molokai t)
(set-face-attribute 'default t :background "#000000")
(set-background-color "#000000")
(setq centaur-tabs-style "bar"
centaur-tabs-set-bar 'left
centaur-tabs-set-icons t
centaur-tabs-gray-out-icons 'buffer)
;; CONFIGURE DEFAULT MODES ;;
(setq evil-want-keybinding nil)
(evil-mode t)
(evil-collection-init)
(xterm-mouse-mode t)
(smooth-scrolling-mode t)
(doom-modeline-mode t)
(centaur-tabs-mode t)
(electric-pair-mode t)
(menu-bar-mode -1)
(tool-bar-mode -1)
(tab-bar-mode -1)
(scroll-bar-mode -1)
(yas-global-mode t)
;; VARIABLES ;;
(setq smooth-scroll-margin 5
company-minimum-prefix-length 1
company-idle-delay 0.0
rustic-lsp-server 'rust-analyzer
rustic-lsp-format t
tramp-default-method "ssh"
inferior-lisp-program "ccl"
exec-path-from-shell-check-startup-files nil)
(setq-default indent-tabs-mode nil)
(set-face-attribute 'default t :font "mononoki Nerd Font Mono-10")
(set-frame-font "mononoki Nerd Font Mono-10" nil t)
(add-to-list 'default-frame-alist '(font . "mononoki Nerd Font Mono-10"))
;; KEYBINDS ;;
(global-set-key (kbd "<mouse-5>") 'next-line)
(global-set-key (kbd "<mouse-4>") 'previous-line)
;; EVIL KEYBINDS ;;
(evil-set-leader 'normal (kbd ","))
;; Tab Movement
(evil-global-set-key 'normal (kbd "<M-right>") 'centaur-tabs-forward)
(evil-global-set-key 'normal (kbd "<M-left>") 'centaur-tabs-backward)
(evil-global-set-key 'normal (kbd "<M-up>") 'centaur-tabs-forward-group)
(evil-global-set-key 'normal (kbd "<M-down>") 'centaur-tabs-backward-group)
;; Split Movement
(evil-global-set-key 'normal (kbd "<C-right>") #'evil-window-right)
(evil-global-set-key 'normal (kbd "<C-left>") #'evil-window-left)
(evil-global-set-key 'normal (kbd "<C-up>") #'evil-window-up)
(evil-global-set-key 'normal (kbd "<C-down>") #'evil-window-down)
;; Bookmark Management
(evil-global-set-key 'normal (kbd "<leader>bo") 'bookmark-bmenu-list)
(evil-global-set-key 'normal (kbd "<leader>ba") 'bookmark-set)
;; EMMS Controls
(evil-global-set-key 'normal (kbd "<leader>pl") 'emms-playlist-mode-go)
(evil-global-set-key 'normal (kbd "<leader>sp") 'emms-shuffle)
(evil-global-set-key 'normal (kbd "<leader>nt") 'emms-next)
(evil-global-set-key 'normal (kbd "<leader>pt") 'emms-previous)
(evil-global-set-key 'normal (kbd "<leader>pp") 'emms-pause)
(evil-global-set-key 'normal (kbd "<leader>ps") 'emms-stop)
;; Misc. Controls
(evil-global-set-key 'normal (kbd "<leader>eb") 'eval-buffer)
;; LSP MODE CONFIGURATION ;;
(require 'lsp-rust)
(require 'lsp-clients)
(lsp-register-client
(make-lsp-client
:new-connection (lsp-tramp-connection "rust-analyzer")
:major-modes '(rust-mode rustic-mode)
:priority (if (eq lsp-rust-server 'rust-analyzer) 1 -1)
:initialization-options 'lsp-rust-analyzer--make-init-options
:notification-handlers (ht<-alist lsp-rust-notification-handlers)
:action-handlers (ht<-alist lsp-rust-action-handlers)
:library-folders-fn (lambda (_workspace) lsp-rust-library-directories)
:ignore-messages nil
:remote? t
:server-id 'rust-analyzer-remote))
;; EMACS MULTIMEDIA SYSTEM ;;
(require 'emms-setup)
(require 'emms-info-libtag)
(require 'emms-mark)
(emms-all)
(emms-default-players)
(emms-add-directory-tree "~/Music/")
(setq emms-source-file-default-directory "~/Music/"
emms-browser-default-browse-type 'info-album)
(setq emms-info-functions '(emms-info-libtag))
;; ORG-MODE CONFIGURATION ;;
(require 'org)
(setcar (nthcdr 4 org-emphasis-regexp-components) 4)
;; PACKAGE AUTOLOADING ;;
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rustic-mode))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.cl\\'" . (lambda ()
(lisp-mode)
(slime-setup '(slime-fancy slime-company)))))
(add-hook 'dashboard-mode-hook 'centaur-tabs-local-mode)
(add-hook 'after-init-hook 'global-company-mode)
(add-hook 'org-mode-hook 'org-bullets-mode)
(add-hook 'rustic-mode-hook #'lsp)
(add-hook 'term-mode-hook #'eterm-256color-mode)
(add-hook 'after-make-frame-functions #'(lambda (frame)
(message "foo")
(set-face-attribute 'default frame :font "mononoki Nerd Font Mono-10")
))
;; INITIALIZE EMACS DAEMON ;;
(unless (server-running-p)
(server-start))
;; SPLASH SCREEN INITIALIZATION ;;
(dashboard-setup-startup-hook)
(setq dashboard-startup-banner "~/Prismarine Co. Icons/prisco_logo_blackwhite.png"
dashboard-items '()
dashboard-banner-logo-title "All packages successfully initialized. Welcome to Emacs, Dr. Bluefall.")
(setq dashboard-footer-messages
'("Watch out for sanitized ink. It stains."
"The Prismarine Company takes pride in your service."
"Take care out there."
"Ceaseless innovation."
"Let the hacking commence."
"Be sure to take your complimentary PR15-F-01 on your way out."
"Stay Calm and Code On."))
(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.
'(inhibit-startup-screen t)
'(safe-local-variable-values '((eval auto-fill-mode t))))
(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment