- Emacs
Full-blown stand-alone applications inside Emacs.
Don’t spam channels with joins/parts.
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
Of course give server buffers proper names…
(setq erc-rename-buffers t)
Highlight nicknames with unique colors.
(use-package erc-hl-nicks)
Will configure proper notifications some day, for now this is just channel tracking.
Channel tracking is enabled by default. Let’s just ignore some noise.
(setq erc-track-exclude-server-buffer t
erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
"324" "329" "332" "333" "353" "477")
erc-track-shorten-start 3
erc-track-visibility 'selected-visible)
Auto reconnect is quite troublesome. It would be great if ERC could watch for network status changes, disconnect when the network goes down, and reconnect once it comes back up. Could be done through NetworkManager’s D-Bus interface.
(setq erc-server-auto-reconnect nil)
Integrate with ZNC.
(use-package znc
:init
(setq znc-detatch-on-kill nil))
Actual account configuration should be in scratch.el.
Archive nothing, it’s on the server.
(setq gnus-message-archive-group nil)
Group by topic.
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
Add BBDB for contact management.
(use-package bbdb
:config
(bbdb-initialize 'gnus 'message)
(bbdb-mua-auto-update-init 'gnus 'message))
(setq org-agenda-files `(,org-directory))
(use-package org-indent
:diminish org-indent-mode
:init
(setq org-startup-indented t))
(setq org-default-notes-file
(expand-file-name "notes.org" org-directory))
(setq org-src-fontify-natively t
org-src-tab-acts-natively t)
(use-package toc-org
:hook
(org-mode . toc-org-enable))
Better defaults for core Emacs things.
Like shorter yes-or-no prompts.
(defalias 'yes-or-no-p 'y-or-n-p)
And don’t leave backup files lying around, I have no use for them.
(setq auto-save-default nil) ; #* files
(setq make-backup-files nil) ; *~ files
Use regexp search by default.
(define-key global-map (kbd "C-r") 'isearch-backward-regexp)
(define-key global-map (kbd "C-s") 'isearch-forward-regexp)
Some more unrelated settings–
(setq echo-keystrokes 0.1
inhibit-startup-screen t
initial-major-mode 'emacs-lisp-mode
scroll-conservatively 100
uniquify-buffer-name-style 'forward
mouse-yank-at-point t)
Use Ibuffer.
(define-key global-map (kbd "C-x C-b") 'ibuffer)
Easily jump to scratch buffer for current major mode.
(use-package scratch)
Include current buffer name in frame title.
(setq frame-title-format
(concat "%b" " - " (invocation-name) "@" (system-name)))
(use-package linum-mode
:hook prog-mode)
Show also the column number besides the line number in mode line.
(setq column-number-mode t)
Pretty pretty spaceline.
(use-package spaceline
:config
(require 'spaceline-config)
(spaceline-spacemacs-theme)
(spaceline-toggle-buffer-encoding-abbrev-off)
(spaceline-toggle-buffer-size-off)
(spaceline-toggle-hud-off))
Use anzu to show search status.
(use-package anzu
:diminish anzu-mode
:bind
(("M-%" . 'anzu-query-replace)
("C-M-%" . 'anzu-query-replace-regexp))
:config
(global-anzu-mode))
(use-package helm
:diminish helm-mode
:bind
(("C-h a" . 'helm-apropos)
("C-x C-f" . 'helm-find-files)
("C-x C-m" . 'helm-M-x)
("C-x b" . 'helm-mini)
("M-x" . 'helm-M-x)
("M-y" . 'helm-show-kill-ring)
:map helm-map
("<tab>" . 'helm-execute-persistent-action)
("C-i" . 'helm-execute-persistent-action)
("C-z" . 'helm-select-action))
:init
(setq helm-split-window-default-side 'same)
:config
(require 'helm-config)
(helm-mode))
Also throw in helm-descbinds:
(use-package helm-descbinds
:config
(helm-descbinds-mode))
(use-package cyberpunk-theme
:config
(load-theme 'cyberpunk t))
No, please, and thank you.
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
Nicely allow for undoing window configuration changes.
(winner-mode)
Faster window switching.
(define-key global-map (kbd "<C-tab>") 'other-window)
Try to establish with Emacs an understanding, that windows must not be disturbed?
(setq display-buffer-base-action '(display-buffer-same-window))
That goes for you too, Org Mode!
(setq org-src-window-setup 'current-window)
I just want a global zoom, why so difficult?
(use-package default-text-scale
:init
(setq default-text-scale-amount 10)
:bind
(("C-+" . 'default-text-scale-increase)
("C--" . 'default-text-scale-decrease)
("C-0" . 'default-text-scale-reset))
:config
(default-text-scale-mode))
Need to define our own reset function–
(defvar default-text-scale-default-height 90)
(defun default-text-scale-reset ()
(interactive)
(default-text-scale-increment
(- default-text-scale-default-height
(face-attribute 'default :height))))
(electric-pair-mode)
(use-package company
:diminish company-mode
:init
(setq company-idle-delay 0.1
company-minimum-prefix-length 2
company-selection-wrap-around t)
:config
(global-company-mode))
(use-package helm-company
:after company
:bind
(:map company-mode-map
("C-:" . 'helm-company)
:map company-active-map
("C-:" . 'helm-company)))
(add-hook 'prog-mode-hook (lambda () (setq fill-column 80)))
(add-hook 'text-mode-hook (lambda () (setq fill-column 72)))
Always highlight matching parens.
(show-paren-mode)
Highlight current line.
(use-package hl-line
:hook
((prog-mode text-mode) . hl-line-mode))
Also highlight surrounding parentheses.
(use-package highlight-parentheses
:diminish highlight-parentheses-mode
:hook
((emacs-lisp-mode lisp-mode) . highlight-parentheses-mode)
:init
(setq hl-paren-colors '("#2aa198"
"#b58900"
"#268bd2"
"#6c71c4"
"#859900"
"#b58900"
"#268bd2"
"#6c71c4"
"#859900")))
Highlight regions affected by undo, yank, kill, and some others.
(use-package volatile-highlights
:diminish volatile-highlights-mode
:custom-face
(vhl/default-face ((t (:background "#077f07"))))
:config
(volatile-highlights-mode))
(setq standard-indent 2)
(setq-default indent-tabs-mode nil)
Try to be smart about file local indentation styles.
(use-package dtrt-indent
:diminish dtrt-indent-mode
:config
(dtrt-indent-global-mode))
Recognize subwords.
(use-package subword
:diminish subword-mode
:config
(global-subword-mode))
(use-package ace-jump-mode
:init
(setq ace-jump-mode-scope 'window)
:bind
(("C-c SPC" . ace-jump-mode)))
Define a special Ace Jump command to jump to parens.
(defun ace-jump-parentheses ()
(interactive)
(ace-jump-char-mode ?\())
(define-key emacs-lisp-mode-map (kbd "C-c SPC") 'ace-jump-parentheses)
(define-key lisp-mode-map (kbd "C-c SPC") 'ace-jump-parentheses)
(use-package multiple-cursors
:bind
(("C-S-c C-S-c" . 'mc/edit-lines)
("C->" . 'mc/mark-next-like-this)
("C-<" . 'mc/mark-previous-like-this)
("C-c C-<" . 'mc/mark-all-like-this)))
(use-package expand-region
:bind
(("C-=" . 'er/expand-region)))
(use-package paredit
:diminish paredit-mode
:hook ((emacs-lisp-mode lisp-mode) . paredit-mode))
(use-package yasnippet
:diminish yas-minor-mode
:config
(yas-global-mode))
(use-package undo-tree
:diminish undo-tree-mode
:config
(global-undo-tree-mode))
(use-package whitespace
:diminish whitespace-mode
:init
(setq whitespace-line-column 80 ; use fill-column
whitespace-style
'(face trailing lines-tail empty tabs tab-mark))
:hook
(prog-mode . whitespace-mode)
:custom-face
(whitespace-trailing ((t (:background "#f00")))))
Let’s not litter dired buffers everywhere; reuse current buffer.
(use-package dired-single
:after dired
:config
(define-key dired-mode-map [return] 'dired-single-buffer)
(define-key dired-mode-map [mouse-1] 'dired-single-buffer-mouse)
(define-key dired-mode-map "^"
(function
(lambda () (interactive) (dired-single-buffer "..")))))
Might have issues cleaning up its locks. See–
(use-package dired-k
:init
(add-hook 'dired-after-readin-hook #'dired-k-no-revert)
(add-hook 'dired-initial-position-hook 'dired-k)
:config
(define-key dired-mode-map (kbd "g") 'dired-k))
(use-package dired-subtree
:init
(define-key dired-mode-map (kbd "TAB") 'dired-subtree-toggle))
(setq tramp-default-method "ssh")
Popup possible completions for incomplete key commands.
(use-package which-key
:diminish which-key-mode
:config
(which-key-mode))
(use-package c-eldoc
:diminish eldoc-mode
:hook
((c-mode c++-mode) . c-turn-on-eldoc-mode))
(use-package coffee-mode
:init
(setq coffee-tab-width 2))
(use-package eldoc
:diminish eldoc-mode
:hook
(lisp-mode . eldoc-mode))
(use-package slime
:init
(setq inferior-lisp-program "/usr/bin/sbcl")
:bind
(:map slime-prefix-map
("M-h" . 'slime-documentation-lookup))
:config
(add-to-list 'slime-contribs 'slime-fancy)
(slime-setup))
(use-package slime-company
:after slime
:config
(add-to-list 'slime-contribs 'slime-company)
(slime-setup))
(use-package dockerfile-mode)
Make emacs-lisp-mode behave more like we’re used to from lisp-mode.
(define-key emacs-lisp-mode-map (kbd "C-c C-c") 'eval-defun)
(define-key emacs-lisp-mode-map (kbd "C-c C-k") 'eval-buffer)
Along with SLIME navigation.
(use-package elisp-slime-nav
:diminish elisp-slime-nav-mode
:hook
(emacs-lisp-mode . elisp-slime-nav-mode))
(use-package eldoc
:diminish eldoc-mode
:hook
(emacs-lisp-mode . eldoc-mode))
(use-package feature-mode)
(use-package haml-mode)
(use-package web-mode
:init
(setq web-mode-block-padding 2
web-mode-script-padding 2
web-mode-style-padding 2)
:mode
("\\.[agj]sp\\'"
"\\.as[cp]x\\'"
"\\.djhtml\\'"
"\\.erb\\'"
"\\.html?\\'"
"\\.mustache\\'"
"\\.phtml\\'"
"\\.tpl\\.php\\'"))
(use-package js2-mode
:init
(setq js2-strict-missing-semi-warning nil
js2-strict-trailing-comma-warning nil)
:interpreter "node"
:mode "\\.js\\'")
Use rjsx-mode for this, for now. Works better than js2-jsx-mode.
(use-package rjsx-mode :mode "\\.jsx\\'")
(use-package json-mode)
(use-package lua-mode
:interpreter "lua"
:mode "\\.lua\\'")
(defalias 'perl-mode 'cperl-mode)
(use-package ruby-mode
:mode
("Capfile\\'"
"Gemfile\\'"
"Guardfile\\'"
"Rakefile\\'"
"\\.rake\\'"
"config\\.ru\\'"))
(use-package bundler)
(use-package projectile-rails
:diminish projectile-rails-mode
:config
(projectile-rails-global-mode))
(use-package robe
:diminish robe-mode
:hook
(ruby-mode . robe-mode)
:config
(with-eval-after-load 'company
(add-to-list 'company-backends 'company-robe)))
(use-package rspec-mode
:config
(rspec-install-snippets))
(use-package rubocop
:hook (ruby-mode . rubocop-mode))
(setq sh-basic-offset 2)
(setq sh-indentation 2)
(use-package slim-mode)
(use-package yaml-mode
:mode "\\.yml\\'")
(use-package projectile
:bind-keymap
("C-c p" . projectile-command-map)
:config
(projectile-mode))
Definitely use with Helm.
(use-package helm-projectile
:config
(helm-projectile-on))
Remember things.
(savehist-mode)
(toggle-save-place-globally)
(use-package flycheck
:diminish flycheck-mode
:init
(setq flycheck-indication-mode nil)
:config
(global-flycheck-mode))
(use-package git-timemachine)
(use-package git-gutter-fringe
:diminish git-gutter-mode
:config
(global-git-gutter-mode)
(fringe-helper-define 'git-gutter-fr:added nil
".XXXXXX."
"XX....XX"
"X......X"
"X......X"
"XXXXXXXX"
"XXXXXXXX"
"X......X"
"X......X")
(fringe-helper-define 'git-gutter-fr:deleted nil
"XXXXXX.."
"XX....X."
"XX.....X"
"XX.....X"
"XX.....X"
"XX.....X"
"XX....X."
"XXXXXX..")
(fringe-helper-define 'git-gutter-fr:modified nil
"XXXXXXXX"
"X..XX..X"
"X..XX..X"
"X..XX..X"
"X..XX..X"
"X..XX..X"
"X..XX..X"
"X..XX..X"))
(use-package magit
:config
(define-key magit-mode-map [C-tab] nil))
(use-package git-link
:init
(setq git-link-open-in-browser t))