summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorJustin Gassner <justin.gassner@mailbox.org>2023-08-25 17:55:32 +0200
committerJustin Gassner <justin.gassner@mailbox.org>2023-09-18 12:39:47 +0200
commit159003fd48ef797dc9ef9d52fc753bec8d8ff72b (patch)
treeff542e87318854a46c93a73d3d1ce202929a1947 /.config/nvim
parentafb499d81dc22ccc00fbd999862360a3e6f16cdb (diff)
downloaddotfiles-159003fd48ef797dc9ef9d52fc753bec8d8ff72b.tar.zst
configx1
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/ale_linters/tex/textidote.vim32
-rw-r--r--.config/nvim/init.vim8
2 files changed, 40 insertions, 0 deletions
diff --git a/.config/nvim/ale_linters/tex/textidote.vim b/.config/nvim/ale_linters/tex/textidote.vim
new file mode 100644
index 0000000..9640ef4
--- /dev/null
+++ b/.config/nvim/ale_linters/tex/textidote.vim
@@ -0,0 +1,32 @@
+" Author: Jordi Altayo <jordiag@kth.se>
+" Description: support for textidote grammar and syntax checker
+
+call ale#Set('tex_textidote_executable', 'textidote')
+call ale#Set('tex_textidote_options', '')
+
+function! ale_linters#tex#textidote#Handle(buffer, lines) abort
+ let l:pattern = '.*' . expand('%:t:r') . '\.tex(L\(\d\+\)C\(\d\+\)-L\d\+C\d\+): \(.*\)".*"'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'col' : l:match[2] + 0,
+ \ 'text': l:match[3],
+ \ 'type': 'E',
+ \})
+ endfor
+
+ return l:output
+endfunction
+
+function! ale_linters#tex#textidote#GetCommand(buffer) abort
+ return '%e --no-color --output singleline' . ale#Pad(ale#Var(a:buffer, 'tex_textidote_options')) . ale#Pad('%s')
+endfunction
+
+call ale#linter#Define('tex', {
+\ 'name': 'textidote',
+\ 'executable': {b -> ale#Var(b, 'tex_textidote_executable')},
+\ 'command': function('ale_linters#tex#textidote#GetCommand'),
+\ 'callback': 'ale_linters#tex#textidote#Handle',
+\})
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index e7e1c9f..e2c6bc6 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -31,6 +31,7 @@ nnoremap gk k
set spelllang=en_gb
+set wildcharm=<C-Z>
let mapleader = ' '
autocmd TextYankPost * silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=250}
@@ -85,6 +86,7 @@ set omnifunc=ale#completion#OmniFunc
" ----- QuickTex -----
let g:quicktex_usedefault = 0
let g:quicktex_excludechar = ['\$', '(', ')', '\[', ']', '{', '}', '\.', ',', ':', ';', '-', '+', '*', '"']
+nmap <leader>g :GenerateQuicktexDictionaries<CR>
" ----- VimTeX -----
nmap <leader>c <Plug>(vimtex-compile)
@@ -93,5 +95,11 @@ let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_open_on_warning = 0
let g:vimtex_indent_enabled = 0
let g:vimtex_indent_on_ampersands = 0
+ "\ 'lt_directory' : '~/code/LanguageTool-6.0/',
+let g:vimtex_grammar_vlty = {
+ \ 'lt_command' : 'languagetool',
+ \ 'shell_options' : '--equation-punctuation display',
+ \ 'show_suggestions' : '1',
+ \}
" vim: ft=vim