snippet fix
This commit is contained in:
parent
0284cdac52
commit
d0f3684cd5
2 changed files with 11 additions and 0 deletions
8
dot_bashrc.d/fzf-snippet.bashrc
Normal file
8
dot_bashrc.d/fzf-snippet.bashrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# edit single line snippet
|
||||||
|
cfg-snippetrc() { $EDITOR ~/.snippetrc ;}
|
||||||
|
|
||||||
|
fzf-snippet() {
|
||||||
|
selected="$(cat ~/.snippetrc | sed '/^$/d' | sort -n | fzf -e -i )"
|
||||||
|
# remove tags, leading and trailing spaces, also no newline
|
||||||
|
echo "$selected" | sed -e s/\;\;\.\*\$// | sed 's/^[ \t]*//;s/[ \t]*$//' | tr -d '\n' | xclip -selection clipboard
|
||||||
|
}
|
|
@ -116,6 +116,9 @@ bind-key Home send-keys "$FAVORITE_COMMAND"
|
||||||
unbind r
|
unbind r
|
||||||
bind r source-file ~/.tmux.conf \; display-message "config reloaded!"
|
bind r source-file ~/.tmux.conf \; display-message "config reloaded!"
|
||||||
|
|
||||||
|
# inspired from fzf-snippet (https://github.com/gotbletu/shownotes/blob/master/fzf-snippet.md)
|
||||||
|
bind-key "'" new-window -n snippet \; send-keys "fzf-snippet && tmux kill-window\n"
|
||||||
|
|
||||||
# plugin last_command_output
|
# plugin last_command_output
|
||||||
set -g @command-capture-prompt-pattern '$ '
|
set -g @command-capture-prompt-pattern '$ '
|
||||||
set -g @command-capture-editor-cmd 'gedit -'
|
set -g @command-capture-editor-cmd 'gedit -'
|
||||||
|
|
Loading…
Add table
Reference in a new issue