-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgvimrc.Windows
65 lines (58 loc) · 1.54 KB
/
gvimrc.Windows
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
" somini.gvimrc - Windows
" Workarounds {{{
set winaltkeys=no
" This does close the current window on Windows. I think
nnoremap <C-w><C-c> <C-c>
" }}}
" Clipboard {{{
set clipboard=unnamed " This works as expected
"}}}
" Appearance {{{
" Important to remove the `:cANSI` nonsense set by default
set guifont=DejaVu_Sans_Mono_for_Powerline:h11,Consolas:h11
"}}}
" Windowing Systems {{{
" If $HOME was non-ASCII characters, copy the DLL into the $VIMRUNTIME folder
let s:search_list = [g:os_dir, $VIMRUNTIME]
if exists('g:os_dir_extra')
call insert(s:search_list, g:os_dir_extra,0)
endif
let s:search_path = join(s:search_list, ',')
let s:dll_maximize = findfile('maximize.dll', s:search_path)
let s:dll_fullscreen = findfile('gvimfullscreen.dll', s:search_path)
function! ToggleFullscreen()
if filereadable(s:dll_fullscreen)
try
call libcallnr(s:dll_fullscreen, 'ToggleFullScreen', 0)
catch
echom 'Error in the Fullscreen DLL'
endtry
endif
endfunction
function! WindowMaximize()
if filereadable(s:dll_maximize)
try
call libcallnr(s:dll_maximize, 'Maximize', 1)
catch
call s:WindowMaximizeHack()
endtry
else
call s:WindowMaximizeHack()
endif
endfunction
function! s:WindowMaximizeHack()
if g:os == 'Windows'
simalt ~x
else
" Fallback to the good old hack
set lines=999 columns=999
endif
endfunction
" Maximize the gVim window on entering
call WindowMaximize()
" Create a <Plug> mapping to maximize windows
nnoremap <Plug>ToggleFullscreen :<C-u>call ToggleFullscreen()<CR>
"}}}
" Modeline {{{
" vim:ft=vim:ts=2:sw=2:fdm=marker
"}}}