Skip to content

Instantly share code, notes, and snippets.

View cognitivegears's full-sized avatar

Nathan Byrd cognitivegears

View GitHub Profile
@cognitivegears
cognitivegears / fo.sh
Last active July 3, 2024 02:36
Function to disown and redirect output for a stopped or background process
fo() {
# Generate a random file name if no output file is provided
if [ "$#" -lt 1 ]; then
OUTPUT_FILE=$(mktemp /tmp/output_XXXXXX.log)
else
OUTPUT_FILE="$1"
fi
echo "Redirecting output to $OUTPUT_FILE"
@cognitivegears
cognitivegears / searchresults.md
Last active October 25, 2016 02:01
Using Search Results Window with Unite and Anzu

Synopsis

With Unite and Anzu (and a little vimscript) it is possible to create a window showing all matching search results that appears automatically when searching.

See Search Results Window with Unite and Anzu for the code or below for a demonstration.

Search Windows

Usage

@cognitivegears
cognitivegears / searchWindow.vim
Created October 24, 2016 17:02
Search Results Window with Unite and Anzu
" General Anzu configuration - change to taste
nmap n <Plug>(anzu-n-with-echo)
nmap N <Plug>(anzu-N-with-echo)
nmap * <Plug>(anzu-star-with-echo)
nmap # <Plug>(anzu-sharp-with-echo)
" clear status
nmap <Esc><Esc> <Plug>(anzu-clear-search-status)
" statusline
set statusline+=%{anzu#search_status()}
" Update the search status results while moving through the file