Skip to content

Commit

Permalink
Merge pull request #8 from danilo-augusto/adding_options
Browse files Browse the repository at this point in the history
Darker Mode & Italic comments options
  • Loading branch information
danilo-augusto authored Dec 8, 2018
2 parents 2bac075 + 481f5ad commit 44b3fca
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ Airline scheme included.

- Airline theme should be updated accordingly, but can be explicitly specified by using `let g:airline_theme='afterglow'`.

## Options

To further customize Afterglow, you can currently use the following options **before** setting the color scheme on your
vimrc:

- Black background: `let g:afterglow_blackout=1` (default: 0)

☀️ Use this option if you need more contrast, such as working in an office where open windows cause glare on your screen.

- Italicize comments: `let g:afterglow_italic_comments=1` (default: 0)

📖 Helps visual grepping and quickly differentiating source code and comments when skimming through files.

⚠️ Using italics needs a terminal emulator (e.g. iTerm in MacOS) and a font supporting it.

## Screenshots

### Python
Expand Down
35 changes: 30 additions & 5 deletions colors/afterglow.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let s:wine = "b05279"
let s:purple = "9e86c8"
let s:window = "4d5057"

" Auxiliar colors
let s:black = "000000"

if has("gui_running") || &t_Co == 88 || &t_Co == 256
" Returns an approximate grey index for the given grey level
fun <SID>grey_number(x)
Expand Down Expand Up @@ -239,8 +242,6 @@ if has("gui_running") || &t_Co == 88 || &t_Co == 256
endfun

" Vim Highlighting
call <SID>X("Normal", s:foreground, s:background, "")
call <SID>X("LineNr", s:comment, "", "")
call <SID>X("NonText", s:selection, "", "")
call <SID>X("SpecialKey", s:selection, "", "")
call <SID>X("Search", s:background, s:yellow, "")
Expand All @@ -264,15 +265,12 @@ if has("gui_running") || &t_Co == 88 || &t_Co == 256
call <SID>X("CursorColumn", "", s:line, "none")
call <SID>X("PMenu", s:foreground, s:selection, "none")
call <SID>X("PMenuSel", s:foreground, s:selection, "reverse")
call <SID>X("SignColumn", "", s:background, "none")
end
if version >= 703
call <SID>X("ColorColumn", "", s:line, "none")
end

" Standard Highlighting
call <SID>X("Comment", s:comment, "", "")
call <SID>X("Todo", s:red, s:background, "bold")
call <SID>X("Title", s:comment, "", "bold")
call <SID>X("Identifier", s:orange, "", "")
call <SID>X("Statement", s:wine, "", "")
Expand Down Expand Up @@ -534,6 +532,33 @@ if has("gui_running") || &t_Co == 88 || &t_Co == 256
call <SID>X("diffRemoved", s:red, "", "")
call <SID>X("gitcommitSummary", "", "", "bold")


" Option g:afterglow_blackout
if !exists( "g:afterglow_blackout")
let g:afterglow_blackout = 0
endif
if g:afterglow_blackout
let s:chosen_background = s:black
else
let s:chosen_background = s:background
endif
" Settings dependent on g:afterglow_blackout
call <SID>X("Normal", s:foreground, s:chosen_background, "")
call <SID>X("LineNr", s:comment, s:chosen_background, "")
if version >= 700
call <SID>X("SignColumn", "", s:chosen_background, "none")
end
call <SID>X("Todo", s:red, s:chosen_background, "bold")

" Option g:afterglow_italic_comments
if exists( "g:afterglow_italic_comments") && g:afterglow_italic_comments
call <SID>X("Comment", s:comment, "", "italic")
else
" make the global variable available to command mode
let g:afterglow_italic_comments = 0
call <SID>X("Comment", s:comment, "", "")
endif

" Delete Functions
delf <SID>X
delf <SID>rgb
Expand Down

0 comments on commit 44b3fca

Please sign in to comment.