Révision | 411f57c1a26b31ff55499efc0dc3dc85af4db6b7 (tree) |
---|---|
l'heure | 2023-01-19 23:08:13 |
Auteur | badcoff33 <none@none> |
Commiter | badcoff33 |
minor stuff
@@ -0,0 +1,4 @@ | ||
1 | +setlocal noexpandtab " should be default | |
2 | +setlocal tabstop=4 | |
3 | +setlocal list | |
4 | +setlocal listchars=tab:<->,lead:., |
@@ -53,14 +53,12 @@ def ConditionalWriteAll(dict: dict<any>) | ||
53 | 53 | if has_key(dict, "nowrite") && (dict.nowrite == 1) |
54 | 54 | return |
55 | 55 | endif |
56 | - if &autowrite || &autowriteall | |
57 | - try | |
58 | - silent wall | |
59 | - catch /.*/ | |
60 | - echomsg "No autowrite. Not all modified buffers written" | |
61 | - finally | |
62 | - endtry | |
63 | - endif | |
56 | + try | |
57 | + silent wall | |
58 | + catch /.*/ | |
59 | + echomsg "No autowrite. Not all modified buffers written" | |
60 | + finally | |
61 | + endtry | |
64 | 62 | enddef |
65 | 63 | |
66 | 64 | export def Run(dict: dict<any>) |
@@ -1,11 +1,12 @@ | ||
1 | -" A Vim color theme | |
2 | -" Intro: Apollo tries to be a less-is-more color theme. It uses less colors to | |
3 | -" gain better readability and colorful clutter. But the temptation was too | |
4 | -" strong: I added some blueish and greenish colors to make thins not too | |
5 | -" boring. Enjoy! | |
6 | -" Name: Apollo | |
7 | -" Maintainer: Markus Prepens | |
8 | -" | |
1 | +vim9script | |
2 | + | |
3 | +# A Vim color theme | |
4 | +# Intro: Apollo tries to be a less-is-more color theme. It uses less colors to | |
5 | +# gain better readability and colorful clutter. But the temptation was too | |
6 | +# strong: I added some blueish and greenish colors to make thins not too | |
7 | +# boring. Enjoy! | |
8 | +# Name: Apollo | |
9 | +# Maintainer: Markus Prepens | |
9 | 10 | |
10 | 11 | if exists("syntax_on") |
11 | 12 | syntax reset |
@@ -13,68 +14,71 @@ endif | ||
13 | 14 | |
14 | 15 | hi clear |
15 | 16 | set background=dark |
16 | -let g:colors_name = "apollo" | |
17 | - | |
18 | -let s:white = "#FFFFFF" | |
19 | -let s:black = "#000000" | |
20 | - | |
21 | -let s:bg1 = "#132443" | |
22 | -let s:bg2 = "#263154" | |
23 | -let s:bg3 = "#344468" | |
24 | -let s:bg4 = "#48506F" | |
25 | -let s:silver1 = "#A0A0A8" | |
26 | -let s:silver2 = "#B8B8BE" | |
27 | -let s:silver3 = "#D0D0D8" | |
28 | -let s:silver4 = "#E0E0E8" | |
29 | -let s:green_bg = "#019378" | |
30 | -let s:green1 = "#02B360" | |
31 | -let s:green2 = "#07C168" | |
32 | -let s:green3 = "#07E070" | |
33 | -let s:green4 = "#07F88F" | |
34 | -let s:blue_bg = "#2E4388" | |
35 | -let s:blue1 = "#3068B0" | |
36 | -let s:blue2 = "#60A0D8" | |
37 | -let s:blue3 = "#70B0F8" | |
38 | -let s:red1 = "#B82042" | |
39 | -let s:red2 = "#E84070" | |
40 | -let s:amber = "#D0CF20" | |
41 | - | |
42 | -let s:Fg = {str -> empty(str) ? "" : "guifg=" ..str} | |
43 | -let s:Bg = {str -> empty(str) ? "" : "guibg="..str} | |
44 | -let s:Attr = {str -> empty(str) ? "" : "gui="..str} | |
45 | -let s:Cterm = {str -> empty(str) ? "" : "cterm="..str} | |
46 | - | |
47 | -" Basics | |
48 | -execute "hi Bold" s:Fg(s:silver2) s:Attr("bold") | |
49 | -execute "hi Cursor" s:Fg(s:black) s:Bg(s:white) | |
50 | -execute "hi CursorLine" s:Bg(s:bg3) s:Cterm("NONE") | |
51 | -execute "hi CursorLineNr" s:Fg(s:green3) s:Bg(s:bg3) s:Attr("bold") | |
52 | -execute "hi ErrorMsg" s:Fg(s:red2) s:Bg("bg") | |
53 | -execute "hi IncSearch" s:Fg(s:black) s:Bg(s:white) s:Attr("bold") s:Cterm("NONE") | |
54 | -execute "hi Italic" s:Fg(s:silver2) s:Attr("NONE") | |
55 | -execute "hi LineNr" s:Fg(s:blue3) s:Bg(s:bg2) | |
56 | -execute "hi LineNrAbove" s:Fg(s:bg4) s:Bg("bg") s:Attr("bold") | |
57 | -execute "hi LineNrBelow" s:Fg(s:bg4) s:Bg("bg") s:Attr("bold") | |
58 | -execute "hi MatchParen" s:Fg(s:green3) s:Bg("bg") s:Attr("underline") | |
59 | -execute "hi ModeMsg" s:Fg(s:silver2) s:Bg("bg") | |
60 | -execute "hi NonText" s:Fg(s:blue1) s:Bg(s:bg1) | |
61 | -execute "hi Normal" s:Fg(s:silver4) s:Bg(s:bg1) s:Attr("NONE") | |
62 | -execute "hi Pmenu" s:Fg(s:white) s:Bg(s:blue_bg) s:Attr("NONE") | |
63 | -execute "hi PmenuSbar" s:Fg(s:silver3) s:Bg(s:bg3) | |
64 | -execute "hi PmenuSel" s:Fg(s:white) s:Bg(s:green_bg) s:Attr("NONE") | |
65 | -execute "hi PmenuThumb" s:Fg(s:blue2) s:Bg(s:bg4) | |
66 | -execute "hi Question" s:Fg(s:green2) s:Bg("bg") | |
67 | -execute "hi QuickFixLine" s:Fg(s:amber) s:Bg("bg") s:Attr("bold") | |
68 | -execute "hi Search" s:Fg(s:white) s:Bg(s:blue2) s:Attr("NONE") | |
69 | -execute "hi StatusLine" s:Fg(s:white) s:Bg(s:blue1) s:Attr("NONE") s:Cterm("NONE") | |
70 | -execute "hi StatusLineNC" s:Fg(s:silver4) s:Bg(s:bg3) s:Attr("NONE") s:Cterm("NONE") | |
71 | -execute "hi Terminal" s:Fg(s:green3) s:Bg(s:black) | |
72 | -execute "hi Title" s:Fg(s:green3) | |
73 | -execute "hi VertSplit" s:Fg(s:bg2) s:Bg(s:bg2) s:Attr("NONE") | |
74 | -execute "hi Visual" s:Fg(s:white) s:Bg(s:blue_bg) | |
75 | -execute "hi WarningMsg" s:Fg(s:blue1) s:Bg("bg") | |
76 | -execute "hi qfFileName" s:Fg(s:blue2) | |
77 | -execute "hi qfSeparator" s:Fg("fg") | |
17 | + | |
18 | +g:colors_name = "apollo" | |
19 | + | |
20 | +var white = "#FFFFFF" | |
21 | +var black = "#000000" | |
22 | + | |
23 | +var bg1 = "#132443" | |
24 | +var bg2 = "#263154" | |
25 | +var bg3 = "#344468" | |
26 | +var bg4 = "#48506F" | |
27 | +var silver1 = "#A0A0A8" | |
28 | +var silver2 = "#B8B8BE" | |
29 | +var silver3 = "#D0D0D8" | |
30 | +var silver4 = "#E0E0E8" | |
31 | +var green_bg = "#019378" | |
32 | +var green1 = "#02B360" | |
33 | +var green2 = "#07C168" | |
34 | +var green3 = "#07E070" | |
35 | +var green4 = "#07F88F" | |
36 | +var blue_bg = "#2E4388" | |
37 | +var blue1 = "#3068B0" | |
38 | +var blue2 = "#60A0D8" | |
39 | +var blue3 = "#70B0F8" | |
40 | +var red1 = "#B82042" | |
41 | +var red2 = "#E84070" | |
42 | +var amber = "#D0CF20" | |
43 | + | |
44 | +var Fg = (str) => empty(str) ? "" : "guifg=" .. str | |
45 | +var Bg = (str) => empty(str) ? "" : "guibg=" .. str | |
46 | +var Attr = (str) => empty(str) ? "" : "gui=" .. str | |
47 | +var Cterm = (str) => empty(str) ? "" : "cterm=" .. str | |
48 | + | |
49 | +# Basics | |
50 | +execute "hi Bold" Fg(silver2) Attr("bold") | |
51 | +execute "hi Cursor" Fg(black) Bg(white) | |
52 | +execute "hi CursorLine" Bg(bg3) Cterm("NONE") | |
53 | +execute "hi CursorLineNr" Fg(green3) Bg(bg3) Attr("bold") | |
54 | +execute "hi ErrorMsg" Fg(red2) Bg("bg") | |
55 | +execute "hi IncSearch" Fg(black) Bg(white) Attr("bold") Cterm("NONE") | |
56 | +execute "hi Italic" Fg(silver2) Attr("NONE") | |
57 | +execute "hi LineNr" Fg(blue3) Bg(bg2) | |
58 | +execute "hi LineNrAbove" Fg(bg4) Bg("bg") Attr("bold") | |
59 | +execute "hi LineNrBelow" Fg(bg4) Bg("bg") Attr("bold") | |
60 | +execute "hi MatchParen" Fg(green3) Bg("bg") Attr("underline") | |
61 | +execute "hi ModeMsg" Fg(silver2) Bg("bg") | |
62 | +execute "hi NonText" Fg(blue1) Bg(bg1) | |
63 | +execute "hi Normal" Fg(silver4) Bg(bg1) Attr("NONE") | |
64 | +execute "hi Pmenu" Fg(white) Bg(blue_bg) Attr("NONE") | |
65 | +execute "hi PmenuSbar" Fg(silver3) Bg(bg3) | |
66 | +execute "hi PmenuSel" Fg(white) Bg(green_bg) Attr("NONE") | |
67 | +execute "hi PmenuThumb" Fg(blue2) Bg(bg4) | |
68 | +execute "hi Question" Fg(green2) Bg("bg") | |
69 | +execute "hi QuickFixLine" Fg(amber) Bg("bg") Attr("bold") | |
70 | +execute "hi Search" Fg(white) Bg(blue2) Attr("NONE") | |
71 | +execute "hi StatusLine" Fg(white) Bg(blue1) Attr("NONE") Cterm("NONE") | |
72 | +execute "hi StatusLineNC" Fg(silver4) Bg(bg3) Attr("NONE") Cterm("NONE") | |
73 | +execute "hi Terminal" Fg(green3) Bg(black) | |
74 | +execute "hi Title" Fg(green3) | |
75 | +execute "hi User1" Fg(white) Bg(green1) | |
76 | +execute "hi VertSplit" Fg(bg2) Bg(bg2) Attr("NONE") | |
77 | +execute "hi Visual" Fg(white) Bg(blue_bg) | |
78 | +execute "hi WarningMsg" Fg(blue1) Bg("bg") | |
79 | +execute "hi qfFileName" Fg(blue2) | |
80 | +execute "hi qfSeparator" Fg("fg") | |
81 | + | |
78 | 82 | highlight! link CursorColumn CursorLine |
79 | 83 | highlight! link FoldColumn Normal |
80 | 84 | highlight! link Folded StatusLineNC |
@@ -84,63 +88,57 @@ highlight! link StatusLineTermNC StatusLineNC | ||
84 | 88 | highlight! link TabLineSel StatusLine |
85 | 89 | highlight! link TabLine StatusLineNC |
86 | 90 | highlight! link TabLineFill StatusLineNC |
87 | -highlight! link User1 StatusLine | |
88 | 91 | highlight! link User2 StatusLine |
89 | 92 | highlight! link User3 StatusLine |
90 | 93 | highlight! link User4 StatusLine |
91 | 94 | highlight! link WildMenu IncSearch |
92 | 95 | highlight! link qfLineNr LineNr |
93 | -" Code | |
94 | -execute "hi Statement" s:Fg(s:blue3) | |
95 | -execute "hi Conditional" s:Fg(s:blue3) s:Attr("bold") | |
96 | -execute "hi Type" s:Fg(s:blue2) s:Attr("NONE") | |
97 | -execute "hi Structure" s:Fg(s:blue2) | |
98 | -execute "hi StorageClass" s:Fg(s:blue3) | |
99 | -execute "hi PreProc" s:Fg(s:white) s:Attr("bold") | |
100 | -execute "hi PreCondit" s:Fg(s:blue1) s:Attr("bold") | |
101 | -execute "hi Define" s:Fg(s:blue2) s:Attr("NONE") | |
102 | -execute "hi Comment" s:Fg(s:green3) | |
103 | -execute "hi Function" s:Fg(s:blue3) s:Attr("bold") | |
104 | -execute "hi Identifier" s:Fg(s:silver3) | |
105 | -execute "hi Special" s:Fg(s:green2) | |
106 | -execute "hi Constant" s:Fg(s:white) | |
107 | -execute "hi Number" s:Fg(s:white) | |
108 | -execute "hi Todo" s:Fg(s:silver2) s:Bg(s:bg3) | |
109 | -execute "hi Error" s:Fg(s:red2) s:Bg(s:bg3) | |
110 | -execute "hi Directory" s:Fg(s:silver4) s:Attr("underline") | |
111 | - | |
112 | -" Filetype VIM | |
113 | -execute "hi vimCommentTitle" s:Fg(s:white) s:Attr("bold") | |
114 | - | |
115 | -" Filetype C | |
116 | -execute "hi cCppOut" s:Fg(s:silver3) | |
117 | -execute "hi cCppOutIf2" s:Fg(s:silver3) | |
118 | -execute "hi cParen" s:Fg(s:silver3) | |
119 | -execute "hi cBlock" s:Fg(s:silver3) | |
120 | - | |
121 | -" filetype HTML | |
122 | -execute "hi htmlH1" s:Fg(s:green4) s:Attr("bold") | |
123 | -execute "hi htmlH2" s:Fg(s:green3) s:Attr("bold") | |
124 | -execute "hi htmlH3" s:Fg(s:green2) s:Attr("bold") | |
125 | - | |
126 | -" markdown | |
127 | -execute "hi markdownCode" s:Fg(s:silver3) s:Bg(s:bg3) | |
128 | -execute "hi markdownCodeBlock" s:Fg(s:silver2) | |
129 | -execute "hi markdownUrl" s:Fg(s:silver2) s:Bg(s:bg3) s:Attr("underline") | |
130 | -execute "hi markdownLinkText" s:Fg(s:blue2) s:Attr("NONE") | |
131 | - | |
132 | -" restructured text | |
133 | -execute "hi rstEmphasis" s:Fg(s:green2) | |
134 | -execute "hi rstStrongEmphasis" s:Fg(s:green2) s:Attr("bold") | |
135 | - | |
136 | -" Diffs | |
137 | -execute "hi DiffChange" s:Fg(s:white) s:Bg(s:bg4) | |
138 | -execute "hi DiffText" s:Fg(s:blue2) s:Bg(s:bg4) s:Attr("bold") | |
139 | -execute "hi DiffDelete" s:Fg(s:red1) s:Bg(s:red1) | |
140 | -execute "hi DiffAdd" s:Fg(s:green2) s:Bg(s:bg3) s:Attr("bold") | |
141 | - | |
142 | -" clean up | |
143 | -unlet s:Fg s:Bg s:Attr s:Cterm | |
144 | -unlet s:white s:black s:bg1 s:bg2 s:bg3 s:bg4 s:silver1 s:silver2 s:silver3 s:silver4 | |
145 | -unlet s:green_bg s:green1 s:green2 s:green3 s:green4 | |
146 | -unlet s:blue_bg s:blue1 s:blue2 s:blue3 s:red1 s:red2 s:amber | |
96 | + | |
97 | +# Code | |
98 | +execute "hi Statement" Fg(blue3) | |
99 | +execute "hi Conditional" Fg(blue3) Attr("bold") | |
100 | +execute "hi Type" Fg(blue2) Attr("NONE") | |
101 | +execute "hi Structure" Fg(blue2) | |
102 | +execute "hi StorageClass" Fg(blue3) | |
103 | +execute "hi PreProc" Fg(white) Attr("bold") | |
104 | +execute "hi PreCondit" Fg(blue1) Attr("bold") | |
105 | +execute "hi Define" Fg(blue2) Attr("NONE") | |
106 | +execute "hi Comment" Fg(green3) | |
107 | +execute "hi Function" Fg(blue3) Attr("bold") | |
108 | +execute "hi Identifier" Fg(silver3) | |
109 | +execute "hi Special" Fg(green2) | |
110 | +execute "hi Constant" Fg(white) | |
111 | +execute "hi Number" Fg(white) | |
112 | +execute "hi Todo" Fg(silver2) Bg(bg3) | |
113 | +execute "hi Error" Fg(red2) Bg(bg3) | |
114 | +execute "hi Directory" Fg(silver4) Attr("underline") | |
115 | + | |
116 | +# Filetype VIM | |
117 | +execute "hi vimCommentTitle" Fg(white) Attr("bold") | |
118 | + | |
119 | +# Filetype C | |
120 | +execute "hi cCppOut" Fg(silver3) | |
121 | +execute "hi cCppOutIf2" Fg(silver3) | |
122 | +execute "hi cParen" Fg(silver3) | |
123 | +execute "hi cBlock" Fg(silver3) | |
124 | + | |
125 | +# filetype HTML | |
126 | +execute "hi htmlH1" Fg(green4) Attr("bold") | |
127 | +execute "hi htmlH2" Fg(green3) Attr("bold") | |
128 | +execute "hi htmlH3" Fg(green2) Attr("bold") | |
129 | + | |
130 | +# markdown | |
131 | +execute "hi markdownCode" Fg(silver3) Bg(bg3) | |
132 | +execute "hi markdownCodeBlock" Fg(silver2) | |
133 | +execute "hi markdownUrl" Fg(silver2) Bg(bg3) Attr("underline") | |
134 | +execute "hi markdownLinkText" Fg(blue2) Attr("NONE") | |
135 | + | |
136 | +# restructured text | |
137 | +execute "hi rstEmphasis" Fg(green2) | |
138 | +execute "hi rstStrongEmphasis" Fg(green2) Attr("bold") | |
139 | + | |
140 | +# Diffs | |
141 | +execute "hi DiffChange" Fg(white) Bg(bg4) | |
142 | +execute "hi DiffText" Fg(blue2) Bg(bg4) Attr("bold") | |
143 | +execute "hi DiffDelete" Fg(red1) Bg(red1) | |
144 | +execute "hi DiffAdd" Fg(green2) Bg(bg3) Attr("bold") |
@@ -82,7 +82,8 @@ execute "hi PreCondit" s:Fg(s:blue) s:Attr("bold") | ||
82 | 82 | execute "hi PreProc" s:Fg(s:blue) s:Attr("NONE") |
83 | 83 | execute "hi Question" s:Fg(s:silver1) s:Bg("bg") |
84 | 84 | execute "hi QuickFixLine" s:Fg(s:white) s:Bg(s:red) s:Attr("NONE") |
85 | -execute "hi Special" s:Fg(s:silver1) | |
85 | +execute "hi Special" s:Fg(s:silver2) | |
86 | +execute "hi SpecialKey" s:Fg(s:silver7) | |
86 | 87 | execute "hi Statement" s:Fg(s:red) s:Attr("bold") |
87 | 88 | execute "hi StorageClass" s:Fg(s:red) |
88 | 89 | execute "hi String" s:Fg(s:silver4) |
@@ -295,24 +295,18 @@ command! -nargs=0 IC :set ignorecase nosmartcase | ||
295 | 295 | command! -nargs=0 CS :set noignorecase nosmartcase |
296 | 296 | command! -nargs=0 SC :set ignorecase smartcase |
297 | 297 | |
298 | -augroup vimrc | |
298 | +augroup vimrc " {{{ | |
299 | 299 | autocmd! |
300 | - " Reload changed buffers. :checktime relies on 'autoread'. | |
301 | - autocmd WinEnter * checktime | |
302 | - | |
303 | - " Choose color theme dependent on term type | |
300 | + autocmd WinEnter * checktime " Reload changed buffers. :checktime relies on 'autoread'. | |
304 | 301 | autocmd VimEnter * execute "colorscheme" ( (&term == "builtin_gui") ? "twotone" : "apollo" ) |
305 | - | |
306 | - " Copy a template as local .vimrc | |
302 | + autocmd FocusLost * silent wall | |
307 | 303 | autocmd BufNewFile .vimrc execute "0read" g:vim_home.."\\templates\\local_vimrc" |
308 | - | |
309 | -augroup END | |
304 | +augroup END " }}} | |
310 | 305 | |
311 | 306 | let g:term = &term |
312 | 307 | syntax on |
313 | 308 | |
314 | - | |
315 | -" Vim9: (gvim.exe) since C-] is no longer mapped on German keyboards, use this {{{ | |
309 | +" Vim9: Workaround for gvim.exe since several keys didn't work on German keyboards {{{ | |
316 | 310 | nmap <C-+> g<C-]> |
317 | 311 | imap <C-+> <C-]> |
318 | 312 | cmap <C-+> <C-]> |