Browse Source

default.el: Cleanup pass; fix company-go

master
Johnathan C Maudlin 2 years ago
parent
commit
471dacc261
No account linked to committer's email address
1 changed files with 114 additions and 113 deletions
  1. 114
    113
      etc/emacs/default.el

+ 114
- 113
etc/emacs/default.el View File

@@ -5,26 +5,26 @@
;;;

;; Force using UTF-8
(setq prefer-coding-system 'utf-8
set-default-coding-systems 'utf-8
set-language-environment "UTF-8"
set-locale-environment "en_US.UTF-8")
(setq prefer-coding-system 'utf-8
set-default-coding-systems 'utf-8
set-language-environment "UTF-8"
set-locale-environment "en_US.UTF-8")

;; Load and set environment variables
(setenv "EDITOR" "emacsclient")
(setenv "GIT_EDITOR" "emacsclient")
(setenv "GOPATH" (getenv "GOPATH"))
(setenv "GOBIN" (getenv "GOBIN"))
(setenv "MANPATH" (getenv "MANPATH"))
(setenv "PATH" (getenv "PATH"))
(setenv "PROMPT_COMMAND" "")
(setenv "SHELL" (getenv "SHELL"))
(setenv "TERM" (getenv "TERM"))
(setenv "EDITOR" "emacsclient")
(setenv "GIT_EDITOR" "emacsclient")
(setenv "GOPATH" (getenv "GOPATH"))
(setenv "GOBIN" (getenv "GOBIN"))
(setenv "MANPATH" (getenv "MANPATH"))
(setenv "PATH" (getenv "PATH"))
(setenv "PROMPT_COMMAND" "")
(setenv "SHELL" (getenv "SHELL"))
(setenv "TERM" (getenv "TERM"))

;; Inhibit
(setq initial-scratch-message nil
inhibit-splash-screen t
inhibit-startup-buffer-menu t)
(setq initial-scratch-message nil
inhibit-splash-screen t
inhibit-startup-buffer-menu t)

;; Inhibit loading toolbars as early as possible
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
@@ -36,20 +36,20 @@
(set-face-attribute 'default nil :family "Monospace" :height 96)

;; Misc
(setq custom-file "~/.emacs.d/custom.el"
require-final-newline t
save-interprogram-paste-before-kill t
select-enable-primary nil
visible-bell nil)
(setq custom-file "~/.emacs.d/custom.el"
require-final-newline t
save-interprogram-paste-before-kill t
select-enable-primary nil
visible-bell nil)

;; Scrolling
(setq auto-window-vscroll nil
scroll-conservatively 101
scroll-margin 0
scroll-preserve-screen-position 1
scroll-step 1
scroll-up-aggressively 0.0
scroll-down-aggressively 0.0)
(setq auto-window-vscroll nil
scroll-conservatively 101
scroll-margin 0
scroll-preserve-screen-position 1
scroll-step 1
scroll-up-aggressively 0.0
scroll-down-aggressively 0.0)


;;;
@@ -71,21 +71,21 @@
(switch-to-next-buffer)))

;; Additional frame movement keys
(global-set-key (kbd "<M-down>") 'windmove-down)
(global-set-key (kbd "<M-left>") 'windmove-left)
(global-set-key (kbd "<M-right>") 'windmove-right)
(global-set-key (kbd "<M-up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)
(global-set-key (kbd "<M-down>") 'windmove-down)
(global-set-key (kbd "<M-left>") 'windmove-left)
(global-set-key (kbd "<M-right>") 'windmove-right)
(global-set-key (kbd "<M-up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)

;; Mouse
(setq mouse-wheel-follow-mouse 't
mouse-wheel-progressive-speed nil
mouse-wheel-scroll-amount '(1 ((shift) . 1))
mouse-yank-at-point t
xterm-mouse-mode t)
(setq mouse-wheel-follow-mouse 't
mouse-wheel-progressive-speed nil
mouse-wheel-scroll-amount '(1 ((shift) . 1))
mouse-yank-at-point t
xterm-mouse-mode t)

;; Set scroll "speed"
(global-set-key (kbd "<mouse-4>") (lambda() (interactive) (scroll-down-line 3)))
@@ -122,9 +122,9 @@
(require 'bind-key))

;; Configure use-package
(setq use-package-always-defer t
use-package-always-ensure t
use-package-check-before-init t)
(setq use-package-always-defer t
use-package-always-ensure t
use-package-check-before-init t)


;;;
@@ -143,13 +143,14 @@

(use-package company
:config
(add-hook 'lisp-mode-hook 'company-mode)
(add-hook 'prog-mode-hook 'company-mode)
(add-hook 'text-mode-hook 'company-mode)

(setq company-tooltip-limit 20
company-idle-delay 0.3
company-echo-delay 0
company-begin-commands '(self-insert-command)))
(setq company-tooltip-limit 20
company-idle-delay 0.3
company-echo-delay 0
company-begin-commands '(self-insert-command)))

(use-package counsel
:bind (("<f1> f" . counsel-describe-function)
@@ -171,17 +172,17 @@
("<f6>" . ivy-resume))
:config
(ivy-mode 1)
(setq ivy-use-virtual-buffers t
enable-recursive-minibuffers t))
(setq ivy-use-virtual-buffers t
enable-recursive-minibuffers t))

(use-package ibuffer
:bind (("C-x C-b" . ibuffer)
("<C-tab>" . next-buffer)
("<C-iso-lefttab>" . previous-buffer))
:config
(add-hook 'ibuffer-hook 'ibuffer-auto-mode)
(add-hook 'ibuffer-auto-mode-hook
(add-hook 'ibuffer-hook
(lambda()
(ibuffer-auto-mode)
(ibuffer-do-sort-by-alphabetic)
(ibuffer-do-sort-by-major-mode))))

@@ -189,9 +190,9 @@
:demand t
:config
(setq linum-delay t)
(add-hook 'lisp-mode-hook 'linum-mode)
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))
(add-hook 'lisp-mode-hook 'linum-mode)
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))

(use-package no-littering
:demand t
@@ -205,9 +206,9 @@
(use-package rainbow-delimiters
:demand t
:config
(add-hook 'markdown-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'text-mode-hook 'rainbow-delimiters-mode))
(add-hook 'markdown-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'text-mode-hook 'rainbow-delimiters-mode))

(use-package server
:demand t
@@ -237,13 +238,13 @@
(use-package smartparens
:demand t
:config
(add-hook 'markdown-mode-hook 'smartparens-mode)
(add-hook 'prog-mode-hook 'smartparens-mode)
(add-hook 'text-mode-hook 'smartparens-mode)
(add-hook 'markdown-mode-hook 'smartparens-mode)
(add-hook 'prog-mode-hook 'smartparens-mode)
(add-hook 'text-mode-hook 'smartparens-mode)

(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay nil
sp-highlight-wrap-tag-overlay nil))
(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay nil
sp-highlight-wrap-tag-overlay nil))

(use-package swiper
:bind ("C-s" . swiper))
@@ -272,21 +273,21 @@
(enable-circe-color-nicks)
(setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)

(if (file-directory-p "~/.emacs/var/circe")
nil
(make-directory "~/.emacs.d/var/circe"))
(setq circe-default-part-message ""
circe-default-quit-message ""
circe-format-server-topic "*** Topic: {userhost}: {topic-diff}"
circe-reduce-lurker-spam t
circe-use-cycle-completion t
lui-fill-type nil
lui-flyspell-alist '((".*" "american"))
lui-flyspell-p t
lui-logging-directory "~/.emacs.d/var/circe"
lui-time-stamp-format "%H:%M:%S"
lui-time-stamp-position 'left-margin)
;; (if (file-directory-p "~/.emacs/var/circe")
;; nil
;; (make-directory "~/.emacs.d/var/circe"))
(setq circe-default-part-message ""
circe-default-quit-message ""
circe-format-server-topic "*** Topic: {userhost}: {topic-diff}"
circe-reduce-lurker-spam t
circe-use-cycle-completion t
lui-fill-type nil
lui-flyspell-alist '((".*" "american"))
lui-flyspell-p t
lui-logging-directory "~/.emacs.d/var/circe"
lui-time-stamp-format "%H:%M:%S"
lui-time-stamp-position 'left-margin)

(defun my-circe-message-option-chanserv (nick user host command args)
(when (and (string= "ChanServ" nick)
@@ -300,39 +301,38 @@
'face 'circe-prompt-face) " "))))
(add-hook 'lui-mode-hook
(lambda()
(setq fringes-outside-margins t
left-margin-width 9
word-wrap t
wrap-prefix ""))))
(setq fringes-outside-margins t
left-margin-width 9
word-wrap t
wrap-prefix ""))))

(use-package elfeed
:bind ("C-x w" . elfeed)
:config
(setq elfeed-search-filter "@1-week-ago +unread "
url-queue-timeout 30)
(setq elfeed-search-filter "@1-week-ago +unread "
url-queue-timeout 30)
(if (file-exists-p "~/.emacs.d/elfeed.el")
(load-file "~/.emacs.d/elfeed.el")))

(use-package eshell
:demand t
:config
(setq eshell-cmpl-cycle-completions nil
eshell-error-if-no-glob t
eshell-hist-ignoredups t
eshell-history-size 4096
eshell-prefer-lisp-functions t
eshell-save-history-on-exit t
eshell-scroll-to-bottom-on-input nil
(setq eshell-cmpl-cycle-completions nil
eshell-error-if-no-glob t
eshell-hist-ignoredups t
eshell-history-size 4096
eshell-prefer-lisp-functions t
eshell-save-history-on-exit t
eshell-scroll-to-bottom-on-input nil
eshell-scroll-to-bottom-on-output nil
eshell-scroll-show-maximum-output nil
eshell-prompt-regexp "^[^#$\n]*[#$] "
eshell-prompt-regexp "^[^#$\n]*[#$] "
eshell-prompt-function
(lambda nil
(concat
"[" (user-login-name) "@" (system-name) " "
(if (string= (eshell/pwd) (getenv "HOME"))
"~" (eshell/basename (eshell/pwd))) "]"
(if (= (user-uid) 0) "# " "$ ")))
(lambda nil
(concat "[" (user-login-name) "@" (system-name) " "
(if (string= (eshell/pwd) (getenv "HOME"))
"~" (eshell/basename (eshell/pwd))) "]"
(if (= (user-uid) 0) "# " "$ ")))
eshell-visual-commands '("alsamixer" "atop" "htop" "less" "mosh"
"nano" "ssh" "tail" "top" "vi" "vim"
"watch"))
@@ -349,8 +349,8 @@
(use-package eww
:demand t
:config
(setq browse-url-browser-function 'eww-browse-url
shr-blocked-images "")
(setq browse-url-browser-function 'eww-browse-url
shr-blocked-images "")

(defun eww-toggle-images()
"Toggle blocking images in eww."
@@ -412,17 +412,17 @@
'("\\.h\\'" . c++-mode))))

;; Default indent
(setq c-basic-offset 2
column-number-mode t
cperl-indent-level 2
indent-tabs-mode nil
js-indent-level 2
tab-width 2
show-paren-delay 0)
(global-visual-line-mode t)
(show-paren-mode t)
(fset 'yes-or-no-p 'y-or-n-p)
(setq c-basic-offset 2
column-number-mode t
cperl-indent-level 2
indent-tabs-mode nil
js-indent-level 2
tab-width 2
show-paren-delay 0)
(global-visual-line-mode t)
(show-paren-mode t)
(fset 'yes-or-no-p 'y-or-n-p)

(use-package magit
:demand t)
@@ -508,6 +508,7 @@
(use-package gitconfig-mode)
(use-package gitignore-mode)

(use-package company-go :after (company))
(use-package go-mode
:config
(add-hook 'before-save-hook 'gofmt-before-save)
@@ -515,10 +516,10 @@
(lambda()
(setq tab-width 4
indent-tabs-mode 1)

(set (make-local-variable 'company-backends)
'(company-go))
(company-mode t))))
(use-package company-go :after (company go-mode))
;; (use-package go-eldoc
;; :after (go-mode)
;; :config (add-hook 'go-mode-hook 'go-eldoc-setup))

Loading…
Cancel
Save