Further configurations

This commit is contained in:
Wojciech Kozlowski 2017-08-28 22:19:38 +01:00
parent dffe201b1d
commit 15fac84de1
5 changed files with 73 additions and 6 deletions

View File

@ -23,7 +23,8 @@
expand-region
fill-column-indicator
volatile-highlights
undo-tree)
undo-tree
ws-butler)
)
@ -94,6 +95,9 @@
;; Kill line when calling kill-region without a selected region.
(whole-line-or-region-global-mode t)
;; `ws-butler' will cleanup whitespace on all modified files on save.
(ws-butler-global-mode)
;; --------------------------------------------------------------------------
;; Formatting
;; --------------------------------------------------------------------------
@ -108,6 +112,27 @@
;; Highlight lines that are too long in whitespace mode.
whitespace-line-column fill-column)
;; --------------------------------------------------------------------------
;; Completion help.
;; --------------------------------------------------------------------------
;; hippie-expand is a better version of dabbrev-expand.
(global-set-key (kbd "M-/") 'hippie-expand)
(setq-default
hippie-expand-try-functions-list
'(try-expand-dabbrev ;; Search current buffer.
try-expand-dabbrev-all-buffers ;; Search all other buffers.
try-expand-dabbrev-from-kill ;; Search the kill ring.
try-complete-file-name-partially ;; Complete text partially as file name.
try-complete-file-name ;; Complete text as file name.
try-expand-all-abbrevs ;; Expand according to all abbrev tables.
try-expand-list ;; Complete the current list to a list in the buffer.
try-expand-line ;; Complete the current line to a line in the buffer.
try-complete-lisp-symbol-partially ;; Complete partially as Elisp symbol.
try-complete-lisp-symbol) ;; Complete as Elisp symbol.
)
;; --------------------------------------------------------------------------
;; Commands.
;; --------------------------------------------------------------------------

View File

@ -17,7 +17,8 @@
(setq init-packages/emacs-packages
'(use-package)
'(use-package
ibuffer-vc)
)
@ -32,7 +33,7 @@
(setq-default scroll-preserve-screen-position 1)
;; --------------------------------------------------------------------------
;; Convenience functions.
;; Functions.
;; --------------------------------------------------------------------------
(defun quit-other-window ()
@ -89,6 +90,34 @@
(load-theme 'havoc-dark t)
(refresh-non-face-colours)))
;; --------------------------------------------------------------------------
;; Update buffers when files change.
;; --------------------------------------------------------------------------
(global-auto-revert-mode)
;; --------------------------------------------------------------------------
;; Configure `ibuffer'.
;; --------------------------------------------------------------------------
(add-hook 'ibuffer-hook
(lambda ()
(ibuffer-vc-set-filter-groups-by-vc-root)
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic))))
(setq ibuffer-formats
'((mark modified read-only vc-status-mini " "
(name 36 36 :left :elide)
" "
(size 9 -1 :right)
" "
(mode 16 16 :left :elide)
" "
(vc-status 16 16 :left)
" "
filename-and-process)))
;; --------------------------------------------------------------------------
;; Aliases.
;; --------------------------------------------------------------------------

View File

@ -80,7 +80,7 @@
(define-key smartparens-mode-map (kbd "C-<right>") 'sp-forward-slurp-sexp)
(define-key smartparens-mode-map (kbd "C-<left>") 'sp-forward-barf-sexp)
(define-key smartparens-mode-map (kbd "M-S-d") 'sp-splice-sexp)
(define-key smartparens-mode-map (kbd "M-D") 'sp-splice-sexp)
(define-key smartparens-mode-map (kbd "C-S-d") 'sp-splice-sexp-killing-forward)
(define-key smartparens-mode-map (kbd "C-M-<backspace>") 'sp-splice-sexp-killing-backward)
(define-key smartparens-mode-map (kbd "C-S-<backspace>") 'sp-splice-sexp-killing-around)
@ -105,7 +105,7 @@
(setq-default
;; Jump to closing parenthesis when closing symbol is typed.
sp-autoskip-closing-pair 'always
sp-autoskip-closing-pair t
;; Do not automatically reindent anything.
sp-navigate-reindent-after-up nil
sp-navigate-reindent-after-up-in-string nil

View File

@ -47,6 +47,19 @@
:init
(yas-global-mode 1))
;; --------------------------------------------------------------------------
;; Trailing whitespace.
;; --------------------------------------------------------------------------
;; The following setting of `show-trailing-whitespace' is incompatible with
;; fci-mode. The only known workaround is to have whitespace mode on with
;; whitespace-style set such that only trailing whitespace is shown. At the
;; moment, just rely on `ws-butler'.
;; (add-hook 'prog-mode-hook (lambda ()
;; (interactive)
;; (setq show-trailing-whitespace t)))
;; --------------------------------------------------------------------------
;; Automatically indent yanked text in programming mode.
;; --------------------------------------------------------------------------

View File

@ -138,7 +138,7 @@
`(highlight ((t (:background, *current-line*))))
`(highlight-face ((t (:background, *current-line*))))
`(vhl/default-face ((t (:background, *bg-2*))))
`(hl-line ((t (:background, *current-line* :underline t))))
`(hl-line ((t (:background, *current-line*))))
`(info-xref ((t (:foreground, *keywords* :underline t))))
`(Info-quoted ((t (:foreground, *keywords*))))
`(region ((t (:background, *visual-selection*))))