aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
AgeCommit message (Collapse)AuthorFilesLines
2018-11-30Suppress a couple of ShellCheck errorsTom Ryder1-0/+1
2018-11-30Remove redundant return short-circuitTom Ryder1-1/+1
2018-11-30Use ||/&& short-circuiting only for flow controlTom Ryder1-19/+39
If we're doing something besides return/exit, it should be a proper `if` condition so that the semantics are clearer.
2018-07-25Stamp down three new ShellCheck 0.5.0 errorsTom Ryder2-2/+2
All of these are false positives.
2018-06-29Break sh noglob guard into two lines for clarityTom Ryder2-2/+4
They're nicer to read this way.
2017-11-08Quote all Bash completion targets literallyTom Ryder1-45/+46
This helps ShellCheck understand them as literal strings for linting purposes, but it seems (and highlights) a little bit clearer this way anyway.
2017-11-06Add "do", "then" keywords to Bash completionTom Ryder1-0/+2
The Bash keywords "do" and "then" will be followed by another command. Adding them to this list means that pressing tab after "if foo ; then b" will complete for all command names beginning with "b". I was actually a little surprised that this worked, but there isn't really any reason to be; they're shell words just like everything else, not metasyntactic characters or anything like that.
2017-11-06Break bash/bashrc.d/completion.bash inline listsTom Ryder1-19/+66
Break the sometimes long list of target keywords after the `complete` builtin and its options into newline-separated lists. This should make reading these lists a little easier, and also confuses Vim's syntax highlighting somewhat less.
2017-07-05Escape backslashes in command prompt outputTom Ryder1-4/+10
To stop them getting interpreted as \h, \w etc. None of these *should* be able to emit backslashes (it's an illegal branch name), but best to be thorough.
2017-06-19Remove user@ prefix from promptTom Ryder1-2/+2
2017-06-16Allow setting a prompt mode for the shellTom Ryder1-2/+2
2017-02-17Revert "Use backslash to escape single char"Tom Ryder1-2/+2
This reverts commit 245c2d6647e34fb432066360499ed02c5711271c. shellcheck worries about this.
2017-02-12Use backslash to escape single charTom Ryder1-2/+2
2017-02-10Break a long lineTom Ryder1-2/+2
2017-02-10Break a long lineTom Ryder1-1/+2
2017-02-10Improve and correct some commentsTom Ryder1-4/+4
2017-01-28Start using Bash host completionTom Ryder1-0/+4
But use ~/.hosts if it's there
2017-01-27Extend "fallback" prompt a bitTom Ryder1-1/+4
Include username/hostname if no SSH variables
2017-01-25Show prompt prefix if a shell is exoticTom Ryder1-0/+6
That is, include e.g. "ksh:" as a prefix to the prompt if the user appears to have Bash or Zsh (or anything else) as their login shell. This is probably imperfect, but it's a start.
2017-01-25Be more specific in ref name trimmingTom Ryder1-1/+1
e.g. for a namespaced branch "foo/bar/bar", don't strip the leading part off
2017-01-24Remove SHLVL nested shell feature for nowTom Ryder1-6/+0
Causes a bit too much curliness in configuration; may need a more comprehensive approach.
2016-12-27Add workaround to what looks like a bug to meTom Ryder1-0/+5
2016-12-27Tell ShellCheck to ignore an errorTom Ryder1-0/+1
ret actually is assigned, just not in any place ShellCheck could reasonably be expected to find
2016-12-27Realised easy win avoiding subshellsTom Ryder1-7/+4
And also the PROMPT_RETURN fudge in Bash/Zsh
2016-12-22Use [!...] not [^...]Tom Ryder1-1/+1
More portable
2016-12-21Fix printf argument mismatch bugsTom Ryder2-2/+2
What did we do before ShellCheck?
2016-12-21Use clearer logic for prompt color settingTom Ryder1-8/+7
2016-12-19Request version with "ver" shortcut not promptTom Ryder1-0/+4
2016-12-19Attempt a much saner approach to managing SHLVLTom Ryder1-3/+2
2016-11-30Handle tmux sessions showing SHLVL properlyTom Ryder1-3/+3
2016-11-30Only add > starting from SHLVL=2Tom Ryder1-1/+1
2016-11-30Add > signs to show shell indentation levelTom Ryder1-0/+7
This needs extension to handle tmux sessions; it should be something like SHLVL - TMUX_SHLVL, which I'm not quite sure how to implement yet.
2016-10-15Correct check of --is-work-tree testTom Ryder1-1/+1
2016-10-04Add % prefix to job spec completionTom Ryder1-2/+2
2016-09-30Stop `keep` writing empty files for undef varsTom Ryder1-13/+12
2016-09-23Completion for aliasesTom Ryder1-1/+4
2016-09-20Add some var quoting within param expansionTom Ryder1-6/+6
2016-09-20Block output/error from prompt tput(1)/git(1)Tom Ryder1-102/+102
Should make things just a little bit faster
2016-09-08Fix an issue (silencing Git prompt errors)Tom Ryder1-1/+1
2016-09-07Restore old code for describing Git prompt commitTom Ryder1-1/+2
I'm really confused. I could have sworn this was working correctly (i.e. the --always option spat out a short reference to the commit as a fallback), but I must have been wrong. Maybe I hadn't installed the appropriate file when I was testing it. At first I thought this was a bug introduced in Git 2.10, but the short-circuit disregarding --always if --exact-match or --candidates=0 is set seems to have been in the `describe` builtin for ages. I must have just tested poorly; I can't see any other explanation in the source. No matter; this isn't much slower.
2016-09-05Complete kill builtin with jobspecs and user PIDsTom Ryder1-1/+1
2016-09-05Flesh out builtin completions a littleTom Ryder1-7/+8
2016-09-03Test number of colors properly for promptTom Ryder1-31/+26
2016-09-01Correct completions for declare, typeset etcTom Ryder1-4/+1
All of them can accept function names
2016-08-31Restore git symbolic-ref as first attemptTom Ryder1-2/+4
Otherwise if two branches point to the same commit, you can't be sure which one will show up.
2016-08-31Efficiency tweaks for Subversion promptTom Ryder1-17/+11
2016-08-31Stop loop when we have needed svn info varsTom Ryder1-3/+2
2016-08-31Remove unneeded fallback for $nameTom Ryder1-2/+1
We've already bailed out by this point if we couldn't get one
2016-08-31Move git index update higher upTom Ryder1-3/+3
2016-08-31Use simpler method to find branch nameTom Ryder1-11/+9
Only one call to git(1), too; seems to work at least as far back as Git v1.5.6.5