-
Notifications
You must be signed in to change notification settings - Fork 8
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
Doesn't auto-indent target #19
Comments
Thanks! Yeah, this is definitely a space I struggle with. I don't know anything about vim indentation rules. If it's frustrating you too, I can take a crack at it. |
I copied /usr/share/vim/vim82/indent/make.vim to ~/.config/nvim/after/indent/justfile.vim and it it seems to work (ie. I get an indent and the world didn't explode). It would be better for this to be implemented properly tbh. Again, I don't know if this an expected feature of vim-just but regular makefile authors might wonder why it's missing. Thanks for reading. MacOS Catalina |
It's expected that there's no indentation because I didn't add any vimscript to handle it. So far, no one's been bothered enough to do the work (myself included), but your solution seems like a reasonable starting off point. Thanks for letting me know. |
This reverts commit 3fbbfe7. vim-just doesn't handle indentation[1], which is fairly annoying. Remove it for now and use `make` as the filetype. [1]: NoahTheDuke/vim-just#19
Instead of copying the file another alternative is to do the following: vim.cmd.source('$VIMRUNTIME/indent/make.vim')
vim.api.nvim_create_autocmd(
'InsertEnter',
{ buffer = 0, command = 'setlocal indentexpr=GetMakeIndent()', once = true }
) I've used an autocmd here as I was otherwise only able to set the |
Using the idea of @sandersantema using make's setlocal ts=2 sts=2 sw=2
setlocal expandtab
source $VIMRUNTIME/indent/make.vim
silent unlet! b:undo_indent
setlocal indentexpr=GetMakeIndent() Or lua version ( vim.opt_local.ts = 2
vim.opt_local.sts = 2
vim.opt_local.sw = 2
vim.opt_local.expandtab = true
vim.cmd.source "$VIMRUNTIME/indent/make.vim"
vim.b.undo_indent = nil
vim.opt_local.indentexpr = 'GetMakeIndent()' BTW, the plugin should have a own indentexpr for |
I don't actually know what I'm doing in Vim indentation rules, but had another go at this and maybe got somewhere this time? - https://github.com/NoahTheDuke/vim-just/tree/indent Please test this branch and let us know how this indentexpr works for you. I don't use auto-indent myself, so whether this is suitable for merge to main depends on your feedback. Thanks 🙂 |
This seems to be going stale. Is there still interest in having and testing this feature? In case switching to the |
Maybe just merge it and let's debug in prod. Better to have something that mostly works and iterate? |
Sounds good if it actually does mostly work? Was hoping for confirmation of that before merging, since it's hard to be sure without dogfooding. |
Just now noticing that while we have been interpreting this issue as requesting indent support, the original question was only "is auto-indenting of recipe bodies a feature of If no one is trying the draft indent support enough to be able to say whether it seems to at least "mostly work", maybe we should just close this and not take on maintaining something that neither the community cares about nor would we use ourselves. We can still leave the |
No responses and the branch has become stale, closing due to apparent lack of interest. This will be reopened when/if people become interested enough in having auto-indent support to test the draft indent file and provide feedback per #19 (comment) . |
My sincere apologies for allowing this lapse - mea culpa. I 100% respect a decision to keep this closed. Thank you for addressing. I am able to successfully indent by pointing packer to the "indent" branch via: |
Thanks @machinemob for testing! Sounds like the indent support in that branch is good enough to bring onto main, and there is interest in the feature. Re-opening |
Initial indent support is merged! |
I updated via Packer and am able to indent. No apparent issues. Thank you! (NVIM v0.10.0, Packer, MacOS 14.4.1 (23E224), Wezterm 20240203-110809-5046fc22) |
Hi, I'm not sure if this is an issue or not-a-feature...
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@iMac-Pro
The text was updated successfully, but these errors were encountered: