nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
16.93k stars 17.06k forks source link

init.lua changes all single quotes to double quotes on first save #895

Closed body-clock closed 2 months ago

body-clock commented 2 months ago

Describe the bug

This is a minor annoyance, but the lua style guide prefers double quotes over single quotes for strings, and only favors single quotes when we have a string with double quotes inside. stylua on save seems to follow this convention and changes all the single quotes in the config to double quotes. Might be useful to just ship the config with this style convention applied. If this is intentional/expected behavior or I have missed some documentation (I'm new), please ignore.

To Reproduce

  1. Install kickstart.nvim
  2. Open with nvim ~/.config/nvim/init.lua
  3. Save and write with :x
  4. Check git status to see all changed lines

Desktop

Neovim Version

NVIM v0.9.4

body-clock commented 2 months ago

Duplicate of #730 - I didn't clone the repo 🤦🏻

Closing

feoh commented 2 months ago

Thanks for posting. Any chance you'd take a whack at fixing? :) Can't blame me for asking :)

body-clock commented 2 months ago

Thanks for posting. Any chance you'd take a whack at fixing? :) Can't blame me for asking :)

I don't think there's much to fix, to be honest. I was able to revert the behavior by cloning the .stylua.toml into my config directory. This config favors single quotes over double quotes (which does seem to go against the style guide), so perhaps that's worth changing? I can make an MR that removes that specific style config, but I don't have enough context about why that's there in the first place.

feoh commented 2 months ago

thanks for the response! I guess my point is: you were confused and someone else was confused who filed the bug. Do we maybe need some additional documentation to explain the happy path if this indeed isn't a problem?

dam9000 commented 2 months ago

The happy path is, clone the repo, don't just copy the init.lua, as usual :)

feoh commented 2 months ago

You mean actually getting people to READ THE DOCS?????

HERESY! :) (No offense Patrick I'm sure you read the docs :) We just get a LOT of issues on this repo :)
body-clock commented 2 months ago

Hah, I do read the docs! I started out by cloning and ran into some issues when symlinking from my dotfiles repo to my local machine. Admittedly, I didn't try very hard to fix them so I just copied the init.lua which became the source of my issue. My laziness got the best of me. I think the docs are clear enough for people who are perhaps slightly less lazy.

feoh commented 2 months ago

To be fair, I struggle with this very issue as well.

I maintain my own kickstart fork but also make my home directory be a Github repo to manage my dotfiles and TBH it's kinda messy.

I'm currently using git subtree to vendor my kickstart repo into place but the back and forth can get frustrating and hard to reason about.

(Like, I just resolved these merge conflicts in my kickstart fork repo, why am I having to resolve them again when I pull the changes into my subtree?)

None of it is straightforward :)

body-clock commented 2 months ago

Ugh, that's annoying. I think I'm just going to stick with my copied init.lua and .stylua.toml and symlink those from my dotfiles into my home config. The nested repos are breaking my brain. In the event of a significant kickstart update, I'll just cry myself to sleep and revisit this problem. Hopefully, by then, my nvim config will be fully my own!