aboutsummaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-17 18:07:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-17 18:17:25 +1200
commit79ef80c29ffc4e19e556266f69538e6a791cef66 (patch)
treebc8e38818d38562e0ad291ae77b4958ac4315f33 /README.markdown
parentAdd parens after hgrep() name in error (diff)
downloaddotfiles-79ef80c29ffc4e19e556266f69538e6a791cef66.tar.gz
dotfiles-79ef80c29ffc4e19e556266f69538e6a791cef66.zip
Update README to reflect change of shell funcs
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown53
1 files changed, 43 insertions, 10 deletions
diff --git a/README.markdown b/README.markdown
index 74a3cc44..4800faaf 100644
--- a/README.markdown
+++ b/README.markdown
@@ -185,25 +185,58 @@ I also add completions for my own scripts and functions where useful.
#### Functions
-There are a few other little tricks in `bash/bashrc.d`, including:
+If a function can be written in POSIX `sh` without too much hackery, I put it
+in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include:
+
+* `bc()` silences startup messages from GNU `bc(1)`.
+* `diff()` forces the unified format for `diff(1)`.
+* `ed()` tries to get verbose error messages, a prompt, and a Readline
+ environment for `ed(1)`.
+* `gdb()` silences startup messages from `gdb(1)`.
+* `gpg()` quietens `gpg(1)` down for most commands.
+* `hgrep()` allows searching `$HISTFILE`.
+* `keychain()` updates `$GPG_TTY` if set for `keychain(1)`.
+* `mkcd()` creates a directory and changes into it.
+* `mysql()` allows shortcuts to MySQL configuration files stored in
+ `~/.mysql`.
+* `pwgen()` generates just one decent password with `pwgen(1)`.
+* `rcsdiff()` forces a unified format for `rcsdiff(1)`.
+* `scp()` tries to detect forgotten hostnames in `scp(1)` command calls.
+* `scr()` creates a temporary directory and changes into it.
+* `sudo()` forces `-H` for `sudo(8)` calls so that `$HOME` is never
+ preserved; I hate ending up `root`-owned files in my home directory.
+* `tmux()` changes the default command for `tmux(1)` to `attach-session -d`
+ if a session exists, or creates a new session if one doesn't.
+* `vim()` defines three functions to always use `vim(1)` as my `ex(1)`,
+ `vi(1)` and `view(1)` implementation if it's available.
+
+There are a few other little tricks defined for other shells, mostly in
+`bash/bashrc.d`:
* `bd()` changes into a named ancestor of the current directory.
-* `fnl()` runs a command and save its output and error into temporary files.
-* `hgrep()` searches `$HISTFILE`.
+* `cd()` wraps the `cd` builtin to allow for a second parameter for string
+ substitution, emulating a Zsh function I like.
+* `fnl()` runs a command and saves its output and error into temporary files,
+ defining variables with the filenames in them.
+* `grep()` tries to apply color and other options good for interactive use,
+ depending on the capabilities of the system `grep(1)`. It's dependent on
+ information written by the `grep.sh` script in `~/.profile.d`.
* `keep()` stores ad-hoc shell functions and variables.
-* `mkcd()` creates a directory and changes into it.
+* `ls()` tries to apply color to `ls(1)` for interactive use if available.
+ It's dependent on information written by the `ls.sh` script in
+ `~/.profile.d`.
* `path()` manages the contents of `PATH` conveniently.
* `pd()` changes to the argument's parent directory.
+* `prompt()` sets up my interactive prompt.
+* `pushd()` adds a default destination of `$HOME` to the `pushd` builtin.
* `readv()` prints names and values from `read` calls to `stderr`.
* `readz()` is an alias for `read -d '' -r`.
-* `scr()` creates a temporary directory and changes into it.
* `sd()` changes into a sibling of the current directory.
* `ud()` changes into an indexed ancestor of a directory.
-
-I also wrap a few command calls with functions to stop me from doing silly
-things that the commands themselves don't catch. My favourite is the one that
-stops me from calling `scp(1)` with no colon in either argument. I also do
-things like give default arguments to `pwgen(1)`.
+* `vared()` allows interactively editing a variable with Readline, emulating
+ a Zsh function I like by the same name.
+* `vr()` tries to change to the root directory of a source control
+ repository.
#### pdksh