You can install the support with Vundle with:
or by directly dropping the files named below under your
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/vundle'
let g:snipMate = {}
let g:snipMate.snippet_version = 1
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'ourbigbook/ourbigbook', {'rtp': 'vim'}
~/.vim/
, e.g. vim/syntax/ourbigbook.vim
The following support is provided:
- vim/syntax/ourbigbook.vim: syntax highlighting.As for other programming languages, this cannot be perfect without actually parsing, which would be slow for larger files.But even the imperfect approximation already covers a lot of the most cases.Notably it turns off spelling from parts of the document like URLs and code which would otherwise contain many false positive spelling errors.
- vim/snippets/ourbigbook.snippets: snippets for github.com/honza/vim-snippets, which you also have to install first for them to work.For example, with those snippets installed, you can easily create links to headers. Suppose you have:To create an cross reference to it you can:
= My long header
and it will automatically expand to:- copy
My long header
to the clipboard, see copy to clipboard shortcuts at: stackoverflow.com/questions/3961859/how-to-copy-to-clipboard-in-vim/67890119#67890119 - type
\x
and then hit tab
This provides a reasonable alternative for ID calculation, until a ctags-like setup gets implemented (never/browser editor with preview-only? ;-))\x[my-long-header]
Syntax highlighting can likely never be perfect without a full parser (which is slow), but even the imperfect approximate setup (as provided for most other languages) is already a huge usability improvement.We will attempt to err on the side of "misses some stuff but does not destroy the entire page below" whenever possible. - copy
- mappings:
<leader>f
, which usually means,f
(comma then F): start searching for a header in the current file. Does a regular/
search without opening any windows, to is it very ligthweight. Mnemonic: "Find".<leader>h
(requires Fugitive to be installed): sets up theObbGitGrep
command, which searches for header across all git tracked files in the current Git repository. After,g
you are left in the prompt with:so if you complete that by:ObbGitGrep
it will match headers that start withObbGitGrep animal kingdom
animal kingdoom
case insentively, e.g.:Vim regular expressions are accepted, e.g. if you don't want it to start with the search pattern:= Animal kingdom tree = Animal kingdom book
The command opens a new tab (technically a "Vim error window") containing all matches, where you can click Enter to open one of them.ObbGitGrep .*animal kingdom
Mnemonic: "Header search".
A simple way to develop is to edit the Vundle repository directly under
~/.vim/bundle/ourbigbook
.