citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 3eec62a5a3959fe84151059b8db62f7a4b71b996
parent 46d7e5f3f9eae8de640d2401c4e61a47b112a4f0
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  7 May 2021 08:51:04 -0700

various fzf compile improvements

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mbin/fuzz-compile | 14+++++++++++---
Mbin/fuzz-compile-repeat | 2+-
Mbin/fuzz-edit-file | 5+++++
Mbin/stripansi | 3++-
Mdotfiles/.bash_aliases | 1+
Mdotfiles/commands | 12+++++++-----
6 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/bin/fuzz-compile b/bin/fuzz-compile @@ -2,12 +2,20 @@ set -eou pipefail -if [ -f package.json ] && [ ! -f Makefile ]; then +cmd="" + +if [ -f package.json ] && [ ! -f Makefile ] +then target=$(jq -r '.scripts | keys[]' package.json | fuzzer "$@") - echo npm run $target \2\>\&\1\| tee .build-result + cmd="npm run $target" +elif [ -f Cargo.toml ] +then + cmd="cargo check --color=always 2>&1| sed -E '/^.*(warning|error).*:/N;s/\n//;s/-->//g'" else target=$(fuzz-make "$@") - echo make -j $target \2\>\&\1\| tee .build-result + cmd="make -j $target" fi +fullcmd="$cmd 2>&1| tee .build-result" +<<<"$fullcmd" tee .buildcmd diff --git a/bin/fuzz-compile-repeat b/bin/fuzz-compile-repeat @@ -1,2 +1,2 @@ #!/usr/bin/env bash -tac ~/.fuzzhist | grep -E "make [^\w]+" | head -n1 +cat .buildcmd diff --git a/bin/fuzz-edit-file b/bin/fuzz-edit-file @@ -1,4 +1,9 @@ #!/usr/bin/env bash set -e +if [ "$1" = "--dir" ]; then + shift + cd "$1" + shift +fi file=$(rg --files | fuzzer "$@") echo $EDITOR \"$(readlink -f $file)\" diff --git a/bin/stripansi b/bin/stripansi @@ -1 +1,2 @@ -perl -pe 's/\e\[?.*?[\@-~]//g' +#!/usr/bin/env bash +exec perl -pe 's/\e\[?.*?[\@-~]//g' diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases @@ -39,6 +39,7 @@ export XZ=pxz export HISTSIZE=50000 export FZF_CTRL_R_OPTS="-e" export FZF_DEFAULT_OPTS="-e" +export FZF_DEFAULT_COMMAND='rg --files --hidden' export EMACSCLIENT=edit export NIXPKGS=$HOME/nixpkgs diff --git a/dotfiles/commands b/dotfiles/commands @@ -1,13 +1,13 @@ -Nc new command echo make-script cc compile fuzz-compile cd change directory fuzz-cd-dirname ce compile error fuzz-compile-error cr compile repeat fuzz-compile-repeat +cR compile repeat error fuzz-compile-repeat-error cs compile show build echo cat .build-result +ecc edit vdirsyncer config echo edit ~/.config/vdirsyncer/config +ec edit commands fuzz-edit-scripts eFc edit fuzz command fuzz-edit-command eFl edit fuzz command list fuzz-edit-command-list -ec edit commands fuzz-edit-scripts -ecc edit vdirsyncer config echo edit ~/.config/vdirsyncer/config egc edit git config echo edit ~/.gitconfig elf edit last files fuzz-last-files edit em edit mimi echo edit ~/.config/mimi/mime.conf @@ -25,18 +25,20 @@ m make fuzz-make nai notmuch archive inbox fuzz-notmuch-archive-inbox nam notmuch am fuzz-notmuch-am nat notmuch archive fuzz-notmuch-archive +Nc new command echo make-script ni notmuch inbox fuzz-notmuch-inbox nt notmuch threads fuzz-notmuch-threads of open file fuzz-open-file olf open last files fuzz-last-files open pc cat project file fuzz-cat-file pf edit project file fuzz-edit-file +ps edit project skeletons fuzz-edit-file --dir ~/dotfiles/skeletons rf recent files fuzz-recent-files sC search commit fuzz-edit-diff-line HEAD^- -sD search staged diff fuzz-edit-diff-line --staged -sFc show fuzz command fuzz-show-fuzz-command sc show command fuzz-show-script sd search diff fuzz-edit-diff-line +sD search staged diff fuzz-edit-diff-line --staged +sFc show fuzz command fuzz-show-fuzz-command sf search project file funcs fuzz-funcs sh show history fuzz-show-hist sp search project fuzz-search-files