" !::exe [So] command! CurrentSession call Info('Session: ' . GetCurrentSession()) command! -nargs=* Lua lua print(vim.inspect()) command! -nargs=* LuaReload exec 'lua package.loaded["' '' '"] = nil' | luafile % command! -bar So so % | echo '' | call Warn('sourced') command! -bar SO w|So command! -bar Sudo write !sudo tee % >/dev/null command! -bar Scratch vnew | setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile " Generics command! -bar -range DeleteTrailingWS noautocmd silent! exe 'keeppatterns ,s/\s\+$//g' command! -bar UpdateTerminalSize silent resize +1 | silent resize -1 command! -nargs=1 Nwhich :Pp maparg(, 'n', 0, 1) " Highlight command! -bar -nargs=1 -complete=highlight Fullfill call hi#fullfill() " Windows etc command! -bar -nargs=0 WindowYank :let _yw=[bufnr('%'), winsaveview()] command! -bar -nargs=0 WindowPaste :if exists('g:_yw') | exe _yw[0] . 'buffer' | call winrestview(_yw[1]) | end command! -bar -nargs=0 WindowCopyView :WindowYank | GoNextListedWindow | WindowPaste command! -bar -nargs=0 WindowFitText :call win#().width(&fdc + &nuw + &tw) " Tabs command! -bar Tabview tab sview command! -bar TabviewRO tab sview +setlocal\ nomodifiable " File tree command! -bar TreeToggle call TreeToggle() let s:is_open = v:false function! TreeToggle() if s:is_open lua require'bufferline.state'.set_offset(0) NERDTreeClose let s:is_open = v:false else lua require'bufferline.state'.set_offset(30, 'Files') NERDTreeToggle let s:is_open = v:true end endfunc