summary refs log tree commit diff
path: root/doc/rfc/rfc.vim
blob: 2455d8a68ce4c8ddb58cb2d88df5b07277dd8753 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
if !exists('g:rfc_path')
	let g:rfc_path = expand('<sfile>:h:h:h:h') . '/rfc'
endif

function! s:RFC(number)
	if !empty(a:number)
		let number = str2nr(matchstr(a:number, '\d\+'), 10)
	else
		let number = '-index'
	endif
	let path = expand(g:rfc_path . '/rfc' . number . '.txt.gz')
	if filereadable(path)
		execute 'silent' 'noswapfile' 'view' path
	else
		echohl ErrorMsg | echo 'No such RFC' a:number | echohl None
	endif
endfunction

function! s:BufRead()
	setlocal readonly
	setlocal keywordprg=:RFC
	setlocal iskeyword=a-z,A-Z,48-57,.,[,],-,_
	nmap <buffer> <silent> gO :call search('^Table of Contents', 'bcs')<CR>
endfunction

command! -bar -nargs=? RFC call s:RFC(<q-args>)
augroup RFC
	autocmd!
	autocmd BufRead rfc*.txt.gz call s:BufRead()
augroup END
'>2020-02-26Add Fierce Femmes and Notorious LiarsJune McEnroe 2020-02-23Add This Is How You Lose the Time WarJune McEnroe 2020-02-22Add See Ya LaterJune McEnroe 2020-02-20Remove wiki scriptJune McEnroe 2020-02-19Add The Obelisk GateJune McEnroe 2020-02-17Add Four Tet — HandsJune McEnroe 2020-02-12Simplify macOS notify-sendJune McEnroe 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe 2020-01-28Change scout sensitivity to 1.4June McEnroe 2020-01-28Import shows.txtJune McEnroe