Browse Source

Improved visual wrapping, mucked with indentation

master
Macoy Madson 4 years ago
parent
commit
ace576f307
  1. 36
      Emacs/emacsConfig.txt
  2. 1
      Emacs/emacsPackages.txt

36
Emacs/emacsConfig.txt

@ -52,7 +52,7 @@
;; Emacs Notes
;; C-h k <the keybind> to find what a key does
;; C-h b to list all bindings (should've used this more when fighting binds...)
;; C-q = quoted-insert "insert the next character, whatever it is" e.g. useful for inserting <tab>
;; Enable MELPA
(require 'package)
@ -148,10 +148,42 @@
;; powerline-vim-theme
;; powerline-nano-theme
;; Instead of wrapping at character, wrap at word. This slightly improves readability
(setq visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))
(global-visual-line-mode 1)
;; After wrapping, try to line up the text with the wrapped line column
(define-globalized-minor-mode my-global-adaptive-wrap-mode adaptive-wrap-prefix-mode
(lambda () (adaptive-wrap-prefix-mode 1)))
(my-global-adaptive-wrap-mode 1)
;; C indentation settings
;; bsd AKA Allman https://www.emacswiki.org/emacs/IndentingC
(setq c-default-style "bsd"
c-basic-offset 4)
c-basic-offset 4
tab-width 4
indent-tabs-mode t)
;; Doesn't quite work
;; (defun infer-indentation-style ()
;; ;; if our source file uses tabs, we use tabs, if spaces spaces, and if
;; ;; neither, we use the current indent-tabs-mode
;; (let ((space-count (how-many "^ " (point-min) (point-max)))
;; (tab-count (how-many "^\t" (point-min) (point-max))))
;; (if (> space-count tab-count)
;; ;; ((message "Indent using space")
;; (setq indent-tabs-mode nil))
;; (if (> tab-count space-count)
;; ;; ((message "Indent using tab")
;; (setq indent-tabs-mode t))))
;; (add-hook 'c-mode-common-hook
;; (lambda () (setq indent-tabs-mode nil)
;; (infer-indentation-style)))
;; (add-hook 'lisp-mode-hook
;; (lambda () (setq indent-tabs-mode nil)
;; (infer-indentation-style)))
;; Detect which indentation style a file is using and use that (doesn't work)
(setq dtrt-indent-mode 1)

1
Emacs/emacsPackages.txt

@ -27,3 +27,4 @@ ac-etags 20161001.807 installed etags/ctags completion so
xah-find 20180310.450 installed find replace in pure emacs lisp. Purpose similar to grep/sed.
yasnippet 20180412.1548 installed Yet another snippet extension for Emacs.
zenburn-theme 2.1 installed A low contrast color theme for Emacs.
adaptive-wrap

Loading…
Cancel
Save