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/plugged/**
nvim.configlink/autoload/** nvim.configlink/autoload/**
fish.configlink/config.fish.bac fish.configlink/config.fish.bac
fish.configlink/functions/vim.fish
fish_variables fish_variables
homebrew/*.lock.json homebrew/*.lock.json
*.bak *.bak

View File

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

View File

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

View File

@ -1,4 +1,11 @@
# Defined via `source` function fcd --description 'Jump to directory' -a 'directory'
function fcd --wraps='set jump (fd -t d . ~ | fzf); and cd $jump' --description 'alias fcd set jump (fd -t d . ~ | fzf); and cd $jump' if test -z $directory
set jump (fd -t d . ~ | fzf); and cd $jump $argv; 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 end

View File

@ -5,4 +5,5 @@ function fish_user_key_bindings
bind -M insert \ce 'recent' bind -M insert \ce 'recent'
bind -M insert \cg 'commandline-git-commits' bind -M insert \cg 'commandline-git-commits'
bind -M insert \x1F accept-autosuggestion bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion
end 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* !.env*
!.github/ !.github/
!.gitignore !.gitignore
!*.tfvars
.terraform/ .terraform/
.target/ .target/
/Library/ /Library/