From aab38f32e0a02e43565a554d0a76ff65636499b8 Mon Sep 17 00:00:00 2001 From: Michal Hanus Date: Sat, 2 Mar 2024 18:49:55 +0100 Subject: crazyshit --- after/ftplugin/markdown.vim | 69 --------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 after/ftplugin/markdown.vim (limited to 'after/ftplugin/markdown.vim') diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim deleted file mode 100644 index efea5e5..0000000 --- a/after/ftplugin/markdown.vim +++ /dev/null @@ -1,69 +0,0 @@ -set concealcursor=c -set synmaxcol=3000 " For long Chinese paragraphs - -set wrap - -" Fix minor issue with footnote, see https://github.com/vim-pandoc/vim-markdownfootnotes/issues/22 -if exists(':FootnoteNumber') - nnoremap ^^ :call markdownfootnotes#VimFootnotes('i') - inoremap ^^ :call markdownfootnotes#VimFootnotes('i') - imap @@ ReturnFromFootnote - nmap @@ ReturnFromFootnote -endif - -" Text objects for Markdown code blocks. -xnoremap ic :call text_obj#MdCodeBlock('i') -xnoremap ac :call text_obj#MdCodeBlock('a') -onoremap ic :call text_obj#MdCodeBlock('i') -onoremap ac :call text_obj#MdCodeBlock('a') - -" Use + to turn several lines to an unordered list. -" Ref: https://vi.stackexchange.com/q/5495/15292 and https://stackoverflow.com/q/42438795/6064933. -nnoremap + :set operatorfunc=AddListSymbolg@ -xnoremap + : call AddListSymbol(visualmode(), 1) - -function! AddListSymbol(type, ...) abort - if a:0 - let line_start = line("'<") - let line_end = line("'>") - else - let line_start = line("'[") - let line_end = line("']") - endif - - " add list symbol to each line - for line in range(line_start, line_end) - let text = getline(line) - - let l:end = matchend(text, '^\s*') - if l:end == 0 - let new_text = '+ ' . text - else - let new_text = text[0 : l:end-1] . ' + ' . text[l:end :] - endif - - call setline(line, new_text) - endfor -endfunction - -" Add hard line breaks for Markdown -nnoremap \ :set operatorfunc=AddLineBreakg@ -xnoremap \ : call AddLineBreak(visualmode(), 1) - -function! AddLineBreak(type, ...) abort - if a:0 - let line_start = line("'<") - let line_end = line("'>") - else - let line_start = line("'[") - let line_end = line("']") - endif - - for line in range(line_start, line_end) - let text = getline(line) - " add backslash to each line - let new_text = text . "\\" - - call setline(line, new_text) - endfor -endfunction -- cgit v1.2.3