commit 1af6b74af6a02347071133c3301e100baf3b2909
parent c95204ff79d9e3f2b32c9de89d6f62edcdb9fff3
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 17 Nov 2020 08:13:24 +0100
.profile: add ot() to open tag in editor
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/.profile b/.profile
@@ -190,6 +190,14 @@ ctags_recurse() {
while read -r; do ctags -a "$REPLY"; done < "$f"
}
+ot() {
+ d="${1:-.}"
+ if ! test -r "${d}/tags"; then
+ ctags_recurse "${d}"
+ fi
+ vi -t "$(cat "${d}/tags" | fzy | cut -f 1)"
+}
+
addtopath() {
for d in "$@"; do
if [ -d "$d" ]; then