https://github.com/ducks/nvim-vandelay
What does Art Vandelay import?
https://github.com/ducks/nvim-vandelay
Last synced: about 1 year ago
JSON representation
What does Art Vandelay import?
- Host: GitHub
- URL: https://github.com/ducks/nvim-vandelay
- Owner: ducks
- Created: 2025-06-24T15:24:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-24T16:14:23.000Z (about 1 year ago)
- Last Synced: 2025-06-24T16:47:40.714Z (about 1 year ago)
- Language: Lua
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nvim-vandelay
> "What does Art Vandelay import?"
A Neovim plugin to automatically expand multiline imports.
## Features
- Language-aware import expansion
- Always emits trailing commas
- Lua-native, zero dependencies
- Fully configurable
- Easy to extend for more languages
## Supported Languages
- JavaScript / TypeScript (`import {}` blocks)
- Rust (`use {}` blocks)
## Installation
### lazy.nvim
```
{
'ducks/nvim-vandelay',
config = function()
require('vandelay').setup({
alphabetize = true, -- alphabetize module imports
threshold = 2, -- min items to multiline
})
end
}
```
## Usage
Use a keybinding:
```
vim.keymap.set('n', 'mi', function()
require('vandelay').format_current_line()
end, { noremap = true, silent = true })
```
## What's it do?
This plugin applies opinionated import formatting. If you have 2 or more
imports in a block, it will always expand to multiline.
Start with this:
`import { foo, bar, baz, qux } from './utils';`
And get this:
```
import {
foo,
bar,
baz,
qux
} from './utils';
```
Same for Rust:
`use std::{fs, io, path};`
becomes:
```
use std::{
fs,
io,
path,
};
```
## Testing
`nvim --headless -c 'PlenaryBustedDirectory tests/ --minimal_init=tests/minimal_init.lua'`
## TODOs
- [] Add more languages
- [] Treesitter integration
- [] Configurable width & indentation
## License
MIT