-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows NodeJS + Cygwin Vim #63
Comments
@davidfmatheson Thanks! |
I needed to get this to work as well. I'm adding this comment for the next guy who loses a few hours trying to get this to work and finds this issue. The key is the First, just to get node to work with cygwin you need to add an alias for node (and npm while you're at it). So in ~/.bashrc, ~/.zshrc or ~/.bash_aliases: alias node='/cygdrive/c/Program\ Files/nodejs/node'
alias npm='/cygdrive/c/Program\ Files/nodejs/npm' Then in vim-jsbeautify/plugins/jsbeautifier.vim beginning at the line 403 modify the conditional which resolves let opts_Beautifier_arg = s:toJSON(string(opts))
let path_Beautifier_arg = s:quote(path)
let tmp_file_Beautifier_arg = s:quote(g:tmp_file_Beautifier)
if has("win32unix") && executable("cygpath")
let beautify_absolute_path_windows = fnameescape(system("cygpath -w ".s:plugin_Root_directory."/beautify.js"))
let tmp_file_Beautifier_arg_windows = fnameescape(system("cygpath -w ".tmp_file_Beautifier_arg))
let path_Beautifier_arg_windows = fnameescape(system("cygpath -w ".path_Beautifier_arg))
let result = system(engine." ".beautify_absolute_path_windows." --js_arguments ".tmp_file_Beautifier_arg_windows." ".opts_Beautifier_arg." ".path_Beautifier_arg_windows)
elseif executable(engine)
let result = system(engine." ".fnameescape(s:plugin_Root_directory."/beautify.min.js")." --js_arguments ".tmp_file_Beautifier_arg." ".opts_Beautifier_arg." ".path_Beautifier_arg)
else
" Executable bin doesn't exist
call ErrorMsg('The '.engine.' is not executable!')
return 1
endif |
@matthewbednarski Thanks! How about PR which fix this issue? |
Fixes issue #63 - Windows NodeJS + Cygwin Vim
Not sure how many people fall into this bucket, but I had some trouble getting this to work in Cygwin because the Windows node.exe doesn't like the paths. I stuck some lines in
~/.vim/bundle/vim-jsbeautify/plugin/beautifier.vim (starting after line 403)
That worked for me. Not sure how to test within the script if this is the scenario, but just in case there's some other Cygwin Vim user with the Windows NodeJS, there you go.
The text was updated successfully, but these errors were encountered: