View tmux-map.vim
" ----------------------------------------------------------------------------
" tmux
" ----------------------------------------------------------------------------
" Recommended
let mapleader = ' '
function! s:tmux_send(content, dest) range
let dest = empty(a:dest) ? input('To which pane? ') : a:dest
let tempfile = tempname()
View fzf.vim
" Copyright (c) 2017 Junegunn Choi
"
" MIT License
"
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
View job_start.vim
function! JobCallback(self, data) abort
echom string([a:self, a:data])
endfunction
let command = printf('git clone "https://github.com/junegunn/seoul256.vim.git" "%s\vimfiles\plugged yolo\seoul256.vim" 2>&1', $HOME)
let j = job_start(command, {'out_cb': 'JobCallback', 'exit_cb': 'JobCallback'})
View keys.go
package main
import (
"fmt"
"os"
"syscall"
)
func GetBytes() []byte {
_in, _ := os.OpenFile("/dev/tty", syscall.O_RDONLY, 0)
View notes.sh
#!/usr/bin/env bash
#
# Managing notes with fzf (https://github.com/junegunn/fzf)
# - CTRL-L: List txt files in descending order by their modified time
# - CTRL-F: Search file contents
NOTE_DIR="${NOTE_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
TRASH_DIR="$NOTE_DIR/trash"
export NORENAME=1
cd "$NOTE_DIR"
View gstash.sh
gstash() {
local out k reflog
out=(
$(git stash list --pretty='%C(yellow)%gd %>(14)%Cgreen%cr %C(blue)%gs' |
fzf --ansi --no-sort --header='enter:show, ctrl-d:diff, ctrl-o:pop, ctrl-y:apply, ctrl-x:drop' \
--preview='git stash show --color=always -p $(cut -d" " -f1 <<< {}) | head -'$LINES \
--preview-window=down:50% --reverse \
--bind='enter:execute(git stash show --color=always -p $(cut -d" " -f1 <<< {}) | less -r > /dev/tty)' \
--bind='ctrl-d:execute(git diff --color=always $(cut -d" " -f1 <<< {}) | less -r > /dev/tty)' \
--expect=ctrl-o,ctrl-y,ctrl-x))
View fzf_history_dir.patch
diff --git a/README.md b/README.md
index a36a60a..65804e6 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,12 @@ let g:fzf_colors =
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
+
+" Enable per-command history.
View functions.sh
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}
View vader-given-path.diff
diff --git a/README.md b/README.md
index 6abc213..c02896a 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,12 @@ Given [filetype] [(comment)]:
[input text]
```
+Alternatively, you can pass a file path to `Given` label as follows:
+
View vimrc
set nocompatible hidden laststatus=2
if !filereadable('/tmp/plug.vim')
silent !curl --insecure -fLo /tmp/plug.vim
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'junegunn/fzf', { 'do': './install --bin' }