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

Background/float border normal float #192

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 41 additions & 38 deletions colors/PaperColor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ let s:version = '0.9.x'
" See: http://vim.wikia.com/wiki/Folding
" - The main section is at the end where the functions are called in order.

" Theme Repository: {{{
" Theme Repository:

let s:themes = {}

" }}}
"

fun! s:register_default_theme()
" Theme name should be lowercase
Expand Down Expand Up @@ -205,7 +205,7 @@ endfun

" ============================ THEME REGISTER =================================

" Acquire Theme Data: {{{
" Acquire Theme Data:

" Brief:
" Function to get theme information and store in variables for other
Expand All @@ -226,7 +226,7 @@ endfun
" s:options <dictionary> user options
fun! s:acquire_theme_data()

" Get theme name: {{{
" Get theme name:
let s:theme_name = 'default'

if exists("g:PaperColor_Theme") " Users expressed theme preference
Expand All @@ -248,7 +248,7 @@ fun! s:acquire_theme_data()
endif

endif
" }}}
"

if s:theme_name ==? 'default'
" Either no other theme is specified or they failed to load
Expand All @@ -258,7 +258,7 @@ fun! s:acquire_theme_data()

let s:selected_theme = s:themes[s:theme_name]

" Get Theme Variant: either dark or light {{{
" Get Theme Variant: either dark or light
let s:selected_variant = 'dark'

let s:is_dark=(&background == 'dark')
Expand All @@ -280,7 +280,7 @@ fun! s:acquire_theme_data()

let s:palette = s:selected_theme[s:selected_variant].palette

" Systematic User-Config Options: {{{
" Systematic User-Config Options:
" Example config in .vimrc
" let g:PaperColor_Theme_Options = {
" \ 'theme': {
Expand Down Expand Up @@ -309,15 +309,15 @@ fun! s:acquire_theme_data()
if exists("g:PaperColor_Theme_Options")
let s:options = g:PaperColor_Theme_Options
endif
" }}}
"

" }}}
"
endfun


" }}}
"

" Identify Color Mode: {{{
" Identify Color Mode:

fun! s:identify_color_mode()
let s:MODE_16_COLOR = 0
Expand All @@ -333,11 +333,11 @@ fun! s:identify_color_mode()
endif
endfun

" }}}
"

" ============================ OPTION HANDLER =================================

" Generate Them Option Variables: {{{
" Generate Them Option Variables:


fun! s:generate_theme_option_variables()
Expand Down Expand Up @@ -408,9 +408,9 @@ fun! s:generate_theme_option_variables()
endif

endfun
" }}}
"

" Check If Theme Has Hint: {{{
" Check If Theme Has Hint:
"
" Brief:
" Function to Check if the selected theme and variant has a hint
Expand All @@ -427,9 +427,9 @@ fun! s:theme_has_hint(hint)
return has_key(s:selected_theme[s:selected_variant], a:hint) &&
\ s:selected_theme[s:selected_variant][a:hint] == 1
endfun
" }}}
"

" Set Overriding Colors: {{{
" Set Overriding Colors:

fun! s:set_overriding_colors()

Expand Down Expand Up @@ -474,9 +474,9 @@ fun! s:set_overriding_colors()
endif

endfun
" }}}
"

" Generate Language Option Variables: {{{
" Generate Language Option Variables:

" Brief:
" Function to generate language option variables so that there is no need to
Expand Down Expand Up @@ -532,12 +532,12 @@ fun! s:generate_language_option_variables()
endif

endfun
" }}}
"

" =========================== COLOR CONVERTER =================================

fun! s:load_GUI_to_256_converter()
" GUI-color To 256-color: {{{
" GUI-color To 256-color:
" Returns an approximate grey index for the given grey level
fun! s:grey_number(x)
if &t_Co == 88
Expand Down Expand Up @@ -734,11 +734,11 @@ fun! s:load_GUI_to_256_converter()



" }}}
"
endfun

fun! s:load_256_to_GUI_converter()
" 256-color To GUI-color: {{{
" 256-color To GUI-color:

""" Xterm 256 color dictionary
" See: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
Expand Down Expand Up @@ -797,12 +797,12 @@ let s:to_HEX = {
\ '250': '#bcbcbc', '251': '#c6c6c6', '252': '#d0d0d0', '253': '#dadada', '254': '#e4e4e4',
\ '255': '#eeeeee' }

" }}}
"
endfun

" ========================== ENVIRONMENT ADAPTER ==============================

" Set Format Attributes: {{{
" Set Format Attributes:

fun! s:set_format_attributes()
" These are the default
Expand Down Expand Up @@ -838,9 +838,9 @@ fun! s:set_format_attributes()

endfun

" }}}
"

" Convert Colors If Needed: {{{
" Convert Colors If Needed:
fun! s:convert_colors()
if s:theme_has_hint('NO_CONVERSION')
return
Expand Down Expand Up @@ -873,14 +873,14 @@ fun! s:convert_colors()
" otherwise use the terminal colors and none of the theme colors are used
endfun

" }}}
"

" ============================ COLOR POPULARIZER ===============================

" Set Color Variables: {{{
" Set Color Variables:
fun! s:set_color_variables()

" Helper: {{{
" Helper:
" -------
" Function to dynamically generate variables that store the color strings
" for setting highlighting. Each color name will have 2 variables with prefix
Expand Down Expand Up @@ -922,7 +922,7 @@ fun! s:set_color_variables()
let {'s:sp_' . a:color_name} = ''
endfun
endif
" }}}
"

" Color value format: Array [<GUI COLOR/HEX >, <256-Base>, <16-Base>]
" 16-Base is terminal's native color palette that can be alternated through
Expand Down Expand Up @@ -1113,9 +1113,9 @@ fun! s:set_color_variables()
endif

endfun
" }}}
"

" Apply Syntax Highlightings: {{{
" Apply Syntax Highlightings:

fun! s:apply_syntax_highlightings()

Expand Down Expand Up @@ -1254,6 +1254,9 @@ fun! s:apply_syntax_highlightings()
exec 'hi LspDiagnosticsUnderlineWarning cterm=undercurl gui=undercurl' . s:sp_todo_fg
exec 'hi LspDiagnosticsUnderlineInformation cterm=undercurl gui=undercurl' . s:sp_todo_fg
exec 'hi LspDiagnosticsUnderlineHint cterm=undercurl gui=undercurl' . s:sp_todo_fg
" correct border color for lsp_signature plugin (ray-x/lsp_signature.nvim)
exec 'hi FloatBorder' . s:bg_background
exec 'hi NormalFloat' . s:bg_background

hi! link DiagnosticError LspDiagnosticsDefaultError
hi! link DiagnosticWarn LspDiagnosticsDefaultWarning
Expand All @@ -1267,7 +1270,7 @@ fun! s:apply_syntax_highlightings()

endif

" Extension {{{
" Extension
" VimL Highlighting
exec 'hi vimCommand' . s:fg_pink
exec 'hi vimVar' . s:fg_navy
Expand Down Expand Up @@ -2122,7 +2125,7 @@ fun! s:apply_syntax_highlightings()
exec 'hi asnTypeInfo' . s:fg_aqua . s:ft_bold
exec 'hi asnFieldOption' . s:fg_purple

" }}}
"

" Plugin: Netrw
exec 'hi netrwVersion' . s:fg_red
Expand Down Expand Up @@ -2305,10 +2308,10 @@ fun! s:apply_syntax_highlightings()
endif

endfun
" }}}
"

" ================================== MISC =====================================
" Command to show theme information {{{
" Command to show theme information
fun! g:PaperColor()
echom 'PaperColor Theme Framework'
echom ' version ' . s:version
Expand All @@ -2326,7 +2329,7 @@ endfun

" @brief command alias for g:PaperColor()
command! -nargs=0 PaperColor :call g:PaperColor()
" }}}
"

" =============================== MAIN ========================================

Expand Down