Skip to content

Commit d1f8059

Browse files
committed
fix(extension.js): create symlink from ~/.vscode/extensions/yeferyv.retronvim-0.1.0-win32-x64
1 parent 852f2f9 commit d1f8059

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

extension.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
const vscode = require('vscode');
22
const path = require('path');
33
const os = require('os');
4+
const fs = require('fs');
45

56
function setNeovimPath() {
67
// Construct the dynamic path
78
const homeDirectory = os.homedir();
8-
const nvimPathLinux = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/nvim');
9-
const nvimPathMacOS = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/nvim-macos-x86_64/bin/nvim');
10-
const nvimPathWindows = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/nvim-win64/bin/nvim.exe');
9+
const nvimPathLinux = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/linux-x64/nvim');
10+
const nvimPathMacOS = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/darwin-x64/nvim-macos-x86_64/bin/nvim');
11+
const nvimPathWindows = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0/bin/win32-x64/nvim-win64/bin/nvim.exe');
12+
const nvimPathWindowsRoot = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0');
13+
const nvimPathWindowsRootX64 = path.join(homeDirectory, '.vscode/extensions/yeferyv.retronvim-0.1.0-win32-x64');
14+
15+
// create symlink if installing from marketplace on Windows 10/11
16+
if (os.platform() == "win32" && fs.existsSync(nvimPathWindowsRootX64)) {
17+
fs.symlinkSync(nvimPathWindowsRootX64, nvimPathWindowsRoot)
18+
}
1119

1220
// Access the configuration for 'vscode-neovim'
1321
const config = vscode.workspace.getConfiguration('vscode-neovim');

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"terminal.integrated.enableImages": true,
8282
"terminal.integrated.env.linux": {
8383
"RETRONVIM_PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0",
84-
"PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin:$HOME/.pixi/bin:$HOME/.local/share/fnm/aliases/default/bin:${env:PATH}",
84+
"PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin/linux-x64:$HOME/.pixi/bin:$HOME/.local/share/fnm/aliases/default/bin:${env:PATH}",
8585
"FNM_MULTISHELL_PATH": "$HOME/.local/share/fnm/aliases/default",
8686
"EDITOR": "nvim -u $RETRONVIM_PATH/nvim/init.lua",
8787
"VISUAL": "code",
@@ -90,15 +90,15 @@
9090
},
9191
"terminal.integrated.env.osx": {
9292
"RETRONVIM_PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0",
93-
"PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin:${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin/nvim-macos-x86_64/bin:${env:PATH}",
93+
"PATH": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin/darwin-x64:${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/bin/darwin-x64/nvim-macos-x86_64/bin:${env:PATH}",
9494
"EDITOR": "nvim -u $RETRONVIM_PATH/nvim/init.lua",
9595
"VISUAL": "code",
9696
"ZDOTDIR": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/zsh",
9797
"STARSHIP_CONFIG": "${env:HOME}/.vscode/extensions/yeferyv.retronvim-0.1.0/zsh/starship.toml"
9898
},
9999
"terminal.integrated.env.windows": {
100100
"RETRONVIM_PATH": "${env:USERPROFILE}/.vscode/extensions/yeferyv.retronvim-0.1.0",
101-
"PATH": "${env:USERPROFILE}\\.vscode\\extensions\\yeferyv.retronvim-0.1.0\\bin;${env:USERPROFILE}\\.vscode\\extensions\\yeferyv.retronvim-0.1.0\\bin\\nvim-win64\\bin;$APPDATA\\Roaming\\fnm\\aliases\\default;${env:PATH}",
101+
"PATH": "${env:USERPROFILE}\\.vscode\\extensions\\yeferyv.retronvim-0.1.0\\bin\\win32-x64;${env:USERPROFILE}\\.vscode\\extensions\\yeferyv.retronvim-0.1.0\\bin\\win32-x64\\nvim-win64\\bin;$APPDATA\\Roaming\\fnm\\aliases\\default;${env:PATH}",
102102
"FNM_MULTISHELL_PATH": "$APPDATA/Roaming/fnm/aliases/default",
103103
"EDITOR": "nvim -u $RETRONVIM_PATH/nvim/init.lua",
104104
"VISUAL": "code",
@@ -552,7 +552,7 @@
552552
"key": "t",
553553
"name": "Neovim terminal (<esc><esc> for tmux-copy-mode)",
554554
"commands": [ "workbench.action.createTerminalEditor", "workbench.action.terminal.sendSequence" ],
555-
"args": [ null, { "text": "nvim -u $HOME/.vscode/extensions/yeferyv.retronvim-0.1.0/nvim/init.lua -cterm; exit\n" } ]
555+
"args": [ null, { "text": "nvim --clean -c 'source $RETRONVIM_PATH/nvim/init.lua' -cterm; exit\n" } ]
556556
},
557557
{ "key": "w", "name": "New Tab terminal (same window group)", "command": "workbench.action.createTerminalEditor" },
558558
{ "key": "W", "name": "New Tab terminal (Separated window group)", "command": "workbench.action.createTerminalEditorSide" },

0 commit comments

Comments
 (0)