summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/nimpretty.vim
blob: fe2e7136a6f2dfe59ce6643f1097ec15bf533a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
" Author: Nhan <hi@imnhan.com>
" Description: Integration of nimpretty with ALE.

call ale#Set('nim_nimpretty_executable', 'nimpretty')
call ale#Set('nim_nimpretty_options', '--maxLineLen:80')

function! ale#fixers#nimpretty#Fix(buffer) abort
    let l:executable = ale#Var(a:buffer, 'nim_nimpretty_executable')
    let l:options = ale#Var(a:buffer, 'nim_nimpretty_options')

    return {
    \   'command': ale#Escape(l:executable) . ' %t' . ale#Pad(l:options),
    \   'read_temporary_file': 1,
    \}
endfunction