tpope/vim-spedddating

mjbrownie/swapit
markdown-preview
liuchengxu/graphviz.vim
rlue/vim-barbaric

Some comment strings
Some markdown latex math macro and spelloff settings
This commit is contained in:
Knyffen 2023-10-06 08:23:32 +02:00
parent 1373d2d2de
commit be59725d52

View File

@ -106,6 +106,10 @@
" shell commands without having to leave vim (eg. rename) " shell commands without having to leave vim (eg. rename)
Plug 'tpope/vim-eunuch' Plug 'tpope/vim-eunuch'
" Improve incrementing/decrementing functionality
Plug 'tpope/vim-speeddating'
Plug 'mjbrownie/swapit'
" open file at linenumber via <filename>:<linenumber> " open file at linenumber via <filename>:<linenumber>
Plug 'wsdjeg/vim-fetch' Plug 'wsdjeg/vim-fetch'
@ -141,11 +145,25 @@
Plug 'instant-markdown/vim-instant-markdown', {'for': 'markdown', 'do': 'yarn install'} Plug 'instant-markdown/vim-instant-markdown', {'for': 'markdown', 'do': 'yarn install'}
" markdown-preview (alternative to vim-instant-markdown) TODO " markdown-preview (alternative to vim-instant-markdown) TODO
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } function! InstallMarkdownIt(info)
" info is a dictionary with 3 fields
" - name: name of the plugin
" - status: 'installed', 'updated', or 'unchanged'
" - force: set on PlugInstall! or PlugUpdate!
if a:info.status == 'installed' || a:info.force
!cd app && yarn install
" Enable showing file:// urls
!cd app && sed -i -e "s/vbscript|javascript|file|data/|vbscript|javascript|data/" $(rg --files-with-matches "\|file\|")
endif
endfunction
Plug 'iamcco/markdown-preview.nvim', { 'for': ['markdown'], 'do': function('InstallMarkdownIt') }
" Better table handling (for markdown) " Better table handling (for markdown)
Plug 'dhruvasagar/vim-table-mode' Plug 'dhruvasagar/vim-table-mode'
" Graphviz
Plug 'liuchengxu/graphviz.vim'
" SageMath " SageMath
Plug 'petRUShka/vim-sage' Plug 'petRUShka/vim-sage'
@ -163,6 +181,9 @@
" }}} " }}}
" Automatically switch fcitx5 modes based on the current vim mode
Plug 'rlue/vim-barbaric'
" vim-test - run perl-tests from inside the editor " vim-test - run perl-tests from inside the editor
Plug 'janko-m/vim-test' Plug 'janko-m/vim-test'
@ -706,6 +727,13 @@ endif
let g:haskell_indent_guard = 4 " 2 let g:haskell_indent_guard = 4 " 2
" }}} " }}}
" vim-barbaric {{
let g:barbaric_ime = 'fcitx'
let g:barbaric_scope = 'buffer'
let g:barbaric_timeout = -1
let g:barbaric_fcitx_cmd = 'fcitx5-remote'
" }}
"au BufRead,BufNewFile *.scad lua require('openscad') "au BufRead,BufNewFile *.scad lua require('openscad')
" openscad {{{ " openscad {{{
@ -777,9 +805,11 @@ augroup CustomCommentDefinitions
autocmd FileType cpp setlocal commentstring=\/\/\ %s autocmd FileType cpp setlocal commentstring=\/\/\ %s
autocmd FileType cuda setlocal commentstring=\/\/\ %s autocmd FileType cuda setlocal commentstring=\/\/\ %s
autocmd FileType openscad setlocal commentstring=\/\/\ %s autocmd FileType openscad setlocal commentstring=\/\/\ %s
autocmd FileType nix setlocal commentstring=#\ %s
autocmd FileType dot setlocal commentstring=\/\/\ %s
autocmd FileType markdown setlocal commentstring=<!---\ %s\ -->
augroup END augroup END
" NCM2 " NCM2
augroup NCM2 augroup NCM2
autocmd! autocmd!
@ -856,6 +886,7 @@ augroup END
" au FileType tex :call TexNewMathZone("N","align*",1) " au FileType tex :call TexNewMathZone("N","align*",1)
" }} " }}
" vim-instant-markdown {{ " vim-instant-markdown {{
au FileType markdown setlocal conceallevel=0 au FileType markdown setlocal conceallevel=0
"Uncomment to override defaults: "Uncomment to override defaults:
@ -876,6 +907,9 @@ augroup END
" markdown-preview {{ " markdown-preview {{
au FileType markdown nnoremap <buffer> <Leader>ll :MarkdownPreview<CR> au FileType markdown nnoremap <buffer> <Leader>ll :MarkdownPreview<CR>
function OpenMarkdownPreview (url)
execute "silent ! firefox --new-window " . a:url
endfunction
" See https://github.com/iamcco/markdown-preview.nvim#markdownpreview-config " See https://github.com/iamcco/markdown-preview.nvim#markdownpreview-config
let g:mkdp_auto_start = 0 " default 0 let g:mkdp_auto_start = 0 " default 0
let g:mkdp_auto_close = 0 " default 1 let g:mkdp_auto_close = 0 " default 1
@ -885,17 +919,22 @@ augroup END
let g:mkdp_open_ip = '' " default '' let g:mkdp_open_ip = '' " default ''
let g:mkdp_browser = '' " default '' let g:mkdp_browser = '' " default ''
let g:mkdp_echo_preview_url = 1 " default 0 let g:mkdp_echo_preview_url = 1 " default 0
let g:mkdp_browserfunc = '' " default '' let g:mkdp_browserfunc = 'OpenMarkdownPreview' " default ''
let g:mkdp_preview_options = { let g:mkdp_preview_options = {
\ 'mkit': {}, \ 'mkit': {},
\ 'katex': { \ 'katex': {
\ 'macros': { \ 'macros': {
\ "\\doubleR": "\\mathbb{R}", \ "\\RR": "\\mathbb{R}",
\ "\\doubleN": "\\mathbb{N}", \ "\\NN": "\\mathbb{N}",
\ "\\doubleZ": "\\mathbb{Z}", \ "\\ZZ": "\\mathbb{Z}",
\ "\\doubleF": "\\mathbb{F}", \ "\\QQ": "\\mathbb{Q}",
\ "\\ds": "\\displaystyle", \ "\\CC": "\\mathbb{C}",
\ }, \ "\\FF": "\\mathbb{F}",
\ "\\ds": "\\displaystyle",
\ "\\lc": "\\operatorname*{lc}",
\ "\\quo": "\\operatorname*{quo}",
\ "\\rem": "\\operatorname*{rem}",
\ },
\ }, \ },
\ 'uml': {}, \ 'uml': {},
\ 'maid': {}, \ 'maid': {},
@ -920,6 +959,17 @@ augroup END
let g:table_mode_corner='|' " make the tables work with markdown let g:table_mode_corner='|' " make the tables work with markdown
" }} " }}
" graphviz.vim {{
let g:graphviz_viewer = 'feh'
let g:graphviz_output_format = 'svg'
" TODO create argument and pull request for giving arguments to the viewer program
augroup graphviz
au!
au FileType dot nnoremap <buffer> <Leader>ll :Graphviz!!<CR>
au BufWritePost *.dot :GraphvizCompile " TODO create toggle command and add pull request to github
augroup END
" }}
" Add spell checking to LaTeX documents {{ " Add spell checking to LaTeX documents {{
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
function! SetLanguageSpecificSpellFile() function! SetLanguageSpecificSpellFile()
@ -964,7 +1014,9 @@ augroup END
" 3zg adds a word to the dictionary " 3zg adds a word to the dictionary
" Disable spelling in math environments " Disable spelling in math environments
au FileType markdown syntax match quoteblock /\$[^$]\+\$/ contains=@NoSpell au FileType markdown syntax match texMath /\$[^$]\+\$/ contains=@NoSpell containedin=markdownBlock,markdownBlockquote
au FileType markdown syntax region texMath start="\$\$" end="\$\$" contains=@NoSpell
augroup END augroup END
" }} " }}
@ -1052,6 +1104,12 @@ nnoremap <Space> :nohl<CR>
augroup END augroup END
" }}} " }}}
" Configure swapit and speeddating {{
nmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
nmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown
vmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
vmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown
" }}
function! InsertSnip(snip_name) function! InsertSnip(snip_name)
" Find the template " Find the template