VSpaceCode / VSpaceCode

Spacemacs like keybindings for Visual Studio Code

Home Page:https://vspacecode.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My workflow around search text and opening workspaces

vlad-terin opened this issue · comments

fzf_file_search() {
local file
file=$(fd --type f --hidden --exclude .git --exclude node_modules . "$HOME" | fzf) && code -r "$file"
}

fzf_folder_search() {
local folder
folder=$(fd --type d --exclude .git --exclude node_modules . "$HOME" | fzf) && code -r "$folder"
}

st() {
local pattern
read -rp "Enter search pattern: " pattern
IFS=: read -r file line rest <<< "$(rg --column --line-number --no-heading --color=always --smart-case "$pattern" . | fzf --ansi --delimiter ':' --preview 'bat --color=always {1} --highlight-line {2}' --preview-window 'up,60%,border-bottom,+{2}+3/3,~3')"
if [[ -n $file && -n $line ]]; then
code -r -g "${file}:${line}"
fi
}

for anyone looking for a good mouseless "build" with vspacecode - here are my helper functions that allow me to quickly open integrated terminal and search for text within project files OR anywhere on my system. Same way you can open a directory OR file with folder and file search.

image image

thought it would be helpful to some, as the built in vs code search was not something that i was happy with along with Vspacecode