Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
305ec3b3
Commit
305ec3b3
authored
9 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[fish] Remove buffering delay by not using subroutines
Close #169
parent
f4fe9333
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shell/key-bindings.fish
+6
-14
6 additions, 14 deletions
shell/key-bindings.fish
with
6 additions
and
14 deletions
shell/key-bindings.fish
+
6
−
14
View file @
305ec3b3
...
@@ -7,18 +7,6 @@ function fzf_key_bindings
...
@@ -7,18 +7,6 @@ function fzf_key_bindings
set -g TMPDIR /tmp
set -g TMPDIR /tmp
end
end
function __fzf_list
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 1d | cut -b3-
end
function __fzf_list_dir
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) \
-prune -o -type d -print 2> /dev/null | sed 1d | cut -b3-
end
function __fzf_escape
function __fzf_escape
while read item
while read item
echo -n (echo -n "$item" | sed -E 's/([ "$~'\''([{<>})])/\\\\\\1/g')' '
echo -n (echo -n "$item" | sed -E 's/([ "$~'\''([{<>})])/\\\\\\1/g')' '
...
@@ -26,7 +14,10 @@ function fzf_key_bindings
...
@@ -26,7 +14,10 @@ function fzf_key_bindings
end
end
function __fzf_ctrl_t
function __fzf_ctrl_t
__fzf_list | eval (__fzfcmd) -m > $TMPDIR/fzf.result
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 1d | cut -b3- | eval (__fzfcmd) -m > $TMPDIR/fzf.result
and commandline -i (cat $TMPDIR/fzf.result | __fzf_escape)
and commandline -i (cat $TMPDIR/fzf.result | __fzf_escape)
commandline -f repaint
commandline -f repaint
rm -f $TMPDIR/fzf.result
rm -f $TMPDIR/fzf.result
...
@@ -41,7 +32,8 @@ function fzf_key_bindings
...
@@ -41,7 +32,8 @@ function fzf_key_bindings
function __fzf_alt_c
function __fzf_alt_c
# Fish hangs if the command before pipe redirects (2> /dev/null)
# Fish hangs if the command before pipe redirects (2> /dev/null)
__fzf_list_dir | eval (__fzfcmd) +m > $TMPDIR/fzf.result
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) \
-prune -o -type d -print 2> /dev/null | sed 1d | cut -b3- | eval (__fzfcmd) +m > $TMPDIR/fzf.result
[ (cat $TMPDIR/fzf.result | wc -l) -gt 0 ]
[ (cat $TMPDIR/fzf.result | wc -l) -gt 0 ]
and cd (cat $TMPDIR/fzf.result)
and cd (cat $TMPDIR/fzf.result)
commandline -f repaint
commandline -f repaint
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment