-
Notifications
You must be signed in to change notification settings - Fork 298
Development
- node v8 or higher
- Run
npm install --global --production windows-build-tools
from an elevated PowerShell or CMD.exe (run as Administrator)
- node v8 or higher
- Neovim 0.2.1+ (neovim binaries are only included for Windows and OS X)
-
python
(v2.7
is required) make
-
sudo apt install libxkbfile-dev
(this is required for building thekeyboard-layout
module)
- node v8 or higher
-
python
(v2.7
is required) -
XCode
- You also need to install the Command Line Tools via Xcode. You can find this under the menu Xcode -> Preferences -> Downloads
- This step will install gcc and the related toolchain containing make
-
sudo apt install libxkbfile-dev
(this is required for building thekeyboard-layout
module)
- Clone the repository:
git clone https://github.com/onivim/oni.git
-
cd oni
to navigate to the root folder - Update submodules:
git submodule update --init --recursive
-
npm install
to install NPM dependencies -
npm run build
to build the project -
npm link
to register theoni
command in the shell, against the local build.
Test it out by running oni
at the command line.
In order to build a source-map enabled build, you can do the following:
npm run build-debug
-
npm link
(only needed the first time) oni
Debugging in VSCode? Default launch configurations are provided for debugging both the Electron main process and Oni application from VSCode.
A production build removes sourcemaps and applies minification, so it's worth testing in this config:
npm run build
-
npm link
(only needed the first time) oni
The optimal way to debug Oni is to use:
npm run start
This enables hot-reload of CSS styles, React components, and will automatically reload Oni when other javascript has changed. Also, the hot-reload webpack config has source maps enabled.
If you use the hot-reload build of Oni to make changes - you'll end up reloading your editor every time you make a javascript change. For that reason, I recommend keeping two instances open - one for development and one to see the changes.
-
npm run build
- build latest source -
npm link
- (only needed the first time, but this enables the ONI command) -
oni
- open the "coding" instance (optional: set a unique colorscheme to differentiate)
-
npm run start
- start ONI against the webpack live-reload service - our "running" instance
Then, the flow is to make the code changes in the "coding" instance, and see them reflected immediately in the "running instance".
Here's an example of using hot-reloading to edit the cursor (albeit in not very useful ways) in real time:
Note: some users may have issues with the
react-devtools
due to OS permissions. to resolve this follow these steps:
-
Navigate to
chrome://extensions
in your browser, and find its extension ID, which is a hash string likefmkadmapgofadopljbjfkapdkoienihi
. -
Find out filesystem location used by Chrome for storing extensions:
- on Windows it is
%LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions
; on Linux it could be: ~/.config/google-chrome/Default/Extensions/
~/.config/google-chrome-beta/Default/Extensions/
~/.config/google-chrome-canary/Default/Extensions/
~/.config/chromium/Default/Extensions/
- on macOS it is
~/Library/Application Support/Google/Chrome/Default/Extensions.
- on Windows it is
-
Once you have found the extension location you will need to grant the current user R&W permissions using
chmod 777 -R path/to/extension
(N.B. the command recursively grants the current user access to the folder and all subfolders)
You can open up Chrome's developer tools at any time using the following steps:
-
Control+Shift+P
- open command palette - Select
Open DevTools
Chrome's developer tools are great for profiling and debugging - you can read more here