diff options
author | Ben Sima <bsima@groq.com> | 2022-07-28 22:54:09 -0700 |
---|---|---|
committer | Ben Sima <bsima@groq.com> | 2022-07-28 22:54:24 -0700 |
commit | 0cf1950d364fced5e63c56add1ee15afc4eddea1 (patch) | |
tree | f78c420d7c36d5c3c2d3176da0630dd192ecd595 /lib/common.nix | |
parent | 40b96e3fd75504497e29a564f0178fe2a42a11e5 (diff) |
vim tweaks and add fcd
Diffstat (limited to 'lib/common.nix')
-rw-r--r-- | lib/common.nix | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/common.nix b/lib/common.nix index 5019e08..3f15754 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -247,6 +247,7 @@ in #viAlias = true; #vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ + base16-vim editorconfig-vim vim-sensible vim-fugitive @@ -298,11 +299,21 @@ in [[ -f "$DIR/nix.sh" ]] && . "$DIR/nix.sh" [[ -f "$DIR/hm-session-vars.sh" ]] && . "$DIR/hm-session-vars.sh" [[ -f "${homedir}/.bashrc.local" ]] && . "${homedir}/.bashrc.local" - source "${pkgs.forgit}/share/bash/forgit.plugin.zsh" - - function cd() { - builtin cd "$@" && ls + function fcd() { + local dir; + echo "exit with ^D" + while : + do + dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" + if [[ -z "$dir" ]]; then + break + else + echo -n "$dir " + cd "$dir" + ls + fi + done } function up() { N=$1 |