aboutsummaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-02 11:06:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-03 09:59:37 +0200
commit87c7258ccc683965d2b6a5190f1e98d74c8d25d3 (patch)
tree7d8dfbe8efe4f23f9d6848c19be9e55e2bbb58b3 /config.def.h
parent860ad58af0e1c39d5ffda0474ed3c58aaa1ecca5 (diff)
downloadvis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.gz
vis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.xz
Add :show command to display special symbols for whitespaces
Enable/disable by setting to 0/1 respectively: :set show spaces=0 tabs=0 newlines=1
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 9d491a0..dff70d5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -827,6 +827,11 @@ enum {
COLOR_COMMENT = COLOR_SYNTAX7,
COLOR_IDENTIFIER = COLOR_SYNTAX8,
COLOR_TYPE = COLOR_SYNTAX9,
+ COLOR_WHITESPACE = COLOR_COMMENT,
+ COLOR_SPACES = COLOR_WHITESPACE,
+ COLOR_TABS = COLOR_WHITESPACE,
+ COLOR_EOL = COLOR_WHITESPACE,
+ COLOR_EOF = COLOR_WHITESPACE,
};
static Color colors[] = {
@@ -894,6 +899,12 @@ static Color colors[] = {
&colors[COLOR_PREPROCESSOR], \
}
+#define SYNTAX_SPACES { "\xC2\xB7", &colors[COLOR_SPACES] }
+#define SYNTAX_TABS { "\xE2\x96\xB6", &colors[COLOR_TABS] }
+#define SYNTAX_TABS_FILL { " ", &colors[COLOR_TABS] }
+#define SYNTAX_EOL { "\xE2\x8F\x8E", &colors[COLOR_EOL] }
+#define SYNTAX_EOF { "~", &colors[COLOR_EOF] }
+
/* these rules are applied top to bottom, first match wins. Therefore more 'greedy'
* rules such as for comments should be the first entries.
*
@@ -905,8 +916,16 @@ static Syntax syntaxes[] = {{
.settings = (const char*[]){
"set number",
"set autoindent",
+ "set show spaces=0 tabs=1 newlines=1",
NULL
},
+ .symbols = {
+ SYNTAX_SPACES,
+ SYNTAX_TABS,
+ SYNTAX_TABS_FILL,
+ SYNTAX_EOL,
+ SYNTAX_EOF,
+ },
.rules = {
SYNTAX_MULTILINE_COMMENT,
SYNTAX_SINGLE_LINE_COMMENT,