Add custom Alt+L, using EXA instead of LS
This commit is contained in:
parent
73174036a3
commit
1e4a413cf1
1 changed files with 21 additions and 0 deletions
21
.config/fish/functions/__fish_list_current_token.fish
Normal file
21
.config/fish/functions/__fish_list_current_token.fish
Normal file
|
@ -0,0 +1,21 @@
|
|||
# This function is typically bound to Alt-L, it is used to list the contents
|
||||
# of the directory under the cursor.
|
||||
|
||||
function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
|
||||
set -l val (commandline -t | string replace -r '^~' "$HOME")
|
||||
printf "\n"
|
||||
if test -d $val
|
||||
eza --icons=auto $val
|
||||
else
|
||||
set -l dir (dirname -- $val)
|
||||
if test $dir != . -a -d $dir
|
||||
eza --icons=auto $dir
|
||||
else
|
||||
eza --icons=auto
|
||||
end
|
||||
end
|
||||
|
||||
string repeat -N \n --count=(math (count (fish_prompt)) - 1)
|
||||
|
||||
commandline -f repaint
|
||||
end
|
Loading…
Reference in a new issue