Skip to content

Commit bf17c96

Browse files
davidstosiklukas-reineke
authored andcommitted
feat!: Use a more commonly supported characters for fat headline
## What This commit replaces the character `🬂` ([Block Sextant-12 (U+1FB02)](https://unicodeplus.com/U+1FB02)) with `▀` ([Upper Half Block (U+2580)](https://unicodeplus.com/U+2580)) to be used for the `fat_headline_lower_string` configuration everywhere. ## Why The _Block Sextant-12_ character is part of a Unicode block named [_Symbols for Legacy Computing_](https://en.wikipedia.org/wiki/Symbols_for_Legacy_Computing). This character seems to not be supported by a lot of fonts and many terminals, as well as other applications (one might even see a "missing character" square while browsing this PR and links I provided). I have for example confirmed that it would not work with the following: - Terminal apps: - macOS' Terminal.app - iTerm2 - Alacritty with `builtin_box_drawing` set to `false` - Fonts: - Monaco - MonaspiceNe Nerd Font - SFMono Nerd Font _Upper Half Block_ is slightly thicker than _Block Sextant-12_, but it also appears to be more widely supported accross terminals and fonts. I think a default configuration that will work in most environments would provide a better user experience, and would likely prevent many developers from spending hours diving into the unknown territories of font rendering, Unicode blocks, NeoVim LUA configuration, etc. ## How A simple script that replaces all instances of the _Block Sextant-12_ character in the repository: ```sh ag -l \U0001fb02 | xargs -n1 sed -i'' -e "s/\U0001fb02/▀/" ``` ## Anything else? ### Alternative An alternative to _Upper Half Block_ would be the thinner `▔` ([Upper One Eighth Block (U+2594)](https://unicodeplus.com/U+2594)). ### Matching "lower" and "upper" If it is important for the width of the fat headline top and bottom padding be identical, then we could also change `fat_headline_upper_string` to use a character of the same width. Respectively, in order of appearance above: - `▄` ([Lower Half Block (U+2584)](https://unicodeplus.com/U+2584)) - `▁` ([Lower One Eighth Block (U+2581)](https://unicodeplus.com/U+2581))
1 parent c19bbff commit bf17c96

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ require("headlines").setup {
114114
quote_highlight = "Quote",
115115
quote_string = "",
116116
fat_headlines = true,
117-
fat_headline_upper_string = "",
118-
fat_headline_lower_string = "🬂",
117+
fat_headline_upper_string = "",
118+
fat_headline_lower_string = "",
119119
},
120120
rmd = {
121121
query = vim.treesitter.parse_query(
@@ -157,8 +157,8 @@ require("headlines").setup {
157157
quote_highlight = "Quote",
158158
quote_string = "",
159159
fat_headlines = true,
160-
fat_headline_upper_string = "",
161-
fat_headline_lower_string = "🬂",
160+
fat_headline_upper_string = "",
161+
fat_headline_lower_string = "",
162162
},
163163
norg = {
164164
query = vim.treesitter.parse_query(
@@ -206,8 +206,8 @@ require("headlines").setup {
206206
quote_highlight = "Quote",
207207
quote_string = "",
208208
fat_headlines = true,
209-
fat_headline_upper_string = "",
210-
fat_headline_lower_string = "🬂",
209+
fat_headline_upper_string = "",
210+
fat_headline_lower_string = "",
211211
},
212212
org = {
213213
query = vim.treesitter.parse_query(
@@ -248,8 +248,8 @@ require("headlines").setup {
248248
quote_highlight = "Quote",
249249
quote_string = "",
250250
fat_headlines = true,
251-
fat_headline_upper_string = "",
252-
fat_headline_lower_string = "🬂",
251+
fat_headline_upper_string = "",
252+
fat_headline_lower_string = "",
253253
},
254254
}
255255
```

doc/headlines.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ Default config: >
133133
quote_highlight = "Quote",
134134
quote_string = "┃",
135135
fat_headlines = true,
136-
fat_headline_upper_string = "",
137-
fat_headline_lower_string = "🬂",
136+
fat_headline_upper_string = "",
137+
fat_headline_lower_string = "",
138138
},
139139
rmd = {
140140
query = vim.treesitter.parse_query(
@@ -176,8 +176,8 @@ Default config: >
176176
quote_highlight = "Quote",
177177
quote_string = "┃",
178178
fat_headlines = true,
179-
fat_headline_upper_string = "",
180-
fat_headline_lower_string = "🬂",
179+
fat_headline_upper_string = "",
180+
fat_headline_lower_string = "",
181181
},
182182
norg = {
183183
query = vim.treesitter.parse_query(
@@ -225,8 +225,8 @@ Default config: >
225225
quote_highlight = "Quote",
226226
quote_string = "┃",
227227
fat_headlines = true,
228-
fat_headline_upper_string = "",
229-
fat_headline_lower_string = "🬂",
228+
fat_headline_upper_string = "",
229+
fat_headline_lower_string = "",
230230
},
231231
org = {
232232
query = vim.treesitter.parse_query(
@@ -267,8 +267,8 @@ Default config: >
267267
quote_highlight = "Quote",
268268
quote_string = "┃",
269269
fat_headlines = true,
270-
fat_headline_upper_string = "",
271-
fat_headline_lower_string = "🬂",
270+
fat_headline_upper_string = "",
271+
fat_headline_lower_string = "",
272272
},
273273
}
274274

lua/headlines/init.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ M.config = {
5656
quote_highlight = "Quote",
5757
quote_string = "",
5858
fat_headlines = true,
59-
fat_headline_upper_string = "",
60-
fat_headline_lower_string = "🬂",
59+
fat_headline_upper_string = "",
60+
fat_headline_lower_string = "",
6161
},
6262
rmd = {
6363
query = parse_query_save(
@@ -99,8 +99,8 @@ M.config = {
9999
quote_highlight = "Quote",
100100
quote_string = "",
101101
fat_headlines = true,
102-
fat_headline_upper_string = "",
103-
fat_headline_lower_string = "🬂",
102+
fat_headline_upper_string = "",
103+
fat_headline_lower_string = "",
104104
},
105105
norg = {
106106
query = parse_query_save(
@@ -148,8 +148,8 @@ M.config = {
148148
quote_highlight = "Quote",
149149
quote_string = "",
150150
fat_headlines = true,
151-
fat_headline_upper_string = "",
152-
fat_headline_lower_string = "🬂",
151+
fat_headline_upper_string = "",
152+
fat_headline_lower_string = "",
153153
},
154154
org = {
155155
query = parse_query_save(
@@ -190,8 +190,8 @@ M.config = {
190190
quote_highlight = "Quote",
191191
quote_string = "",
192192
fat_headlines = true,
193-
fat_headline_upper_string = "",
194-
fat_headline_lower_string = "🬂",
193+
fat_headline_upper_string = "",
194+
fat_headline_lower_string = "",
195195
},
196196
}
197197

0 commit comments

Comments
 (0)