Base repo taken from https://github.com/timlrx/tailwind-nextjs-starter-blog
Note: I have not used this repo outside of this testing, I just pulled a random tailwind/react project down. My example was using Remix Stacks like the Blue Stack but that requires a bit more setup.
Example repository and setup instructions to reproduce protected folders interfering with tailwindcss autocompletion in Neovim on Linux.
Taken from LazyVim
- Neovim >= 0.9.0 (needs to be built with LuaJIT)
- Git >= 2.19.0 (for partial clones support)
- a C compiler for
nvim-treesitter
- Ubuntu 22 (likely other linux distros. I've only tested this on a dedicated Linux box as well as WSL w/ Windows)
Taken from LazyVim Installation
Backup current files:
# required
mv ~/.config/nvim{,.bak}
# optional but recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
Clone the starter.
git clone https://github.com/LazyVim/starter ~/.config/nvim
Launch Neovim with nvim
Launch Mason
with :Mason
Install tailwindcss
LSP (scroll to tailwind, type i
)
- Start
nvim
- Open
Main.tsx
- Verify that when editing a
className
you see Tailwind auto completions - Exit
nvim
sudo mkdir test-dir
sudo chmod 222 test-dir
- start
nvim
- Open
Main.tsx
- Note that you no longer have Tailwind auto completions when editing
className
prop - Exit
nvim
,sudo chmod 777 test-dir
, try step 8 again and you will see auto completions working as expected
You can also write some Javascript at the bottom of the file and see JS autocompletions work as expected regardless of the protected directory.
I tested this just by adding this to the bottom of the file:
const someVar = 'testing';
someVar. // then inspecting autocompletion popup