fcd and clean up fish

This commit is contained in:
Noah Masur 2021-05-12 18:59:22 -04:00
parent 281f2a5a86
commit 895b779eab
7 changed files with 15 additions and 9 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ nvim.configlink/.netrwhist
nvim.configlink/plugged/**
nvim.configlink/autoload/**
fish.configlink/config.fish.bac
fish.configlink/functions/vim.fish
fish_variables
homebrew/*.lock.json
*.bak

View File

@ -1,6 +1,7 @@
!.env*
!.github/
!.gitignore
!*.tfvars
.terraform/
.target/
/Library/

View File

@ -8,11 +8,9 @@ function abbrs --description 'All abbreviations'
abbr -a ll 'ls -alhF'
abbr -a lf 'ls -lh | fzf'
abbr -a c 'cd'
abbr -a fcd 'cd (fd -t d . ~ | fzf)'
abbr -a -- - 'cd -'
abbr -a proj 'cd $PROJ'
abbr -a mkd 'mkdir -pv'
alias --save fcd 'set jump (fd -t d . ~ | fzf); and cd $jump'
# Tmux
abbr -a ta 'tmux attach-session'
@ -54,6 +52,7 @@ function abbrs --description 'All abbreviations'
alias --save vim='nvim'
abbr -a vimrc 'vim $HOME/.config/nvim/init.vim'
else
alias --save vim='vim'
abbr -a vimrc 'vim $HOME/.vimrc'
end
abbr -a v 'vim'

View File

@ -1,4 +1,11 @@
# Defined via `source`
function fcd --wraps='set jump (fd -t d . ~ | fzf); and cd $jump' --description 'alias fcd set jump (fd -t d . ~ | fzf); and cd $jump'
set jump (fd -t d . ~ | fzf); and cd $jump $argv;
function fcd --description 'Jump to directory' -a 'directory'
if test -z $directory
set directory "$HOME"
end
if ! test -d $directory
echo "Directory not found: $directory"
return 1
end
set jump (fd -t d . $directory | fzf)
and cd $jump $argv;
end

View File

@ -5,4 +5,5 @@ function fish_user_key_bindings
bind -M insert \ce 'recent'
bind -M insert \cg 'commandline-git-commits'
bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion
end

View File

@ -1,4 +0,0 @@
# Defined via `source`
function vim --wraps=nvim --description 'alias vim=nvim'
nvim $argv;
end

View File

@ -1,6 +1,7 @@
!.env*
!.github/
!.gitignore
!*.tfvars
.terraform/
.target/
/Library/