Make aliases executable.
Add separate wf function for wiki work.
This commit is contained in:
parent
3627eac40d
commit
bcc462e5d2
|
@ -4,14 +4,17 @@ function fin {
|
||||||
find -iname "*$@*"
|
find -iname "*$@*"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ws {
|
function wf {
|
||||||
if [[ "$@" != "" ]]; then
|
if [[ "$@" != "" ]]; then
|
||||||
local fzf_args="-q $@"
|
local fzf_args="-q $@"
|
||||||
fi
|
fi
|
||||||
# fd --type f --search-path ~/wiki -x cat | grep -v "^ *$" | \fzf $fzf_args
|
echo ~/wiki/"$(rg --with-filename --no-heading . ~/wiki | sed 's@/home/sage/wiki/@@' | fzf $fzf_args -1 --preview='bat ~/wiki/$(echo {} | sed "s/:.*//")' | sed 's/:.*//')"
|
||||||
local filename="$(rg --with-filename --no-heading . ~/wiki | sed 's@/home/sage/wiki/@@' | fzf $fzf_args -1 --preview='bat ~/wiki/$(echo {} | sed "s/:.*//")' | sed 's/:.*//')"
|
}
|
||||||
|
|
||||||
|
function ws {
|
||||||
|
local filename="$(wf $@)"
|
||||||
if [[ "$filename" != "" ]]; then
|
if [[ "$filename" != "" ]]; then
|
||||||
vim ~/wiki/$filename
|
vim $filename
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,3 +103,7 @@ alias ls='ls --color=auto -F -w 80'
|
||||||
alias du='du -sh'
|
alias du='du -sh'
|
||||||
|
|
||||||
alias tags='ctags --exclude=node_modules -f newtags -R . && mv newtags tags'
|
alias tags='ctags --exclude=node_modules -f newtags -R . && mv newtags tags'
|
||||||
|
|
||||||
|
if [[ "$@" != "" ]]; then
|
||||||
|
$@
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue