Skip to content

Commit 07230fa

Browse files
committed
gitignore twiddle and comments on all_binaries_in_path
1 parent cba60c5 commit 07230fa

File tree

6 files changed

+421
-219
lines changed

6 files changed

+421
-219
lines changed

.gitconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
diffcommitsfrommain = !"git log --no-merges origin/$(git mainormaster).."
3030
# ^^ also, 2 vs 3 dots: so important. https://stackoverflow.com/a/48681527
3131

32+
# I prefer these from my fish abbv's, but for bash we'll keep this as a fallback.
33+
db = diffbranch
34+
dbt = diffbranch-that
35+
3236
# Squash a branch to one commit against a branch with many non-main commits.
3337
# This can't be an alias, but here's the hack.
3438
# # be on the new feature branch, be okay with rewriting it's history.
@@ -159,9 +163,6 @@
159163
[include]
160164
path = ~/.gitconfig.local
161165

162-
#[init]
163-
# templatedir = ~/.git_template
164-
165166
[filter "lfs"]
166167
clean = git-lfs clean -- %f
167168
smudge = git-lfs smudge -- %f

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
# the symlink for this broke so.. whatever
1+
# This is intended as GLOBAL ~/.gitignore, not just this dotfiles repo. (But.. it's both.)
2+
3+
# I like having a personal readme file to keep notes.
4+
PAUL.readme.md
5+
6+
# git credential file
7+
.gitconfig.local
8+
9+
# Nice and clean by default, but this does create a problem if I don't add into new repos gitignore and other folks dont have the same default. problems when other folks don't have the same in their global gitignore.
10+
node_modules
11+
12+
# why u be like that
13+
.DS_Store

docs/bash history.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
* `sh` has terrible history mgmt, just dont even try.
2+
* `fish` is aiight but needs some love
3+
* `bash` is better with a lot of config (like the below) -- Even then it still isn't good enough:
4+
- up-arrow through history goes through all sessions, and not just the current one.
5+
6+
```sh
7+
# Enable history expansion with space
8+
# E.g. typing !!<space> will replace the !! with your last command
9+
bind Space:magic-space
10+
11+
# Use standard ISO 8601 timestamp
12+
# %F equivalent to %Y-%m-%d
13+
# %T equivalent to %H:%M:%S (24-hours format)
14+
export HISTTIMEFORMAT='%F %T '
15+
16+
# keep history up to date, across sessions, in realtime
17+
# http://unix.stackexchange.com/a/48113
18+
export HISTCONTROL="ignoredups" # no duplicate entries, but keep space-prefixed commands. (bash-sensible uses "erasedups:ignoreboth" but i think i validated this already?)
19+
# here's the popularity amonngst other-peoples-dotfiles... (cmd: ag --nogroup --noheading --nofilename --hidden -o "HISTCONTROL.*" | grep -E -o "(ignore|erase)[a-z:]*" | sort | uniq -c | sort -r)
20+
# 5 ignoreboth
21+
# 4 ignoredups
22+
# 2 erasedups:ignoreboth
23+
# 1 ignorespace:erasedups
24+
# 1 ignoredups:erasedups
25+
# 1 erasedups
26+
27+
export HISTSIZE=100000 # big big history (default is 500)
28+
export HISTFILESIZE=$HISTSIZE # big big history
29+
shopt -s histappend # append to history, don't overwrite it
30+
shopt -s cmdhist # Save multi-line commands as one command
31+
32+
33+
# Enable incremental history search with up/down arrows (also Readline goodness)
34+
# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/
35+
bind '"\e[A": history-search-backward'
36+
bind '"\e[B": history-search-forward'
37+
38+
# Don't record some commands
39+
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
40+
41+
# Save and reload the history after each command finishes. Also look for any conflicting prompt_command definitions!!
42+
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
43+
44+
# ^ the only downside with this is [up] on the readline will go over all history not just this bash session.
45+
```

fish/functions.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ function beep --description "make two beeps"
7979
echo -e '\a'; sleep 0.1; echo -e '\a';
8080
end
8181

82-
function all_binaries_in_path --description "list all binaries available in \$PATH, even if theres conflicts"
82+
function all_binaries_in_path --description \
83+
"list all binaries available in \$PATH (incl conflicts). pipe it to grep. top-most are what's used, in case of conflicts"
8384
# based on https://unix.stackexchange.com/a/120790/110766 but tweaked to work on mac. and then made it faster.
8485
find -L $PATH -maxdepth 1 -perm +111 -type f 2>/dev/null
85-
#gfind -L $PATH -maxdepth 1 -executable -type f # shrug. probably can delete this.
8686
end
8787

8888
function my_paths --description "list paths, in order"

0 commit comments

Comments
 (0)