VIM: Adds functions for proselint and languagetool
This commit is contained in:
parent
5b22913c67
commit
9816fbb258
2 changed files with 40 additions and 0 deletions
|
@ -18,3 +18,40 @@ function! mine#functions#colorcols() abort
|
||||||
setlocal colorcolumn=80,100
|
setlocal colorcolumn=80,100
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! mine#functions#proselint() abort
|
||||||
|
let oldmakeprg = &l:makeprg
|
||||||
|
" set new value of makeprg and call the function
|
||||||
|
set makeprg=proselint\ %
|
||||||
|
make
|
||||||
|
copen
|
||||||
|
" set makeprg back to old value
|
||||||
|
let &l:makeprg = oldmakeprg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! mine#functions#languagetool() abort
|
||||||
|
let oldmakeprg = &l:makeprg
|
||||||
|
let olderrformat = &l:errorformat
|
||||||
|
" set new value of makeprg and call the function
|
||||||
|
set makeprg=languagetool\ -l\ en-GB\ %
|
||||||
|
let &l:errorformat =
|
||||||
|
\ '%-GPicked up _JAVA_OPTIONS: %.%#,' .
|
||||||
|
\ '%-GExpected text language: %.%#,' .
|
||||||
|
\ '%-PWorking on %f...,' .
|
||||||
|
\ '%-I%.%# [main] DEBUG %.%#,' .
|
||||||
|
\ '%+IUsing %.%# for file %.%#,' .
|
||||||
|
\ '%I%\d%\+.) Line %l\, column %c\, Rule ID: %m,' .
|
||||||
|
\ '%-CMessage%m,' .
|
||||||
|
\ '%-CSuggestion%m,' .
|
||||||
|
\ '%-CMore info%m,' .
|
||||||
|
\ '%-C%\s%#^%\+%\s%#,' .
|
||||||
|
\ '%-C%.%#,' .
|
||||||
|
\ '%-Z%\s%#,' .
|
||||||
|
\ '%-Q,' .
|
||||||
|
\ '%-GTime: %.%#'
|
||||||
|
make
|
||||||
|
copen
|
||||||
|
" set makeprg back to old value
|
||||||
|
let &l:makeprg = oldmakeprg
|
||||||
|
let &l:makeprg = olderrformat
|
||||||
|
endfunction
|
||||||
|
|
|
@ -78,3 +78,6 @@ vnoremap > >gv
|
||||||
|
|
||||||
nnoremap [c :cprevious<cr>
|
nnoremap [c :cprevious<cr>
|
||||||
nnoremap ]c :cnext<cr>
|
nnoremap ]c :cnext<cr>
|
||||||
|
|
||||||
|
" Run proselint and put it in the quickfix list
|
||||||
|
nnoremap <leader>p :call mine#functions#proselint()<CR>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue