-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_gvimrc8
161 lines (160 loc) · 6.8 KB
/
_gvimrc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
" .gvimrc / _gvimrc
" 01 Windows, WSL, GUI options {{{
" GUI toolbar
if has("toolbar") &&
\ (v:version > 704 || (v:version == 704 && has('patch2015')))
if len(split(execute('amenu ToolBar'), '\n')) > 0
silent! aunmenu ToolBar
endif
anoremenu 1.10 ToolBar.Open :browse confirm e<CR>
tmenu ToolBar.Open Open file
anoremenu 1.20 ToolBar.Mks :execute "browse mksession! "
\ .. strftime("%Y-%m-%d")<CR>
tmenu ToolBar.Mks Save current session
anoremenu 1.30 ToolBar.Run :browse source<CR>
tmenu ToolBar.Run Run a Vim Script / Load a session
if has("printer") && !has("unix")
anoremenu 1.40 ToolBar.Print :hardcopy<CR>
vnoremenu ToolBar.Print :hardcopy<CR>
elseif has("unix")
anoremenu 1.40 ToolBar.Print :w !lpr<CR>
vnoremenu ToolBar.Print :w !lpr<CR>
endif
tmenu ToolBar.Print Print
anoremenu 1.45 ToolBar.-sep1- <Nop>
anoremenu 1.50 ToolBar.Undo u
tmenu ToolBar.Undo Undo
anoremenu 1.60 ToolBar.Redo <C-R>
tmenu ToolBar.Redo Redo
anoremenu 1.65 ToolBar.-sep2- <Nop>
vnoremenu 1.70 ToolBar.Cut "+x
tmenu ToolBar.Cut Cut to clipboard
vnoremenu 1.80 ToolBar.Copy "+y
cnoremenu 1.80 ToolBar.Copy <C-Y>
tmenu ToolBar.Copy Copy to clipboard
nnoremenu 1.90 ToolBar.Paste "+gP
cnoremenu 1.90 ToolBar.Paste <C-R>+
silent! execute 'vnoremenu <script> ToolBar.Paste ' .. paste#paste_cmd['v']
silent! execute 'inoremenu <script> ToolBar.Paste ' .. paste#paste_cmd['i']
tmenu ToolBar.Paste Paste from Clipboard
anoremenu 1.95 ToolBar.-sep3- <Nop>
anoremenu <silent> 1.100 ToolBar.Spell :let &spell = &spell==0 ? 1 : 0<CR>
tmenu ToolBar.Spell Toggle spell checking
anoremenu <silent> 1.110 ToolBar.SpellNext ]s
tmenu ToolBar.SpellNext Next misspelled word
anoremenu 1.115 ToolBar.-sep4- <Nop>
anoremenu 1.120 ToolBar.Menu :execute
\ "if &guioptions=~'m' \| set guioptions-=m \| else \|" ..
\ " set guioptions+=m \| endif"<CR>
tmenu ToolBar.Menu Toggle menu
endif
"}}}
" 02 Highlights {{{
" Make sure that the default g:colors_name exists and is default (which it
" should be anyhow since that is the default rather than empty!) NB: Actually
" calling colorscheme default does weird things here - AVOID doing that!
if !exists("g:colors_name")
let g:colors_name = 'default'
endif
" " Screen column indicator
" highlight ColorColumn guibg=LightGrey
" " Just the current (cursor's) line number indicator - makes it more distinct
" highlight CursorLineNr guifg=DarkGrey gui=bold
" " The colour of the line numbers
" highlight LineNr guifg=Grey
" " The showmode message's colour (e.g., -- INSERT --)
" highlight ModeMsg guifg=DarkGrey gui=bold
" " Colour of 'showbreak' and other non-text characters
" highlight NonText guifg=LightGrey guibg=White
" " Colour of the 'list' characters like Tab
" highlight SpecialKey guibg=LightGrey guifg=White
" }}}
" 03 Settings (global) {{{
" columns Set columns to 80 + 1 (colorcolumn) + 3 (number) + 1 (foldcolumn)
set columns=85
" Set gvim-specific font to ensure display of special characters. For WSL the
" font can be set in WSL Properties dialog, but the font should be installed.
if has('gui_gtk3')
set guifont=FiraCode\ Nerd\ Font\ Mono\ Regular\ 12,FiraCode\ NFM\ 12
elseif has('gui_win32')
set guifont=FiraCode_Nerd_Font_Mono:h12,FiraCode_NFM:h12
" https://www.nerdfonts.com/font-downloads
endif
set guioptions+=!abceghLmrtT " extend default guioptions to...
set guioptions-=m " but then remove (use toolbar to toggle Menu)...
" ! External commands are executed in a terminal window
" a Autoselect: When VISUAL mode is started/or the Visual area extended,
" Vim tries to become the owner of the system's global selection
" b Bottom (horizontal) scrollbar is present
" c Use console dialogs instead of popup dialogs for simple choices
" e Add tab pages when indicated with 'showtabline'
" g Grey menu items: Make menu items that are not active grey
" h Limit horizontal scrollbar size to the length of the cursor line
" L Left-hand scrollbar is present when there is a vertically split window
" m Menu bar is present
" r Right-hand scrollbar is always present.
" t Include tearoff menu items.
" T Include Toolbar.
if version > 899 " customise the tabline for when using vim9-tene
set guitablabel=%{%join(tabpagebuflist('%'),'\ ˙\ ')..'\ %t'%}
endif
" guitabtooltip Consider using this. Maybe a function; make it useful?
" set renderoptions - :h 'renderoptions'
" "only available when compiled with GUI and DIRECTX on MS-Windows"
" See 06 Mappings, below - it has a toggleable Leader option
" The reason for this is that although certainly the
" "drawn glyphs more beautiful than default GDI", meaning things
" like coloured emoji are awesome, I hate ligatures in coding
" fonts, so having the option to toggle this is the go.
" # Keep cmd.exe default as that keeps gx working!
" # set shell=bash.exe # Vim plays nicest with Linux/bash, so exploit that
" # set shell=powershell.exe # system32\WindowsPowerShell\v1.0\powershell.exe
" let $PYTHONPATH=#~/AppData/Local/Programs/Python/Python311# # needed?
" endif
" All of these are in the .vimrc / _vimrc. There are none needed here
" titlestring= This is set in .vimrc too, but overridden for gvim only here
set titlestring=%{expand(\"%:p\")}\ %{&modified&&&buftype!='terminal'?'\ +':''}%{&readonly?'\ RO':''}%{(!&modifiable&&mode()!=#'t')?'\ -':''}%{&buftype=='help'?'\ HLP':''}
" }}}
" 04 Commands (none yet for gvim specifically) {{{
" }}}
" 05 Functions {{{
" Colorscheme overrides
function g:ColoursGUIreset()
" default colorscheme overrides (they persist until the colorscheme changes)
if g:colors_name == "default"
" line numbers
highlight LineNr guifg=Grey
" the line number of the active cursor
highlight CursorLineNr gui=bold guifg=DarkRed
" Screen column indicator
highlight ColorColumn guibg=LightGrey
" 'showmode' message's colour (e.g., -- INSERT --)
highlight ModeMsg guifg=DarkGrey
" 'showbreak' and other non-text characters
highlight NonText guifg=LightGrey
" 'list' characters like Tab
highlight SpecialKey guifg=LightGrey
" Inactive statusline less prominent
highlight StatusLineNC guifg=Black guibg=Grey gui=NONE
else
" Do nothing special - only use default!
endif
endfunction
" }}}
" 06 Mappings {{{
" Mapping to toggle renderer in Windows: needs Win32 and directx
if has ('Win32') && has('directx') && v:version > 704
nnoremap <Leader>r <Cmd>execute "let &rop = (len(&rop)==0) ? 'type:directx,gamma:1.0,geom:0,renmode:5,taamode:1' : ''"<CR>
endif
"}}}
" 07 Autocommands {{{
augroup gvimrc-ColorScheme
au!
au ColorScheme * call g:ColoursGUIreset()
augroup END
" }}}
" 08 Plugins (none yet for gvim specifically) {{{
" }}}
" 09 Syntax + filetype (n/a for gvim specifically?) {{{
" }}}
" vim: textwidth=79 foldmethod=marker filetype=vim expandtab