fish search updates

This commit is contained in:
Noah Masur 2022-06-20 15:20:20 -04:00
parent 454ceb7d7d
commit 6a47ffa024
4 changed files with 32 additions and 1 deletions

View File

@ -51,6 +51,10 @@
description = "Open a recent file in Vim";
body = builtins.readFile ./functions/recent.fish;
};
search-and-edit = {
description = "Search and open the relevant file in Vim";
body = builtins.readFile ./functions/search-and-edit.fish;
};
syncnotes = {
description = "Full git commit on notes";
body = builtins.readFile ./functions/syncnotes.fish;

View File

@ -1,5 +1,7 @@
bind -M insert \co edit
bind -M default \co edit
bind -M insert \cs search-and-edit
bind -M default \cs search-and-edit
bind -M insert \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
bind -M default \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
bind -M insert \ce recent

View File

@ -0,0 +1,18 @@
set vimfile (
rg \
--color=always \
--line-number \
--no-heading \
--smart-case \
--iglob !/Library/** \
--iglob !/System/** \
--iglob "!Users/$HOME/Library/*" \
| fzf --ansi \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "vim $vimfile"
and commandline -f execute

View File

@ -9,7 +9,14 @@
projects = {
description = "Jump to a project";
body = ''
set projdir (ls ${config.homePath}/dev/personal | fzf)
set projdir ( \
fd \
--search-path $HOME \
--type directory \
--hidden \
--exclude ".local/**" \
"^.git\$" \
| fzf)
and cd ${config.homePath}/dev/personal/$projdir
and commandline -f execute
'';