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/cpp.vim | 39 ------------------------ after/ftplugin/gitconfig.vim | 1 - after/ftplugin/javascript.vim | 3 -- after/ftplugin/json.vim | 6 ---- after/ftplugin/lua.vim | 8 ----- after/ftplugin/markdown.vim | 69 ------------------------------------------- after/ftplugin/python.vim | 17 ----------- after/ftplugin/qf.vim | 6 ---- after/ftplugin/sql.vim | 1 - after/ftplugin/tex.lua | 2 -- after/ftplugin/text.vim | 1 - after/ftplugin/toml.vim | 0 after/ftplugin/vim.vim | 15 ---------- after/ftplugin/yaml.vim | 4 --- 14 files changed, 172 deletions(-) delete mode 100644 after/ftplugin/cpp.vim delete mode 100644 after/ftplugin/gitconfig.vim delete mode 100644 after/ftplugin/javascript.vim delete mode 100644 after/ftplugin/json.vim delete mode 100644 after/ftplugin/lua.vim delete mode 100644 after/ftplugin/markdown.vim delete mode 100644 after/ftplugin/python.vim delete mode 100644 after/ftplugin/qf.vim delete mode 100644 after/ftplugin/sql.vim delete mode 100644 after/ftplugin/tex.lua delete mode 100644 after/ftplugin/text.vim delete mode 100644 after/ftplugin/toml.vim delete mode 100644 after/ftplugin/vim.vim delete mode 100644 after/ftplugin/yaml.vim (limited to 'after') diff --git a/after/ftplugin/cpp.vim b/after/ftplugin/cpp.vim deleted file mode 100644 index a8f76f3..0000000 --- a/after/ftplugin/cpp.vim +++ /dev/null @@ -1,39 +0,0 @@ -set commentstring=//\ %s - -" Disable inserting comment leader after hitting o or O or -set formatoptions-=o -set formatoptions-=r - -nnoremap :call compile_run_cpp() - -function! s:compile_run_cpp() abort - let src_path = expand('%:p:~') - let src_noext = expand('%:p:~:r') - " The building flags - let _flag = '-Wall -Wextra -std=c++11 -O2' - - if executable('clang++') - let prog = 'clang++' - elseif executable('g++') - let prog = 'g++' - else - echoerr 'No C++ compiler found on the system!' - endif - call s:create_term_buf('h', 20) - execute printf('term %s %s %s -o %s && %s', prog, _flag, src_path, src_noext, src_noext) - startinsert -endfunction - -function s:create_term_buf(_type, size) abort - set splitbelow - set splitright - if a:_type ==# 'v' - vnew - else - new - endif - execute 'resize ' . a:size -endfunction - -" For delimitMate -let b:delimitMate_matchpairs = "(:),[:],{:}" diff --git a/after/ftplugin/gitconfig.vim b/after/ftplugin/gitconfig.vim deleted file mode 100644 index 9c2e80a..0000000 --- a/after/ftplugin/gitconfig.vim +++ /dev/null @@ -1 +0,0 @@ -set commentstring=#\ %s diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim deleted file mode 100644 index 3e27ee8..0000000 --- a/after/ftplugin/javascript.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Disable inserting comment leader after hitting o or O or -set formatoptions-=o -set formatoptions-=r diff --git a/after/ftplugin/json.vim b/after/ftplugin/json.vim deleted file mode 100644 index 90db3ec..0000000 --- a/after/ftplugin/json.vim +++ /dev/null @@ -1,6 +0,0 @@ -" let the initial folding state be that all folds are closed. -set foldlevel=0 - -" Use nvim-treesitter for folding -set foldmethod=expr -set foldexpr=nvim_treesitter#foldexpr() diff --git a/after/ftplugin/lua.vim b/after/ftplugin/lua.vim deleted file mode 100644 index 73b1a8f..0000000 --- a/after/ftplugin/lua.vim +++ /dev/null @@ -1,8 +0,0 @@ -" Disable inserting comment leader after hitting o or O or -set formatoptions-=o -set formatoptions-=r - -nnoremap :luafile % - -" For delimitMate -let b:delimitMate_matchpairs = "(:),[:],{:}" 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 diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim deleted file mode 100644 index 185aa6e..0000000 --- a/after/ftplugin/python.vim +++ /dev/null @@ -1,17 +0,0 @@ -if exists(':AsyncRun') - nnoremap :AsyncRun python -u "%" -endif - -" Do not wrap Python source code. -set nowrap -set sidescroll=5 -set sidescrolloff=2 -set colorcolumn=100 - -set tabstop=4 " number of visual spaces per TAB -set softtabstop=4 " number of spaces in tab when editing -set shiftwidth=4 " number of spaces to use for autoindent -set expandtab " expand tab to spaces so that tabs are spaces - -" For delimitMate -let b:delimitMate_matchpairs = "(:),[:],{:}" diff --git a/after/ftplugin/qf.vim b/after/ftplugin/qf.vim deleted file mode 100644 index 89b4c1f..0000000 --- a/after/ftplugin/qf.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Set quickfix window height, see also https://github.com/lervag/vimtex/issues/1127 -function! AdjustWindowHeight(minheight, maxheight) - execute max([a:minheight, min([line('$'), a:maxheight])]) . 'wincmd _' -endfunction - -call AdjustWindowHeight(5, 15) diff --git a/after/ftplugin/sql.vim b/after/ftplugin/sql.vim deleted file mode 100644 index 8c0d563..0000000 --- a/after/ftplugin/sql.vim +++ /dev/null @@ -1 +0,0 @@ -set commentstring=--\ %s diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua deleted file mode 100644 index a11226a..0000000 --- a/after/ftplugin/tex.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.o.textwidth = 120 -vim.o.wrap = true diff --git a/after/ftplugin/text.vim b/after/ftplugin/text.vim deleted file mode 100644 index 0dfe4de..0000000 --- a/after/ftplugin/text.vim +++ /dev/null @@ -1 +0,0 @@ -set colorcolumn= diff --git a/after/ftplugin/toml.vim b/after/ftplugin/toml.vim deleted file mode 100644 index e69de29..0000000 diff --git a/after/ftplugin/vim.vim b/after/ftplugin/vim.vim deleted file mode 100644 index 17dcedb..0000000 --- a/after/ftplugin/vim.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Disable inserting comment leader after hitting o or O or -set formatoptions-=o -set formatoptions-=r - -" Set the folding related options for vim script. Setting folding option in -" modeline is annoying in that the modeline get executed each time the window -" focus is lost (see -" https://github.com/tmux-plugins/vim-tmux-focus-events/issues/14) -set foldmethod=expr foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText() - -" Use :help command for keyword when pressing `K` in vim file, -" see `:h K` and https://stackoverflow.com/q/15867323/6064933 -set keywordprg=:help - -nnoremap :source % diff --git a/after/ftplugin/yaml.vim b/after/ftplugin/yaml.vim deleted file mode 100644 index ad695d7..0000000 --- a/after/ftplugin/yaml.vim +++ /dev/null @@ -1,4 +0,0 @@ -" Turn off syntax highlighting for large YAML files. -if line('$') > 500 - setlocal syntax=OFF -endif -- cgit v1.2.3