Run a default command when you press return on an empty command line.
Project description
xontrib-default-command
This Oh-My-Xonsh plugin for the xonsh shell runs a default command when you press return on an empty command line.
By default, this command will run ls
. If $PWD
is a git project, it will also
run a short git status with git status -s
.
Customizing
You can redefine the defaultcmd
function in your rc.xsh to do whatever you want.
For example, if you want a detailed ls
and git status
, you could do this instead:
def defaultcmd():
"""Run a detailed ls and git status when no other command given"""
newcmd = "ls -laFG"
if p'$PWD/.git'.exists():
newcmd += " && git status"
return newcmd
Installation
Install from PyPI via xpip
:
xpip install xontrib-default-command
# or: xpip install -U git+https://github.com/oh-my-xonsh/xontrib-default-command
Then, add this to your rc.xsh:
xontrib load default_command
Similar projects
- Zsh has an auto-ls plugin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for xontrib-default-command-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaa68470c4f5550576cdc871b34bcdb8a4153be2466beeb8f5f9c13f28f632cb |
|
MD5 | 5279ddd6819db16402e8d8080b08629a |
|
BLAKE2b-256 | 4f333b85a959ef3b0f6538cdf0051240dc6c0a1b3385e1a3b5d32d952f08c6d8 |
Close
Hashes for xontrib_default_command-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc61dad34aa2aaac612e375ec7ad12a0b10228cfce697b319b56a43948887fe7 |
|
MD5 | 15813fa012408c32fe1904720b30de33 |
|
BLAKE2b-256 | dea19a4697603226a1dae03c9fc27a420ce544d245b950e9d8be68e1d58a1b9f |