Starship Prompt: Building Custom Modules

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Starship (starship.rs/) is a terminal prompt customizer that's easy to use and incredibly powerful. It has many built in modules that give you a ton of information, but it's also incredibly easy to create your own modules to show your own info in your prompt. In this video, we'll look at how to do it!
    shaky.sh
  • Наука та технологія

КОМЕНТАРІ • 21

  • @argonjs
    @argonjs Рік тому +5

    Recently discovered the channel and its good content. Keep up the excellent work!

  • @a_maxed_out_handle_of_30_chars

    simple and to the point, thank you :)

  • @PRonYouTube
    @PRonYouTube Рік тому

    This was an awesome and helpful walkthrough. Thanks!

  • @davemeech
    @davemeech Рік тому

    You had me at stack overflow driven development. I didn't know that I was on Kent Beck's youtube channel.

  • @DV-ml4fm
    @DV-ml4fm 4 місяці тому +1

    I used crontab to run a command and output the result it to a file. Then I create a custom command to read the file with detect_files option.

  • @fahadahaf
    @fahadahaf Рік тому +4

    You could have probably optimized the performance a little bit by getting rid of the two repeated grep calls and filtering using awk instead, or using pgrep instead of using ps to begin with
    pgrep vim
    or even
    ps aux | awk '/vim/ && !/awk/ { print $2 }'
    instead of
    ps aux | grep vim | grep -v grep | awk '{ print $2 }'

  • @auntiecarol
    @auntiecarol Рік тому +2

    When I was tooling around with various shells I'd use a module to check $0 and write the prompt accordingly, a φ (fish) β (bash) ζ (zsh) τ (tcsh) etc., because I'd forget which shell I happened to be using.
    Since deleted as I've gone back to bash. Well, actually, 😘Emacs' eshell , so not much time in a terminal these days.

  • @joselima7655
    @joselima7655 Рік тому

    Wow this is awesome I use starship but didn’t think that it could do all this. What colorscheme are you using in vim ?

  • @moneyfr
    @moneyfr Рік тому +1

    I downloaded yesterday thanks to your video but i don't see for a basic use what could i do more than oh-my-zsh , p10k.
    I couldn't install plugins on it for history entries
    But i ll still keep an eye on it and maybe install for my powershell

    • @andrew-burgess
      @andrew-burgess  Рік тому

      Yeah, I’d consider it an alternative to OMZ or p10k.
      Can you say more about the history entries? What would you want that plug-in to do?

    • @shlokbhakta2893
      @shlokbhakta2893 Рік тому

      I like it because of the windows Linux compatibility, now I can use the same toml file and have similar prompts on windows and wsl (also docker containers)

  • @osmanakar2507
    @osmanakar2507 Рік тому

    great!

  • @Deiha-z4d
    @Deiha-z4d 4 місяці тому

    To speed up, maybe: ps -e -o comm -t | grep nano | grep -v grep

  • @HawaiiMacAddict
    @HawaiiMacAddict Рік тому

    I was attempting to add a custom module to include the date as well as the time, but was unable to display it. Do you have any suggestions as to how that may be accomplished?

    • @andrew-burgess
      @andrew-burgess  Рік тому

      If you can share a link to the code, we can take a look!

  • @moneyfr
    @moneyfr Рік тому

    Could you share your config ?

    • @andrew-burgess
      @andrew-burgess  Рік тому +2

      Sure, check it out here: github.com/andrew8088/dotfiles/blob/main/starship/starship.toml

  • @Samonitari
    @Samonitari 4 місяці тому

    At this point, you could just throw out zsh, one less sh*t to maintain, I definitely did left zsh and never looked back!
    I always hated the bazillion frikin' knobs to tweak, and the whole oh-my-zsh project. I mean why do I have to have a plugin manager for my shell?
    Luckily starship is quite cross-shell!
    On a similar note, I left nvim for helix. Unfortunately I cannot install it to all of our servers. But the environment on the workstations I use have become leaner, and less of a beautiful-only-for-me-and-brittle-AF snowflakes...

  • @JACOBSAYONO
    @JACOBSAYONO Рік тому

    thank you!! i got .cpp and .ino extensions to work. i want to customize for folders too since that would be visually convenient when working with ROS.
    is it possible to see the state of the terminal when you've sourced something? e.g `source .bashrc` (trying to see if i can use starship to show which version of ROS i've sourced on the terminal since i usually switch back and forth between ROS1 noetic and ROS2 foxy)
    how did you get the +8 -1 git line stuff btw? i have git_branch, git_commit, git_status, git_state already in my format (idk what git_state is?).
    can i start tmux automatically when opening a new terminal? i tried putting "tmux" in my .bashrc, which works but always gives me a warning about recursive tmux stuff. is there a workaround or even on starship.toml?
    thanks and here's how my ubuntu terminal is looking right now! (:
    imgur(dot)com/ONLqSJP

    • @andrew-burgess
      @andrew-burgess  Рік тому

      Your terminal looks great! love those colours!
      For the git: you can see my whole git prompt config in my starship.toml: github.com/andrew8088/dotfiles/blob/main/starship/starship.toml. the git status stuff is for stateful operations like rebasing and merging (starship.rs/config/#git-state).
      hmm, not sure about tmux. The problem with adding `tmux` to your `bashrc` is that then, when you open a terminal, you start a bash process, which starts a tmux process, which starts a bash process, which starts a tmux process ...
      not sure I understand your question about state when sourcing something, but I think you can create a custom module to check any env var, command version, or whatever you need!