From 7a2407cde88b2d5a326c766574cfb276f4305d66 Mon Sep 17 00:00:00 2001 From: Matsuuu Date: Thu, 26 Sep 2024 13:31:21 +0300 Subject: [PATCH] Use GUIColors in Windows WSL --- colors/pinkmare.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/colors/pinkmare.vim b/colors/pinkmare.vim index 1242170..62f112d 100644 --- a/colors/pinkmare.vim +++ b/colors/pinkmare.vim @@ -38,7 +38,17 @@ let s:palette = pinkmare#get_palette() " E.g.: " call s:HL('Normal', s:palette.fg, s:palette.bg0) -if (has('termguicolors') && &termguicolors) || has('gui_running') " guifg guibg gui cterm guisp +function! IsWSL() + let uname = substitute(system('uname'),'\n','','') + if uname == 'Linux' + let lines = readfile("/proc/version") + if lines[0] =~ "Microsoft" + return 1 + endif + endif +endfunction + +if (has('termguicolors') && &termguicolors) || has('gui_running' || IsWSL()) " guifg guibg gui cterm guisp function! s:HL(group, fg, bg, ...) let l:fg = get(get(s:configuration.overwrite_groups, a:group, {}), 'fg', a:fg) let l:bg = get(get(s:configuration.overwrite_groups, a:group, {}), 'bg', a:bg)