Skip to content

Commit

Permalink
✨ Add difftastic
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Jul 14, 2022
1 parent 67637dd commit a8c556f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ PS1="⨊ 𝕯𝓭𝓵:\[\033[36m\]\w\[\033[m\]$ " # ⚛ ⨊ 𝓓𝔇𝒟ℓℒ

# functions

alias kubetop="watch -n4 ~/git/kubetop.py"
alias kubetop="watch -n4 python ~/git/kubetop.py"
# https://gist.github.com/ddelange/24575a702a10c2cb6348c4c7f342e0eb
kubelogs() {
# View logs as they come in (like in Rancher) using mktemp and less -r +F.
Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Note: first open Chrome for the first time
- Use built-in keychain and app password from above, and add a Mac specific global gitignore:
```bash
git config --global user.name "ddelange"
git config --global user.email "14880945+ddelange@users.noreply.github.com" # https://github.com/settings/emails
git config --global user.email "ddelange@users.noreply.github.com"
git config --global credential.helper osxkeychain
# EITHER
Expand All @@ -331,6 +331,7 @@ Note: first open Chrome for the first time
gpg --armor --export <key-here> # paste this key at github.com/settings/keys
git config --global user.signingkey <key-here>
git config --global commit.gpgsign true
git config --global gpg.program "$(which gpg)"
# sign tags using git tag -s
```
- To [enable password caching](https://stackoverflow.com/a/38422272/5511061) for 1 week:
Expand Down Expand Up @@ -368,7 +369,7 @@ git config --global alias.co "checkout"
git config --global alias.mt "mergetool"
git config --global alias.st "status"
# split diff - needs icdiff (see below) - use `git icdiff` to keep output in terminal after less quits
git config --global alias.df '! f() { diff=$(git icdiff --color=always "$@") && test "$diff" && echo "$diff" | less -eR; }; f'
git config --global alias.df '! f() { diff=$(git difft "$@") && test "$diff" && echo "$diff" | less -eR; }; f'
# who needs the default verbose git log? - also try `git lg --all`
git config --global alias.lg "log --graph --oneline"
# tested with GitHub remote - ref https://stackoverflow.com/questions/28666357#comment101797372_50056710
Expand Down Expand Up @@ -416,13 +417,20 @@ git config --global alias.undo '! f() { git reset --hard $(git rev-parse --abbre
##### Split diff
- `git df` (above) uses less that keeps a clean terminal
- `git icdiff` (below) uses new core.pager that leaves less output in terminal after exiting
- `git icdiff` and `git difft` (below) uses new core.pager that leaves less output in terminal after exiting
```bash
pip install git+https://github.com/jeffkaufman/icdiff.git
git config --global --replace-all core.pager 'less -+$LESS -eFRSX' # with double quotes, $ will be evaluated
git config --global icdiff.options "--highlight --line-numbers --numlines=3"
git config --global difftool.icdiff.cmd 'icdiff --highlight --line-numbers --numlines=3 $LOCAL $REMOTE'
# with diff highlighting
pip install git+https://github.com/jeffkaufman/icdiff.git # installs git-icdiff for `git icdiff``
git config --global icdiff.options "--highlight --line-numbers --numlines=3 --color=always"
git config --global difftool.icdiff.cmd 'icdiff --highlight --line-numbers --numlines=3 --color=always $LOCAL $REMOTE'
# with syntax & diff highlighting
brew install difftastic
git config --global difftool.difft.cmd 'difft --display=side-by-side-show-both --color=always --background=light "$LOCAL" "$REMOTE"'
git config --global alias.difft 'difftool --tool difft --no-prompt'
```
Expand Down
19 changes: 12 additions & 7 deletions htoprc
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.1.2
config_reader_min_version=2
fields=0 48 17 18 38 39 2 46 47 49 1
sort_key=46
sort_direction=1
tree_sort_key=0
tree_sort_direction=1
sort_direction=-1
tree_sort_key=46
tree_sort_direction=-1
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=1
show_thread_names=0
show_program_path=1
highlight_base_name=1
highlight_deleted_exe=1
highlight_megabytes=1
highlight_threads=1
highlight_changes=0
Expand All @@ -20,6 +23,7 @@ strip_exe_from_cmdline=1
show_merged_command=0
tree_view=0
tree_view_always_by_pid=0
all_branches_collapsed=1
header_margin=1
detailed_cpu_time=0
cpu_count_from_one=1
Expand All @@ -30,8 +34,9 @@ account_guest_in_cpu_meter=0
color_scheme=0
enable_mouse=1
delay=10
left_meters=AllCPUs2 CPU Memory Swap
left_meter_modes=1 1 1 1
right_meters=DateTime Tasks LoadAverage Uptime
right_meter_modes=2 2 2 2
hide_function_bar=0
header_layout=two_50_50
column_meters_0=AllCPUs2 CPU Memory Swap
column_meter_modes_0=1 1 1 1
column_meters_1=DateTime Tasks LoadAverage Uptime
column_meter_modes_1=2 2 2 2

0 comments on commit a8c556f

Please sign in to comment.