Skip to content

Instantly share code, notes, and snippets.

@yuya-matsushima
Last active December 10, 2015 00:39
Show Gist options
  • Save yuya-matsushima/4353064 to your computer and use it in GitHub Desktop.
Save yuya-matsushima/4353064 to your computer and use it in GitHub Desktop.
保存時に実行する末尾スペース削除処理のうち、Markdownだけ都合がわるいのでちょっと変える
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
@yuya-matsushima
Copy link
Author

Underlined にhighlightで色指定を入れておけば__って色付きで表示される。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment