LoginSignup
7
7

More than 5 years have passed since last update.

香り屋gvimでマークダウンのファイルをシンタックスハイライトする方法@Mac

Posted at

syntax 定義ファイルを持ってくる

syntax 定義ファイルを配置する

  • /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax 配下に配置する

配置したsyntax定義ファイルを読み込むようにする

  • :echo $VIMRUNTIMEして出るパス配下にftdetectディレクトリを作成

    /Applications/MacVim.app/Contents/Resources/vim/runtime/ftdetect

  • 上書き定義記載のvimファイル配置

/Applications/MacVim.app/Contents/Resources/vim/runtime/ftdetect/mkd.vim
" Markdown
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.md set filetype={syntax配下に配置したvimファイル名}

以上でmd形式のファイルを開いたときにハイライトされるようになる

その他

  • 無名ファイルにmkdを適用する
    set ft=mkd

Markdown Viewer @Web

Markdown Viewer @local

参考リンク


マークダウン記法チートシート

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7