aboutsummaryrefslogtreecommitdiffhomepage
path: root/home-manager/config
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-02-25 23:33:43 +0900
committernsfisis <nsfisis@gmail.com>2025-02-25 23:33:43 +0900
commit7a886767262625d44bd03010d14011ea9d080dff (patch)
tree3c43f72cd16af214ebcd1f7e4e23313955d02a53 /home-manager/config
parent5b678d74a5eca96ad535a26713b475011a7da044 (diff)
downloaddotfiles-7a886767262625d44bd03010d14011ea9d080dff.tar.gz
dotfiles-7a886767262625d44bd03010d14011ea9d080dff.tar.zst
dotfiles-7a886767262625d44bd03010d14011ea9d080dff.zip
fish: make `ee` put selected files on history
Diffstat (limited to 'home-manager/config')
-rw-r--r--home-manager/config/fish/config.fish29
1 files changed, 11 insertions, 18 deletions
diff --git a/home-manager/config/fish/config.fish b/home-manager/config/fish/config.fish
index f881f4e..172526d 100644
--- a/home-manager/config/fish/config.fish
+++ b/home-manager/config/fish/config.fish
@@ -87,25 +87,18 @@ function pwgen --wraps pwgen
end
end
-if [ -n $has_nvim ]
- if [ -n $has_fd ]
- set -gx FZF_DEFAULT_COMMAND "fd --type f --strip-cwd-prefix --hidden --exclude .git"
- end
- function ee
- if [ (count $argv) -eq 0 ]
- fzf --reverse --bind 'enter:become(nvim {})'
- else
- find $argv[1] -type f -print0 | fzf --read0 --reverse --bind 'enter:become(nvim {})'
- end
- end
-else
- function ee
- if [ (count $argv) -eq 0 ]
- fzf --reverse --bind 'enter:become(vim {})'
- else
- find $argv[1] -type f -print0 | fzf --read0 --reverse --bind 'enter:become(vim {})'
- end
+if [ -n $has_fd ]
+ set -gx FZF_DEFAULT_COMMAND "fd --type f --strip-cwd-prefix --hidden --exclude .git"
+end
+
+function ee
+ if [ (count $argv) -eq 0 ]
+ set selection (fzf --reverse)
+ else
+ set selection (find $argv[1] -type f -print0 | fzf --read0 --reverse)
end
+ commandline --replace "e $selection"
+ commandline --function execute
end
function terraform