From 0d397e4d3d204a1e016c0863815f0b5dc516c46b Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Wed, 21 May 2025 14:30:00 +0530 Subject: added some new scripts and cleaned up nvim directory --- .local/bin/fgrp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100755 .local/bin/fgrp (limited to '.local/bin/fgrp') diff --git a/.local/bin/fgrp b/.local/bin/fgrp deleted file mode 100755 index 18bcabd..0000000 --- a/.local/bin/fgrp +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# fzf-grep: browse through grepped lines using fzf - -if [ "$OPENFLAG" = 0 ]; then - location="$(echo "$*" | sed 's/^\(.*\):\([0-9]\+\):.*$/\1|\2/')" - file="${location%|*}"; line="${location##*|}" - case "${OPENWITH:=$EDITOR}" in - ''|vi|*vim*) $OPENWITH +"$line" "$file" ;; - *) $OPENWITH "$file" ;; - esac; exit -fi - -[ -z "$FZF_HISTDIR" ] && - export FZF_HISTDIR="${XDG_STATE_HOME:-$HOME/.local/state}/fzf" -mkdir -pv "$FZF_HISTDIR" -export FZF_HIST="$FZF_HISTDIR/grep_history" - -cmd="grep -Rnsi --exclude-dir=.git --exclude-dir=node_modules --color=always" -$cmd "$@" | - fzf --ansi \ - --history="$FZF_HIST" \ - --prompt="grep > " \ - --preview='preview "$(echo {1} | cut -d: -f1)"' \ - --preview-window="hidden" \ - --bind 'ctrl-v:toggle-preview,ctrl-space:toggle-preview' \ - --bind "ctrl-r:reload($cmd $*)" \ - --bind 'enter:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 fgrp {})' \ - --bind 'alt-e:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 OPENWITH=${EDITOR:-vi} fgrp {})' \ - --bind 'alt-o:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 OPENWITH=${OPENER:-xdg-open} fgrp {})' \ - --bind 'alt-O:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 OPENWITH=${FILES:-lf} fgrp {})' -- cgit v1.2.3