m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Add bind action for executing arbitrary command (#265)

e.g. fzf --bind "ctrl-m:execute(less {})"
     fzf --bind "ctrl-t:execute[tmux new-window -d 'vim {}']"
This commit is contained in:
Junegunn Choi
2015-06-14 12:25:08 +09:00
parent fe5b190a7d
commit 6c99cc1700
5 changed files with 113 additions and 22 deletions

View File

@@ -86,10 +86,15 @@ func (i *Item) Rank(cache bool) Rank {
// AsString returns the original string
func (i *Item) AsString() string {
return *i.StringPtr()
}
// StringPtr returns the pointer to the original string
func (i *Item) StringPtr() *string {
if i.origText != nil {
return *i.origText
return i.origText
}
return *i.text
return i.text
}
func (item *Item) colorOffsets(color int, bold bool, current bool) []colorOffset {