jslint-org / jslint

JSLint, The JavaScript Code Quality and Coverage Tool
https://www.jslint.com
The Unlicense
3.62k stars 463 forks source link

Feature request: vim integration - allow custom directory in config #455

Closed bunglegrind closed 8 months ago

bunglegrind commented 8 months ago

Is your feature request related to a problem? Please describe. As stated in the title, the vim integration assumes jslint files in .vim directory. But in Windows, the default directory is vimfiles

Describe the solution you'd like Passing the directory as a parameter in .vimrc

Describe alternatives you've considered Change the path according to the platform vim is running

See: https://superuser.com/questions/119991/how-do-i-get-vim-home-directory

kaizhu256 commented 8 months ago
bunglegrind commented 8 months ago

Mmm...I don't think it's working...the command is correctly registered but it does not output anything

bunglegrind commented 8 months ago

expand("<sfile>:p:h") gives you the path of the directory you're in, not the path of .vim or vimfiles, because it is inside a function. You may:

  1. let the user set the path in a variable in .vimrc
  2. Take the first path of the runtime variable
  3. mimic a closure using a dictionary function (I'm not fluent in vimscript, so you should check its feasibility http://ujihisa.blogspot.com/2010/11/something-like-closure-for-vim-script.html )
kaizhu256 commented 8 months ago

Mmm...I don't think it's working...the command is correctly registered but it does not output anything

image

kaizhu256 commented 8 months ago

can you download the alpha-version @ https://raw.githubusercontent.com/jslint-org/jslint/alpha/jslint_wrapper_vim.vim and see if it works?

bunglegrind commented 8 months ago

can you download the alpha-version @ https://raw.githubusercontent.com/jslint-org/jslint/alpha/jslint_wrapper_vim.vim and see if it works?

I've just replaced jslint_wrapper_vim.vim with the alpha version and now it works! Thanks!