When using `git` aliases, the alias would be highlighted red by
fast-syntax-highlighting even though the alias is valid so remove it and
go back to zsh-syntax-highlighting instead.
With `setopt nonomatch` unescaped `*` can be used in command arguments
however when passing command arguments to `vimdebug` the `*` _should_
be escaped so that the debugger e.g. `gdb` will correctly invoke the
program where `setopt nonomatch` does not apply.
In addition to setting the `~build` hashed directory, also export the
`build_dir` environment variable to enable commands like this:
```
cmake . -B$build_dir
```
VIM 8.1 added the optional plugin termdebug which integrates gdb
with separate buffers for source, output, and gdb console. This adds the
`vimdebug` command which enables the termdebug plugin and executes the
`:TermdebugCommand` with the given arguments.
Tips from [zsh-vimto](https://github.com/laurenkt/zsh-vimto).
* Remove delay when changing mode
* Enable backspace when returning to viins from vicmd mode
Following on from the previous commit, use of `RPS1` results in the
prompt being redrawn when the terminal gets narrower, this makes the
line drawn by `fresh_line_one` scroll off the screen. By removing any
use of `RPS1` this behaviour goes away.
* When a command fails, don't print the error code at the end of the
first line but directly after the git stats.
* Remove `cr` from `prompt_opts` since there is no longer a new line in
`PS1`, combined with above, this result in no new lines being inserted
when the terminal becomes narrower e.g. a horizontal tmux split.
* Remove `fresh_visible_length` function and instead use the length of
string variables e.g. `${#userhost}`.
After fixing the macOS `/etc/zprofile` issue rewriting the `PATH`
environment variable it is no longer necessary to explicitly add
`/usr/local/opt/python/libexec/bin` to `PATH` since Homebrew installed
python 2.x is installed in `/usr/local/bin` and is used by default.
macOS is obnoxious and overwrites the PATH from a users ~/.zshenv, which is
sourced first, in /etc/zprofile by calling `/usr/libexec/path_helper -s` so
this is required so that PATH is once again set to the desired value.
Update the build-dir shell function to usage zcurses instead of the
Python pick package to interactively select build directories, this
results in a more responsive user experience. Add argument parsing to
handle various use cases. Add prompt when the build command for the
selected build directory could not be detected, allowing the user to
specify the desired build command.
```
usage: build-dir [-h] [--build] [<directory>]
Find and select the current build directory interactively.
positional arguments:
<directory> the build directory to select
optional arguments:
-h, --help show this help message and exit
--build invoke a build after selection
```
* `build` is an alias which on first use invokes `build-dir --build` to
select a build directory, reconfigure the `build` alias, and invoke
the `build` alias on the selected build directory.
* `debug` is an alias to the installed system native debugger.
* `build-dir` is a function to select a build directory by reconfiguring
the `build` alias, it detects `build.ninja` or `Makefile` in the build
directory and selects the appropriate `ninja` or `make` command.
Depends on the `build-dir.py` Python script which uses the `pick`
package to interactively select the build directory.
* `build-run` is a function which builds the specified target then
attempts to run it, making the assumption it resides in the `bin`
subdirectory of the build directory.
* `build-debug` is a function which build the specified tared then
attempts to debug it using the system native debugger, making the
assumption it resides in the `bin` subdirectory of the build
directory.