Added my fish config
This commit is contained in:
commit
f5306476ea
21 changed files with 704 additions and 0 deletions
24
functions/_fzf_search_history.fish
Normal file
24
functions/_fzf_search_history.fish
Normal file
|
@ -0,0 +1,24 @@
|
|||
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
|
||||
# history merge incorporates history changes from other fish sessions
|
||||
builtin history merge
|
||||
|
||||
set command_with_ts (
|
||||
# Reference https://devhints.io/strftime to understand strftime format symbols
|
||||
builtin history --null --show-time="%m-%d %H:%M:%S │ " |
|
||||
_fzf_wrapper --read0 \
|
||||
--tiebreak=index \
|
||||
--query=(commandline) \
|
||||
# preview current command using fish_ident in a window at the bottom 3 lines tall
|
||||
--preview="echo -- {4..} | fish_indent --ansi" \
|
||||
--preview-window="bottom:3:wrap" \
|
||||
$fzf_history_opts |
|
||||
string collect
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
set command_selected (string split --max 1 " │ " $command_with_ts)[2]
|
||||
commandline --replace -- $command_selected
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue