From 0cf1950d364fced5e63c56add1ee15afc4eddea1 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 28 Jul 2022 22:54:09 -0700 Subject: vim tweaks and add fcd --- lib/common.nix | 19 +++++++++++++++---- lib/vimrc | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'lib') 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 diff --git a/lib/vimrc b/lib/vimrc index c346fbb..fe4c099 100644 --- a/lib/vimrc +++ b/lib/vimrc @@ -123,8 +123,8 @@ let s:cgray = ['#737373', 243] let s:dgray = ['DarkGray', 248] let s:sblue = ['LightBlue', 67] let s:yellow = ['LightYellow', 226] -let s:red = ['LightRed', 160] -let s:green = ['LightGreen', 28] +let s:red = ['DarkRed', 160] +let s:green = ['DarkGreen', 28] let s:purple = ['LightMagenta', 13] let s:default_fg = s:lgray -- cgit v1.2.3