Press Ctrl-B to fuzzy find all configuration CMake variables for the
current build directory. Once a variable is selected, rewrite the
command-line to set the selected CMake variable.
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.
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.