Skip to content

Instantly share code, notes, and snippets.

@yuttie
yuttie / push-line.fish
Last active August 7, 2021 07:37 — forked from turanegaku/push-line.fish
A fish shell function to emulate zsh's buffer stack, i.e. store the current command and run one in between - restore the last command afterwards
# Save this file to ~/.config/fish/functions/push-line.fish
# Bind the function by using this in ~/.config/fish/functions/fish_user_key_bindings.fish
# function fish_user_key_bindings
# # For example alt+q
# bind \eq push-line
# end
function push-line
# Add an event handler for fish_postexec
@yuttie
yuttie / company-simple-complete.el
Last active September 3, 2016 12:28 — forked from aaronjensen/company-complete-cycle.el
Enables tab to complete and cycle completions with company-mode, similar to neocomplete in vim
;;; company-simple-complete.el --- Vim-like completion style
;; Package-Requires: ((company))
;;; Commentary:
;; Modify company so that tab and S-tab cycle through completions without
;; needing to hit enter.
;;; Code:
@yuttie
yuttie / zsh-history-search-with-peco.zsh
Last active June 4, 2021 16:06 — forked from jimeh/zsh-history-search-with-peco.zsh
Use peco (https://github.com/peco/peco) to search ZSH's history via ctrl+R
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if which peco &> /dev/null; then
function peco_select_history() {
local tac
{ which gtac &> /dev/null && tac="gtac" } || \
{ which tac &> /dev/null && tac="tac" } || \
tac="tail -r"
BUFFER=$(fc -l -n 1 | eval $tac | \
peco --layout=bottom-up --query "$LBUFFER")