From 6c77cde8c2be0fd0216915f09d601115dd1a053a Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 18 Dec 2020 23:49:12 -0500 Subject: Add :RFC vim command to view IETF RFCs This sets iskeyword so that ^] will work for the kinds of tags generated by rfctags.pl, and keywordprg so that K on another RFC number will view that one. It also binds gO to jump to the table of contents of the RFC. --- home/.config/nvim/init.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'home/.config/nvim') diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 9245ccf4..d4bad8eb 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -35,3 +35,8 @@ nmap a m':0/^#include <:nohlsearchO#include < nmap l :0read ~/src/etc/agpl.c'' nmap L :0read ~/src/etc/gpl.c'' nmap d :0delete:0read !date +'.Dd \%B \%e, \%Y' + +command! -nargs=1 RFC :silent noswapfile view ~/src/rfc/rfc.txt.gz +autocmd BufRead rfc*.txt.gz + \ setlocal keywordprg=:RFC iskeyword=a-z,A-Z,48-57,.,-,[,] | + \ nmap gO :call search('^Table of Contents', 'bcs') -- cgit 1.4.1