167 Commits

Author SHA1 Message Date
df819f58a8 Update fresh prompt
* 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}`.
2018-08-30 21:04:05 +01:00
c636dd078c Update sandbox to use .enter and .exit 2018-08-28 22:15:33 +01:00
0992b65d17 Don't explicitly add python to PATH
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.
2018-08-28 21:58:22 +01:00
9e9c43a0cf Fix error in build-dir when --build is not set 2018-08-28 14:44:19 +01:00
0ab04406ec Fix macOS PATH being rewritten in /etc/zprofile
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.
2018-08-26 20:19:12 +01:00
e17ff47d5e Only load layout when inside tmux 2018-08-26 19:11:29 +01:00
ff8bb3e4ab Change layout path to ~/.local/share/tmux/layouts 2018-08-26 18:39:02 +01:00
31d06e0f19 Add sandbox directory color to fresh_line_one 2018-08-26 15:37:30 +01:00
7bb6a459ee Fix autoenv's use of zstat 2018-08-25 15:45:11 +01:00
9e4c984822 Fix chsh to work on macOS 2018-08-24 18:26:13 +01:00
9af452a8e2 Update readme file 2018-08-24 12:29:15 +01:00
3194afc80d Replace build-dir.py with zcurses build-dir
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
```
2018-08-24 11:04:18 +01:00
087a315289 Fix build-run and build-debug functions 2018-08-22 17:17:06 +01:00
9b54ebc366 Add fast-syntax-highlighting theme: fresh 2018-08-22 13:44:57 +01:00
9f9c4a11eb Add GoogleTest environment variables 2018-08-22 10:22:36 +01:00
8cad5acd83 Correct build command todo list 2018-08-20 10:41:34 +01:00
90b3e24789 Load work config if present 2018-08-20 10:23:33 +01:00
ada3cb7d3d Add layout and note plugins 2018-08-20 10:16:45 +01:00
e13e70de6b Actually add sandbox plugin 2018-08-20 10:12:43 +01:00
b61ebc4f7a Enable sandbox plugin 2018-08-19 22:20:09 +01:00
f7d952c628 Use bash for default shell on removal 2018-08-19 21:01:02 +01:00
65b0b7a099 Remove --user from pick pip action 2018-08-19 19:30:33 +01:00
64dcee0d78 Use fast-syntax-highlighting
Replace zsh-syntax-highlighting plugin with the improved
fast-syntax-highlighting, faster and more accurate.
2018-07-19 23:52:47 +01:00
128cc3c57a Remove unused tmux split aliases 2018-07-19 23:14:45 +01:00
8e04758760 Fix debug alias always picking gdb 2018-06-17 23:04:59 +01:00
52f42a7875 Edit the command line with ^F in normal mode 2018-06-09 17:41:07 +01:00
639e1b9cee Fix typo in CMAKE_EXPORT_COMPILE_COMMANDS 2018-06-08 19:57:33 +01:00
b12dcfe243 Add build utility commands
* `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.
2018-05-01 23:25:31 +01:00
e9993b0874 Add autoenv command to manage autoenv's
usage: autoenv [-h] {init,edit,deinit}

options:
        -h, --help  show this help message and exit

commands:
        init        add .enter and .exit scripts in current directory
        edit        edit .enter and .exit scripts in current directory
        deinit      remove .enter and .exit scripts in current directory

Fixes #9.
2018-04-26 20:18:47 +01:00
40c2395f43 Add default pip completion
The default pip completion is suboptimal because it uses the old Zsh
completion engine which is compatible with bash.
2018-04-24 20:47:50 +01:00
9f7367c550 Add autoenv, automatic environment setup
Using a hook, automatically detect when `.enter` and `.exit` scripts
and source them when changing the shells current directory.

Fixes #3.
2018-04-22 19:03:53 +01:00
d58e543c78 Improve & rename plugin sourcing function
Rename `plugin-load` to `source-plugin` and add a check for the plugin
directory, a message is displayed if it does not exist.
2018-04-22 12:15:38 +01:00
9e77e83d7f Only add aliases when the target command exists
Previously aliases for commands were added without checking if the
command being aliased existed first, this is now not the case.
2018-04-21 17:18:43 +01:00
5a1ef73524 Fix ccache compiler aliases being first in PATH
Add ccache symlink directory to start of PATH, this must be after
`typeset -U PATH` because on macOS this reorders the list so ccache's
symlinks will no longer be at the start of PATH rendering it unusable.
2018-04-21 16:59:35 +01:00
0ecc231c18 Fully disable tty flow control
From experimenting `unsetopt flow_control` seems to only disable flow
control for Zsh itself, not for child processes like Vim. To fix the
issue also call `stty -ixon` to disable flow control completely.

Fixes #8
2018-04-15 17:22:41 +01:00
7653ea6f93 Add -a option to enable almostontop behaviour
* Add option parsing to `prompt_fresh_setup` to detect when options are
  set during setup.
* Add `-a` option to enable almostontop behaviour, every time a command
  is invoked the screen is cleared and the is prompt redrawn before the
  command begins using the `preexec` hook. `-a` is disabled by default.
* Add `prompt_fresh_help` function to display a description of available
  options using `prompt -h fresh`.
* Canonicalize all utility functions for the fresh prompt theme to
  follow the `fresh_<name>` convention.

Fixes #1.
2018-04-15 16:28:05 +01:00
2c189c87e6 Support changing cursor shape in iTerm2 in tmux
Depends on setting the following in `.tmux.conf`:

    set -ga terminal-overrides '*:Ss=\E]1337;CursorShape=%p1%d\7'

This allows changing the iTerm2 cursor shape using the same escape
sequences as used for VTE compatible terminals.
2018-01-02 16:54:49 +00:00
a450b3cb45 Fix cursor shape change bug in tmux
Sending escape sequences directly from zsh and bypassing tmux results in
the wrong cursor shape when switching between panes which no longer
reflect the current zsh vi mode.

When using ZTE compatible terminals tmux supports tracking cursor shape
changes on a per pane basis using a suitable `terminal-override`, this
allows zsh and vim to behave as if they are not operating in tmux and
everything works as expected. However, so far I've not been able to
reproduce this behaviour in iTerm2.
2018-01-02 16:54:49 +00:00
2846e7d68e Enable reverse order completions 2018-01-02 16:54:49 +00:00
9da4d8ee71 Add autosuggestions plugin
Fish-like autosuggestions for zsh
2018-01-02 16:54:45 +00:00
4fce36e27b Add Homebrew python to PATH if present 2017-12-04 21:38:30 +00:00
38c3992418 Cleanup README plugin section 2017-12-03 13:51:08 +00:00
e04b49633c Add cursor shape change dependant on vi mode 2017-12-01 16:58:41 +00:00
a8fe7e42af Remove incorrect vi bindings 2017-12-01 16:57:24 +00:00
b6fffc35fc Add README file 2017-11-30 21:08:57 +00:00
d7daa09b22 Reorder options and make them lower case 2017-11-30 21:05:43 +00:00
c3c6b83313 Remove duplicates from MANPATH and INFOPATH too 2017-11-30 20:52:10 +00:00
29b73d3b26 Add whole line vicmd bindings 2017-11-30 20:51:51 +00:00
deb03421a3 Reorder ~/.local environment variables 2017-11-30 20:51:29 +00:00
0e734bbc7b Remove prompt options, they are enable in a theme 2017-11-30 20:44:56 +00:00