Commit graph

82 commits

Author SHA1 Message Date
Oliver Davies 6082de62b0 Look for .ignored/run when running commands
Make the `run` command cleverer by also searching for a `.ignored/run`
file, following the convention of always ignoring a `.ignored` directory
from Git.

This allows me to have a local `run` file that doesn't need to be
committed and pushed to the repo (e.g. it's too specific to me), and
being able to keep it outside of the root of the project directory where
it could be committed accidentally.

A similar approach was done by Andreas Möller using Makefiles in this
article:

https://localheinz.com/articles/2020/05/07/using-makefiles-in-projects-where-i-can-not-use-them

With this function, the `.ignored/run` file is executed if it's found
and exits with the status code of the command.

If not, it will fall back to using `./run` as before.

I considered reversing these and checking for `./run` first as there
could be a performance benefit but, if neither file is found, I want the
error to show `./run` and not `.ignored/run` as that's the main use
case.
2024-07-31 16:40:25 +01:00
Oliver Davies 75f983fea7 Revert "git: use difftastic"
This reverts commit c06fb20115.
2024-07-28 13:30:11 +01:00
Oliver Davies 22385b9a1c Revert "git: use difftastic by default"
This reverts commit 2fbf67507f.
2024-07-28 13:29:57 +01:00
Oliver Davies b944d20123 zsh: run zle reset-prompt in each widget
Instead of having to press the Enter key after running a widget, use
`zle reset-prompt` to reset the prompt.
2024-07-24 08:01:20 +01:00
Oliver Davies 15d6fa1aab tmux: update prefix key 2024-07-23 21:33:13 +01:00
Oliver Davies 0a28c2a5b3 zsh: open nvim with Ctrl+v 2024-07-23 20:47:53 +01:00
Oliver Davies ce9cf2ea83 Add gpl and gps abbreviations
`gpl` expands to `git pull` and `gps` expands to `git push`.
2024-07-14 10:38:24 +01:00
Oliver Davies 537eb704e7 zsh: remove zsh-auto-notify plugin
`AUTO_NOTIFY_IGNORE` keeps being reset within a tmux session, so I'm
removing this for now until I have time to investigate further and
resolve.
2024-07-11 13:14:10 +01:00
Oliver Davies d2ae9d01ee git-instafix: set a default upstream branch 2024-07-11 02:58:46 +01:00
Oliver Davies a2ed026258 Use $REPOS variable consistently in scripts 2024-07-10 13:44:09 +01:00
Oliver Davies f0e3671e1d zsh: remove unused functions 2024-07-09 14:25:41 +01:00
Oliver Davies 5bf2253f98 git: organise extraConfig values 2024-07-09 14:25:00 +01:00
Oliver Davies 2fbf67507f git: use difftastic by default
As described in
https://difftastic.wilfred.me.uk/git.html#difftastic-by-default, the
`--ext-diff` option needs to be used for difftastic to be used on
commands other than `git diff`, such as `git show` or `git log`.

> This only applies to git diff. For other git commands, you still need
to specify --ext-diff, or use an alias as described above.

```shell
$ git diff
$ git show HEAD --ext-diff
$ git log -p --ext-diff
```

> Conversely, if you need to copy/paste a diff in the standard diff
format, you can use git diff --no-ext-diff.
2024-07-09 14:15:46 +01:00
Oliver Davies c06fb20115 git: use difftastic 2024-07-09 13:53:02 +01:00
Oliver Davies 42c1bc4045 zsh: remove just override 2024-07-09 12:01:08 +01:00
Oliver Davies 0c4167a464 zsh: don't automatically source zsh plugins
It seems this is done automatically.
2024-07-08 18:46:56 +01:00
Oliver Davies d769885d8f Flatten Code directories 2024-07-06 02:21:40 +01:00
Oliver Davies 53b8745b34 Update git-instafix to 0.2.7
v0.2.6 contained fixes for trunk-based development workflows that don't
require being on a separate branch.

https://github.com/quodlibetor/git-instafix/releases/tag/v0.2.6
2024-07-06 01:38:44 +01:00
Oliver Davies 0fc3c765e5 tmux: remove padding around words in the status
...bar
2024-07-05 23:10:56 +01:00
Oliver Davies d37e30e67c git: ignore .ddev/providers 2024-07-05 15:12:06 +01:00
Oliver Davies b636f365ca tmux: remove tmuxinator 2024-07-03 09:08:47 +01:00
Oliver Davies b11055fd8e zsh: configure auto-notify ignore settings 2024-07-03 09:08:47 +01:00
Oliver Davies b68d48603e zsh: extract aliases and abbreviations into
...separate files
2024-06-30 14:22:57 +01:00
Oliver Davies 0ec273cbb4 zsh: fix gs alias for git status 2024-06-29 20:51:22 +01:00
Oliver Davies 53423ccdbf zsh: add zsh-auto-notify plugin
Shows notifications when long running tasks are completed.

See https://github.com/MichaelAquilina/zsh-auto-notify.
2024-06-29 20:47:41 +01:00
Oliver Davies 0df5f17dae zsh: migrate to zsh-abbr
Migrate from `zsh-expand` to `zsh-abbr` as it seems more performant and
isn't giving me unwanted expansions, such as when typing `run` within
this repository and it completing to something else.

Whilst Home Manager does have `programs.zsh-attr`, there isn't an option
for setting global abbreviations that expand anywhere in the command,
which I need to replace global ZSH aliases such as `G` which expands to
`| grep`.

For now, I've installed `zsh-abbr` via zplug and am creating the
`user-abbreviations` file using Home Manager where I can use `attr -g`
for global aliases.

If or when support is added for global abbreviations in Home Manager,
I'll switch to `programs.zsh-abbr.abbreviations`.

`programs.zsh.shellAliases` is still used for aliases that shouldn't
expand, whereas everything else has been moved to abbreviations.
2024-06-25 12:43:30 +01:00
Oliver Davies 3092cafb20 tmux: make the status bar transparent 2024-06-24 22:36:48 +01:00
Oliver Davies b3b96c3163 Add navigation aliases 2024-06-19 22:04:51 +01:00
Oliver Davies 5ba78f110a Configure starship prompt
Based on the Plain Text present.

https://starship.rs/presets/plain-text
2024-06-19 22:04:51 +01:00
Oliver Davies f0163cd28c Revert "Reapply "Remove starship""
This reverts commit 7c06364329.
2024-06-19 21:59:18 +01:00
Oliver Davies 1e14953314 Add git-instafix
As seen on
https://www.youtube.com/live/ik_d0dWYQgQ?si=XSNR00ovIgSu7Ent&t=6510,
`git-instafix` is a tool for quickly fix up an old commit using your
currently-staged changes.

https://github.com/quodlibetor/git-instafix
2024-06-19 08:07:02 +01:00
Oliver Davies 25b286786d Re-add alacritty 2024-06-15 12:22:36 +01:00
Oliver Davies 9f33af70a3 Change status bar background colour 2024-06-11 23:39:38 +01:00
Oliver Davies 7f2df5f726 Run nix fmt
Format using `nixfmt-rfc-style`.
2024-06-10 09:38:34 +01:00
Oliver Davies 7c06364329 Reapply "Remove starship"
This reverts commit e4923e708e.
2024-06-09 20:55:21 +01:00
Oliver Davies f952e2d6b8 Refactor zsh configuration
* Move aliases into `programs.zsh.shellAliases` and
  `programs.shellGlobalAliases`.
* Use the `MenkeTechnologies/zsh-expand` plugin instead of using custom
  expansion code.

https://github.com/MenkeTechnologies/zsh-expand
2024-06-09 20:54:19 +01:00
Oliver Davies e4923e708e Revert "Remove starship"
This reverts commit 90a1ca81aa.
2024-06-02 01:43:01 +01:00
Oliver Davies c8bc522268 Revert "Use fzf for searching zsh history"
This reverts commit 0bbd536e3e.
2024-06-01 14:38:55 +01:00
Oliver Davies a29372ef99 Try using wezterm as my default terminal 2024-05-31 19:43:51 +01:00
Oliver Davies 361412db61 Add wezterm
Add wezterm as another terminal option and to see how it compares to
Alacritty.
2024-05-24 15:29:00 +01:00
Oliver Davies c8cc72b1ac Add build-configs from its derivation
It currently uses a local version of `build-configs`. I need to look
into how to get it to with Nix and a private GitHub repository.
2024-05-22 09:21:25 +01:00
Oliver Davies 395e92054e Add vss alias for sorting words in my spellfile
Automatically sort and update the words within my `spellfile` that's
used by Neovim.
2024-05-22 08:52:27 +01:00
Oliver Davies ab20c7de69 Consolidate Git aliases
Move the `update` alias into the Git namespace, so it's now `git
update`, and remove the others that I wasn't using.
2024-05-20 19:09:17 +01:00
Oliver Davies f766a15616 Alias cat to bat 2024-05-15 13:49:05 +01:00
Oliver Davies 7b9e5c6cfc Add todo and til functions
Add helper functions to write text input into a `TODO.txt` or `TIL.txt`
file respectively.

Extracting this to a function means I'm not able to overwrite the
contents of a file by typing `echo "foo" > TODO.txt` or similar
accidentally and overwriting the entire file instead of appending to it.
2024-05-12 09:25:21 +02:00
Oliver Davies 475a2195c0 Configure lsd
See: https://github.com/lsd-rs/lsd
2024-05-11 01:55:59 +02:00
Oliver Davies 0a5815c116 Add the git root command
Add the `git root` command shown by Greg in his YouTube video:

https://www.youtube.com/watch?v=C5aRtq-Rtbg
2024-05-09 23:57:05 +01:00
Oliver Davies 5d3f7ef58f Override just command
If a `.ignored/justfile` exists, e.g. for open-source projects I can't
commit a `justfile` to, use it by default.
2024-05-09 23:40:30 +01:00
Oliver Davies 634ed23325 Override the ttyper command with a function
Set values for the number of words and languages, as there isn't a word
setting to add to a `config.toml` file.

This is based on https://www.youtube.com/watch?v=C5aRtq-Rtbg by Greg
Hurrell.
2024-05-09 23:31:43 +01:00
Oliver Davies 0976d079e4 Fix copying from tmux to the system clipboard 2024-05-09 18:53:09 +01:00