vim9script set encoding=utf-8 scriptencoding utf-8 augroup gvimrc au! augroup END # 表示設定 {{{ set cmdheight=0 set textwidth=0 set renderoptions=type:directx,renmode:6 set guifont=Cica:h13 # 絵文字テスト 🐞_🐝_ # }}} # フォントサイズ変更 {{{ def IncFontSize(d: number) var f = split(&guifont, ':h') &guifont = f[0] .. ':h' .. (str2nr(f[1]) + d) enddef nnoremap call IncFontSize(v:count1) nnoremap call IncFontSize(-v:count1) # }}} # guioptions {{{ nnoremap set go-=mset go-=T nnoremap if &go=~#'m'set go-=melseset go+=mendif nnoremap if &go=~#'T'set go-=Telseset go+=Tendif set go-=m set go-=T # }}} # ウィンドウ位置記憶 {{{ # http://vim-jp.org/vim-users-jp/2010/01/28/Hack-120.html g:save_window_file = expand('~/.vimwinpos') def SaveWindow() var options = [ 'set background=' .. &background, 'colorscheme ' .. g:colors_name, 'set columns=' .. &columns, 'set lines=' .. &lines, 'winpos ' .. getwinposx() .. ' ' .. getwinposy(), ] writefile(options, g:save_window_file) enddef au gvimrc VimLeavePre * SaveWindow() if filereadable(g:save_window_file) execute 'source' g:save_window_file endif # }}} # プラグイン {{{ g:nerdtree_tabs_open_on_gui_startup = 0 g:webdevicons_conceal_nerdtree_brackets = 1 g:WebDevIconsNerdTreeAfterGlyphPadding = '' def MyLightline() g:lightline.separator = { left: "\ue0b0", right: "\ue0b2" } g:lightline.subseparator = { left: "", right: "" } lightline#init() lightline#enable() enddef MyLightline() au gvimrc VimEnter * ++once MyLightline() au gvimrc BufRead * MyLightline() # }}} # Windows {{{ if has('win32') # Alt-Spaceでシステムメニュー(winaltkeysはメニューバーが無いと動かないので×) noremap simalt ~ # 外部ツール # https://github.com/utubo/winscp_upload.bat nnoremap :!winscp_upload.bat =expand("%:p") endif # }}}