Skip to content

Commit

Permalink
Made neovim spawn in the file directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed Apr 9, 2018
1 parent 7870b2c commit e525141
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/neovim/neovim.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { spawn, ChildProcess } from 'child_process';
import { dirname } from 'path';
import { attach, Nvim } from 'promised-neovim-client';
import * as vscode from 'vscode';

Expand All @@ -14,8 +15,9 @@ export class Neovim implements vscode.Disposable {
private nvim: Nvim;

async initialize() {
const dir = dirname(vscode.window.activeTextEditor!.document.fileName);
this.process = spawn(configuration.neovimPath, ['-u', 'NONE', '-N', '--embed'], {
cwd: __dirname,
cwd: dir
});
this.process.on('error', err => {
console.log(err);
Expand Down

0 comments on commit e525141

Please sign in to comment.