edkolev / promptline.vim

Generate a fast shell prompt with powerline symbols and airline colors
MIT License
625 stars 54 forks source link

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) #40

Open bryanbecker opened 9 years ago

bryanbecker commented 9 years ago

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() ],
matthisk commented 9 years ago

Cool thnx :+1: