summary refs log tree commit diff
path: root/doc/rfc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/rfc')
-rw-r--r--doc/rfc/Makefile10
-rw-r--r--doc/rfc/rfc.vim26
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/rfc/Makefile b/doc/rfc/Makefile
index a629782d..87462a6c 100644
--- a/doc/rfc/Makefile
+++ b/doc/rfc/Makefile
@@ -1,3 +1,5 @@
+PREFIX ?= ~/.local
+
 MODULE = ftp.rfc-editor.org::rfcs-text-only
 
 tags: rfctags.pl rfc-index.txt.gz
@@ -9,3 +11,11 @@ rfc-index.txt.gz:
 
 clean:
 	rm -f tags *.txt *.txt.gz
+
+install: tags rfc.vim
+	install -d ${PREFIX}/share/rfc ${PREFIX}/share/nvim/site/plugin
+	ln -f tags *.txt.gz ${PREFIX}/share/rfc
+	install -m 644 rfc.vim ${PREFIX}/share/nvim/site/plugin
+
+uninstall:
+	rm -fr ${PREFIX}/share/rfc ${PREFIX}/share/nvim/site/plugin/rfc.vim
diff --git a/doc/rfc/rfc.vim b/doc/rfc/rfc.vim
new file mode 100644
index 00000000..56d2085c
--- /dev/null
+++ b/doc/rfc/rfc.vim
@@ -0,0 +1,26 @@
+if !exists('g:rfc_path')
+	let g:rfc_path = expand('<sfile>:h:h:h:h') . '/rfc'
+endif
+
+function! s:RFC(number)
+	let number = (empty(a:number) ? '-index' : str2nr(a:number, 10))
+	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
> 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe