Skip to content

Commit 2ba632a

Browse files
committed
vim: Turn "pub" into a big asterisk for those who dislike the look of it.
This is not the default and must be turned on.
1 parent 3a34c96 commit 2ba632a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/etc/vim/after/syntax/rust.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrow
2525

2626
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=
2727

28+
" For those who don't want to see `pub`...
29+
if exists('g:rust_conceal_pub')
30+
syn match rustPublicSigil contained "pu" conceal cchar=
31+
syn match rustPublicRest contained "b" conceal cchar= 
32+
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
33+
endif
34+
2835
hi link rustNiceOperator Operator
2936

3037
if !exists('g:rust_conceal_mod_path')

src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ syn match rustAssert "\<assert\(\w\)*"
1414
syn keyword rustKeyword again as break
1515
syn keyword rustKeyword const copy do drop else export extern fail
1616
syn keyword rustKeyword for if impl import in let log
17-
syn keyword rustKeyword loop match mod module move mut new of owned priv pub pure
17+
syn keyword rustKeyword loop match mod module move mut new of owned priv pure
18+
syn match rustKeyword "\<pub\>"
1819
syn keyword rustKeyword ref return static to unchecked
1920
syn match rustKeyword "\<unsafe\>" " Allows also matching unsafe::foo()
2021
syn keyword rustKeyword use while with

0 commit comments

Comments
 (0)