Last active
December 10, 2015 00:39
-
-
Save yuya-matsushima/4353064 to your computer and use it in GitHub Desktop.
保存時に実行する末尾スペース削除処理のうち、Markdownだけ都合がわるいのでちょっと変える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! RTrim() | |
let s:cursor = getpos(".") | |
if &filetype == "markdown" | |
%s/\s\+\(\s\{2}\)$/\1/e | |
match Underlined /\s\{2}/ | |
else | |
%s/\s\+$//e | |
endif | |
call setpos(".", s:cursor) | |
endfunction |
Underlined にhighlightで色指定を入れておけば__って色付きで表示される。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
markdownの場合、保存時に無駄なスペースを削除しつつ、スペース2つ(markdownの改行相当)には下線をつけるように色指定を入れる。