- ファイルタイプ検知 (.scrapbox)
- Syntax highlight
filetype plugin onruntimepathに加えるか、各種プラグイン管理ツールを使用してください。
Vim-plug:
Plug 'syusui-s/scrapbox-vim', { 'for': 'scrapbox' }
dein.vim:
call dein#add('syusui-s/scrapbox-vim')dein.vim(TOML):
[[plugins]]
repo = 'syusui-s/scrapbox-vim'
on_ft = 'scrapbox'インデント可視化プラグインを導入しておくと、リストが見やすくなります。
Shougo/context_filetype.vim: Context filetype library for Vim scriptの設定例です。
※ 私は osyo-manga/vim-precious: Vim constext filetypeと組み合わせて使っています
拡張子がそのままfiletypeとして使われる設定になっています。
let g:context_filetype#filetypes = {
  \   'scrapbox': [
  \     {
  \       'start' : '^\(\s*\)code:[^.]*\.\(\w\+\)',
  \       'end' : '^\1\(\s\)\@!',
  \       'filetype' : '\2',
  \     }
  \   ]
  \ }拡張子とファイルタイプのマップを用意して動的に生成することもできます。
let g:context_filetype#filetypes = {}
let filetype_map = {
  \ 'js': 'javascript',
  \ 'rs': 'rust',
  \ 'fs': 'fsharp',
  \ 'fsx': 'fsharp',
  \}
let scrapbox = []
for ext in keys(filetype_map)
  let def = {
    \   'start' : '^\(\s*\)code:[^.]*\.' . ext,
    \   'end' : '^\1\(\s\)\@!',
    \   'filetype' : filetype_map[ext],
    \ }
  call add(scrapbox, def)
endfor
let g:context_filetype#filetypes = {}
let g:context_filetype#filetypes['scrapbox'] = scrapbox
  
    
  To the extent possible under law,
  Syusui Moyatani
  has waived all copyright and related or neighboring rights to
  scrapbox-vim.
  This work is published from:
  日本.
