Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reindent with = is broken #11

Open
marak8 opened this issue May 29, 2018 · 4 comments
Open

Reindent with = is broken #11

marak8 opened this issue May 29, 2018 · 4 comments

Comments

@marak8
Copy link

marak8 commented May 29, 2018

Have this in a Vim buffer

{
	manifest_version: 2,
  name: 'Pinboard Simple',
  version: '1.0',
  description: 'Simple extension for bookmarking to Pinboard',
}

Select all lines in visual mode (<S-V>) and press =. Result:

{
manifest_version: 2,
					  name: 'Pinboard Simple',
					  version: '1.0',
					  description: 'Simple extension for bookmarking to Pinboard',
}

This doesn't look good. My settings

set noexpandtab
set shiftwidth=4
set tabstop=4

Except for indent character, result does not depend on expandtab.

@sparkprime
Copy link
Member

I dunno what that does, it looks like it's not calling the Jsonnet reformatter

@tklebanoff
Copy link

I am also getting this behavior... does anybody know why?

@tklebanoff
Copy link

i found that jsonnetfmt was not in my path -- putting jsonnet in my path made it so I can do

:call jsonnet#Format()

and then it indents. It also indents on write based on the plugin setting. The only thing I havn't been able to get working so far is indent on "=" does anybody here know how to do this?

@timmow
Copy link

timmow commented Jun 19, 2020

Theres no indent script in this plugin - probably because jsonnetfmt on save works well enough. But if you do want to enable the indent when using = - i've confirmed the vim-json indent script works - if you put it in $VIMRUNTIME/indent/jsonnet.vim (or symlink it if you use vim-json) - i've done this in my dotfiles repo

There will likely be cases where this doesnt work, but its better to have some indent behaviour - if the repo maintainers were happy to take it, a pull request to add a copy of the vim-json indent script to this repo would make things work out of the box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants