summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/ale_linters/tex/textidote.vim32
-rw-r--r--.config/nvim/init.vim27
m---------.config/nvim/pack/plugins/start/gitsigns.nvim0
3 files changed, 53 insertions, 6 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 c50acf8..23a5ecf 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -19,6 +19,8 @@ set shiftwidth=2
set softtabstop=2
set expandtab
+set clipboard=unnamed
+
" Filter the command history without leaving the home row (PV34)
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
@@ -38,6 +40,7 @@ augroup END
set spelllang=en_gb
+set wildcharm=<C-Z>
let mapleader = ' '
autocmd TextYankPost * silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=250}
@@ -68,11 +71,14 @@ nmap <leader>i <Plug>(ale_info)
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
let g:ale_linters = {
- \ 'sh' : ['shellcheck'],
- \ 'text' : ['cspell', 'languagetool'],
- \ 'yaml' : ['yamllint'],
+ \ 'PKGBUILD' : ['shellcheck'],
+ \ 'lua' : ['luacheck', 'lua_language_server'],
+ \ 'sh' : ['shellcheck'],
+ \ 'text' : ['cspell', 'languagetool'],
+ \ 'yaml' : ['yamllint'],
\}
let g:ale_fixers = {
+ \ '*' : ['remove_trailing_lines', 'trim_whitespace'],
\ 'css' : ['prettier'],
\ 'html' : ['prettier'],
\ 'javascript' : ['prettier'],
@@ -88,14 +94,13 @@ let g:ale_markdown_markdownlint_options = '--disable MD025 --'
let g:ale_tex_chktex_options = '-I -n1 -n3 -n24' " VimTeX does '-n1 -n3 -n8 -n25 -n36'
let g:ale_sh_shfmt_options = '--indent 2 --case-indent --binary-next-line'
-set omnifunc=ale#completion#OmniFunc
-
" ----- Gitsigns -----
lua require('gitsigns').setup()
" ----- QuickTex -----
let g:quicktex_usedefault = 0
-let g:quicktex_excludechar = ['\$', '(', ')', '\[', ']', '{', '}', '\.', ',', ':', ';', '-', '+', '*', '"']
+let g:quicktex_excludechar = ['\$', '(', ')', '\[', ']', '{', '}', '\.', ',', ':', ';', '-', '+', '*', '"', '''']
+nmap <leader>g :GenerateQuicktexDictionaries<CR>
" ----- Vifm -----
nmap <leader>f :Vifm<CR>
@@ -108,5 +113,15 @@ 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',
+ \}
+let g:vimtex_toc_config = {
+ \ 'layers' : ['content'],
+ \ 'show_help' : 0,
+ \}
" vim: ft=vim
diff --git a/.config/nvim/pack/plugins/start/gitsigns.nvim b/.config/nvim/pack/plugins/start/gitsigns.nvim
-Subproject 3e6e91b09f0468c32d3b96dcacf4b947f037ce2
+Subproject bdeba1cec3faddd89146690c10b9a87949c0ee6