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
3a6af275
Unverified
Commit
3a6af275
authored
8 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[zsh] emulate -L zsh to avoid issues with incompatible options
Close #858
parent
c89ac341
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
shell/completion.zsh
+2
-2
2 additions, 2 deletions
shell/completion.zsh
shell/key-bindings.zsh
+5
-2
5 additions, 2 deletions
shell/key-bindings.zsh
with
7 additions
and
4 deletions
shell/completion.zsh
+
2
−
2
View file @
3a6af275
...
...
@@ -46,7 +46,7 @@ __fzf_generic_path_completion() {
tail
=
$6
fzf
=
"
$(
__fzfcmd_complete
)
"
setopt
localoptions
nonomatch
setopt nonomatch
dir
=
"
$base
"
while
[
1
]
;
do
if
[[
-z
"
$dir
"
||
-d
${
~dir
}
]]
;
then
...
...
@@ -142,8 +142,8 @@ _fzf_complete_unalias() {
}
fzf-completion
()
{
emulate
-L
zsh
local
tokens cmd prefix trigger
tail
fzf matches lbuf d_cmds
setopt localoptions noshwordsplit noksh_arrays
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
...
...
This diff is collapsed.
Click to expand it.
shell/key-bindings.zsh
+
5
−
2
View file @
3a6af275
...
...
@@ -27,6 +27,7 @@ __fzfcmd() {
}
fzf-file-widget
()
{
emulate
-L
zsh
LBUFFER
=
"
${
LBUFFER
}
$(
__fsel
)
"
local
ret
=
$?
zle redisplay
...
...
@@ -38,9 +39,10 @@ bindkey '^T' fzf-file-widget
# ALT-C - cd into the selected directory
fzf-cd-widget
()
{
emulate
-L
zsh
setopt pipefail 2> /dev/null
local
cmd
=
"
${
FZF_ALT_C_COMMAND
:-
"command find -L . -mindepth 1
\\
( -path '*/
\\
.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc'
\\
) -prune
\
-o -type d -print 2> /dev/null | cut -b3-"
}
"
setopt localoptions pipefail 2> /dev/null
local dir
=
"
$(
eval
"
$cmd
"
|
FZF_DEFAULT_OPTS
=
"--height
${
FZF_TMUX_HEIGHT
:-
40
%
}
--reverse
$FZF_DEFAULT_OPTS
$FZF_ALT_C_OPTS
"
$(
__fzfcmd
)
+m
)
"
if
[[
-z
"
$dir
"
]]
;
then
zle redisplay
...
...
@@ -57,8 +59,9 @@ bindkey '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line
fzf-history-widget
()
{
emulate
-L
zsh
setopt pipefail 2> /dev/null
local
selected num
setopt localoptions noglobsubst pipefail 2> /dev/null
selected
=(
$(
fc
-l
1 |
FZF_DEFAULT_OPTS
=
"--height
${
FZF_TMUX_HEIGHT
:-
40
%
}
$FZF_DEFAULT_OPTS
+s --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort
$FZF_CTRL_R_OPTS
--query=
${
(q)LBUFFER
}
+m"
$(
__fzfcmd
))
)
local
ret
=
$?
...
...
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