prettier / vim-prettier

A Vim plugin for Prettier
MIT License
1.78k stars 138 forks source link

let g:prettier#config#tab_width not working #313

Open Nishant-Pall opened 3 years ago

Nishant-Pall commented 3 years ago

What is the current/expected behavior? whenever I execute :Prettier it's using tab spaces as 2, even though I have set the value as let g:prettier#config#tab_width = 4

What version of vim-prettier are you using - (output of :PrettierVersion) ? 1.0.0-beta

What version of prettier are you using - (output of :PrettierCliVersion) ? 2.3.1

What is your prettier executable path - (output of :PrettierCliPath) ? .config/nvim/vim-prettier/node_modules/.bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ? No

Daniel-Monroy commented 2 years ago

Hello, you found a solution? I have the same problem :(

Nishant-Pall commented 2 years ago

Hey, I didnt fix it but I did reset my neovim and everything and never encountered this again. Maybe that'll help you. I did switch to 0.6 neovim maybe that's the reason

aaaaargZombies commented 2 years ago

I had the same issue and I think it was to do with this

" use tabs instead of spaces: true, false, or auto (use the expandtab setting).
" default: 'auto'
let g:prettier#config#use_tabs = 'auto'
theodale commented 1 year ago

To solve this you need to add let g:prettier#config#use_tabs = 'false' to your .vimrc. Then you can use let g:prettier#config#tab_width = 2 as intended.