Skip to content

syusui-s/scrapbox-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scrapbox-vim

image

機能

  • ファイルタイプ検知 (.scrapbox)
  • Syntax highlight

必要要件

filetype plugin on

インストール方法

runtimepathに加えるか、各種プラグイン管理ツールを使用してください。

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'

オススメ設定

インデント表示

インデント可視化プラグインを導入しておくと、リストが見やすくなります。

context_filetype 設定例

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

ライセンス

CC0
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: 日本.

Releases

No releases published

Packages

No packages published