Skip to content

Instantly share code, notes, and snippets.

View acepukas's full-sized avatar

Aaron Cepukas acepukas

View GitHub Profile
@acepukas
acepukas / .zshrc
Last active January 12, 2022 17:26
Convenient commands for ripgrep and fzf.vim integration
# RIPGREP config (this is the environment variable that vim is reading when building the rg command)
# In this case the shell is zsh. Adjust accordingly based on preferred shell and needs.
export RG_COMMAND_BASE='rg --ignore-file ~/.ignore --hidden --follow'
# Minimal FZF config. Shares the RG_COMMAND_BASE env var.
[ -f $HOME/.fzf.zsh ] && source $HOME/.fzf.zsh
export FZF_DEFAULT_COMMAND="$RG_COMMAND_BASE --files"
@acepukas
acepukas / init.vim
Last active April 16, 2021 19:54 — forked from danmikita/init.vim
File preview with FZF, RG, Bat, and Devicons (supports multiple file open and opening files in splits and tabs)
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
" Overriding fzf.vim's default :Files command.
" Pass zero or one args to Files command (which are then passed to Fzf_dev). Support file path completion too.
command! -nargs=? -complete=file Files call Fzf_dev(<q-args>)
@acepukas
acepukas / server.sh
Created December 11, 2012 16:18
easy_httpd_in_dir
#!/bin/sh
if [ -z $2 ]; then
PORT=8000
else
PORT=$2
fi
PIDFILE=/tmp/mini-httpd.pid