diff --git a/vim/vimrc b/vim/vimrc
index e87b10c..cd4dff0 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,6 +1,40 @@
 " Script Settings ------------------------------------------------------------|
 
-let s:colors=[
+let _agw={}
+
+let _agw.mode_map = {
+\	'n'    : '~ ',
+\	'no'   : 'n ',
+\	'nov'  : 'n→',
+\	'noV'  : 'n↓',
+\	'no' : 'n↔',
+\	'niI'  : '←i',
+\	'niR'  : '←R',
+\	'niV'  : '←v',
+\	'v'    : 'v→',
+\	'V'    : 'v↓',
+\	''   : 'v↔',
+\	's'    : 's→',
+\	'S'    : 's↓',
+\	''   : 's↔',
+\	'i'    : 'i ',
+\	'ic'   : '↗c',
+\	'ix'   : '↗x',
+\	'R'    : 'R ',
+\	'Rc'   : '↗r',
+\	'Rv'   : "R'",
+\	'Rx'   : '↗X',
+\	'c'    : '% ',
+\	'cv'   : ":'",
+\	'ce'   : ': ',
+\	'r'    : '↲ ',
+\	'rm'   : '⎬ ',
+\	'r?'   : "↲'",
+\	'!'    : '… ',
+\	't'    : '…!',
+\}
+
+let _agw.colors=[
 \	'base16-ashes',
 \	'base16-atelier-cave',
 \	'base16-atelier-forest',
@@ -14,13 +48,75 @@ let s:colors=[
 \	'base16-unikitty-dark',
 \]
 
-let s:columns=80      " GUI columns
-let s:rows=24         " GUI rows
-let s:cr_scheme=-1    " color from s:colors, -1 = random
-let s:number=1        " 0=no number, 1=enable relativenumber, 2=enable number
-let s:enable_list=1   " enable whitespace visibility (2=also newlines)
-let s:enable_tagbar=0 " enable tagbar addon
-let s:enable_vsp=0    " enable vertical split on enter
+let _agw.columns=80   " GUI columns
+let _agw.rows=24      " GUI rows
+let _agw.cr_scheme=-1 " color from s:colors, -1 = random
+let _agw.use_number=1 " 0=no number, 1=enable relativenumber, 2=enable number
+let _agw.use_list=1   " enable whitespace visibility (2=also newlines)
+let _agw.use_tagbar=0 " enable tagbar addon
+let _agw.use_vsp=0    " enable vertical split on enter
+
+" Functions ------------------------------------------------------------------|
+
+fu _agw.fill_line()
+ruby<<
+	tw  = VIM::evaluate("&tw").to_i
+	tw  = 80 if tw == 0
+	lin = $curbuf.line
+	rep = tw - lin.length - 3
+	if rep > 0
+		$curbuf.line += " " + "-" * rep + "|"
+	end
+.
+endfu
+
+fu _agw.file_flags()
+	let ret=""
+	if &modified | let ret..="'" | else | let ret..="." | end
+	if &readonly | let ret..="." | else | let ret..="'" | end
+	return ret
+endfu
+
+fu _agw.file_size()
+	let fs=line2byte(line('$')+1)-1
+	if fs < 0
+		return "no text"
+	else
+		return printf("%10d", fs)
+	endif
+endfu
+
+fu _agw.cur_mode()
+	return g:_agw.mode_map[mode()]
+endfu
+
+fu _agw.file_type()
+	return &filetype
+endfu
+
+fu _agw.statusline_start()
+	hi clear StatusLine
+	hi StatusLine guibg=#0a0a0a guifg=#92ebf0
+	return ''
+endfu
+
+fu _agw.strip_white()
+ruby<<
+	for ln in 1..$curbuf.length
+		li = $curbuf[ln]
+		if li[-1] == ?\s
+			$curbuf[ln] = li.rstrip!
+		end
+	end
+.
+endfu
+
+fu _agw.close_empty()
+	let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&modified")')
+	if !empty(bufs)
+		execute 'bdelete' join(bufs, ' ')
+	endif
+endfu
 
 " Settings -------------------------------------------------------------------|
 
@@ -31,31 +127,31 @@ set autochdir
 set laststatus=2
 
 " visuals
-set statusline=%{StatuslinePrelude()}
-set statusline+=%{ModePrint()}
-set statusline+=\ %r
-set statusline+=\ %{&filetype}
+set statusline=%{_agw.statusline_start()}
+set statusline+=%{_agw.cur_mode()}
+set statusline+=\ %{_agw.file_type()}
 set statusline+=\ %f
+set statusline+=\ %{_agw.file_flags()}
 set statusline+=%=
-set statusline+=\ %m
-set statusline+=\ %{FileSize()}
-set statusline+=\ ↑%4l→%-3c
+set statusline+=\ %{_agw.file_size()}
+set statusline+=\ ↑%5l
+set statusline+=\ →%5c
 set statusline+=\ ↓%5L
-set statusline+=\ %3p%%
+set statusline+=\ %%%3p
 
 set ruler
 set showcmd
 set noshowmode
 
-if s:number == 1
+if _agw.use_number == 1
 	set numberwidth=2
 	set relativenumber
-	let s:columns+=2
-elseif s:number == 2
+	let _agw.columns+=2
+elseif _agw.use_number == 2
 	set numberwidth=4
 	set relativenumber
 	set number
-	let s:columns+=4
+	let _agw.columns+=4
 endif
 
 set colorcolumn=80
@@ -63,11 +159,11 @@ set conceallevel=1
 
 set belloff=all
 
-if s:enable_list >= 1
+if _agw.use_list >= 1
 	set list
 	set listchars=tab:»—,space:·,trail:∴,extends:>,precedes:<
 
-	if s:enable_list >= 2
+	if _agw.use_list >= 2
 		set listchars+=eol:¶
 	endif
 endif
@@ -128,49 +224,49 @@ set updatetime=500
 " Plugin Settings ------------------------------------------------------------|
 
 " bufexplorer
-let g:bufExplorerDisableDefaultKeyMapping=1
+let bufExplorerDisableDefaultKeyMapping=1
 
 " gutentags
-let g:gutentags_project_root=['.git', 'Makefile']
+let gutentags_project_root=['.git', 'Makefile']
 
 " TwitVim
 let twitvim_browser_cmd='palemoon'
 
 " vim-markdown
-let g:vim_markdown_folding_disabled=1
+let vim_markdown_folding_disabled=1
 
 " rainbow
-let g:rainbow_active=0
+let rainbow_active=0
 
 " netrw
-let g:netrw_banner=0
-let g:netrw_liststyle=3
-let g:netrw_browse_split=4
-let g:netrw_altv=1
-let g:netrw_winsize=20
+let netrw_banner=0
+let netrw_liststyle=3
+let netrw_browse_split=4
+let netrw_altv=1
+let netrw_winsize=20
 
 " buftabline
-let g:buftabline_show=2
-let g:buftabline_numbers=2
-let g:buftabline_indicators=1
-let g:buftabline_separators=0
-let g:buftabline_plug_max=19
+let buftabline_show=2
+let buftabline_numbers=2
+let buftabline_indicators=1
+let buftabline_separators=0
+let buftabline_plug_max=19
 
 " TagBar
-let g:tagbar_vertical=7
-let g:tagbar_compact=1
-let g:tagbar_show_linenumbers=1
-let g:tagbar_iconchars=['»', '▼']
-let g:tagbar_autoshowtag=1
+let tagbar_vertical=7
+let tagbar_compact=1
+let tagbar_show_linenumbers=1
+let tagbar_iconchars=['»', '▼']
+let tagbar_autoshowtag=1
 
 " abolish
-let g:abolish_no_mappings=1 " we set out own later
+let abolish_no_mappings=1 " we set out own later
 
 " zig.vim
-let g:zig_fmt_autosave=0
+let zig_fmt_autosave=0
 
 " polyglot
-let g:polyglot_disabled=['c++11']
+let polyglot_disabled=['c++11']
 
 " gui and terminal specific settings
 if has('gui_running')
@@ -179,8 +275,8 @@ if has('gui_running')
 	set guioptions=agit
 	set guitablabel=%N.%t
 
-	let &lines=s:rows
-	let &columns=s:columns
+	let &lines=_agw.rows
+	let &columns=_agw.columns
 else
 	" use high-color terminal capabilities
 	let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
@@ -209,23 +305,23 @@ endif
 " OS-specific settings
 if has('win32')
 	" windows sucks
-	let $PATH='G:\msys64\usr\bin;'.$PATH
+	let $PATH='G:\msys64\usr\bin;'..$PATH
 
 	set shellslash
 
 	" netrw
 	let key='G:/msys64/home/marrub/.ssh/id_rsa'
 
-	let g:netrw_cygwin=0
-	let g:netrw_ignorenetrc=1
-	let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa "
-	let g:netrw_ssh_cmd="ssh -i " . key
-	let g:netrw_scp_cmd="scp -q -i " . key
-	let g:netrw_sftp_cmd="sftp -i " . key
-	let g:netrw_silent=1
+	let netrw_cygwin=0
+	let netrw_ignorenetrc=1
+	let netrw_list_cmd="ssh -i "..key.." USEPORT HOSTNAME ls -Fa "
+	let netrw_ssh_cmd="ssh -i "..key
+	let netrw_scp_cmd="scp -q -i "..key
+	let netrw_sftp_cmd="sftp -i "..key
+	let netrw_silent=1
 
 	" gutentags
-	let g:gutentags_cache_dir=$VIM.'/vimtags/'
+	let gutentags_cache_dir=$VIM..'/vimtags/'
 
 	" swap files
 	set directory=$VIM/vimtemp//
@@ -235,7 +331,7 @@ else
 	endif
 
 	" gutentags
-	let g:gutentags_cache_dir=$HOME.'/.vim/tags/'
+	let gutentags_cache_dir=$HOME..'/.vim/tags/'
 
 	" searching
 	set grepprg=rg\ --vimgrep\ -n
@@ -248,102 +344,14 @@ endif
 
 syntax on
 
-if s:cr_scheme != -1
-	execute 'colorscheme' s:colors[s:cr_scheme]
+if _agw.cr_scheme != -1
+	execute 'colorscheme' _agw.colors[_agw.cr_scheme]
 endif
 
 filetype on
 filetype plugin on
 filetype indent on
 
-" Functions ------------------------------------------------------------------|
-
-" Automatic headers
-fu! <SID>FillLine()
-ruby<<
-	tw  = VIM::evaluate("&tw").to_i
-	tw  = 80 if tw == 0
-	lin = $curbuf.line
-	rep = tw - lin.length - 3
-	if rep > 0
-		$curbuf.line += " " + "-" * rep + "|"
-	end
-.
-endfu
-
-" File size
-fu! FileSize()
-	let fs=line2byte(line('$')+1)-1
-	if fs < 0
-		return ""
-	else
-		return fs
-	endif
-endfu
-
-" Mode printer
-fu! ModePrint()
-	let mode_map = {
-\		'n'    : '~ ',
-\		'no'   : 'n ',
-\		'nov'  : 'n→',
-\		'noV'  : 'n↓',
-\		'no' : 'n↔',
-\		'niI'  : '←i',
-\		'niR'  : '←R',
-\		'niV'  : '←v',
-\		'v'    : 'v→',
-\		'V'    : 'v↓',
-\		''   : 'v↔',
-\		's'    : 's→',
-\		'S'    : 's↓',
-\		''   : 's↔',
-\		'i'    : 'i ',
-\		'ic'   : '↗c',
-\		'ix'   : '↗x',
-\		'R'    : 'R ',
-\		'Rc'   : '↗r',
-\		'Rv'   : "R'",
-\		'Rx'   : '↗X',
-\		'c'    : '% ',
-\		'cv'   : ":'",
-\		'ce'   : ': ',
-\		'r'    : '↲ ',
-\		'rm'   : '⎬ ',
-\		'r?'   : "↲'",
-\		'!'    : '… ',
-\		't'    : '…!',
-\	}
-	return mode_map[mode()]
-endfu
-
-" Statusline prelude function
-fu! StatuslinePrelude()
-	hi clear StatusLine
-	hi StatusLine guibg=#0a0a0a guifg=#92ebf0
-	return ''
-endfu
-
-" Strip whitespace on buffer write
-fu! s:StripWhite()
-ruby<<
-	for ln in 1..$curbuf.length
-		li = $curbuf[ln]
-		if li[-1] == ?\s
-			$curbuf[ln] = li.rstrip!
-		end
-	end
-.
-endfu
-
-" Close empty buffers
-fu! s:CloseEmptyBuffers()
-	let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&modified")')
-	if !empty(bufs)
-		execute 'bdelete' join(bufs, ' ')
-	endif
-endfu
-
 " Commands -------------------------------------------------------------------|
 
 " Find
@@ -355,7 +363,7 @@ com W execute 'w !sudo tee > /dev/null %' | edit!
 " Autocommands ---------------------------------------------------------------|
 
 " Strip whitespace
-au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,markdown au BufWritePre <buffer> call s:StripWhite()
+au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,markdown au BufWritePre <buffer> call _agw.strip_white()
 
 " Enable rainbow braces
 au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,html,scheme,racket,lisp,json au BufEnter <buffer> RainbowToggleOn
@@ -367,11 +375,12 @@ au FileType markdown set comments+=fb:- comments-=b:- indentexpr=
 au BufNewFile,BufRead *.s,*.inc setlocal shiftwidth=8 filetype=asm_ca65
 
 " close empty buffers automatically
-au BufEnter * call s:CloseEmptyBuffers()
+au BufEnter * call _agw.close_empty()
 
 " set color randomly on buffer enter
-if s:cr_scheme == -1
-	au BufEnter * execute 'colorscheme' s:colors[localtime() % len(s:colors)]
+if _agw.cr_scheme == -1
+	au BufEnter * execute 'colorscheme'
+	\	_agw.colors[localtime() % len(_agw.colors)]
 endif
 
 " .rkt → Racket
@@ -385,7 +394,7 @@ au BufReadPre * let b:did_ftplugin=1
 au BufReadPre *.rkt unlet b:did_ftplugin
 
 " enable tagbar
-if s:enable_tagbar == 1
+if _agw.use_tagbar == 1
 	au VimEnter * nested :TagbarOpen
 endif
 
@@ -394,7 +403,7 @@ endif
 au BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=toml | endif
 
 " vertical split on enter
-if s:enable_vsp == 1
+if _agw.use_vsp == 1
 	au VimEnter * vsplit
 endif
 
@@ -407,7 +416,7 @@ au BufEnter * set noreadonly
 nm ga <Plug>(EasyAlign)
 xm ga <Plug>(EasyAlign)
 
-nn <Leader>e :call <SID>FillLine()<CR>
+nn <Leader>e :call _agw.fill_line()<CR>
 
 " TagBar
 nm <F5> :TagbarToggle<CR>
@@ -445,7 +454,7 @@ nn <Leader>S vip:sort<CR>
 vn <Leader>S :sort<CR>
 
 " Tmux-like bindings
-nn <silent> <Leader>bw :let g:netrw_chgwin = winnr()<CR>
+nn <silent> <Leader>bw :let netrw_chgwin = winnr()<CR>
 nn <silent> <Leader>b" :new<CR>:wincmd x<CR>:wincmd j<CR>
 nn <silent> <Leader>b% :vnew<CR>:wincmd x<CR>:wincmd l<CR>
 
@@ -529,7 +538,7 @@ nn Q gqap
 
 " Rainbow Config -------------------------------------------------------------|
 
-let g:rainbow_conf = {
+let rainbow_conf = {
 \	'guifgs': ['#ff533d', '#ff973d', '#ffe13d', '#91ff3d', '#3dffd8', '#3daeff', '#6a3dff', '#ee3dff'],
 \	'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'],
 \	'operators': '_,_',
