Quantcast
Channel: adrianlikins.com » fedora
Viewing all articles
Browse latest Browse all 3

git diff like highlighting of extra whitespace in vim and emacs

$
0
0

via Jim Meyering via coreutils list

Some configs for vim and emacs to show trailing whitespace and other whitespace anomalies.

vim config

let c_space_errors=1
highlight RedundantSpaces ctermbg=red guibg=red
match RedundantSpaces /\s\+$\| \+\ze\t/

Emacs needs the Whitespace mode from http://www.emacswiki.org/emacs/WhiteSpace

The default config is a bit overboard for me, so I use something more like:

;http://www.emacswiki.org/emacs/WhiteSpace
(require 'whitespace)
(autoload 'global-whitespace-mode "whitespace" "Toggle whitespace visualization." t)
(autoload 'global-whitespace-toggle-options "whitespace" "Toggle local `whitespace-mode' options." t)

;turn on the more or less git diff --color whitespace highlighting
(setq whitespace-space whitespace-style (quote (face tabs trailing space-before-tab newline empty space-after-tab indentation)))


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images