Coder Social home page Coder Social logo

promptline.vim's People

Contributors

edkolev avatar flashmeow avatar hferreiro avatar nekonyuu avatar pdf avatar pencilcheck avatar stanleykylee 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  avatar  avatar  avatar  avatar  avatar  avatar

promptline.vim's Issues

Right prompt disappearing

Hi, very cool plugin!

The right section of my prompt disappears when I start typing, know of any fix for this?

I'm on Mavericks with Zsh 5.0.5

Unmatching arrow?

screen shot 2017-01-16 at 4 52 25 am

Any idea why the end of the prompt has that non-matching bright arrow?

Vi-mode indicator

Several shells supprot vi-mode command line editing and changing prompt based on whether you're in normal or insert mode. So far I've resorted to hacking up my prompt.sh to change color and insert/normal indicator based on checking [[ $KEYMAP = vicmd ]] upon keymap change. Can we intergrate support for this into promptline.vim instead?

Can't use slices functions on zsh

I can't use slices functions to customize the statusline:

E117: Unknown function: promptline#slices#cwd

I tried manually sourcing the function before assigning let g:promptline_preset:

source ~/.vim/bundle/promptline.vim/autoload/promptline/slices/cwd.vim

but I get the same result.

I use Zsh and Tmux.

Arrow symbols are not loading correctly.

I really like promptline from your screenshots but after sourcing the generated file

:PromptlineSnapshot ~/.shell_prompt.sh airline

My prompt is missing the cool arrow aesthetic and just has these weird symbols:

I also tried the jelly theme. The colors changed but the issue with these weird symbols remained.

I'm on OS X 10.9.2, Terminal v2.4

Prompt Notifications/Statuses

(This is an optional feature request/enhancement, nothing has broken for me so far)

I really love this shell prompt, the only things I think it's missing and would love to see implemented are the following :

  • Virtualenv support (I'd like to know I'm in a virtualenv)
  • Changes in git repos (I'd like to know that I need to push/commit my repo)

Other than that I have to say, I prefer this over everything else I've had the pleasure of using.

Support for virtual environments

@edkolev

I came across this bug, where one wouldn't know if a virtual environment is active or not


This is the bug, (I'm using Python's virtualenv as a example). Using the $PS1 generated from promptline.vim

virtual_no

This is the default $PS1 (Without promptline.vim)

virtual3_yes

As mentioned, this is with python's virtualenv, but I think it may (or may not) also affect the ruby's rbenv or rvm.

Are you planning to make a fix for this ?

Thanks in advance ! ๐Ÿ˜„

add option to start typing on a new line

Would be nice to have an option to split powerline into two lines.
The status bar on top and a new line for typing on the bottom.

Right now I have it hacked together by manually adding \n in the output file.

Truncation character (U+22EF) not being displayed

I'm using ConEmu + mintty / PuTTY and the Source Code Pro for Powerline patched font. The truncation character "โ‹ฏ" is being displayed as a blank space. I checked the autoload/promptline/symbols.vim file and it is displayed as a blank space there as well.

Style is only loaded after a vim session.

when I start a terminal (ubuntu 16.10) the bottom line has no style.
promtline_fail
When I open a random vim session. For example
vim test :q!
The bottom line changes and has color and style?
promtline_better

Preset cannot be found

I was willing to write a preset but i can't get promptline to load it:
~/.vim/bundle/promptline.vim/autoload/promptline/presets/custom.vim

let g:promptline_preset = {
\'a' : [ promptline#slices#user() ],
\'b' : [ promptline#slices#cwd() ],
\'c' : [ promptline#slices#jobs() ],
\'y' : [ promptline#slices#vcs_branch() ],
\'z' : [ promptline#slices#git_status() ],
\'warn' : [ promptline#slices#last_exit_code() ]}

vim keeps telling me Promptline: preset cannot be found 'custom'. I'm using zsh + xterm.

Directories in home folder showing ~ in prompt

When I'm in my home folder and cd into a subfolder the prompt will say ~ as the cwd and continue to show that directory as ~ if I descend further, though appending the new folder. When I then cd into home again it says /home/ instead of ~.
I'm on a fresh ArchLinux install and tested both on zsh and bash with the same results. Also I'm using the gnome-terminal. The curious thing is that it doesn't happen on my laptop also with an Arch install and very similar configuration, so I guess it's some other setting, but I can't figure out what.

Here's a screenshot of what it looks like

fj4tor4

termguicolors not working

I'm using iTerm with zsh as my terminal and want to export my airline theme.
Unluckily the exported promptline looks like the theme without set termguicolors in my vim-file.

Not sure this is something you can fix but maybe you can give me a hint.

Slices are not working

Hello, I keep getting this error:

Error detected while processing /home/grelek/.dotfiles/nvim/nvimrc:
line  158:
E117: Unknown function: promptline#slices#user
E15: Invalid expression: {'a': [ promptline#slices#user(), promptline#slices#host({'only_if_ssh': 1}) ],'b': [ promptline#slices#cwd() ],'c': [ promptline#slices#vcs_branch(), promptline#slices#git_status() ],'warn': [ promptline#slices#last_exit_code() ],'options': {'left_sections': [ 'a', 'c' ],'left_only_sections': [ 'a', 'c' ]}}

And when I delete promptline#slices#user(), error yells that promptline#slices#host... is unknown function and so on.

I'm using zsh, neovim, vim-plug and airline and this configuration:

let g:promptline_powerline_symbols=1
let g:promptline_theme='airline'
let g:promptline_preset={
    \'a': [ promptline#slices#user(), promptline#slices#host({'only_if_ssh': 1}) ],
    \'b': [ promptline#slices#cwd() ],
    \'c': [ promptline#slices#vcs_branch(), promptline#slices#git_status() ],
    \'warn': [ promptline#slices#last_exit_code() ],
    \'options': {
        \'left_sections': [ 'a', 'c' ],
        \'left_only_sections': [ 'a', 'c' ]}}

It looks like slices are completely missing since promptline can run this PromptlineSnapshot! ~/.shell_prompt.sh airline full.

It's pretty annoying and sad as this plugin looks great.

How to spawn a shell with a clean prompt from a promptline-enabled shell ?

Hello,

I love promptline most of the time, but when I want to document what I just did in my shell, I have to manually clean my buffer log to remove the left and right prompts.

I'd like to switch to a simple "$ " prompt when doing something I want to document, then switch back to the promptline prompt once I'm done. I don't care spawning a custom shell for the operation.

My main issue is that my login shell loads promptline, so if I spawn a new shell, I always inherits from the prompt defined in the parent shell.

How can I switch easily between promptline and a simple prompt ?

Thanks for your help !

Unused space after hostname align on right in zsh

Well at first thank you for great way to configure powerlinish prompt in my shell.
I run only into one issue. When I configure hostname to be align on right in my zsh, I got unused space after last right prompt element, which is hostname.
Would be nice to have some way to get rid of it.
20140102162600

This is my promptline configuration

" promptline {
let g:promptline_preset = {
      \'a' : [ promptline#slices#host() ],
      \'b' : [ '$(whoami)'],
      \'c' : [ promptline#slices#cwd() ],
      \'y' : [ promptline#slices#vcs_branch() ],
      \'warn' : [ promptline#slices#last_exit_code() ],
      \'options': {
      \'left_sections' : [ 'c', 'y' ],
      \'right_sections' : [ 'b', 'a', 'warn'],
      \'left_only_sections' : [ 'c' ]}}

" }

fish support

Support for the fish shell would be great! I may give it a try myself if I have time.

Custom Themes

The documentation is quite clear on how to define a custom preset, but I don't see anything about creating a custom theme. I looked through the source but didn't see an obvious way (not a vimscript pro though).

My airline segment colors don't map quite the way I'd like to my promptline segments, so I'm hoping there's a way to override it. Also since my vim color configuration is quite right atm, I'd like to hardcode the colors based on my shell rather than pulling them out of airline.

Connection and User awareness

Hi,

I would like to have special symbol (like ๎‚ข) at the beginning of "a" if I am on a remote host and different colors if I am a normal user (default orange) or root (more red).

At them moment I use the following settings:

    let g:promptline_theme = 'powerlineclone'
    let g:promptline_preset = {
        \'a' : [ promptline#slices#user(), promptline#slices#host() ],
        \'b' : [ promptline#slices#vcs_branch({'git': 1, 'hg': 1, 'svn': 1}), promptline#slices#git_status() ],
        \'c' : [ promptline#slices#python_virtualenv() ],
        \'y' : [ promptline#slices#cwd() ],
        \'warn' : [ promptline#slices#last_exit_code() ]}

Compabiltiy with oh-my-git

oh-my-git is extremely great and has support for custom prompts using $omg_ungit_prompt and $omg_second_line. I quickly tried to make it talk with promptline.vim, but, unless I'm missing something, it failed beacuse generated file overwrites $PROMPT and $RPROMPT every time it displays a prompt. Any ideas on how can I use it in this way? ๐Ÿ˜ƒ (I am using zsh)

OSX: adding update_terminal_cwd to $prompt_command?

Hi, first off, thanks for this terrific project, it's by far my favorite airline extension (my coworkers inquire about promptline way more often than airline!).

In OSX (on Mountain Lion), I believe Terminal.app (in bash) preserves the current working directory when opening a new tab or window by setting PROMPT_COMMAND to update_terminal_cwd(). Promptline.vim calls __promptline() to set PROMPT_COMMAND, so I lose my current working directory unless, in my bash_profile, I set PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"

Would Promptline.vim break if __promptline()preserves and appends to the existing PROMPT_COMMAND, or is there another generally shell-safe way to preserve the cwd in new tabs from within promptline? Thanks again for such an awesome project!

I'm not sure how to contribute, but I made a small slice that displays a lock if $PWD has no write access (in comments)

Maybe you can add this as a slice? Otherwise, just leaving it here for others:

the -w flag here just tests for write access, for those not familiar

'$(if [ ! -w $PWD ] ; then printf "%s" "๎‚ข" ; fi)'

(sorry, also not sure how to paste the unicode lock character into github... I just copied the character from powerline into my .vimrc)

you can use this line in the warn prompt, like:

\'warn' : [ '$(if [ ! -w $PWD ] ; then printf "%s" "(lock)" ; fi)', promptline#slices#last_exit_code() ],

Possible to use with MinGW MSYS shell?

Hi,

I run gvim on WIndows, and have working MinGW/MSYS.
Is it possible to use this plugin as interface to MSYS shell?

I have MSYS sh in PATH, but that doesn't seem enough if possible at all.

Possible to note directory changes and detailed git status?

I was a longtime user of the angoster theme of oh-my-zsh but switched to promptline.vim for customization purposes. I apologize if this is not the proper place to ask, but is there a way to display the following with promptline.vim ร  la agnoster?

  • Denoting when there have been changes since the last commit
  • Denoting when there are staged files that have not been committed
  • Denoting when the current branch is up to date with a remote repo

Others (#43) have attempted to use oh-my-git for this but ran into issues.

left prompt only in zsh

Is there a way to get zsh to use the left side prompt only for all available slices?

I tried to redefine the left_sections to include, x, y, z, warn, but I get errors when I try to create the prompt like this.

symbol customization dose't work

image

Hi, wonderful Plugin~

Now I seem to come across with a problem that after disable the powerline symbols, I want to customise the symbols as screenshot above, but whatever I do it just make no sense and nothing happen then like below,
image

I am totally confused and what's wrong with mine?

vi mode indicator

Is there a way to get an indicator for which mode one is in when using vi mode for command line editing?

Hostname not displayed with bash

When configuring, adding promptline#slices#host() to a slice does not print the hostname in bash. I've worked around this by using \h in my slice, but it will break if I ever manage to migrate to zsh.

Feature Request: SHA of last commit near branch name

@edkolev

Is it possible to implement this feature ?


From this default (instead of just branch symbol and name),

old

To this changed prompt (7-character SHA value | branch name),

new

This is the hack around that I use,

hack_around

But, this error happens when you cd into a non-version controlled directory,

error2

Is it possible to implement this feature ? (without throwing out error !)

Thanks in advance ! ๐Ÿ˜„

Unknown function from vimrc while launching vim

I recently updated the promptline plugin and found that the default preset included the hostname.
This led me to setting my own preset.

The presets worked great for fixing my hostname issue except every time I launch vim, I get an unknown function error.

screen shot 2017-01-16 at 12 27 28

I have my preset setup exactly as shown in the examples and it even worked, so I'm unsure why I'm getting unknown function error.

Thoughts?

promptline#slices functions not found

Hi,

if I use let g:promptline_preset with the following settings I'll get an error. I use bash-4.2 with Ubuntu 12.04.

Configuration

let g:promptline_preset = {                                                                           
        \'a' : [ promptline#slices#host() ],                                                          
        \'b' : [ promptline#slices#user() ],                                                          
        \'c' : [ promptline#slices#cwd() ],                                                           
        \'y' : [ promptline#slices#vcs_branch() ],                                                    
        \'warn' : [ promptline#slices#last_exit_code() ]}   

Error

line  145:
E117: Unknown function: promptline#slices#host
E15: Invalid expression: {
'a' : [ promptline#slices#host() ],
'b' : [ promptline#slices#user() ],
'c' : [ promptline#slices#cwd() ],
'y' : [ promptline#slices#vcs_branch() ],
'warn' : [ promptline#slices#last_exit_code() ]
}

edit

I installed with NeoBundle and the default configuration works fine.

Combinaten zsh + promptline + urxvt won't work well

Any other combination combination works:
zsh + promptline + qterminal
bash + promptline + urxvt
zsh + not promptline + urxvt

The first line suggests urxvt is the problem, the second, zsh and the third that promptline is the problem.

The problem itself / steps to reproduce:

  • set up urxvt with zsh and promptline (obviously)
  • type something
  • result:
    MYPROMPT>WHATITYPED
  • hit Ctrl-C and type something
  • result:
    MYPROMPT> WHATITYPEDNOW

notice the whitespace between the > and what I typed in the latter example?
This wouldn't be a major issue itself but when being in the state of having no whitespace one can get wired behavior for example like this:

  • be in "missing whitespace" mode
  • type cd and the beginning of a folder name but only so far as it is still ambiguos.
  • hit tab to get auto-completion
  • the result will be:
    MYPROMPT>ccd ...

now there's a 'ccd'.
These are only "easily reproducible" examples but it can get really weird when one is using the terminal for a longer time.

fossil support

Hello,

I installed promptline along with lightline in order to replace powerline-shell, but I do miss Fossil support which would do same/similar as powerline-shell, iow.

Shows some important details about the git/svn/hg/fossil branch:

  • Displays the current branch which changes background color when the branch is dirty
  • A '+' appears when untracked files are present
  • When the local branch differs from the remote, the difference in number of commits is shown along with 'โ‡ก' or 'โ‡ฃ' indicating whether a git push or pull is pending

What do you think about it?

Vi-mode indicator

Hi again! Thanks to you my prompt is an inch away from perfect. The only thing I'm missing right now is a way to indicate when you're in Vi-mode (for those of us using bindkey -v). Normally this can be done with something like this:

function zle-line-init zle-keymap-select {
    RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
    RPS2=$RPS1
    zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select

Maybe it would fit well as a custom slice? Can you perhaps point me in the right direction?

Cheers!

Node version slice when using nvm

If you're using nvm (Node Version Manager), this will show the active Node.js/io.js version:

'$(nvm_ls_current 2>/dev/null | grep -v none)'

Here's my preset, for example, where I put the node version in the a section:

let g:promptline_preset = {
        \'a'    : [ promptline#slices#python_virtualenv(), '$(nvm_ls_current 2>/dev/null | grep -v none)', '$USER', promptline#slices#host({ 'only_if_ssh': 1 })],
        \'b'    : [ promptline#slices#vcs_branch(), promptline#slices#git_status() ],
        \'c'    : [ '\w' ],
        \'warn' : [ promptline#slices#last_exit_code() ]}

The a section will show virtualenv, node version, user name and, if logged in through ssh, host name.

Is there a proper place to save these type of examples, maybe a wiki page?

battery slice is not working on ubuntu 15.04 (kernel 3.19.0)

Hello,

On my laptop, I do not have /sys/class/power_supply/BAT0/energy_now and energy_full. But I have charge_now and charge_full.
It works well if I replace "energy_full" with "charge_full" and "energy_now" with "charge_now" in the generated script.
I use the stock kernel of Ubuntu 15.04, which is 3.19.0.

Was there a change in how the kernel expose the information ? Or are these different information ?

Thanks

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.