set nocompatible
set runtimepath^=/.vim
set number
set guifont=PagesWikiHack:h16
set background=dark
set cursorline
set laststatus=2
set showcmd
set ruler
set scrolloff=4
set sidescrolloff=4
set noswapfile
set nobackup
set nowritebackup
set display+=lastline
set linebreak
set listchars=tab:»\ ,trail:·,extends:›,precedes:‹
let mapleader = " "
set hidden
set encoding=utf-8
set fileencoding=utf-8
set mouse=a
set backspace=indent,eol,start
set wildmenu
set wildmode=longest:full,full
set incsearch
set hlsearch
set ignorecase
set smartcase
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
syntax enable
filetype plugin indent on
highlight Normal guifg=#e6edf3 guibg=#1e222a
highlight LineNr guifg=#8994a6 guibg=#1e222a
highlight CursorLine guibg=#2b3240
highlight StatusLine guifg=#e6edf3 guibg=#35415a gui=NONE

" Close the hosted Vim session with :q even when the argument list contains
" more files. Unsaved buffers still require :q! explicitly.
cnoreabbrev <expr> q getcmdtype() ==# ':' && getcmdline() ==# 'q' ? 'qa' : 'q'
cnoreabbrev <expr> q! getcmdtype() ==# ':' && getcmdline() ==# 'q!' ? 'qa!' : 'q!'

" Pages Wiki writes each exported buffer as a new Revision.
augroup pageswiki
  autocmd!
  autocmd BufWritePost /work/* execute 'export ' . expand('%:p')
augroup END

" Pure Vimscript plugins are preloaded into /.vim/plugin by app.js.
" vim-plug installation and fzf's native executable do not work in MEMFS.
" Vendoring fzf.vim alone does not remove that native dependency.
