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 "*$@*"
|
||||
}
|
||||
|
||||
function ws {
|
||||
function wf {
|
||||
if [[ "$@" != "" ]]; then
|
||||
local fzf_args="-q $@"
|
||||
fi
|
||||
# fd --type f --search-path ~/wiki -x cat | grep -v "^ *$" | \fzf $fzf_args
|
||||
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/:.*//')"
|
||||
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/:.*//')"
|
||||
}
|
||||
|
||||
function ws {
|
||||
local filename="$(wf $@)"
|
||||
if [[ "$filename" != "" ]]; then
|
||||
vim ~/wiki/$filename
|
||||
vim $filename
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -100,3 +103,7 @@ alias ls='ls --color=auto -F -w 80'
|
|||
alias du='du -sh'
|
||||
|
||||
alias tags='ctags --exclude=node_modules -f newtags -R . && mv newtags tags'
|
||||
|
||||
if [[ "$@" != "" ]]; then
|
||||
$@
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue