Skip to content

Instantly share code, notes, and snippets.

@graves
Created October 26, 2020 22:53
Show Gist options
  • Save graves/ee97c99377e5a2423ef3d171c8df5cdb to your computer and use it in GitHub Desktop.
Save graves/ee97c99377e5a2423ef3d171c8df5cdb to your computer and use it in GitHub Desktop.
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Thomas Graves"
user-mail-address "luvshrimps@gmail.com")
;; macOS
;;(setq mac-control-modifier 'control)
;;(setq mac-command-modifier 'meta)
;;(setq mac-right-option-modifier 'control)
(setq mac-option-modifier nil
mac-command-modifier 'meta)
;;; Keybinds
(map! :m "M-j" #'multi-next-line
:m "M-k" #'multi-previous-line
;; Easier window movement
:n "C-h" #'evil-window-left
:n "C-j" #'evil-window-down
:n "C-k" #'evil-window-up
:n "C-l" #'evil-window-right
;; Treemacs
:n "C-n" #'treemacs
;; Ivy
:n "C-c b" #'ivy-switch-buffer
;; Counsel
:n "C-p" #'counsel-projectile-find-file
:n "C-c r" #'counsel-recentf
:n "C-c g" #'counsel-rg
:n "C-c d" #'counsel-descbinds
:n "C-c /" #'counsel-find-file
;; Swiper
:n "C-c s" #'swiper
;; Avy
:n "C-c j" #'avy-goto-word-or-subword-1
;; LSP
:n "C-c C-d" #'lsp-describe-thing-at-point
;; Rust
(:map rust-mode-map
:n "C-c C-f" #'rust-format-buffer
:n "C-c C-t" #'rust-test
:n "C-c C-r" #'rust-run)
(:map vterm-mode-map
;; Easier window movement
:i "C-h" #'evil-window-left
:i "C-j" #'evil-window-down
:i "C-k" #'evil-window-up
:i "C-l" #'evil-window-right)
(:map evil-treemacs-state-map
"C-h" #'evil-window-left
"C-l" #'evil-window-right
"M-j" #'multi-next-line
"M-k" #'multi-previous-line)
)
(setq-default evil-escape-key-sequence "jk")
;;; all-the-icons
(require 'all-the-icons)
;;; Theme
(require 'doom-themes)
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each theme
;; may have their own settings.
(load-theme 'doom-dark+ t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-colors") ; use the colorful treemacs theme
(doom-themes-treemacs-config)
;; Treemacs
(setq
treemacs-follow-mode t
treemacs-width 25)
;;(def-package! company
;; :config
;; (setq tmp-file "/home/luvshrimps/.emacs.d/tmp/rustic.tmp"
;; tmp-file-for-stderr "/home/luvshrimps/.emacs.d/tmp/rustic-stderr.tmp")
;;)
(setq confirm-kill-emacs nil)
;; Rust
(add-hook 'rust-mode-hook #'racer-mode)
(add-hook 'racer-mode-hook #'eldoc-mode)
(add-hook 'racer-mode-hook #'company-mode)
(add-hook 'rust-mode-hook
(lambda ()
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)))
;;(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
;; Go
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:hook (go-mode . lsp-deferred))
;; Set up before-save hooks to format buffer and add/delete imports.
;; Make sure you don't have other gofmt/goimports hooks enabled.
(defun lsp-go-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)
;; Optional - provides fancier overlays.
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode)
;; Company mode is a standard completion package that works well with lsp-mode.
(use-package company
:ensure t
:config
;; Optionally enable completion-as-you-type behavior.
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 1))
;; Optional - provides snippet support.
(use-package yasnippet
:ensure t
:commands yas-minor-mode
:hook (go-mode . yas-minor-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment