Commit Graph

246 Commits

Author SHA1 Message Date
Philip Schaten
2428af06aa theme_display_ssh - switch added 2018-03-25 09:01:22 -07:00
Justin Hileman
5acaae3f62 Improved color scheme handling.
- Improve performance significantly in the base case (i.e. when git or something isn't slowing it down anyway).
- Make `bobthefish_display_colors` a non-underscore function. It's meant for public use :)
- Support previewing _different_ color schemes via `bobthefish_display_colors`. Pass a color scheme name, or `--all` to preview everything.
- Make color overrides a bit fishier: use a `bobthefish_colors` function to override color schemes, rather than declaring a whole pile of variables.
- Add support for a base color scheme in `bobthefish_colors`, in case you don't want to override everything.
- Add a deprecation notice with upgrade instructions for users with old-style custom color schemes.
2018-03-25 08:58:10 -07:00
Justin Hileman
b579292c22 Add the dev null redirect missed in #140 2018-03-22 23:02:51 -07:00
Alberto Cavalin
c6d8357a91 fish_prompt: fix __bobthefish_rvm_info for both rvm installation types (#140) 2018-03-22 23:01:39 -07:00
remche
0cc32a5585 adding desk prompt (#132)
A prompt segment for desk shell environment.
https://github.com/jamesob/desk
2018-03-21 07:08:21 -07:00
Justin Hileman
4ac7f3c5d7 Switch "hide git master branch" logic from opt-in to opt-out
This is a better default.
2018-03-21 06:38:08 -07:00
Justin Hileman
e57a8f344c Support hiding "master" branch name.
I've been using this for a bit, and I'm starting to think this should be the default, so I might switch it from opt-in to opt-out at some point :)
2018-03-03 19:59:33 -08:00
Justin Hileman
39d2739fb7 Fix python version detection with pypy (probably)
See #137
2018-03-01 15:51:03 -08:00
Justin Hileman
348666beaf Better +/-0 filtering
Fixes #135
2018-02-24 10:29:21 -08:00
Justin Hileman
e3d4545f74 Nope. That one didn't work in empty repos. Oh well. 2018-02-21 09:56:53 -08:00
Justin Hileman
dd3d58ac5e Fix regression in "staged" git flag
Fixes #134
2018-02-21 09:46:01 -08:00
Justin Hileman
523f7d916a Omit +0 and -0 from verbose dirty state 2018-02-20 22:33:51 -08:00
Justin Hileman
8bd72dbe19 Match "or return" style used elsewhere 2018-02-20 22:30:19 -08:00
Philip Fulgham
180f251189 Add verbose option for Git dirty state (#133)
* Add verbose option for Git dirty state

* Simplify git dirty verbose setting check
2018-02-20 22:25:19 -08:00
Justin Hileman
d1731ae1e1 huh. weird that we were still using glyphs there. 2018-02-20 22:20:50 -08:00
Justin Hileman
da2cd2eac4 use index for git staged status
hashtag premature optimizations
2018-02-20 22:16:17 -08:00
Justin Hileman
e067bba8a4 words 2018-02-20 22:15:23 -08:00
remche
6b65311b6c fixing dirty indentation 2018-02-20 14:57:40 +01:00
remche
f8d99f2a46 adding desk prompt 2018-02-16 15:18:48 +01:00
Justin Hileman
aa6a8e3c1d Stop looking for .hg when we hit root
We used to do this, in a different way, but let's make it super explicit.

Fixes #127
2018-01-28 19:45:53 -08:00
Justin Hileman
d0a6e45403 Allow disabling the "dirty" check for git.
This gets suuuuper slow for big repos. Support disabling it globally, via `theme_display_git_dirty`, or per-repo, using the `bash.showDirtyState` git config.
2018-01-10 13:43:38 -08:00
Justin Hileman
03ad58508a Don't show k8s segment for empty "current context"
Fixes #122
2018-01-10 06:38:55 -08:00
Justin Hileman
914530cca4 Fix typo in hostname display
Fixes #121
2018-01-03 13:23:57 -08:00
Justin Hileman
d657024ce3 Support replace_one vi mode
Fixes #120
2017-12-31 05:44:38 -08:00
Justin Hileman
69c737f592 Support k8s $KUBECONFIG, multiple configs, fallback. 2017-12-27 12:06:24 -08:00
Avital Tamir
6583634a9f Added support for showing current kubernetes context 2017-12-27 12:06:24 -08:00
Justin Hileman
d8d7a544cf Oops :) 2017-12-24 11:51:22 -08:00
Justin Hileman
7d6c23e1dd Rework adsf a bit for performance.
Add a comment re: adsf provenance format caveat.

See #119
2017-12-24 11:28:55 -08:00
John Schank
753189f173 #114 Add asdf ruby version to ruby version prompt
Followed established pattern for chruby and rbenv, adding the ruby
version number from asdf to the ruby prompt, only when the local
ruby version differs from the system ruby.

Note that asdf tracks its versions in a dot file (.tool-versions) so
the concept of what is global/system vs what is local simply depends
upon what file asdf is using to determine the correct version.
Fortunately, asdf reports the .tool-versions file when querying for
the current version.

The downside to this is that correct behavior of this patch will
depend upon the format asdf uses for their provenance string.

See https://github.com/asdf-vm/asdf for details about asdf
2017-12-24 14:25:13 -05:00
Justin Hileman
ab7123e063 Better faster stronger vcs ignore path matching 2017-12-23 19:52:07 -08:00
Justin Hileman
89cda861ba Style change, for consistency. 2017-12-23 19:39:26 -08:00
Justin Hileman
c68498fc79 string trim appears to be a hair faster than regex. 2017-12-23 19:39:10 -08:00
Justin Hileman
61325754bb 3-5x faster basename and dirname. 2017-12-23 19:28:52 -08:00
Justin Hileman
3d3690eb40 200x faster "am i root?" check. 2017-12-23 18:27:01 -08:00
Justin Hileman
1562614484 20x faster "has background jobs" flag. 2017-12-23 18:26:48 -08:00
Justin Hileman
b49a821a81 Minor style fixes 2017-12-23 05:07:56 -08:00
Justin Hileman
a31e4cea30 Update color previews helper.
- Include glyphs for all the glyphy segments
 - Make segment display names consistent with variable names
 - Add virtualgo segment
 - Update user@hostname segment to match current style
2017-12-19 12:33:50 -08:00
Justin Hileman
40bd268210 virtualgo segment cleanup
- Use a virtualgo color variable, even though it's the same as virtualenv.
- Switch to a cleaner nerd fonts go glyph.
- Add a non-nerd fonts go glyph (empty for now, but TBD if this changes).
2017-12-19 12:30:52 -08:00
Justin Hileman
201309db80 Don't set -g color schemes. 2017-12-19 12:21:28 -08:00
Justin Hileman
5b632d1cca Housekeeping. 2017-12-19 08:58:13 -08:00
Jelte Fennema
6916339c0f Add virtualgo support 2017-12-19 11:33:21 -05:00
Justin Hileman
b67c0bd910 Cleaner user/hostname display logic:
- Show if `theme_display_user` / `theme_display_hostname` is set to `yes`.
- Show both user and hostname when using SSH.
- Show user if `$default_user` is set and it isn't the current user.
2017-12-19 08:08:05 -08:00
Justin Hileman
4985cf8a4d Use bold to distinguish between username and hostname. 2017-12-19 08:08:00 -08:00
Ben
444b9a4827 Add support for choosing to show user and/or hostname in prompt (#71)
Add support for choosing to show user and/or hostname in prompt
2017-12-19 10:38:15 -05:00
Justin Hileman
500fc527a7 Add theme_newline_cursor = clean to docs. 2017-12-19 07:10:48 -08:00
Dietrich Daroch
f8012eae84 Add setting for clean multiline prompt 2017-12-19 10:08:06 -05:00
Justin Hileman
162062b3ac Clean up theme_vcs_ignore_paths implementation.
- realpath isn't necessary for $PWD
- match subdirectories of all ignore paths (otherwise the vcs segment is missing for the directory itself, but shows in subdirectories, which is weird)
- check whether $theme_vsc_ignore_paths is set to save a command substitution
2017-12-19 06:58:56 -08:00
Jesper Derehag
2673d2c39d Add support for ignoring VCS directories
Signed-off-by: Jesper Derehag <jderehag@hotmail.com>
2017-12-19 09:41:12 -05:00
Justin Hileman
f4378582d6 Clean up some unused glyphs from the nerd fonts PR. 2017-09-07 16:53:17 -07:00
Justin Hileman
c24bcc443d Merge pull request #99 from nemoDreamer/git-glyphs
Git glyphs for Nerd Fonts
2017-09-07 16:50:47 -07:00
Cameron Moon
ee8e150424 rename flag from 'force' to 'yes' 2017-08-08 12:46:23 +10:00
Cameron Moon
d204ecdb5b Enable vi mode display for hybrid_bindings
Vi mode display should be enabled for people using the hybrid_bindings
function found in the fish documentation.
2017-08-08 12:20:14 +10:00
Cameron Moon
5337033ee4 Add option to force show vi mode 2017-08-08 12:19:10 +10:00
Philip Blyth
e2cf9a7d3b Removed trailing white-space 2017-08-02 23:45:27 +01:00
Philip Blyth
7e6543a3f0 Merge branch 'master' into git-glyphs 2017-07-18 14:49:45 -04:00
Jingkai Tang
9ec8d2cf24 Fix git warnings in __bobthefish_prompt_git 2017-07-10 15:04:40 +08:00
Andrew Choo
0b3b522160 Implement newline cursor feature with one option instead of three
Per bobthecow:

"In keeping with bobthefish's goal to be opinionated but flexible,
let's do this with one option, not three. I'm leaning toward:

set -g theme_cursor_on_new_line yes
Then:

Always show the arrow at the end of the first line
Always show a minimalist arrow at the start of the next line"
2017-06-17 11:37:12 -04:00
Andrew Choo
176c3a7a69 Remove tabs 2017-06-10 22:51:31 -04:00
Andrew Choo
28dfc4f985 Add ability to have cursor start on a new line
In order for the right prompt to work the new line must start with at
least one character. A space is used for this purpose. This looks a bit
strange so added option to include the default right arrow glyph. Lastly,
added option to remove the right arrow glyph on the first (top) line.
2017-06-10 22:51:14 -04:00
Philip Blyth
dc151776b6 moar git-glyps! 2017-05-18 17:10:24 -04:00
Philip Blyth
f8c8dc7f07 Moved Git chars to glyph variables 2017-05-03 15:23:28 -04:00
Justin Hileman
87534a008a Fix issues when RBENV_ROOT/version doesn't exist.
Fixes #89
2017-04-26 20:12:30 -07:00
Justin Hileman
1eb4cf63ac Show vi mode prompt in hybrid key bindings too. 2017-03-07 05:23:18 -08:00
Justin Hileman
cbae8ad3fc Fix git worktree support.
Fixes #82
2017-02-28 07:09:38 -08:00
LaurentTreguier
cb6bb0ecb3 Use a different glyph color when using fakeroot 2017-02-27 20:44:01 +01:00
LaurentTreguier
23fdcb8048 Display superuser glyph when using fakeroot 2017-02-27 10:37:15 +01:00
Justin Hileman
750030a110 Remove a ton of set_color normal calls.
Eases the pain of fish-shell/fish-shell#3793 just a bit.

This _shouldn't_ ever look any different to the end user. I think.
2017-02-01 05:13:31 -08:00
Justin Hileman
9b414bc6fb Speed up git ahead/behind parsing by ~20% 2017-01-30 07:33:52 -08:00
Justin Hileman
908a7b5365 s/sed/string replace builtin/g 2017-01-29 20:02:01 -08:00
Justin Hileman
86116b7e80 Merge pull request #72 from kephas/master
Display user in terminal title
2017-01-19 10:15:54 -08:00
Jelte Fennema
b5f7b1eaee Make python --version a single line
Pypy outputs two lines and  causes an error this way.
2017-01-17 19:30:41 +01:00
Pierre Thierry
551a768534 Display user in terminal title 2017-01-10 00:55:09 +01:00
Justin Hileman
48f067bac0 Add support for full paths in prompt
(and support for abbreviated project-relative paths!)

Use `fish_prompt_pwd_dir_length` and `theme_project_dir_length` to control the number of characters shown from each parent directory name.

Fixes #68
2016-12-29 16:12:55 -08:00
Justin Hileman
ee5c1e29b8 More efficient python version checking, capture pypy3. 2016-10-18 07:25:22 -07:00
Justin Hileman
dca95833dc Merge pull request #60 from rominf/master
Fix #52
2016-10-18 07:23:39 -07:00
Justin Hileman
1f827c6bab Update vi mode prompt.
* Default to showing vi mode prompt (if the current bind mode is vi). Allow overriding by setting it `theme_display_vi` to `no`.

* Remove `theme_display_vi_hide_mode`, because I don't like the prompt jumping around when changing modes.

* Override `fish_mode_prompt` because we're already handling it inside `fish_prompt`. Add a note so future code archeologists can figure out how to override.

* Add support for `replace-one` bind mode.

Fixes #65
2016-10-18 07:04:59 -07:00
Roman Inflianskas
a2df7fbacd Fix #52 2016-08-28 23:32:52 +03:00
Justin Hileman
ff560c97a8 Merge pull request #57 from Jguer/master
Add Gruvbox Theme
2016-08-27 09:05:24 -07:00
Justin Hileman
8898658a9a Speed up Vagrant status code by 10-15x.
(Excluding whatever time is spent getting the status from the provider, of course. Can't do much with that)

See #56
2016-08-25 12:18:10 -07:00
Justin Hileman
ca7a3ecaa2 Merge pull request #56 from rickard-von-essen/vargrant-prl
Improved Vagrant provider detection and support for parallels provider.
2016-08-25 12:15:13 -07:00
Justin Hileman
02c4c51973 Whoops. Forgot the non-nerd-fonts tag glyph :) 2016-08-25 08:06:23 -07:00
Justin Hileman
4669e3dad6 Add better tag support in the git branch segment. 2016-08-25 08:01:08 -07:00
Justin Hileman
b2f097c91c Glyph cleanup
* Rearrange overrides so they're closer to what they're overriding
* Remove some unused Powerline glyph definitions
* Use all the pretty Octicons when Nerd Fonts support is enabled
2016-08-25 07:59:01 -07:00
Rickard von Essen
525416cc19 Improved handling of Vagrantfiles with multiple providers 2016-08-22 21:38:28 +02:00
Jguer
3ecd0726ca Changed path segment for gruvbox 2016-08-22 12:00:02 +01:00
Rickard von Essen
54ef10a844 Make provider a local var 2016-08-22 08:22:04 +02:00
John Guerreiro
22451d400f Fixed repo color to green instead of yellow 2016-08-22 02:45:23 +01:00
Jguer
1133c4b7bf Added gruvbox theme 2016-08-22 02:40:15 +01:00
Rickard von Essen
2cc237267e Improved Vagrant provider detection and support for parallels provider.
Improved the detection of Vagrant provider. The previouse didn't
correctly detect which provider was used.

Added support for detecting the state of Parallels vagrant provider.
2016-08-21 21:11:35 +02:00
Justin Hileman
ab720a3bb3 Add docker and theme configs to fish_prompt comment. 2016-06-08 19:31:16 -07:00
Justin Hileman
ac1a6e230c Update docker segment to use new color variables.
See #47
See #48
2016-06-08 01:21:13 -07:00
Justin Hileman
e39a850ed0 Merge pull request #48 from feinstruktur/master
Docker machine display and conditional date
2016-06-08 01:15:24 -07:00
Sven A. Schmidt
77977f882f Added -d to function 2016-06-08 08:33:41 +01:00
Don March
0ea2e743a7 Add example code for a custom color scheme 2016-06-07 13:48:40 -04:00
Sven A. Schmidt
d730526c07 Added settings variables to allow date and docker display to be made conditional 2016-06-07 08:31:34 +01:00
Don March
023030fd50 Improve __bobthefish_display_colors variable
Per suggestions from @bobthecow.
2016-06-07 01:30:18 -04:00
Justin Hileman
0ac50039a7 Color schemes tweaks for themes with more limited palettes. 2016-06-06 21:56:14 -07:00
Don March
672c637f94 Add configurable color schemes
* Refactor fish_prompt.fish to use semantically named variables
  throughout the script rather than specific colors. Set those variables
  to various colors depending on the `theme_color_scheme` variable.

* Add the `__bobthefish_display_colors` function to easily test and
  preview different color schemes.

* Update documentation.

Fixes #7.
2016-06-06 18:38:19 -04:00
Sven A. Schmidt
43af67f68a Added segment to display DOCKER_MACHINE_NAME (indicating which docker daemon we're talking to) 2016-06-01 14:50:14 +01:00
pik
cfb7c7df79 Support chruby ruby_version for show_ruby() 2016-05-23 20:48:09 +08:00