Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
f400ea1e
Unverified
Commit
f400ea1e
authored
Mar 16, 2020
by
wurza
Committed by
GitHub
Mar 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
man: use only first element of command before prepending man (#8747)
Co-authored-by:
Michael Wurzer
<
michael.wurzer@sequality.at
>
Co-authored-by:
Marc Cornellà
<
marc.cornella@live.com
>
parent
07e3236b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
man.plugin.zsh
plugins/man/man.plugin.zsh
+6
-2
No files found.
plugins/man/man.plugin.zsh
View file @
f400ea1e
...
@@ -13,8 +13,12 @@
...
@@ -13,8 +13,12 @@
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
man-command-line
()
{
man-command-line
()
{
[[
-z
$BUFFER
]]
&&
zle up-history
# if there is no command typed, use the last command
[[
$BUFFER
!=
man
\
*
]]
&&
LBUFFER
=
"man
$LBUFFER
"
[[
-z
"
$BUFFER
"
]]
&&
zle up-history
# prepend man to only the first part of the typed command
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
[[
"
$BUFFER
"
!=
man
\
*
]]
&&
BUFFER
=
"man
${${
(Az)BUFFER
}
[1]
}
"
}
}
zle
-N
man-command-line
zle
-N
man-command-line
# Defined shortcut keys: [Esc]man
# Defined shortcut keys: [Esc]man
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment