Anton Shestakov <av6@dwimlabs.net>, Sat, 26 Nov 2022 02:07:35 +0400
.vimrc: set updatetime from 4000ms to 500ms
This matters for certain async plugins, such as signify, that use CursorHold
autocommand event. Signify recommends going as low as 100, but 500 should be
good enough.
This file provides
``prompt_command`` function that is executed by the
shell just before displaying
``PS1`` (which the function sets). The result is a
Note that the clock is not real-time. It updates after your shell command
finishes (e.g. after you press enter). That's sufficient if you want to
know how long your db backup took, for example.
.. image:: https://code.rhodecode.com/u/av6/dotfiles/raw/default/docs/prompt-exit.png
.. image:: https://code.rhodecode.com/u/av6/dotfiles/raw/default/docs/prompt-venv.png
There are two implementations of mercurial prompt: using a separate mercurial
extension
`hg-prompt <https://hg.stevelosh.com/hg-prompt/>`_, and a fallback
implementation in pure bash.
The screenshot shows the former in action:
.. image:: https://code.rhodecode.com/u/av6/dotfiles/raw/default/docs/prompt-hg.png
Pure bash implementation currently lags behind in features.
.. image:: https://code.rhodecode.com/u/av6/dotfiles/raw/default/docs/prompt-git.png
.. image:: https://code.rhodecode.com/u/av6/dotfiles/raw/default/docs/prompt-root.png
Mercurial and Git support is disabled for root, thus two colored dashes.
This file contains aliases. Currently, the only alias that is not exactly
self-explanatory is
``whatsopen``. In short, it's an alternative to
``sockstat`` from FreeBSD. It shows listening (TCP) applications, like
``netstat -ntlp``, but with a handy difference. It additionally shows
users, so instead of this
:: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:5984 0.0.0.0:* LISTEN 30617/beam.smp COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME beam.smp 30617 couchdb 16u IPv4 7652760 0t0 TCP 127.0.0.1:5984 (LISTEN) As you can see, it's much easier to guess what beam.smp is when you know