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
- Host: GitHub
- URL: https://github.com/syusui-s/scrapbox-vim
- Owner: syusui-s
- License: cc0-1.0
- Created: 2019-09-02T15:09:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-03T16:08:27.000Z (about 3 years ago)
- Last Synced: 2025-03-25T20:33:06.092Z (3 months ago)
- Topics: scrapbox, vim, vim-syntax
- Language: Vim script
- Homepage:
- Size: 13.7 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
scrapbox-vim
======
## 機能
* ファイルタイプ検知 (`.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)
endforlet 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:
日本.