aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
Commit message (Collapse)AuthorAgeFilesLines
...
* Use terser prompt status flag checksTom Ryder2016-08-211-8/+4
|
* Resolve an issue with incorrect prompt infoTom Ryder2016-08-211-0/+3
| | | | | | | | | | | | | From `man 1 git-config`: > diff.autoRefreshIndex > When using git diff to compare with work tree files, do not > consider stat-only change as changed. Instead, silently run git > update-index --refresh to update the cached stat information for > paths whose contents in the work tree match the contents in the > index. This option defaults to true. Note that this affects only > git diff Porcelain, and not lower level diff commands such as git > diff-files.
* Port path() to POSIX shTom Ryder2016-08-201-180/+0
| | | | That was a lot easier than I thought
* Port fnl() to POSIX sh script fnl(1)Tom Ryder2016-08-201-41/+0
| | | | | No real compelling reason to make it a shell function in the first place.
* Remove readv() and readz()Tom Ryder2016-08-202-29/+0
| | | | Neither are terribly useful
* Port vr(1) to POSIX shTom Ryder2016-08-201-59/+0
|
* Port lhn() to POSIX shTom Ryder2016-08-201-7/+0
|
* Port sd() to POSIX shTom Ryder2016-08-201-109/+0
|
* Port pd() to POSIX shTom Ryder2016-08-201-53/+0
|
* Port ud() to POSIX shTom Ryder2016-08-201-50/+0
|
* Port bd() to POSIX shTom Ryder2016-08-201-78/+0
|
* Change cd() into POSIX shell scriptTom Ryder2016-08-191-32/+0
|
* Add lhn()Tom Ryder2016-08-181-0/+7
|
* Don't do Git prompt work if not in working treeTom Ryder2016-08-181-0/+7
|
* Port grep() and ls() to POSIX shTom Ryder2016-08-182-55/+0
| | | | | | Check capabilities of wrapped programs at runtime, not declaration time. Also do away with the silly GREP_COLORS and GREP_OPTS variables. Considering doing the same with LS_COLORS.
* Move simple Bash/pdksh functions into POSIX shTom Ryder2016-08-1716-171/+0
| | | | | | | Have only translated the scripts that translate readily into POSIX sh for now. More complex stuff like that bd/pd/sd/ud navigation for Bash doesn't port as easily, mostly because there isn't an analogue for the "local" keyword in POSIX.
* Keep grep(1) option metadata in cacheTom Ryder2016-08-151-9/+11
| | | | | | | | | It's stupid to run `grep --help` once per shell (twice for login shells!) when it's so unlikely to change, and way faster to check for the presence or absence of hint files rather than pattern-match the output with the shell. ls(1) will get the same treatment in a minute.
* Don't use git: prompt prefix if PROMPT_VCS unsetTom Ryder2016-08-151-2/+3
| | | | | All of my personal stuff is in Git, so this is only really applicable at work
* Remove square brackets around promptTom Ryder2016-08-151-1/+1
| | | | Just noise
* Quote a PS1 character to appease shellcheckTom Ryder2016-08-141-1/+1
|
* Two extra commentsTom Ryder2016-08-141-0/+2
|
* Rearrange prompt variable assignments a bitTom Ryder2016-08-141-10/+12
|
* Use --quiet flag for prompt git-rev-parse(1) callTom Ryder2016-08-141-1/+1
|
* Use porcelain commands for Git promptTom Ryder2016-08-131-27/+9
| | | | | | | | | | | | Checking the output of `git status -z` works, but to be correctly handled requires using a null delimiter for read. Because I want to port this to OpenBSD pdksh (which doesn't have the -d option for read), this seems to be a workable alternative. It also enables me to remove the process substitution (another thing pdksh doesn't support), and the array of flags. I haven't yet tested this for speed.
* Fix comment typoTom Ryder2016-08-111-1/+1
|
* Test bc(1) for non-POSIX -qTom Ryder2016-08-111-0/+3
|
* Add explicit -n to hgrep() $HISTFILE checkTom Ryder2016-08-101-1/+1
|
* Remove Mercurial support from Bash promptTom Ryder2016-08-101-37/+0
| | | | | | Since Vim and Fanboy's list both moved to Git, I have no reason to use it anymore. Also added a note explaining why I've left the SVN stuff in there (I don't like SVN, but I do need to use it for work)
* Switch fnl()/scr() to use mktd(1)Tom Ryder2016-08-042-6/+3
|
* Move clrd()/clwr() to scriptsTom Ryder2016-08-022-13/+0
| | | | | clrd(1) is POSIX sh, but clwr(1) ideally needs Readline, so I've left it as #!/bin/bash for now.
* Strip trailing newline from clrd()Tom Ryder2016-08-021-1/+0
|
* Add clrd()Tom Ryder2016-08-021-0/+6
|
* Change apf() to a shell scriptTom Ryder2016-08-021-99/+0
|
* Change bell() to a POSIX sh scriptTom Ryder2016-08-011-4/+0
|
* Change cf() from Bash func to shell scriptTom Ryder2016-07-301-29/+0
|
* Move sprunge() Bash function to spr(1)Tom Ryder2016-07-301-5/+0
|
* Change pa and paz bash funcs to sh scriptsTom Ryder2016-07-302-11/+0
|
* Move bash completion setup into separate dirTom Ryder2016-07-3021-523/+1
|
* Change ca from Bash func to sh scriptTom Ryder2016-07-301-4/+0
|
* Change mkmv/mkcp from Bash funcs to sh scriptsTom Ryder2016-07-302-8/+0
|
* Remove md.bashTom Ryder2016-07-241-4/+0
| | | | Not really justified
* Replace use of ${var:?} with explicit errorsTom Ryder2016-07-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <http://mywiki.wooledge.org/BashFAQ/100#Default_or_alternate_values> >Nobody ever uses ${var?word} or ${var:?word}. Please pretend they don't >exist, just like you pretend set -e and set -u don't exist. ><tejr> from FAQ 100: >Nobody ever uses ${var?word} or ${var:?word}. ><tejr> why is that? just because it's unwieldy, or are there other >technical reasons? ><ormaaj> tejr: Putting random fatal unhandlable errors into a script is >generally useless. ><tejr> ormaaj: is it less handleable than a more explicit check, like >`[[ $var ]] || exit 1` ? ><ormaaj> yes ><ormaaj> # : ; ${_[RANDOM%2]?:you win} ><shbot> ormaaj: no output ><ormaaj> didn't win ><tejr> i was thinking more as a terse means of perhaps asserting a >variable had a value, like a positional parameter; are you saying if >you really did just want to write to stderr and exit with failure, it's >still inappropriate? ><ormaaj> depends on the complexity I suppose but I'd not consider that >unless it's the global scope in a file you know isn't going to be >sourced and has no other explicit error handling. Even then it's ugly >because it bails out in the middle of evaluating parameters that >technically could have side-effects and such. ><tejr> ahh yes, kinda a separation of concerns ><tejr> that makes more sense now! thank you > * tejr combs his scripts to see if he's used it anywhere ><ormaaj> tejr: another reason is the type of error is a bash error >which usually indicates a problem with the script where bash itself >can't continue. An unset var isn't a " bash error", You can even make >it print counterintuitive error messages that look like bash internal >errors. ><tejr> ormaaj: also compelling ><tejr> i've found a few "{@:?}"s in here so i'm fixing them up now ><tejr> thanks for the analysis
* Quote expansions within parameter expansionsTom Ryder2016-07-1513-22/+21
| | | | | | I made the incorrect assumption that it was safe not to do this; expansions that include glob characters, for example, can cause problems.
* Terser `read -rd ''` idiomTom Ryder2016-07-1511-12/+12
|
* Use set rather than building arg arraysTom Ryder2016-07-025-32/+27
| | | | | | Allows for terser functions and avoids error-prone local variables; also nicer to have a single `command` call at the end of the function (although there are still two at the end of the ed(1) wrapper)
* Terser pa/paz implementationsTom Ryder2016-07-022-6/+4
|
* Switch back to read array split for targetsTom Ryder2016-06-251-2/+8
| | | | Works better than the well-intended while-read loop
* More efficient/terser make(1) completionTom Ryder2016-06-241-21/+29
|
* Remove unneeded linebreak backslashesTom Ryder2016-06-213-14/+11
| | | | | | | | | | | Handy command: $ find bin sh bash -type f -exec grep \ -e '|| \\$' \ -e '&& \\$' \ -e '^\s*||' \ -e '^\s*&&' \ {} +
* Correct td(1) completionTom Ryder2016-06-151-4/+4
| | | | Forgot to narrow completions down to ones that match the current word