edkolev / promptline.vim Goto Github PK
View Code? Open in Web Editor NEWGenerate a fast shell prompt with powerline symbols and airline colors
License: MIT License
Generate a fast shell prompt with powerline symbols and airline colors
License: MIT License
I need to run git remote update
for the behind symbol to show up.
Is that expected behavior?
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
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?
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.
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
(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 :
Other than that I have to say, I prefer this over everything else I've had the pleasure of using.
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
This is the default $PS1
(Without promptline.vim)
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 ! ๐
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.
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.
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.
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
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.
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.
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 !
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.
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' ]}}
" }
Support for the fish shell would be great! I may give it a try myself if I have time.
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.
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() ]}
https://cloud.githubusercontent.com/assets/1532071/4437991/6b687cba-47a4-11e4-8efe-b53aa1ef34bb.png
You guys use it in your Fish example but I'd like to use it in real life. Thanks!
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
)
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!
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() ],
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.
If there is '/' contain in git branch name, vcs_branch will show only the parts of brach name after last '/'.
I think the root cause is using branch=${branch##*/}
in promptline#slices#vcs_branch#function_body
.
Would you fix this condition?
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?
Others (#43) have attempted to use oh-my-git
for this but ran into issues.
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.
Is there a way to get an indicator for which mode one is in when using vi mode for command line editing?
Typing long line of command replaces the prompt ,i.e it doesn't wrap to the newline . Any solution ?
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.
Is it possible to implement this feature ?
From this default (instead of just branch symbol and name
),
To this changed prompt (7-character SHA value | branch name
),
This is the hack around that I use,
But, this error happens when you cd
into a non-version controlled directory,
Is it possible to implement this feature ? (without throwing out error !)
Thanks in advance ! ๐
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.
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?
It still adds the powerline fonts even if I have let g:airline_powerline_fonts=0
in my .vimrc
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.
...I can't figure out how to activate the prompt line.
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:
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:
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.
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?
Would be nice to have fish shell support.
Keep up the good work! =)
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!
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?
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
I'm getting this odd issue with tab completion
When I try to do any tab completion, I get this odd double text effect with what ever I have in the prompt.
Video of whats happening, this demos the issue better than me trying to explain it.
http://youtu.be/4CUcncXNEic
Here's my prompt for zsh
https://github.com/mhartington/dotfiles/blob/master/prompt
I removed the prompt theme form my shell and tab completion does work as expect.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.