mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 05:24:52 +00:00
fish search updates
This commit is contained in:
parent
454ceb7d7d
commit
6a47ffa024
@ -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;
|
||||
|
@ -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
|
||||
|
18
modules/shell/fish/functions/search-and-edit.fish
Normal file
18
modules/shell/fish/functions/search-and-edit.fish
Normal 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
|
@ -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
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user