424d4cb779
Detect `ls` provided by GNU Core Utilities upfront before applying the relevant settings and aliases. The revised logic takes the following aspects into consideration: - `is-callable 'dircolors'` is not a sufficient test for verifying if the `ls` in scope is _also_ provided by GNU Core Utilities. `ls` can continue to be the one provided by BSD Core Utilities because of its precedence in `$path`. - The `ls` in scope anyway can be either GNU Utils provided or BSD Utils provided depending on either `$path` precedence, soft link (via `ln -s`), or wrapper function (via 'gnu-utility' module). - So instead of '_guessing_' the possible one, just detect if it is from GNU Utils and apply the relevant settings and aliases. - Note that GNU prefixed `ls` (`gls`) is intentionally not honored in this case to avoid possible conflict/shadowing with other `gls` callable (can happen if 'git' module is used, for example). Besides, honoring `gls` would imply we honor other commands (like `mv`, `rm` etc.) to be consistent. We have a module 'gnu-utils' dedicated for that after all. |
||
---|---|---|
.. | ||
functions | ||
init.zsh | ||
README.md |
Utility
Defines general aliases and functions.
Note: Some of the utilities configured in this module might be provided via
GNU utilities with incompatible arguments on non-GNU systems. In such cases,
using gnu-utility
module is recommended and it must be loaded
before this module.
Settings
Highlighting
If you have enabled color globally in ~/.zpreztorc, you may disable it for certain commands.
To disable ls
color, add the following line to ~/.zpreztorc; when coloring
is disabled, type indicators (\*
, /
, =>
, @
, =
, |
, %
) will be
appended to entries.
zstyle ':prezto:module:utility:ls' color 'no'
To disable GNU coreutils ls
to list directories grouped first, add the
following line to ~/.zpreztorc:
zstyle ':prezto:module:utility:ls' dirs-first 'no'
To disable diff
highlighting, add the following line to ~/.zpreztorc:
zstyle ':prezto:module:utility:diff' color 'no'
To disable wdiff
highlighting, add the following line to ~/.zpreztorc:
zstyle ':prezto:module:utility:wdiff' color 'no'
To disable make
highlighting, add the following line to ~/.zpreztorc:
zstyle ':prezto:module:utility:make' color 'no'
Aliases
Disabled Spelling Correction
ack
cd
cp
ebuild
gcc
gist
grep
heroku
ln
man
mkdir
mv
mysql
rm
To disable all spelling corrections, add the following line to ~/.zpreztorc:
zstyle ':prezto:module:utility' correct 'no'
Disabled File Globbing
bower
fc
find
ftp
history
locate
rake
rsync
(selectively enabled for local files)scp
(selectively enabled for local files)sftp
General
_
executes a command as another user (sudo
).b
opens the default web browser.diffu
shorthand fordiff --unified
e
opens the default editor.mkdir
creates directories, including intermediary directories.p
opens the default pager.po
removes a directory from the stack and changes to it (popd
).pu
changes the directory and pushes the old directory onto the stack (pushd
).sa
search aliases for a word.type
displays all the attribute values of a shell parameter.
Files and Directories
ls
lists with directories grouped first (GNU only).l
lists in one column, hidden files.ll
lists human readable sizes.lr
lists human readable sizes, recursively.la
lists human readable sizes, hidden files.lm
lists human readable sizes, hidden files through pager.lx
lists sorted by extension (GNU only).lk
lists sorted by size, largest last.lt
lists sorted by date, most recent last.lc
lists sorted by date, most recent last, shows change time.lu
lists sorted by date, most recent last, shows access time.sl
lists directory contents (correction forls
).
macOS Everywhere
o
opens files and directories (open
orxdg-open
).get
downloads files (curl
orwget
).pbcopy
copies to the pasteboard (pbcopy
,xclip
orxsel
).pbpaste
pastes from the pasteboard (pbcopy
,xclip
orxsel
).pbc
copies to the pasteboard (pbcopy
).pbp
pastes from the pasteboard (pbpaste
).
Resource Usage
df
displays free disk space using human readable units (aliases topydf
, if installed).du
displays disk usage using human readable units.top
displays information about processes.topc
displays information about processes sorted by CPU usage.topm
displays information about processes sorted by RAM usage.
Safe ops
By default, cp
,ln
, mv
and rm
are aliased to their interactive variants.
If this is not desired, it can be disabled by adding the following line to
~/.zpreztorc:
zstyle ':prezto:module:utility' safe-ops 'no'.
In addition, the following aliases have been added:
cpi
copies files and directories interactively.lni
links files and directories interactively.mvi
moves files and directories interactively.rmi
removes files and directories interactively.
Miscellaneous
http-serve
serves a directory via HTTP.
Functions
General
slit
prints columns 1, 2, 3 ... n.
Files and Directories
cdls
changes to a directory and lists its contents.dut
displays the grand total disk usage using human readable units.find-exec
finds files and executes a command on them.mkdcd
makes a directory and changes to it.popdls
pops an entry off the directory stack and lists its contents.pushdls
pushes an entry onto the directory stack and lists its contents.noremoteglob
enable local path globbing but disable remote path globbing.
Developer
diff
highlights diff output (requirescolordiff
).make
highlights make output (requirescolormake
).wdiff
highlights wdiff output (requireswdiff
orgit
).
Resource usage
psu
displays user owned processes status.
Search and Replace
prep
provides a grep-like pattern search.psub
provides a sed-like pattern substitution.
Authors
The authors of this module should be contacted via the issue tracker.