Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Request: accents #299

Closed
notpratheek opened this issue Oct 5, 2013 · 18 comments
Closed

Documentation Request: accents #299

notpratheek opened this issue Oct 5, 2013 · 18 comments

Comments

@notpratheek
Copy link
Contributor

@bling

Accents are interesting !

Perhaps you could add how to configure/change accents, in the docs (like the way you explained how to change sections in airline) or, you can explain them in the default dark theme ?

@bling bling closed this as completed in 9e53c2c Oct 6, 2013
@bling
Copy link
Member

bling commented Oct 6, 2013

please let me know if it's still unclear. thanks.

@notpratheek
Copy link
Contributor Author

This is good 😄 , But I'd be really happy if you can provide the example code that creates this

img

Also, what other keywords/words can be used apart from red ?

@bling
Copy link
Member

bling commented Oct 6, 2013

here it is!

function! AccentDemo()
  let keys = ['a','b','c','d','e','f','g','h']
  for k in keys
    call airline#parts#define_text(k, k)
  endfor
  call airline#parts#define_accent('a', 'red')
  call airline#parts#define_accent('b', 'green')
  call airline#parts#define_accent('c', 'blue')
  call airline#parts#define_accent('d', 'yellow')
  call airline#parts#define_accent('e', 'orange')
  call airline#parts#define_accent('f', 'purple')
  call airline#parts#define_accent('g', 'bold')
  call airline#parts#define_accent('h', 'italic')
  let g:airline_section_a = airline#section#create(keys)
endfunction
autocmd VimEnter * call AccentDemo()

@notpratheek
Copy link
Contributor Author

Thanks ! 😄 👍

@vadz
Copy link

vadz commented Oct 29, 2013

Accents are great, I should be able to replace all of my hacks for showing the line number in bold yellow with just defining an accent for it. However I don't quite understand how to define a "bold yellow" accent -- either one works but both combined do not. I've also tried this:

let g:airline_section_z='%3p%% %#__accent_bold#%#__accent_yellow#%4l%#__restore__#:%3v'

but it doesn't work neither, the yellow accent just replaces the bold one. What would be the simplest (and working :-) way to do this? TIA!

@bling
Copy link
Member

bling commented Oct 29, 2013

combining two accents is tricky and not supported out of the box...you'd have to define that accent manually.

accents are just a special type of highlight group where the background color is ignored (and uses current section's background color, whatever it is). there's an accents dictionary defined in every theme, so the following should do the trick for you.

function! AirlineThemePatch(palette)
  let a:palette.accents.bold_yellow = [ '#ffffff', '', 0, ''�, 'bold' ]
endfunction
let g:airline_theme_patch_func = 'AirlineThemePatch'

and then just define a part to use the bold_yellow accent.

@vadz
Copy link

vadz commented Oct 29, 2013

Excellent, this works just fine, thanks a lot!

@harriszh
Copy link

harriszh commented Nov 4, 2013

@bling
I am using vim-colors-solarized + vim-airline.

Then yellow background+white font makes my eyes uncomfortable. Is there any solution?
Uploading statusline.png . . .

@bling
Copy link
Member

bling commented Nov 4, 2013

@harriszh you can patch the theme just before it gets loaded. there's an example in the documentation, see here.

@harriszh
Copy link

harriszh commented Nov 4, 2013

@bling, Thanks. I read the doc and find how to select the theme.
now I have another issue. You can see the screen capture. why the color can
cross << and >>?

2013/11/4 Bailey Ling [email protected]

@harriszh https://github.com/harriszh you can patch the theme just
before it gets loaded. there's an example in the documentation, see herehttps://github.com/bling/vim-airline/blob/master/doc/airline.txt#L83
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/299#issuecomment-27684515
.

@harriszh
Copy link

harriszh commented Nov 4, 2013

BTW: I doesn't have any conf related airline in my vimrc. I use default
configuration.

2013/11/4 Harris Zhu [email protected]

@bling, Thanks. I read the doc and find how to select the theme.
now I have another issue. You can see the screen capture. why the color
can cross << and >>?

2013/11/4 Bailey Ling [email protected]

@harriszh https://github.com/harriszh you can patch the theme just
before it gets loaded. there's an example in the documentation, see herehttps://github.com/bling/vim-airline/blob/master/doc/airline.txt#L83
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/299#issuecomment-27684515
.

@bling
Copy link
Member

bling commented Nov 4, 2013

@harriszh please open up a new issue as this doesn't have anything to do with accents. also, none of your attachments made it through to github so i can't see anything. thanks.

@harriszh
Copy link

harriszh commented Nov 5, 2013

@bling, I create one issue. but I can't upload pictures in forum.

2013/11/4 Bailey Ling [email protected]

@harriszh https://github.com/harriszh please open up a new issue as
this doesn't have anything to do with accents. also, none of your
attachments made it through to github so i can't see anything. thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/299#issuecomment-27693639
.

@bart-kow
Copy link

Hi
thanks for your work bling.
Do you know how can I resolve graphic problem with right separators, I've got space between bar and separator ?
print_screen1

@bling
Copy link
Member

bling commented Dec 28, 2013

@bart-kow that's a known issue and there's nothing i can do to fix it. try different a different font, font size, terminal, or any combination of the previous and there will be at least one combo that'll work for you.

@paprykarz
Copy link

Hi

I don't have idea how to apply an accent to the part of text, when lucius colorscheme is enabled. Line below does not work:

let g:airline_section_a = 'b%n, w%{winnr()}%#__accent_bold#%{winnr()==winnr("#")?" [LW]":""}%#__restore__#'

@bling
Copy link
Member

bling commented Feb 16, 2014

@paprykarz so it works for other colorschemes? that doesn't make sense....

@bugcoding
Copy link

same problem as @bart-kow, under windows gvim, use powerline patchfont(Meslo LG S Regular for Powerline.otf) , got large spaces between seprator and bar, sorry, my English is very poor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants