Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const activate = (oni) => {
- console.log("config activated")
- // Per-workspace init.vim
- const path = require("path")
- const fs = require("fs")
- const loadWorkspaceInitVim = () => {
- if (oni.workspace.activeWorkspace) {
- // We're assuming it lives in `.oni/init.vim`
- const initVimFile = path.join(oni.workspace.activeWorkspace, ".oni", "init.vim")
- if (fs.existsSync(initVimFile)) {
- oni.editors.activeEditor.neovim.command(":so " + initVimFile)
- }
- }
- }
- // Load the per-workspace init vim whenever it changes
- oni.workspace.onDirectoryChanged.subscribe(() => loadWorkspaceInitVim())
- // And also on startup, in case we already have a workspace
- loadWorkspaceInitVim()
- // End per-workspace init.vim
- ...
- }
Add Comment
Please, Sign In to add comment