An open API service indexing awesome lists of open source software.

https://github.com/syusui-s/scrapbox-vim

scrapbox syntax plugin for vim
https://github.com/syusui-s/scrapbox-vim

scrapbox vim vim-syntax

Last synced: about 2 months ago
JSON representation

scrapbox syntax plugin for vim

Awesome Lists containing this project

README

        

scrapbox-vim
======

![image](https://user-images.githubusercontent.com/1228033/165723282-124f4294-4f50-4eee-8bde-3edee215a7f5.png)

## 機能
* ファイルタイプ検知 (`.scrapbox`)
* Syntax highlight

## 必要要件

```vim
filetype plugin on
```

## インストール方法

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

Vim-plug:

```
Plug 'syusui-s/scrapbox-vim', { 'for': 'scrapbox' }
```

dein.vim:

```vim
call dein#add('syusui-s/scrapbox-vim')
```

dein.vim(TOML):

```toml
[[plugins]]
repo = 'syusui-s/scrapbox-vim'
on_ft = 'scrapbox'
```

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

* [Yggdroot/indentLine](https://github.com/Yggdroot/indentLine)
* [nathanaelkane/vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides)

### context_filetype 設定例
[Shougo/context_filetype.vim: Context filetype library for Vim script](https://github.com/Shougo/context_filetype.vim)の設定例です。

※ 私は [osyo-manga/vim-precious: Vim constext filetype](https://github.com/osyo-manga/vim-precious)と組み合わせて使っています

拡張子がそのままfiletypeとして使われる設定になっています。

```vim
let g:context_filetype#filetypes = {
\ 'scrapbox': [
\ {
\ 'start' : '^\(\s*\)code:[^.]*\.\(\w\+\)',
\ 'end' : '^\1\(\s\)\@!',
\ 'filetype' : '\2',
\ }
\ ]
\ }
```

拡張子とファイルタイプのマップを用意して動的に生成することもできます。

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