Skip to content

Instantly share code, notes, and snippets.

@casssoft
casssoft / grep-with-git.vim
Last active August 13, 2018 23:47
vim-grep-with-git
" This is the grep command I've always wanted.
" This plugin opens the results of 'grep -r' in a bottom window
" and uses 'git grep' when in a git repo and regular grep otherwise.
" <C-x><C-x> runs grep for the word under the cursor
" also this:
"map <C-j> :cn<CR>
"map <C-k> :cp<CR>
"map <leader>c :cclose<CR>
@casssoft
casssoft / .bashrc.sh
Created May 2, 2019 17:13
bash session history
# this needs to be at the end of bash setup (possibly at the end of ~/.bashrc)
# use script because it works and is installed by default
# this also requires the user to double exit out
# NOTE: trying to replicate it with bash -il 2>$1 | tee .terminal_session fails with an infinite loop
if [ "$IN_SCRIPT_SESSION" != "0" ]; then
mkdir -p ~/.bash_session_history/
# this might get really big so report it everytime
echo "bash session history size: $(du -h ~/.bash_session_history)"