Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit faa5d2c

Browse files
authored
Merge pull request #192 from pzelnip/starship
Starship post revisions
2 parents 2b70d60 + 2e48a7b commit faa5d2c

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

content/starship.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ depending on your current context. In this you can see:
123123

124124
* I'm in a directory called `dotfiles`
125125
* I'm currently in a Git repo, but not on any branch instead checked out an
126-
arbitrary commit with SHA 931e5c4
127-
* I don't know what the coffee cup is 🤷
126+
arbitrary commit with SHA `931e5c4`
127+
* The coffee cup has to do with Java, but I don't have a valid JDK installed so
128+
it's not showing what version
128129
* My current Python environment is Python 3.9.2
129130
* My AWS environment is configured to communicate with the `ca-central-1` region
130131

@@ -171,16 +172,16 @@ module, I gave this a try to configure it:
171172
[directory]
172173
truncation_length = 100
173174
truncate_to_repo = false
174-
style = " yellow"
175+
style = "yellow"
175176
format = "[:$path]($style)[$read_only]($read_only_style) "
176177
```
177178

178179
Let's explain this a little bit to give a feel:
179180

180181
* `truncation_length` controls how many directories deep you have to be before
181182
Starship will abbreviate the directory name in your prompt. I rarely go very
182-
deep and TBH when I do I still want to see the full path so I made the number
183-
rediculously high so that it never truncated
183+
deep and to be honest when I do I still want to see the full path so I made
184+
the number rediculously high so that it never truncated
184185
* `truncate_to_repo` is a special setting that controls if the directory is
185186
truncated to the root of the Git repo you are currently in. Again, I don't
186187
like this (I want to see the full path), so disabled it
@@ -199,7 +200,7 @@ followed by the value of the `$path` variable. Each module has its own set of
199200
variables that get populated with values that are relevant to that module (in
200201
this case `$path` ends up being the full path of the current working directory).
201202
The brackets that follow a text group specify a `style string`. You might
202-
wonder "but isn't that what the `style` setting is for? And yes, but
203+
wonder "but isn't that what the `style` setting is for?" And yes, but
203204
essentially the `style` setting defines the "default" style within a module, and
204205
style strings within the format can override that. In this case, `$style`
205206
corresponds to the `style` setting defined in the configuration for the module
@@ -218,7 +219,7 @@ tweak each module to your liking.
218219
Ok, that's fine, but Adam how do we control the order of items in the prompt?
219220
And that's a good question that took me a little while to figure out. Turns
220221
out that the prompt as a whole has a `format` setting. The default is to show
221-
effectively all modules:
222+
all modules, this is from the docs:
222223

223224
```toml
224225
format = "$all"
@@ -281,16 +282,16 @@ $character"""
281282
```
282283

283284
This is what controls the order of items. Move an item up, and it'll appear
284-
earlier in the prompt, move down to move it later in the prompt. It also
285-
provides a global "completely hide" ability for module -- if you remove it from
286-
the format then it won't be displayed. Personally I don't like this, as it
287-
means if you want to change the order of items you have to override the
288-
*entire* format string. It'd be nice if there was an "index" value or something
289-
on each module that could determine ordering, but oh well.
285+
earlier in the prompt, move down to move it later in the prompt. Personally I
286+
don't like this, as it means if you want to change the order of items you have
287+
to override the *entire* format string. It'd be nice if there was an "index"
288+
value or something on each module that could determine ordering, but oh well.
290289

291-
Note that I don't think hiding from the format is the same thing as *disabling*
292-
a module. Each module has a `disabled` setting which (if true) disables that
293-
module (so won't get displayed, and I believe not evaluated).
290+
In any case it also provides a global "completely hide" ability for a module --
291+
if you remove it from the format then it won't be displayed. Note that I don't
292+
think hiding from the format is the same thing as *disabling* a module. Each
293+
module has a `disabled` setting which (if true) disables that module (so won't
294+
get displayed, and I believe not evaluated).
294295

295296
Ok, with this I continued on and got most of my old prompt in place:
296297

@@ -319,9 +320,6 @@ untracked = ""
319320
format = '([\[$conflicted$deleted$renamed$modified$staged$behind\]]($style) )'
320321
modified = '*'
321322

322-
[python]
323-
format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style)'
324-
325323
[status]
326324
disabled = false
327325
format = '[\[$status - $common_meaning\]](green)'
@@ -562,7 +560,7 @@ disabled = true
562560
# time_format = "%a %b %d %Y %l:%M%p (%z)"
563561
```
564562

565-
Note current version in case I revise in the future is at:
563+
Note current version (in case I revise in the future) is at:
566564
[https://github.com/pzelnip/dotfiles/blob/mainline/.config/starship.toml](https://github.com/pzelnip/dotfiles/blob/mainline/.config/starship.toml))
567565

568566
This gives a prompt like the following:

0 commit comments

Comments
 (0)