fish: add key bindings
This commit is contained in:
parent
bc20f8f7d4
commit
59f0fba5f4
3
fish/.gitignore
vendored
3
fish/.gitignore
vendored
@ -1,5 +1,2 @@
|
|||||||
fish_variables
|
fish_variables
|
||||||
fisher/
|
fisher/
|
||||||
functions/br.fish
|
|
||||||
functions/fish_user_key_bindings.fish
|
|
||||||
functions/fzf_key_bindings.fish
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
function battery
|
function battery --description "Print battery status"
|
||||||
# Only works on Mac
|
|
||||||
if test (uname -s) != Darwin
|
if test (uname -s) != Darwin
|
||||||
echo "Unsupported kernel: "(uname -s)
|
echo "Unsupported kernel: "(uname -s)
|
||||||
return 1
|
return 1
|
||||||
@ -12,4 +11,5 @@ function battery
|
|||||||
set_color green
|
set_color green
|
||||||
echo "⚡️ Running on $power_source with $battery_charge charge"
|
echo "⚡️ Running on $power_source with $battery_charge charge"
|
||||||
set_color normal
|
set_color normal
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
|
10
fish/functions/fish_user_key_bindings.fish
Normal file
10
fish/functions/fish_user_key_bindings.fish
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
function fish_user_key_bindings
|
||||||
|
bind \cb battery
|
||||||
|
bind \cq fkill
|
||||||
|
|
||||||
|
# Bindings for fzf
|
||||||
|
if test -f (brew --prefix)/opt/fzf/shell/key-bindings.fish
|
||||||
|
source (brew --prefix)/opt/fzf/shell/key-bindings.fish
|
||||||
|
fzf_key_bindings
|
||||||
|
end
|
||||||
|
end
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Install fzf key-bindings
|
|
||||||
FZF_INSTALLER=$(brew --prefix)/opt/fzf/install
|
|
||||||
|
|
||||||
if [ -x "$FZF_INSTALLER" ]; then
|
|
||||||
"$FZF_INSTALLER" --key-bindings --no-completion --no-update-rc --no-bash --no-zsh
|
|
||||||
end
|
|
@ -18,8 +18,5 @@ grep -q "$BREW_PREFIX/bin/fish" /etc/shells || echo "$BREW_PREFIX/bin/fish" | su
|
|||||||
# Make fish the default shell
|
# Make fish the default shell
|
||||||
sudo chsh -s "$BREW_PREFIX/bin/fish" `whoami`
|
sudo chsh -s "$BREW_PREFIX/bin/fish" `whoami`
|
||||||
|
|
||||||
# Install fzf keybindings
|
|
||||||
"$DOTFILES/install-fzf.sh"
|
|
||||||
|
|
||||||
# Install symlinks
|
# Install symlinks
|
||||||
"$DOTFILES/install-symlinks.sh"
|
"$DOTFILES/install-symlinks.sh"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user