From 50295e8d1d1b2ab4d5514d441ba28e45e7699c55 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 16 Oct 2020 12:34:44 +0300 Subject: [PATCH] g:loaded_* stopper --- vim/.vim/plugin/buftabline.vim | 3 +++ vim/.vim/plugin/chnglstnav.vim | 3 +++ vim/.vim/plugin/ctags.vim | 3 +++ vim/.vim/plugin/exted.vim | 4 ++++ vim/.vim/plugin/file_line.vim | 3 +++ vim/.vim/plugin/ggrep.vim | 3 +++ vim/.vim/plugin/grep.vim | 3 +++ vim/.vim/plugin/lsp.vim | 3 +++ vim/.vim/plugin/netrw.vim | 3 +++ vim/.vim/plugin/pastemode.vim | 5 ++++- vim/.vim/plugin/whereami.vim | 3 +++ 11 files changed, 35 insertions(+), 1 deletion(-) diff --git a/vim/.vim/plugin/buftabline.vim b/vim/.vim/plugin/buftabline.vim index 47a31da..24a3547 100644 --- a/vim/.vim/plugin/buftabline.vim +++ b/vim/.vim/plugin/buftabline.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_buftabline") | finish | endif +let g:loaded_mein_buftabline = 1 + function! BufTabline() redir => bufsRaw silent buffers diff --git a/vim/.vim/plugin/chnglstnav.vim b/vim/.vim/plugin/chnglstnav.vim index 648fafb..e383743 100644 --- a/vim/.vim/plugin/chnglstnav.vim +++ b/vim/.vim/plugin/chnglstnav.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_chnglstnav") | finish | endif +let g:loaded_mein_chnglstnav = 1 + function! s:Chng(...) if a:0 == 0 | return | endif execute "normal " . a:1 . (a:1 > 0 ? "g;" : "g,") diff --git a/vim/.vim/plugin/ctags.vim b/vim/.vim/plugin/ctags.vim index 8f66a48..a76e736 100644 --- a/vim/.vim/plugin/ctags.vim +++ b/vim/.vim/plugin/ctags.vim @@ -5,6 +5,9 @@ " Create "tags" file in your project's root first. " Then :Ctags LANG to fill it. +if exists("g:loaded_mein_ctags") | finish | endif +let g:loaded_mein_ctags = 1 + function! s:ctags(lang, onlyCmd, verbose) let dst = tagfiles()[0] let src = "/" . join(split(dst, "/")[:-2], "/") diff --git a/vim/.vim/plugin/exted.vim b/vim/.vim/plugin/exted.vim index 013402a..3911431 100644 --- a/vim/.vim/plugin/exted.vim +++ b/vim/.vim/plugin/exted.vim @@ -1,4 +1,8 @@ +if exists("g:loaded_mein_exted") | finish | endif +let g:loaded_mein_exted = 1 + function! s:exted(ext) execute "edit %<." . a:ext endfunction + command! -nargs=1 Ee silent call s:exted() diff --git a/vim/.vim/plugin/file_line.vim b/vim/.vim/plugin/file_line.vim index e5a6a92..65962d2 100644 --- a/vim/.vim/plugin/file_line.vim +++ b/vim/.vim/plugin/file_line.vim @@ -1,6 +1,9 @@ " Simplified version of http://www.vim.org/scripts/script.php?script_id=2184 " that does not replace current window +if exists("g:loaded_mein_file_line") | finish | endif +let g:loaded_mein_file_line = 1 + function! s:gotoline() let names = matchlist(bufname("%"), '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$') if empty(names) | return | endif diff --git a/vim/.vim/plugin/ggrep.vim b/vim/.vim/plugin/ggrep.vim index 657e7ea..7b52921 100644 --- a/vim/.vim/plugin/ggrep.vim +++ b/vim/.vim/plugin/ggrep.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_ggrep") | finish | endif +let g:loaded_mein_ggrep = 1 + function! s:Vmg(pattern) silent execute 'Ggrep "' . a:pattern . '"' copen diff --git a/vim/.vim/plugin/grep.vim b/vim/.vim/plugin/grep.vim index 7154d2d..e0878e7 100644 --- a/vim/.vim/plugin/grep.vim +++ b/vim/.vim/plugin/grep.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_grep") | finish | endif +let g:loaded_mein_grep = 1 + function! s:Vim(pattern) let ignorecase_bak=&ignorecase set noignorecase diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index 93b49b2..3a93544 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_lsp") | finish | endif +let g:loaded_mein_lsp = 1 + let g:lsp_highlight_references_enabled = 1 let g:lsp_diagnostics_echo_cursor = 1 let g:lsp_diagnostics_echo_delay = -1 diff --git a/vim/.vim/plugin/netrw.vim b/vim/.vim/plugin/netrw.vim index a1ba7ec..a724061 100644 --- a/vim/.vim/plugin/netrw.vim +++ b/vim/.vim/plugin/netrw.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_netrw") | finish | endif +let g:loaded_mein_netrw = 1 + let g:netrw_banner = 0 let g:netrw_bufsettings = "noma nomod nowrap ro nobl" diff --git a/vim/.vim/plugin/pastemode.vim b/vim/.vim/plugin/pastemode.vim index d2dbd7e..78f42a0 100644 --- a/vim/.vim/plugin/pastemode.vim +++ b/vim/.vim/plugin/pastemode.vim @@ -1,7 +1,10 @@ +if exists("g:loaded_mein_pastemode") | finish | endif +let g:loaded_mein_pastemode = 1 + if &term =~ "screen.*" let &t_ti = &t_ti . "\e[?2004h" let &t_te = "\e[?2004l" . &t_te - function XTermPasteBegin(ret) + function! XTermPasteBegin(ret) set pastetoggle=[201~ set paste return a:ret diff --git a/vim/.vim/plugin/whereami.vim b/vim/.vim/plugin/whereami.vim index 95126c1..8c55ede 100644 --- a/vim/.vim/plugin/whereami.vim +++ b/vim/.vim/plugin/whereami.vim @@ -1,3 +1,6 @@ +if exists("g:loaded_mein_whereami") | finish | endif +let g:loaded_mein_whereami = 1 + function! WhereAmI(fmt) let fullpath = expand("%:p") if a:fmt == "gnu" -- 2.44.0