neovim-config/ginit.vim

48 lines
1.2 KiB
VimL

""
"" Misc.
""
set termguicolors
GuiScrollBar 0
GuiTabline 0
GuiRenderLigatures 0
"" get colorscheme from gtk
let gtk_colorscheme = substitute(system('gsettings get org.gnome.desktop.interface color-scheme'), '\n', '', '')
if gtk_colorscheme == "'prefer-dark'"
set background=dark
else
set background=light
"" hi ColorColumn guibg=#c0bfbc
endif
""
"" Font Setup
""
"" parameters
let s:defaultfontsize = 10
let s:fontname = "RobotoMono Nerd Font [GOOG]"
"" set default font
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
"" increase/decrease font size function
let s:fontsize = s:defaultfontsize
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize+a:amount
:execute "Guifont " . s:fontname . ":h" . s:fontsize
endfunction
"" reset font size
function! ResetFontSize()
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
endfunction
"" font size keybindings
noremap <C-S-+> :call AdjustFontSize(1)<CR>
noremap <C-S-_> :call AdjustFontSize(-1)<CR>
noremap <C-S-)> :call ResetFontSize()<CR>
inoremap <C-S-+> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-S-_> <Esc>:call AdjustFontSize(-1)<CR>a
inoremap <C-S-)> <Esc>:call ResetFontSize()<CR>a