GithubHelp home page GithubHelp logo

agemooij / sbt-prompt Goto Github PK

View Code? Open in Web Editor NEW
109.0 8.0 6.0 217 KB

An SBT plugin for making your SBT prompt more awesome

License: MIT License

Scala 100.00%
sbt sbt-plugin scala command-line terminal-themes terminal powerline powerline-fonts

sbt-prompt's People

Contributors

agemooij avatar alonsodomin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-prompt's Issues

Launching an editor makes the SBT hang

If you do something like "git commit" and git brings up an editor (in my case vim), the editor does not display and there's no obvious way of exiting except CTRL-C which kills SBT too.

Customizing ScalapenosTheme

How can I customize my Scalapenos Powerline prompt to show project name. Can't tell how to combine custom promplets along with the default ScalapenosTheme.
image

this is what I have for the above but need to add currentSbtKeyName

import com.scalapenos.sbt.prompt.SbtPrompt.autoImport._
promptTheme := com.scalapenos.sbt.prompt.PromptThemes.ScalapenosTheme

Autoimported object has too many common names in scope

autoImport extends several traits that define lots of common operations like currentSbtVersion, currentScalaVersion, etcetera. https://github.com/agemooij/sbt-prompt/blob/master/src/main/scala/com/scalapenos/sbt/prompt/promptlets/promptlets.scala#L16-L36

This causes name clash problems with builds that do define these names in some way or another. In my case, it failed because I had a val currentScalaVersion = "2.12.3" in my build.sbt.

This is an important problem. Sbt autoimports all those names and that's why it's good practice to reduce the names in autoImport as much as possible.

Would it be possible that you remove all those clashing names from this excellent sbt plugin?

Make the git promptlet detect untracked files

Currently there is a difference between the way most bash/zsh prompts detect git changes and the way we do it. We only track modified files while most shells will also mark the working directory as dirty if there are untracked files.

There's probably a git command that produces the required output. The questions are:

  • is it fast enough?
  • should we add a third color level?
  • should we make it configurable whether to detect untracked files or not?

tag missing

release 1.0.0 is not showing up under the releases in GitHub.
Maybe you can do a git tag -a v1.0.0 5b144ba -m "Released version 1.0.0"

Improve toString behaviour of Promptlet and PromptletSeparator

SBT inspect prints the following:

inspect promptTheme
[info] Setting: com.scalapenos.sbt.prompt.PromptTheme = PromptTheme(List(Promptlet(<function1>), Promptlet(<function1>), Promptlet(<function1>)),PromptletSeparator(<function2>))

Improve the output to replace those Function1 references with something more meaningful

Cross-build for SBT 1.0.x

Now that SBT 1.0.0 is out and SBT 0.13.16 allows for easy cross-building, this should be pretty easy.

Is it possible to enable as a global plugin?

I'd rather not force my choice of prompt on all my co-workers, but haven't been able to get sbt-prompt working as a global plugin. I've got it so that I can inspect the promptTheme setting:

[status-app] $ inspect promptTheme
[info] Setting: com.scalapenos.sbt.prompt.PromptTheme = PromptTheme(List(Promptlet(<function1>), Promptlet(<function1>), Promptlet(<function1>), Promptlet(<function1>)),PromptletSeparator(<function2>))
[info] Description:
[info]  A theme for rendering the SBT shell prompt.
[info] Provided by:
[info]  {file:/Users/philip/status-app/}status-app/*:promptTheme
[info] Defined at:
[info]  /Users/philip/.sbt/0.13/prompt.sbt:3
[info] Delegates:
[info]  *:promptTheme
[info]  {.}/*:promptTheme
[info]  */*:promptTheme
[info] Related:
[info]  */*:promptTheme
[status-app] $

but the prompt remains stubbornly boring.

Tweak the default theme to render the current project in a different color

Now it is rendered in the same color as the shell foreground, which end up withsome confusion about where the prompt stops and the current command starts, at least for somebody like me who is used to a clearer distinction.

Render the current project in a slightly darker color to make it stand out a little bit.

Make default theme easier to override

The default theme is now set in the projectSettings method of the plugin, which makes it win over quite a few ways to override it on the user side.

Examples:

  • in multi-project builds, setting the promptTheme setting will only have effect on the root project, not on sub-projects
  • in multi-user scenarios, there was no way to override the promptTheme from ~/.sbt/0.13

The default value should be moved to globalSettings, where it belongs.

Unfortunately the SBT is still terrible in explaining this ;(

Play Framework prompt override

I'm having troubles enabling your plugin in a play project. In our library project, it works as described. But for the play project, I always get the default prompt.

plugin.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.4")

addSbtPlugin("com.scalapenos" % "sbt-prompt" % "1.0.0")

build.sbt

lazy val root = (project in file("."))
  .enablePlugins(PlayScala)
  .settings(promptTheme := ScalapenosTheme)

I tried moving the promptTheme to the root level of the sbt file, but no effect. Am I missing something? The prompt stays at play's? default [helloWorld] $.

I also tried to register it as a global sbt plugin.

Automatically apply promptTheme to all subprojects

Awesome sbt facelift. Would it make much sense automatically applying the a promptTheme setting to all subprojects of a multi-project build definition - for cleaner sbt files? I mean, typically you would expect the same theme all over, or wouldn't you?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.