Add latest file key and reorganise
This commit is contained in:
parent
8df3781baf
commit
4d99aecff1
4 changed files with 28 additions and 5 deletions
|
|
@ -22,8 +22,3 @@ function bind_dollar
|
||||||
commandline --insert '$'
|
commandline --insert '$'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fish_user_key_bindings
|
|
||||||
bind ! bind_bang
|
|
||||||
bind '$' bind_dollar
|
|
||||||
end
|
|
||||||
|
|
|
||||||
5
alex/fish/functions/fish-user-key-bindings.fish
Normal file
5
alex/fish/functions/fish-user-key-bindings.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
function fish_user_key_bindings
|
||||||
|
bind ! bind_bang
|
||||||
|
bind '$' bind_dollar
|
||||||
|
bind @ bind_at
|
||||||
|
end
|
||||||
20
alex/fish/functions/latest-file.fish
Normal file
20
alex/fish/functions/latest-file.fish
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
function bind_at
|
||||||
|
set -l token (commandline -t)
|
||||||
|
if string match -q -- "*@" "$token"
|
||||||
|
commandline -f backward-delete-char
|
||||||
|
set -l newest_file
|
||||||
|
for f in (command ls -tA)
|
||||||
|
if test -f "$f"
|
||||||
|
set newest_file "$f"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if test -n "$newest_file"
|
||||||
|
commandline -i (string escape -- "$newest_file")
|
||||||
|
else
|
||||||
|
commandline -i "@"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
commandline -i "@"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -181,10 +181,13 @@
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
|
source ~/.config/fish/functions/latest-file.fish
|
||||||
source ~/.config/fish/functions/cardboard.fish
|
source ~/.config/fish/functions/cardboard.fish
|
||||||
source ~/.config/fish/functions/bangbang.fish
|
source ~/.config/fish/functions/bangbang.fish
|
||||||
source ~/.config/fish/functions/borg-h.fish
|
source ~/.config/fish/functions/borg-h.fish
|
||||||
|
|
||||||
|
source ~/.config/fish/functions/fish-user-key-bindings.fish
|
||||||
|
|
||||||
set PATH ~/.cargo/bin $PATH
|
set PATH ~/.cargo/bin $PATH
|
||||||
set PATH ~/scripts $PATH
|
set PATH ~/scripts $PATH
|
||||||
set PATH ~/.local/bin $PATH
|
set PATH ~/.local/bin $PATH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue