neoformat
neoformat copied to clipboard
`latexindent` ignores `localSettings.yaml` although `-l` is specified
latexindent is called with the -l options, which tells latexindent to look for a localSettings.yaml file in the same directory as the .tex file is in. As seen here:
https://github.com/sbdchd/neoformat/blob/master/autoload/neoformat/formatters/tex.vim#L8
This however seems not to work with neoformat.
Here is a command line session to verify that latexindent works and uses the local configuration:
░ tamasgal@greybox:~/tmp
░ 00:30:25 > cat localSettings.yaml
defaultIndent: ' '
░ tamasgal@greybox:~/tmp
░ 00:30:34 > latexindent test.tex
\begin{abstract}
test
\end{abstract}
░ tamasgal@greybox:~/tmp
░ 00:30:36 > latexindent -l test.tex
\begin{abstract}
test
\end{abstract}
However, when calling :Neoformat in neovim, you get the same output as for the latexindent command without the -l option, thus ignoring the settings file.
Note that latexindent requires the localSettings.yaml to be in the same folder as the .tex file. So this issue is caused by the temp file handling as seen in the verbose output:
Neoformat: ['\begin{abstract}', 'test', '\end{abstract}']
Neoformat: latexindent -l -w /var/folders/n2/fpv312vd5xg91ncw_s5f1m5m0000gn/T/neoformat/test.tex
Neoformat: using tmp file
Neoformat: ['\begin{abstract}', '^Itest', '\end{abstract}']
Neoformat: [0]
Neoformat: 0
Neoformat: latexindent formatted buffer
With this settings, it works as expected:
let g:neoformat_tex_latexindent = {
\ 'exe': 'latexindent',
\ 'args': ['-l'],
\ 'stdin': 1
\ }
Is this solved? I tried using solution proposed by @tamasgal but it does not seems that it helped, my localSettings.yaml present in the same dir than the .tex files is not taken into account.
I used -l with a full path. However, neoformat turn my code into some messy code.
