This repository has been archived by the owner on Apr 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
How To: Minimal Oni Configuration
Amadeus Folego edited this page Apr 4, 2018
·
19 revisions
Oni by default overrides some configurations to provide an IDE-like experience, here follows a method to strip Oni to make it behave more like vim:
// .config/oni/config.js
const activate = (oni) => {
oni.input.unbind("<c-g>") // make C-g work as expected in vim
oni.input.bind("<s-c-g>", () => oni.commands.executeCommand("sneak.show")) // You can rebind Oni's behaviour to a new keybinding
};
module.exports = {
activate,
"oni.hideMenu": true, // Hide default menu, can be opened with <alt>
"oni.loadInitVim": true, // Load user's init.vim
"oni.useDefaultConfig": false, // Do not load Oni's init.vim
"autoClosingPairs.enabled": false, // disable autoclosing pairs
"commandline.mode": false, // Do not override commandline UI
"wildmenu.mode": false, // Do not override wildmenu UI,
"learning.enabled": false, // Turn off learning pane
"achievements.enabled": false, // Turn off achievements tracking / UX
"editor.textMateHighlighting.enabled": false // Use vim syntax highlighting
}
Since we're not loading Oni's init.vim
defaults, prepend and adjust these lines to your init.vim
:
" init.vim
set nocompatible " be iMproved, required
filetype off " required
set number
set noswapfile
set smartcase
" Turn off statusbar, because it is externalized
set noshowmode
set noruler
set laststatus=0
set noshowcmd
" Enable GUI mouse behavior
set mouse=a
set list
set listchars=trail:·
If you share a config file between vim versions, you may use the following to check if you are in Oni or not. This will allow you to enable or disable features in Oni specifically.
if exists('g:gui_oni')
" Statements here
endif