~benburwell/bootstrap

e51ab41915cb5d4c8d5a57fb1869ce568f71bfbd — Ben Burwell 10 months ago 04ea4d1 master
zsh: make the rfc cmd just launch the vim plugin
4 files changed, 4 insertions(+), 29 deletions(-)

A roles/bin/files/rfc
M roles/bin/tasks/main.yml
D roles/zsh/files/func_rfc.zsh
M roles/zsh/tasks/main.yml
A roles/bin/files/rfc => roles/bin/files/rfc +3 -0
@@ 0,0 1,3 @@
#!/bin/sh

nvim +":RFC $@"

M roles/bin/tasks/main.yml => roles/bin/tasks/main.yml +1 -0
@@ 39,6 39,7 @@
  - psqlenv
  - randombg
  - randword
  - rfc
  - rot13
  - setbg.sh
  - taf

D roles/zsh/files/func_rfc.zsh => roles/zsh/files/func_rfc.zsh +0 -28
@@ 1,28 0,0 @@
function rfc () {
	rfc_dir="/usr/local/share/doc/rfc"

	if [[ "$#" -eq "0" ]]; then
		cd "$rfc_dir"
		return
	fi

	if [[ "$1" -eq "search" ]]; then
		grep -irL "$2" "$rfc_dir" | xargs basename | less
		return
	fi

	if [[ "$#" -eq "1" && -f "$rfc_dir/rfc${1}.txt" ]]; then
		"$EDITOR" "$rfc_dir/rfc${1}.txt"
		return
	fi

	echo "Usage: $0"
	echo
	echo "    $0 search html"
	echo "        Search for 'html' in RFCs"
	echo
	echo "    $0 3966"
	echo "        open RFC 3966 in \$EDITOR ($EDITOR)"
	return 1
}


M roles/zsh/tasks/main.yml => roles/zsh/tasks/main.yml +0 -1
@@ 48,6 48,5 @@
  - ghclone
  - git-branches
  - prs
  - rfc
  - sheb
  - track