From 10bfda27570a9b6a7927c820accb75700c4bd6fe Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 00:45:01 +0800 Subject: [PATCH 01/10] Update .vimrc add support to custom plugins in .vimrc.local --- .vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index b3f9018..1838075 100644 --- a/.vimrc +++ b/.vimrc @@ -154,7 +154,7 @@ Plug 'terryma/vim-smooth-scroll' Plug 'rhysd/clever-f.vim' Plug 'vim-scripts/indentpython.vim' -call plug#end() + " load vim default plugin runtime macros/matchit.vim @@ -355,3 +355,4 @@ let g:indentLine_enabled = 0 if filereadable(expand($HOME . '/.vimrc.local')) source $HOME/.vimrc.local endif +call plug#end() From 65c2cb9f85924e21b4a9140317b107f91adea046 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 00:51:42 +0800 Subject: [PATCH 02/10] Update .vimrc Add support to custom plugins in .vimrc.local --- .vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.vimrc b/.vimrc index 1838075..70e443b 100644 --- a/.vimrc +++ b/.vimrc @@ -154,7 +154,6 @@ Plug 'terryma/vim-smooth-scroll' Plug 'rhysd/clever-f.vim' Plug 'vim-scripts/indentpython.vim' - " load vim default plugin runtime macros/matchit.vim From db5464c8ab1ca6fff2bd905bca4b26c02185f9e1 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:23:47 +0800 Subject: [PATCH 03/10] Update .vimrc --- .vimrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 7779856..fe7e31d 100644 --- a/.vimrc +++ b/.vimrc @@ -154,6 +154,12 @@ Plug 'terryma/vim-smooth-scroll' Plug 'rhysd/clever-f.vim' Plug 'vim-scripts/indentpython.vim' +" 自定义插件 +if filereadable(expand($HOME . '/.vimrc.plugs')) + source $HOME/.vimrc.plugs +endif + +call plug#end() " load vim default plugin runtime macros/matchit.vim @@ -353,8 +359,7 @@ nnoremap gg :GV? " indentLine 默认不启用 let g:indentLine_enabled = 0 -" 个性化 +" 自定义设置 if filereadable(expand($HOME . '/.vimrc.local')) source $HOME/.vimrc.local endif -call plug#end() From 455c6c9048f3038d5d7e8a21e9d21888bfb60081 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:26:02 +0800 Subject: [PATCH 04/10] Create .vimrc.plugs --- .vimrc.plugs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vimrc.plugs diff --git a/.vimrc.plugs b/.vimrc.plugs new file mode 100644 index 0000000..6d34c91 --- /dev/null +++ b/.vimrc.plugs @@ -0,0 +1,3 @@ +"for test +"Plug 'sjl/badwolf' +"Plug 'luochen1990/rainbow' From e7da67402f2cef965b0de7cad76bd060803ca444 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:26:44 +0800 Subject: [PATCH 05/10] Delete .vimrc.plugs --- .vimrc.plugs | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vimrc.plugs diff --git a/.vimrc.plugs b/.vimrc.plugs deleted file mode 100644 index 6d34c91..0000000 --- a/.vimrc.plugs +++ /dev/null @@ -1,3 +0,0 @@ -"for test -"Plug 'sjl/badwolf' -"Plug 'luochen1990/rainbow' From 5f5aaf24bdef43b8ad61d3b382dba732bbdb33b7 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:29:20 +0800 Subject: [PATCH 06/10] Add custom plugs at --- .vimrc.plugs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vimrc.plugs diff --git a/.vimrc.plugs b/.vimrc.plugs new file mode 100644 index 0000000..6d34c91 --- /dev/null +++ b/.vimrc.plugs @@ -0,0 +1,3 @@ +"for test +"Plug 'sjl/badwolf' +"Plug 'luochen1990/rainbow' From 2c3a81055f3b0da7dc0ce668546b19b038efa670 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:29:55 +0800 Subject: [PATCH 07/10] Update .vimrc.local --- .vimrc.local | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc.local b/.vimrc.local index 70b42e1..bca2f4e 100644 --- a/.vimrc.local +++ b/.vimrc.local @@ -3,3 +3,6 @@ " 启动代码对齐线 " let g:indentLine_enabled = 1 + +" for test +" let g:rainbow_active = 1 From 10182e0c42d82282e7daf151f19c67c207095115 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:33:15 +0800 Subject: [PATCH 08/10] Add custom plugs at --- .vimrc.plugs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc.plugs b/.vimrc.plugs index 6d34c91..f18df76 100644 --- a/.vimrc.plugs +++ b/.vimrc.plugs @@ -1,3 +1,3 @@ -"for test -"Plug 'sjl/badwolf' -"Plug 'luochen1990/rainbow' +" for test +" Plug 'sjl/badwolf' +" Plug 'luochen1990/rainbow' From 650dbf7ab2a4d92774e4f6c7ae9bfa2aa45573f6 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 13:30:01 +0800 Subject: [PATCH 09/10] Vim read mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果是修改系统配置文件,sudo后环境变量改变,不会加载用户配置。而只需要查看文件而非修改时,这个属性可以保证文件不会弄乱。修改自己的只读文件的情况几乎遇不到。 --- .vimrc.local | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc.local b/.vimrc.local index bca2f4e..02e101d 100644 --- a/.vimrc.local +++ b/.vimrc.local @@ -6,3 +6,6 @@ " for test " let g:rainbow_active = 1 + +" vim read mode +" autocmd BufRead * let &l:modifiable = !&readonly From 22841493f07f288998971cbedce8b9f66b7658c8 Mon Sep 17 00:00:00 2001 From: titubery <17917040+Titubery@users.noreply.github.com> Date: Fri, 25 Oct 2019 13:34:53 +0800 Subject: [PATCH 10/10] Add read mode tips at --- help.md | 1 + 1 file changed, 1 insertion(+) diff --git a/help.md b/help.md index 8f52c96..028428f 100644 --- a/help.md +++ b/help.md @@ -334,3 +334,4 @@ | ------- | ----- | | `vim -u NONE -N` | 开启vim时不加载vimrc文件 | | `vimdiff file1 file2` | 显示文件差异 | +| `vim -R filename` | 以只读方式打开(阅读模式) |