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

How to configure in neovim? - uses GetOCamlIndent by default #268

Open
gaborigloi opened this issue Jun 11, 2018 · 1 comment
Open

How to configure in neovim? - uses GetOCamlIndent by default #268

gaborigloi opened this issue Jun 11, 2018 · 1 comment

Comments

@gaborigloi
Copy link

For some reason, by default neovim uses indentexpr=GetOCamlIndent(), even if ocp-indent is enabled.
If I manually comment out the first few lines of the vim file, it switches to ocp-indent:

" Only load this indent file when no other was loaded.                                                                                                                           
"if exists("b:did_indent")                                                                                                                                                       
"  finish                                                                                                                                                                        
"endif                                                                                                                                                                           
"let b:did_indent = 1 

My neovim configuration is here

@Villetaneuse
Copy link

Villetaneuse commented Jan 2, 2024

I just had this problem and found out a temporary fix.
The thing is that the system's nvim files are read before, even if one changes the rtp inside ~/.config/nvim/init.{lua,vim}.
The system's indent/ocaml.vim defines b:did_indent, as it should.

Making ocp-indent into a package solves this somehow:

$ mkdir -p ~/.config/nvim/pack/mypack/start
$ ln -s "$(opam var share)/ocp-indent/vim" ~/.config/nvim/pack/mypack/start/ocp-indent

It's far from perfect since it's vulnerable to opam switching but maybe this indent file isn't supposed to change too much anyway.

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

2 participants