├── .gitattributes
├── LICENSE
├── README.md
├── ansible.cfg
├── doc
└── HowToContribute.md
├── group_vars
└── vimide
├── hosts
├── images
├── example1.png
├── example10.png
├── example11.png
├── example12.png
├── example14.png
├── example15.png
├── example2.png
├── example3.png
├── example4.png
├── example5.png
├── example6.png
├── example7.png
├── example8.png
└── example9.png
├── roles
└── vim
│ ├── README.md
│ ├── defaults
│ └── main.yml
│ ├── files
│ ├── Python-3.8.15.tgz
│ ├── cmake-3.15.0.tar.gz
│ ├── fonts.tar.gz
│ ├── git-2.18.4.tar.gz
│ ├── global_extra_conf.py
│ ├── lua-5.3.6.tar.gz
│ └── vim-9.0.tar.bz2
│ ├── handlers
│ └── main.yml
│ ├── meta
│ └── main.yml
│ ├── tasks
│ └── main.yml
│ ├── templates
│ ├── CentOS7_vimrc.j2
│ └── Rocky8_vimrc.j2
│ ├── tests
│ ├── inventory
│ └── test.yml
│ └── vars
│ └── main.yml
├── tags
├── update_plugin.yml
└── vim-ide.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.vim linguist-language=python
2 | *.j2 linguist-language=python
3 | *.yml linguist-language=python
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 设计初衷:
2 | 目前看github里面有很多写的都不错的VIM-IDE,但是有这么几个缺点
3 | * 1.功能过于单一:比如我的IDE只是针对某一个编程语言,功能以及配置都不能灵活的自定义。
4 | * 2.环境依赖问题:安装他们的vim-ide之前可能需要我们手动安装一些软件依赖比如python、lua、go、java、c++等各种环境依赖
5 | * 3.vim版本过于陈旧:目前最新的vim版本已经9.0了但是大部分系统还是老的版本7.0,新版本具有更好的性能以及扩展性。
6 | * 4.批量部署问题,如果我有很多台甚至上千台服务器那么我要挨个去手动部署么?在这里我们是支持同时部署上千台。。。
7 |
8 | # 功能描述:
9 |
10 | * 1.vim 颜色插件AirLine,展示漂亮美观的vim终端环境
11 |
12 | * 2.针对编写代码层面优化:
13 | * 漂亮美观的缩进代码对齐线,编写代码脉络清晰可见
14 | * 神级补全插件YouCompleteMe支持python、go、java、c#、Ansible等主流编程语言,妈妈以后再也不用担心我的编程了
15 | * 行尾空格一键删除(大部分人偶尔会在编写代码过程中在行尾加一个小尾巴) (快捷键 F5)
16 | * 括号补全(彩虹颜色)
17 | * 粘贴缩进混乱解决方案(F1开启/关闭vim paste模式)
18 | * 自动代码折叠功能,让代码更美观
19 | * ployglot语法高亮插件支持,让各种代码高亮更智能
20 | * 异步语法检测插件ale支持,比传统的syntastic快很多并且不卡顿,大部分编程语言都支持
21 |
22 | * 3.vim NERDTree 树形树支持让目录查找跳转显示更加智能方便
23 | * nerdtree-git-plugin 显示文件git仓库代码状态
24 | * tagbar 显示编程语言的函数 变量 类等 (快捷键 F3开启)
25 | * Nerdcommenter 智能快捷注释代码
26 | * 在vim的Visual模式下选定多行后,按下键盘"\"键位+ci),会对选中的特定区块进行注释/反注释.
27 | * 支持devicons小图标智能展示功能,可以在vim中给文件增加精美图标展示.
28 |
29 | * 4.集成fuzzy finder 模糊搜索神器
30 | * 默认快捷键\f搜索文件,\a快速搜索目录文本,\b查看buffers缓冲记录
31 | * 快速模糊搜索文件,缓冲区,单词,文本行,tags,git 提交历史等,并且支持预览。
32 | * 使用说明:https://github.com/junegunn/fzf/blob/master/README-VIM.md
33 |
34 | * 5.vim mini buffer explorer 标签插件支持vim下多个文件之间的快速切换(F6 F7翻页功能)
35 |
36 | * 6.undotree 撤销树功能,方便编写过程中随时回退到某一个时间点(F9开启)
37 |
38 | * 7.支持在vim中打开一个异步terminal终端窗口,直接在vim窗口下进行命令的执行与调试(F10开启)
39 |
40 | * 8.支持在vim中浏览markdown文件方便快捷
41 |
42 | * 9.支持linux终端 Bash powerline 功能
43 |
44 |
45 | # 部署步骤:
46 | ## 1. ansible安装
47 |
48 | 可以参考官方网站安装方式https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-release-via-dnf-or-yum
49 | 目前centos系列用户可以直接使用yum安装(ansible官方YUM 仓库地址:https://releases.ansible.com/ansible)
50 |
51 | ## 2.一键安装
52 | * 2.1 将项目下的所有文件拷贝到anbile的安装路径下面 (Redhat 系列默认在/etc/ansible)
53 | * 2.2 修改/etc/ansible/hosts 配置文件
54 | * [vimide] 语句块下为需要部署的主机地址,[all:vars]语句块下定义主机的账号密码,其他配置信息可以参考文件说明
55 | * 2.2 执行 ansible-playbook -i hosts vim-ide.yml
56 | * 2.3 更新所有插件 ansible-playbook -i hosts update_plugin.yml
57 | ```ansible-playbook vim-ide.yml```
58 |
59 | ## 3.如何进行vim插件更新?
60 | 执行```ansible-playbook update_plugin.yml``` 即可
61 |
62 | ## 4.如何自定义配置文件?
63 | 项目的自定义变量都放在了ansible的hosts文件内,熟悉ansible的用户可以自己修改hosts资源文件,比如自定义支持的python/go版本,ycm的一些配置等等
64 |
65 | # 操作系统支持:
66 | 目前支持的Linux操作系统:centos7、Rocker系列后面会支持更多哦!
67 |
68 |
69 | ## 贡献&致谢
70 |
71 | 感谢所有为项目提交 `Issues`和`PRs` 的贡献者!
72 |
73 | - [如何贡献](doc/HowToContribute.md)
74 |
75 |
76 | # 运行样例截图:
77 | 
78 | 
79 | 
80 | 
81 | 
82 | 
83 | 
84 | 
85 | 
86 | 
87 | 
88 | 
89 |
90 | 如果您觉得项目不错的话可以多多支持一下作者,后面会做出更好的改进
91 |
92 |

93 |

94 |
95 |
96 |
--------------------------------------------------------------------------------
/ansible.cfg:
--------------------------------------------------------------------------------
1 | # config file for ansible -- https://ansible.com/
2 | # ===============================================
3 |
4 | # nearly all parameters can be overridden in ansible-playbook
5 | # or with command line flags. ansible will read ANSIBLE_CONFIG,
6 | # ansible.cfg in the current working directory, .ansible.cfg in
7 | # the home directory or /etc/ansible/ansible.cfg, whichever it
8 | # finds first
9 |
10 | [defaults]
11 |
12 | # some basic default values...
13 |
14 | #inventory = /etc/ansible/hosts
15 | #library = /usr/share/my_modules/
16 | #module_utils = /usr/share/my_module_utils/
17 | #remote_tmp = ~/.ansible/tmp
18 | #local_tmp = ~/.ansible/tmp
19 | #plugin_filters_cfg = /etc/ansible/plugin_filters.yml
20 | #forks = 5
21 | #poll_interval = 15
22 | #sudo_user = root
23 | #ask_sudo_pass = True
24 | #ask_pass = True
25 | #transport = smart
26 | #remote_port = 22
27 | #module_lang = C
28 | #module_set_locale = False
29 |
30 | # plays will gather facts by default, which contain information about
31 | # the remote system.
32 | #
33 | # smart - gather by default, but don't regather if already gathered
34 | # implicit - gather by default, turn off with gather_facts: False
35 | # explicit - do not gather by default, must say gather_facts: True
36 | #gathering = implicit
37 |
38 | # This only affects the gathering done by a play's gather_facts directive,
39 | # by default gathering retrieves all facts subsets
40 | # all - gather all subsets
41 | # network - gather min and network facts
42 | # hardware - gather hardware facts (longest facts to retrieve)
43 | # virtual - gather min and virtual facts
44 | # facter - import facts from facter
45 | # ohai - import facts from ohai
46 | # You can combine them using comma (ex: network,virtual)
47 | # You can negate them using ! (ex: !hardware,!facter,!ohai)
48 | # A minimal set of facts is always gathered.
49 | #gather_subset = all
50 |
51 | # some hardware related facts are collected
52 | # with a maximum timeout of 10 seconds. This
53 | # option lets you increase or decrease that
54 | # timeout to something more suitable for the
55 | # environment.
56 | # gather_timeout = 10
57 |
58 | # Ansible facts are available inside the ansible_facts.* dictionary
59 | # namespace. This setting maintains the behaviour which was the default prior
60 | # to 2.5, duplicating these variables into the main namespace, each with a
61 | # prefix of 'ansible_'.
62 | # This variable is set to True by default for backwards compatibility. It
63 | # will be changed to a default of 'False' in a future release.
64 | # ansible_facts.
65 | # inject_facts_as_vars = True
66 |
67 | # additional paths to search for roles in, colon separated
68 | #roles_path = /etc/ansible/roles
69 |
70 | # uncomment this to disable SSH key host checking
71 | host_key_checking = False
72 |
73 | # change the default callback, you can only have one 'stdout' type enabled at a time.
74 | #stdout_callback = skippy
75 |
76 |
77 | ## Ansible ships with some plugins that require whitelisting,
78 | ## this is done to avoid running all of a type by default.
79 | ## These setting lists those that you want enabled for your system.
80 | ## Custom plugins should not need this unless plugin author specifies it.
81 |
82 | # enable callback plugins, they can output to stdout but cannot be 'stdout' type.
83 | #callback_whitelist = timer, mail
84 |
85 | # Determine whether includes in tasks and handlers are "static" by
86 | # default. As of 2.0, includes are dynamic by default. Setting these
87 | # values to True will make includes behave more like they did in the
88 | # 1.x versions.
89 | #task_includes_static = False
90 | #handler_includes_static = False
91 |
92 | # Controls if a missing handler for a notification event is an error or a warning
93 | #error_on_missing_handler = True
94 |
95 | # change this for alternative sudo implementations
96 | #sudo_exe = sudo
97 |
98 | # What flags to pass to sudo
99 | # WARNING: leaving out the defaults might create unexpected behaviours
100 | #sudo_flags = -H -S -n
101 |
102 | # SSH timeout
103 | #timeout = 10
104 |
105 | # default user to use for playbooks if user is not specified
106 | # (/usr/bin/ansible will use current user as default)
107 | #remote_user = root
108 |
109 | # logging is off by default unless this path is defined
110 | # if so defined, consider logrotate
111 | #log_path = /var/log/ansible.log
112 |
113 | # default module name for /usr/bin/ansible
114 | #module_name = command
115 |
116 | # use this shell for commands executed under sudo
117 | # you may need to change this to bin/bash in rare instances
118 | # if sudo is constrained
119 | #executable = /bin/sh
120 |
121 | # if inventory variables overlap, does the higher precedence one win
122 | # or are hash values merged together? The default is 'replace' but
123 | # this can also be set to 'merge'.
124 | #hash_behaviour = replace
125 |
126 | # by default, variables from roles will be visible in the global variable
127 | # scope. To prevent this, the following option can be enabled, and only
128 | # tasks and handlers within the role will see the variables there
129 | #private_role_vars = yes
130 |
131 | # list any Jinja2 extensions to enable here:
132 | #jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n
133 |
134 | # if set, always use this private key file for authentication, same as
135 | # if passing --private-key to ansible or ansible-playbook
136 | #private_key_file = /path/to/file
137 |
138 | # If set, configures the path to the Vault password file as an alternative to
139 | # specifying --vault-password-file on the command line.
140 | #vault_password_file = /path/to/vault_password_file
141 |
142 | # format of string {{ ansible_managed }} available within Jinja2
143 | # templates indicates to users editing templates files will be replaced.
144 | # replacing {file}, {host} and {uid} and strftime codes with proper values.
145 | #ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
146 | # {file}, {host}, {uid}, and the timestamp can all interfere with idempotence
147 | # in some situations so the default is a static string:
148 | #ansible_managed = Ansible managed
149 |
150 | # by default, ansible-playbook will display "Skipping [host]" if it determines a task
151 | # should not be run on a host. Set this to "False" if you don't want to see these "Skipping"
152 | # messages. NOTE: the task header will still be shown regardless of whether or not the
153 | # task is skipped.
154 | #display_skipped_hosts = True
155 |
156 | # by default, if a task in a playbook does not include a name: field then
157 | # ansible-playbook will construct a header that includes the task's action but
158 | # not the task's args. This is a security feature because ansible cannot know
159 | # if the *module* considers an argument to be no_log at the time that the
160 | # header is printed. If your environment doesn't have a problem securing
161 | # stdout from ansible-playbook (or you have manually specified no_log in your
162 | # playbook on all of the tasks where you have secret information) then you can
163 | # safely set this to True to get more informative messages.
164 | #display_args_to_stdout = False
165 |
166 | # by default (as of 1.3), Ansible will raise errors when attempting to dereference
167 | # Jinja2 variables that are not set in templates or action lines. Uncomment this line
168 | # to revert the behavior to pre-1.3.
169 | #error_on_undefined_vars = False
170 |
171 | # by default (as of 1.6), Ansible may display warnings based on the configuration of the
172 | # system running ansible itself. This may include warnings about 3rd party packages or
173 | # other conditions that should be resolved if possible.
174 | # to disable these warnings, set the following value to False:
175 | #system_warnings = True
176 |
177 | # by default (as of 1.4), Ansible may display deprecation warnings for language
178 | # features that should no longer be used and will be removed in future versions.
179 | # to disable these warnings, set the following value to False:
180 | #deprecation_warnings = True
181 |
182 | # (as of 1.8), Ansible can optionally warn when usage of the shell and
183 | # command module appear to be simplified by using a default Ansible module
184 | # instead. These warnings can be silenced by adjusting the following
185 | # setting or adding warn=yes or warn=no to the end of the command line
186 | # parameter string. This will for example suggest using the git module
187 | # instead of shelling out to the git command.
188 | # command_warnings = False
189 |
190 |
191 | # set plugin path directories here, separate with colons
192 | #action_plugins = /usr/share/ansible/plugins/action
193 | #cache_plugins = /usr/share/ansible/plugins/cache
194 | #callback_plugins = /usr/share/ansible/plugins/callback
195 | #connection_plugins = /usr/share/ansible/plugins/connection
196 | #lookup_plugins = /usr/share/ansible/plugins/lookup
197 | #inventory_plugins = /usr/share/ansible/plugins/inventory
198 | #vars_plugins = /usr/share/ansible/plugins/vars
199 | #filter_plugins = /usr/share/ansible/plugins/filter
200 | #test_plugins = /usr/share/ansible/plugins/test
201 | #terminal_plugins = /usr/share/ansible/plugins/terminal
202 | #strategy_plugins = /usr/share/ansible/plugins/strategy
203 |
204 |
205 | # by default, ansible will use the 'linear' strategy but you may want to try
206 | # another one
207 | #strategy = free
208 |
209 | # by default callbacks are not loaded for /bin/ansible, enable this if you
210 | # want, for example, a notification or logging callback to also apply to
211 | # /bin/ansible runs
212 | #bin_ansible_callbacks = False
213 |
214 |
215 | # don't like cows? that's unfortunate.
216 | # set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1
217 | #nocows = 1
218 |
219 | # set which cowsay stencil you'd like to use by default. When set to 'random',
220 | # a random stencil will be selected for each task. The selection will be filtered
221 | # against the `cow_whitelist` option below.
222 | #cow_selection = default
223 | #cow_selection = random
224 |
225 | # when using the 'random' option for cowsay, stencils will be restricted to this list.
226 | # it should be formatted as a comma-separated list with no spaces between names.
227 | # NOTE: line continuations here are for formatting purposes only, as the INI parser
228 | # in python does not support them.
229 | #cow_whitelist=bud-frogs,bunny,cheese,daemon,default,dragon,elephant-in-snake,elephant,eyes,\
230 | # hellokitty,kitty,luke-koala,meow,milk,moofasa,moose,ren,sheep,small,stegosaurus,\
231 | # stimpy,supermilker,three-eyes,turkey,turtle,tux,udder,vader-koala,vader,www
232 |
233 | # don't like colors either?
234 | # set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1
235 | #nocolor = 1
236 |
237 | # if set to a persistent type (not 'memory', for example 'redis') fact values
238 | # from previous runs in Ansible will be stored. This may be useful when
239 | # wanting to use, for example, IP information from one group of servers
240 | # without having to talk to them in the same playbook run to get their
241 | # current IP information.
242 | #fact_caching = memory
243 |
244 | #This option tells Ansible where to cache facts. The value is plugin dependent.
245 | #For the jsonfile plugin, it should be a path to a local directory.
246 | #For the redis plugin, the value is a host:port:database triplet: fact_caching_connection = localhost:6379:0
247 |
248 | #fact_caching_connection=/tmp
249 |
250 |
251 |
252 | # retry files
253 | # When a playbook fails by default a .retry file will be created in ~/
254 | # You can disable this feature by setting retry_files_enabled to False
255 | # and you can change the location of the files by setting retry_files_save_path
256 |
257 | #retry_files_enabled = False
258 | #retry_files_save_path = ~/.ansible-retry
259 |
260 | # squash actions
261 | # Ansible can optimise actions that call modules with list parameters
262 | # when looping. Instead of calling the module once per with_ item, the
263 | # module is called once with all items at once. Currently this only works
264 | # under limited circumstances, and only with parameters named 'name'.
265 | #squash_actions = apk,apt,dnf,homebrew,pacman,pkgng,yum,zypper
266 |
267 | # prevents logging of task data, off by default
268 | #no_log = False
269 |
270 | # prevents logging of tasks, but only on the targets, data is still logged on the master/controller
271 | #no_target_syslog = False
272 |
273 | # controls whether Ansible will raise an error or warning if a task has no
274 | # choice but to create world readable temporary files to execute a module on
275 | # the remote machine. This option is False by default for security. Users may
276 | # turn this on to have behaviour more like Ansible prior to 2.1.x. See
277 | # https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
278 | # for more secure ways to fix this than enabling this option.
279 | #allow_world_readable_tmpfiles = False
280 |
281 | # controls the compression level of variables sent to
282 | # worker processes. At the default of 0, no compression
283 | # is used. This value must be an integer from 0 to 9.
284 | #var_compression_level = 9
285 |
286 | # controls what compression method is used for new-style ansible modules when
287 | # they are sent to the remote system. The compression types depend on having
288 | # support compiled into both the controller's python and the client's python.
289 | # The names should match with the python Zipfile compression types:
290 | # * ZIP_STORED (no compression. available everywhere)
291 | # * ZIP_DEFLATED (uses zlib, the default)
292 | # These values may be set per host via the ansible_module_compression inventory
293 | # variable
294 | #module_compression = 'ZIP_DEFLATED'
295 |
296 | # This controls the cutoff point (in bytes) on --diff for files
297 | # set to 0 for unlimited (RAM may suffer!).
298 | #max_diff_size = 1048576
299 |
300 | # This controls how ansible handles multiple --tags and --skip-tags arguments
301 | # on the CLI. If this is True then multiple arguments are merged together. If
302 | # it is False, then the last specified argument is used and the others are ignored.
303 | # This option will be removed in 2.8.
304 | #merge_multiple_cli_flags = True
305 |
306 | # Controls showing custom stats at the end, off by default
307 | #show_custom_stats = True
308 |
309 | # Controls which files to ignore when using a directory as inventory with
310 | # possibly multiple sources (both static and dynamic)
311 | #inventory_ignore_extensions = ~, .orig, .bak, .ini, .cfg, .retry, .pyc, .pyo
312 |
313 | # This family of modules use an alternative execution path optimized for network appliances
314 | # only update this setting if you know how this works, otherwise it can break module execution
315 | #network_group_modules=eos, nxos, ios, iosxr, junos, vyos
316 |
317 | # When enabled, this option allows lookups (via variables like {{lookup('foo')}} or when used as
318 | # a loop with `with_foo`) to return data that is not marked "unsafe". This means the data may contain
319 | # jinja2 templating language which will be run through the templating engine.
320 | # ENABLING THIS COULD BE A SECURITY RISK
321 | #allow_unsafe_lookups = False
322 |
323 | # set default errors for all plays
324 | #any_errors_fatal = False
325 |
326 | [inventory]
327 | # enable inventory plugins, default: 'host_list', 'script', 'yaml', 'ini'
328 | #enable_plugins = host_list, virtualbox, yaml, constructed
329 |
330 | # ignore these extensions when parsing a directory as inventory source
331 | #ignore_extensions = .pyc, .pyo, .swp, .bak, ~, .rpm, .md, .txt, ~, .orig, .ini, .cfg, .retry
332 |
333 | # ignore files matching these patterns when parsing a directory as inventory source
334 | #ignore_patterns=
335 |
336 | # If 'true' unparsed inventory sources become fatal errors, they are warnings otherwise.
337 | #unparsed_is_failed=False
338 |
339 | [privilege_escalation]
340 | #become=True
341 | #become_method=sudo
342 | #become_user=root
343 | #become_ask_pass=False
344 |
345 | [paramiko_connection]
346 |
347 | # uncomment this line to cause the paramiko connection plugin to not record new host
348 | # keys encountered. Increases performance on new host additions. Setting works independently of the
349 | # host key checking setting above.
350 | #record_host_keys=False
351 |
352 | # by default, Ansible requests a pseudo-terminal for commands executed under sudo. Uncomment this
353 | # line to disable this behaviour.
354 | #pty=False
355 |
356 | # paramiko will default to looking for SSH keys initially when trying to
357 | # authenticate to remote devices. This is a problem for some network devices
358 | # that close the connection after a key failure. Uncomment this line to
359 | # disable the Paramiko look for keys function
360 | #look_for_keys = False
361 |
362 | # When using persistent connections with Paramiko, the connection runs in a
363 | # background process. If the host doesn't already have a valid SSH key, by
364 | # default Ansible will prompt to add the host key. This will cause connections
365 | # running in background processes to fail. Uncomment this line to have
366 | # Paramiko automatically add host keys.
367 | #host_key_auto_add = True
368 |
369 | [ssh_connection]
370 |
371 | # ssh arguments to use
372 | # Leaving off ControlPersist will result in poor performance, so use
373 | # paramiko on older platforms rather than removing it, -C controls compression use
374 | #ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
375 |
376 | # The base directory for the ControlPath sockets.
377 | # This is the "%(directory)s" in the control_path option
378 | #
379 | # Example:
380 | # control_path_dir = /tmp/.ansible/cp
381 | #control_path_dir = ~/.ansible/cp
382 |
383 | # The path to use for the ControlPath sockets. This defaults to a hashed string of the hostname,
384 | # port and username (empty string in the config). The hash mitigates a common problem users
385 | # found with long hostames and the conventional %(directory)s/ansible-ssh-%%h-%%p-%%r format.
386 | # In those cases, a "too long for Unix domain socket" ssh error would occur.
387 | #
388 | # Example:
389 | # control_path = %(directory)s/%%h-%%r
390 | #control_path =
391 |
392 | # Enabling pipelining reduces the number of SSH operations required to
393 | # execute a module on the remote server. This can result in a significant
394 | # performance improvement when enabled, however when using "sudo:" you must
395 | # first disable 'requiretty' in /etc/sudoers
396 | #
397 | # By default, this option is disabled to preserve compatibility with
398 | # sudoers configurations that have requiretty (the default on many distros).
399 | #
400 | pipelining = True
401 |
402 | # Control the mechanism for transferring files (old)
403 | # * smart = try sftp and then try scp [default]
404 | # * True = use scp only
405 | # * False = use sftp only
406 | #scp_if_ssh = smart
407 |
408 | # Control the mechanism for transferring files (new)
409 | # If set, this will override the scp_if_ssh option
410 | # * sftp = use sftp to transfer files
411 | # * scp = use scp to transfer files
412 | # * piped = use 'dd' over SSH to transfer files
413 | # * smart = try sftp, scp, and piped, in that order [default]
414 | #transfer_method = smart
415 |
416 | # if False, sftp will not use batch mode to transfer files. This may cause some
417 | # types of file transfer failures impossible to catch however, and should
418 | # only be disabled if your sftp version has problems with batch mode
419 | #sftp_batch_mode = False
420 |
421 | # The -tt argument is passed to ssh when pipelining is not enabled because sudo
422 | # requires a tty by default.
423 | #use_tty = True
424 |
425 | # Number of times to retry an SSH connection to a host, in case of UNREACHABLE.
426 | # For each retry attempt, there is an exponential backoff,
427 | # so after the first attempt there is 1s wait, then 2s, 4s etc. up to 30s (max).
428 | #retries = 3
429 |
430 | [persistent_connection]
431 |
432 | # Configures the persistent connection timeout value in seconds. This value is
433 | # how long the persistent connection will remain idle before it is destroyed.
434 | # If the connection doesn't receive a request before the timeout value
435 | # expires, the connection is shutdown. The default value is 30 seconds.
436 | #connect_timeout = 30
437 |
438 | # Configures the persistent connection retry timeout. This value configures the
439 | # the retry timeout that ansible-connection will wait to connect
440 | # to the local domain socket. This value must be larger than the
441 | # ssh timeout (timeout) and less than persistent connection idle timeout (connect_timeout).
442 | # The default value is 15 seconds.
443 | #connect_retry_timeout = 15
444 |
445 | # The command timeout value defines the amount of time to wait for a command
446 | # or RPC call before timing out. The value for the command timeout must
447 | # be less than the value of the persistent connection idle timeout (connect_timeout)
448 | # The default value is 10 second.
449 | #command_timeout = 10
450 |
451 | [accelerate]
452 | #accelerate_port = 5099
453 | #accelerate_timeout = 30
454 | #accelerate_connect_timeout = 5.0
455 |
456 | # The daemon timeout is measured in minutes. This time is measured
457 | # from the last activity to the accelerate daemon.
458 | #accelerate_daemon_timeout = 30
459 |
460 | # If set to yes, accelerate_multi_key will allow multiple
461 | # private keys to be uploaded to it, though each user must
462 | # have access to the system via SSH to add a new key. The default
463 | # is "no".
464 | #accelerate_multi_key = yes
465 |
466 | [selinux]
467 | # file systems that require special treatment when dealing with security context
468 | # the default behaviour that copies the existing context or uses the user default
469 | # needs to be changed to use the file system dependent context.
470 | #special_context_filesystems=nfs,vboxsf,fuse,ramfs,9p
471 |
472 | # Set this to yes to allow libvirt_lxc connections to work without SELinux.
473 | #libvirt_lxc_noseclabel = yes
474 |
475 | [colors]
476 | #highlight = white
477 | #verbose = blue
478 | #warn = bright purple
479 | #error = red
480 | #debug = dark gray
481 | #deprecate = purple
482 | #skip = cyan
483 | #unreachable = red
484 | #ok = green
485 | #changed = yellow
486 | #diff_add = green
487 | #diff_remove = red
488 | #diff_lines = cyan
489 |
490 |
491 | [diff]
492 | # Always print diff when running ( same as always running with -D/--diff )
493 | # always = no
494 |
495 | # Set how many context lines to show in diff
496 | # context = 3
497 |
--------------------------------------------------------------------------------
/doc/HowToContribute.md:
--------------------------------------------------------------------------------
1 | 为项目Ansible-VIM-IDE提交pull request
2 |
3 | 首先请核对下本地git config配置的用户名和邮箱与你github上的注册用户和邮箱一致,否则即使pull request被接受,贡献者列表中也看不到自己的名字,设置命令:
4 |
5 | $ git config --global user.email "you@example.com"
6 | $ git config --global user.name "Your Name"
7 |
8 | 1.登陆github,在本项目页面点击fork到自己仓库
9 | 2.clone 自己的仓库到本地:git clone https://github.com/xxx/Ansible-VIM-IDE.git
10 | 3.在 master 分支添加原始仓库为上游分支:git remote add upstream https://github.com/Hello-Linux/Ansible-VIM-IDE.git
11 | 4.在本地新建开发分支:git checkout -b dev
12 | 5.在开发分支修改代码并提交:git add ., git commit -am 'xx变更说明'
13 | 6.切换至 master 分支,同步原始仓库:git checkout master, git pull upstream master
14 | 7.切换至 dev 分支,合并本地 master 分支(已经和原始仓库同步),可能需要解冲突:git checkout dev, git merge master
15 | 8.提交本地 dev 分支到自己的远程 dev 仓库:git push origin dev
16 | 9.在github自己仓库页面,点击Compare & pull request给原始仓库发 pull request 请求
17 | a.等待原作者回复(接受/拒绝)
18 |
--------------------------------------------------------------------------------
/group_vars/vimide:
--------------------------------------------------------------------------------
1 | ---
2 | #这里定义远程ssh用户的账号 端口以及秘钥的位置
3 | ansible_ssh_user: "root"
4 | ansible_ssh_port: "22"
5 | ansible_ssh_private_key_file: "~/.ssh/id_rsa"
6 |
--------------------------------------------------------------------------------
/hosts:
--------------------------------------------------------------------------------
1 | # This is the default ansible 'hosts' file.
2 | #
3 | # It should live in /etc/ansible/hosts
4 | #
5 | # - Comments begin with the '#' character
6 | # - Blank lines are ignored
7 | # - Groups of hosts are delimited by [header] elements
8 | # - You can enter hostnames or ip addresses
9 | # - A hostname/ip can be a member of multiple groups
10 |
11 | # Ex 1: Ungrouped hosts, specify before any group headers.
12 |
13 | ## green.example.com
14 | ## blue.example.com
15 | ## 192.168.100.1
16 | ## 192.168.100.10
17 |
18 | # Ex 2: A collection of hosts belonging to the 'webservers' group
19 |
20 | ## [webservers]
21 | ## alpha.example.org
22 | ## beta.example.org
23 | ## 192.168.1.100
24 | ## 192.168.1.110
25 |
26 | # If you have multiple hosts following a pattern you can specify
27 | # them like this:
28 |
29 | ## www[001:006].example.com
30 |
31 | # Ex 3: A collection of database servers in the 'dbservers' group
32 |
33 | ## [dbservers]
34 | ##
35 | ## db01.intranet.mydomain.net
36 | ## db02.intranet.mydomain.net
37 | ## 10.25.1.56
38 | ## 10.25.1.57
39 |
40 | # Here's another example of host ranges, this time there are no
41 | # leading 0s:
42 |
43 | ## db-[99:101]-node.example.com
44 | #这里主要是用来定义你要部署的vimidc主机组,如果你要部署其他的可以添加主机列表
45 | #将本地的ssh秘钥拷贝到远程主机后修改group_vars下面的vimide文件即可
46 | [vimide]
47 | 192.168.98.129
48 |
49 | #这里主要用来定义VIM-IDE构建参数
50 |
51 | [all:vars]
52 | #定义Ansible的主机环境信息,ansible_connection=local为本地执行部署,远程部署其他主机则修改user,port。pass即可!
53 | ansible_connection=smart
54 | ansible_ssh_user="root"
55 | ansible_ssh_pass="buzhidao"
56 | ansible_ssh_port=22
57 |
58 | #定义是否需要安装python3,如果本地有python3环境则设置python_install变量为no,同时修改python_version为本地python的具体版本,如果没有python3环境,则默认版本为3.8.15
59 | python_install="yes"
60 | python_version="3.8.15"
61 |
62 | #定义powerline 使用的python版本格式为:python+版本号 例如:python3.7
63 | powerline_python_version="python3.8"
64 |
65 | #YCM使用的python版本
66 | ycm_python_binary_path="/usr/bin/python3.8"
67 |
68 | #YCM安装过程中python3第三方包的路径Redhat默认是/usr/local/lib/python3.7/site-packages
69 | ycm_python_third_party_package='/usr/lib/python3.8/site-packages'
70 |
71 | #这里定义YouCompleteMe支持的语言种类(python默认是支持的) 目前支持的参数为--java-completer --go-completer 多个参数之间用空格分隔注意--clang-completer是必须带的默认参数
72 | build_params="--clang-completer"
73 |
74 | # 自定义go二进制版本
75 | go_version="1.10.3"
76 |
77 | #新创建文件头模板中的作者名字
78 | author="Sun~Shell"
79 |
80 | #主要用来定义创建的模板文件的主机名
81 | hostname="{% for h in groups['vimide'] %} {{ hostvars[h]['ansible_hostname'] }} {% endfor %}"
82 |
--------------------------------------------------------------------------------
/images/example1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example1.png
--------------------------------------------------------------------------------
/images/example10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example10.png
--------------------------------------------------------------------------------
/images/example11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example11.png
--------------------------------------------------------------------------------
/images/example12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example12.png
--------------------------------------------------------------------------------
/images/example14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example14.png
--------------------------------------------------------------------------------
/images/example15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example15.png
--------------------------------------------------------------------------------
/images/example2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example2.png
--------------------------------------------------------------------------------
/images/example3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example3.png
--------------------------------------------------------------------------------
/images/example4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example4.png
--------------------------------------------------------------------------------
/images/example5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example5.png
--------------------------------------------------------------------------------
/images/example6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example6.png
--------------------------------------------------------------------------------
/images/example7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example7.png
--------------------------------------------------------------------------------
/images/example8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example8.png
--------------------------------------------------------------------------------
/images/example9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/images/example9.png
--------------------------------------------------------------------------------
/roles/vim/README.md:
--------------------------------------------------------------------------------
1 | # 设计初衷:
2 | 目前看github里面有很多写的都不错的VIM-IDE,但是有这么几个缺点
3 | * 1.功能有的过于单一比如我的IDE只是针对某一个编程语言
4 | * 2.环境依赖问题,安装他们的vim-ide之前可能需要我们手动安装一些软件依赖比如python,lua各种依赖
5 | * 3.vim版本识别问题,目前最新的vim版本已经9.0了但是大部分系统还是老的版本7.0,github上大部分vim-ide项目的插件都在朝着新的vim版本发展,所以需要VIM-IDE部署更加具有灵活性
6 | * 4.VIM-IDE的配置自定义化,大部分github项目还是不支持的,我们目前项目引入了自定义功能,比如youcompleteme插件的支持的语言自定义选择,python环境自定义选择,vimrc配置文件模板化等
7 | * 5.批量部署问题,如果我有很多台甚至上千台服务器那么我要挨个去手动部署么?在这里我们是支持同时部署上千台。。。
8 |
9 | # 功能描述:
10 |
11 | * 1.vim 颜色插件AirLine,展示漂亮美观的vim终端环境
12 |
13 | * 2.漂亮美观的缩进代码对齐线,编写代码脉络清晰可见
14 |
15 | * 3.Ansible-Vim 插件支持让ansible编写更加顺畅
16 |
17 | * 4.vim NERDTree 树形树支持让目录查找跳转显示更加智能方便
18 |
19 | * 5.神级补全插件YouCompleteMe支持python,go,java.c#等主流编程语言,妈妈以后再也不用担心我的编程了
20 |
21 | * 6.vim tagbar 显示编程语言的函数 变量 类等(目前已经和nerdtree捆绑到一起,统一在左侧栏显示) (快捷键 F3开启)
22 |
23 | * 7.vim 行尾空格一键删除(大部分人偶尔会在编写代码过程中在行尾加一个小尾巴) (快捷键 F5)
24 |
25 | * 8.Nerdcommenter 智能快捷注释代码(\leader+)
26 | * ca在可选的注释方式之间切换,比如C/C++ 的块注释/* */和行注释//
27 | * cc注释当前行
28 | * cs以”性感”的方式注释
29 | * cA在当前行尾添加注释符,并进入Insert模式
30 | * cu取消注释
31 |
32 | * 9.vim各种括号补全(彩虹颜色)
33 |
34 | * 10.fuzzy finder 模糊搜索工具,vim下最快的文件目录搜索工具
35 | * 使用说明:https://github.com/junegunn/fzf/blob/master/README-VIM.md
36 |
37 | * 11.vim粘贴缩进混乱解决方案(F1开启/关闭vim paste模式)
38 |
39 | * 12.nerdtree-git-plugin 显示文件git仓库代码状态
40 |
41 | * 13.vim mini buffer explorer 标签插件支持多个文件之间的快速切换(F6 F7翻页功能)
42 |
43 | * 14.自动代码折叠功能,让代码更美观
44 |
45 | * 15.undotree 撤销树功能,方便编写过程中随时回退到某一个时间点(F9开启)
46 |
47 | * 16.异步语法检测插件ale支持,比传统的syntastic快很多并且不卡顿,大部分编程语言都支持
48 |
49 | * 17.ployglot语法高亮插件支持,让各种代码高亮更智能
50 |
51 | * 18.支持在vim中打开一个异步terminal终端窗口,方便在vim下的命令的执行与调试(F10开启)
52 |
53 | * 19.支持在vim中浏览markdown文件方便快捷
54 |
55 | * 20.bash powerline 功能支持
56 |
57 |
58 | # 部署步骤:
59 | ## 1. ansible安装
60 |
61 | 可以参考官方网站安装方式https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-release-via-dnf-or-yum
62 | 目前centos系列用户可以直接使用yum安装(ansible官方YUM 仓库地址:https://releases.ansible.com/ansible
63 |
64 | ## 2.一键安装
65 | * 2.1 将项目下的所有文件拷贝到anbile的安装路径下面 (centos7默认在/etc/ansible)
66 | * 2.2 执行ansible-playbook vim-ide.yml
67 |
68 | ## 3.vim插件更新
69 | 执行ansible-playbook update_plugin.yml 即可
70 |
71 | ## 4.如何自定义配置文件
72 | 项目的自定义变量都放在了ansible的hosts文件内,熟悉ansible的用户可以自己修改hosts资源文件,比如自定义支持的python/go版本,ycm的一些配置等等
73 |
74 | # 操作系统支持:
75 | 目前支持的Linux操作系统:centos7、Rocker系列后面会支持更多哦
76 |
77 |
78 | ## 贡献&致谢
79 |
80 | 感谢所有为项目提交 `Issues`和`PRs` 的贡献者!
81 |
82 | - [如何贡献](doc/HowToContribute.md)
83 |
84 |
85 | # 运行样例截图:
86 | 
87 | 
88 | 
89 | 
90 | 
91 | 
92 | 
93 | 
94 | 
95 | 
96 | 
97 | 
98 |
99 | 如果您觉得项目不错的话可以多多支持一下作者,后面会做出更好的改进
100 |
101 |

102 |

103 |
104 |
105 |
--------------------------------------------------------------------------------
/roles/vim/defaults/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # defaults file for vim
3 |
--------------------------------------------------------------------------------
/roles/vim/files/Python-3.8.15.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/Python-3.8.15.tgz
--------------------------------------------------------------------------------
/roles/vim/files/cmake-3.15.0.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/cmake-3.15.0.tar.gz
--------------------------------------------------------------------------------
/roles/vim/files/fonts.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/fonts.tar.gz
--------------------------------------------------------------------------------
/roles/vim/files/git-2.18.4.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/git-2.18.4.tar.gz
--------------------------------------------------------------------------------
/roles/vim/files/global_extra_conf.py:
--------------------------------------------------------------------------------
1 | def Settings( **kwargs ):
2 | client_data = kwargs[ 'client_data' ]
3 | return {
4 | 'interpreter_path': client_data[ 'g:ycm_python_interpreter_path' ],
5 | 'sys_path': client_data[ 'g:ycm_python_sys_path' ]
6 | }
7 |
--------------------------------------------------------------------------------
/roles/vim/files/lua-5.3.6.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/lua-5.3.6.tar.gz
--------------------------------------------------------------------------------
/roles/vim/files/vim-9.0.tar.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hello-Linux/Vim-Toolkit/3d45d8e03d8576f1f4102a8f8c7e093deef361a0/roles/vim/files/vim-9.0.tar.bz2
--------------------------------------------------------------------------------
/roles/vim/handlers/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # handlers file for vim
--------------------------------------------------------------------------------
/roles/vim/meta/main.yml:
--------------------------------------------------------------------------------
1 | galaxy_info:
2 | author: your name
3 | description: your description
4 | company: your company (optional)
5 |
6 | # If the issue tracker for your role is not on github, uncomment the
7 | # next line and provide a value
8 | # issue_tracker_url: http://example.com/issue/tracker
9 |
10 | # Some suggested licenses:
11 | # - BSD (default)
12 | # - MIT
13 | # - GPLv2
14 | # - GPLv3
15 | # - Apache
16 | # - CC-BY
17 | license: license (GPLv2, CC-BY, etc)
18 |
19 | min_ansible_version: 1.2
20 |
21 | # If this a Container Enabled role, provide the minimum Ansible Container version.
22 | # min_ansible_container_version:
23 |
24 | # Optionally specify the branch Galaxy will use when accessing the GitHub
25 | # repo for this role. During role install, if no tags are available,
26 | # Galaxy will use this branch. During import Galaxy will access files on
27 | # this branch. If Travis integration is configured, only notifications for this
28 | # branch will be accepted. Otherwise, in all cases, the repo's default branch
29 | # (usually master) will be used.
30 | #github_branch:
31 |
32 | #
33 | # platforms is a list of platforms, and each platform has a name and a list of versions.
34 | #
35 | # platforms:
36 | # - name: Fedora
37 | # versions:
38 | # - all
39 | # - 25
40 | # - name: SomePlatform
41 | # versions:
42 | # - all
43 | # - 1.0
44 | # - 7
45 | # - 99.99
46 |
47 | galaxy_tags: []
48 | # List tags for your role here, one per line. A tag is a keyword that describes
49 | # and categorizes the role. Users find roles by searching for tags. Be sure to
50 | # remove the '[]' above, if you add tags to this list.
51 | #
52 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
53 | # Maximum 20 tags per role.
54 |
55 | dependencies: []
56 | # List your role dependencies here, one per line. Be sure to remove the '[]' above,
57 | # if you add dependencies to this list.
--------------------------------------------------------------------------------
/roles/vim/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # tasks file for vim
3 | - name: -基础依赖安装--
4 | yum:
5 | name: "{{ item }}"
6 | state: latest
7 | loop:
8 | - epel-release
9 | - ctags
10 | - ncurses
11 | - gcc-c++
12 | - ncurses-devel
13 | - wget
14 | - readline-devel
15 | - bzip2
16 | - curl
17 | - libcurl
18 | - curl-devel
19 | - openssl
20 | - openssl-devel
21 | - centos-release-scl
22 | - 'zlib*'
23 | - libffi-devel
24 | - expat-devel
25 | - python3-devel
26 | - perl-ExtUtils-CBuilder
27 | - perl-ExtUtils-Embed
28 | - perl-ExtUtils-Install
29 | - perl-ExtUtils-MakeMaker
30 | - perl-ExtUtils-Manifest
31 | - perl-ExtUtils-ParseXS
32 | - the_silver_searcher
33 |
34 | - name: gcc环境检测
35 | shell: which gcc
36 | register: gcc_result
37 | ignore_errors: True
38 |
39 | - name: 获取本地gcc版本
40 | shell: gcc --version|awk 'NR==1 {print $3}'|awk -F "." '{print $1}'
41 | register: gcc_version
42 | ignore_errors: true
43 |
44 | - name: git环境检测
45 | shell: git
46 | register: git_result
47 | ignore_errors: True
48 |
49 | - name: 获取本地Git版本
50 | shell: "git --version|awk '{print $3}'|cut -d '.' -f1"
51 | register: git_version
52 | ignore_errors: true
53 |
54 | - name: 检测GCC环境
55 | block:
56 | - name: 解压新版gcc压缩包
57 | unarchive:
58 | src: https://mirrors.aliyun.com/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.gz
59 | dest: /tmp
60 | remote_src: yes
61 | validate_certs: no
62 |
63 | - name: 安装/升级gcc8.5.0
64 | shell: "cd gcc-8.5.0 && mkdir -p build && ./contrib/download_prerequisites && cd build && ../configure --prefix=/usr/local/gcc-8.5.0 --enable-languages=c,c++ --disable-multilib && make -j$(nproc) && make install && rm -rf /usr/lib64/libstdc++.so.6 && ln -s /usr/local/gcc-8.5.0/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6"
65 | args:
66 | chdir: /tmp
67 | - name: 配置gcc软连接
68 | file:
69 | src: /usr/local/gcc-8.5.0/bin/{{ item }}
70 | dest: /usr/bin/{{ item }}
71 | owner: root
72 | group: root
73 | state: link
74 | force: yes
75 | loop:
76 | - gcc
77 | - g++
78 | - name: 设置gcc环境变量
79 | lineinfile:
80 | dest="{{ item }}"
81 | line='export PATH=$PATH:/usr/local/gcc-8.5.0/bin'
82 | state=present
83 | loop:
84 | - "/root/.bashrc"
85 | - "/etc/profile"
86 |
87 | rescue:
88 | - name: Print when errors
89 | debug:
90 | msg: 'Install error with gcc!'
91 | when: gcc_version.stdout | int < 8 or gcc_result is failed
92 |
93 | - name: 检测Git环境
94 | block:
95 | - name: 卸载旧版本git
96 | yum:
97 | name: git
98 | state: absent
99 | ignore_errors: true
100 |
101 | - name: 解压新版git压缩包
102 | unarchive:
103 | src: git-2.18.4.tar.gz
104 | dest: /tmp
105 | remote_src: no
106 |
107 | - name: 安装/升级Git2.18
108 | shell: "cd git-2.18.4 && make prefix=/usr/local/git all && make prefix=/usr/local/git install"
109 | args:
110 | chdir: /tmp
111 |
112 | - name: 设置git环境变量
113 | lineinfile:
114 | dest="{{ item }}"
115 | line='export PATH=$PATH:/usr/local/git/bin'
116 | state=present
117 | loop:
118 | - "/root/.bashrc"
119 | - "/etc/profile"
120 | rescue:
121 | - name: Print when errors
122 | debug:
123 | msg: 'Install error with git!'
124 | when: git_version.stdout | float < 2 or git_result is failed
125 |
126 | - name: 重载系统变量
127 | shell: "source ~/.bashrc;source /etc/profile"
128 |
129 | - name: 解压Cmake3.15
130 | unarchive:
131 | src: cmake-3.15.0.tar.gz
132 | dest: /tmp
133 | remote_src: no
134 |
135 | - name: 安装Cmake
136 | shell: "cd cmake-3.15.0 && ./bootstrap && make -j$(nproc) && make install"
137 | args:
138 | chdir: /tmp
139 | - name: 检查Python版本
140 | block:
141 | - name: 安装python3.8.15版本
142 | unarchive:
143 | src: Python-3.8.15.tgz
144 | dest: /tmp
145 | remote_src: no
146 |
147 | - name: 安装Python3.8.15
148 | shell: "cd Python-3.8.15 && ./configure --enable-shared && make -j$(nproc) && make install"
149 | args:
150 | chdir: /tmp
151 |
152 | - name: 更新Python 动态库
153 | lineinfile:
154 | path: /etc/ld.so.conf
155 | line: '/usr/local/lib/'
156 | create: yes
157 | state: present
158 | rescue:
159 | - name: Print when errors
160 | debug:
161 | msg: 'Install error with Python!'
162 | when: python_install == 'yes'
163 |
164 | - name: 安装python语法库Jedi
165 | shell: "ldconfig;pip3.{{ python_version.split('.',2)[1] | default(8) }} install jedi pylint -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com"
166 |
167 | - name: 解压lua5.3.6版本
168 | unarchive:
169 | src: lua-5.3.6.tar.gz
170 | dest: /tmp
171 | remote_src: no
172 |
173 | - name: 安装lua5.3.6
174 | shell: "cd lua-5.3.6 && make linux test && make install"
175 | args:
176 | chdir: /tmp
177 |
178 | - name: 获取本地vim版本
179 | shell: "vim --version|awk 'NR==1 {print $5}'"
180 | register: vim_version
181 |
182 | - name: 准备vim环境
183 | unarchive:
184 | src: vim-9.0.tar.bz2
185 | dest: /tmp
186 | remote_src: no
187 | when: (vim_version.stdout | float) < 8.2
188 |
189 | - name: 获取本地python config路径
190 | shell: "python3-config --configdir"
191 | register: python3_config_dir
192 |
193 | - name: 安装vim 9.0
194 | shell: "cd vim90 && ./configure --with-features=huge --enable-multibyte --with-ruby-command=ruby --enable-pythoninterp=yes --enable-gui=gtk2 --enable-cscope --enable-luainterp --with-lua-prefix=/usr/local --enable-fontset --enable-rubyinterp=dynamic --enable-python3interp=yes --with-python3-config-dir={{ python3_config_dir.stdout }} && make -j$(nproc) && make install"
195 | args:
196 | chdir: /tmp
197 | when: (vim_version.stdout | float) < 8.2
198 |
199 | - name: -下载powerline字体-
200 | unarchive:
201 | src: fonts.tar.gz
202 | dest: /tmp
203 | remote_src: no
204 |
205 | - name: -安装fronts字体文件-
206 | shell: sh install.sh
207 | args:
208 | chdir: /tmp/fonts
209 |
210 | - name: -安装Nerd Fonts字体库-
211 | git:
212 | repo: 'https://github.com/ryanoasis/nerd-fonts.git'
213 | dest: /tmp/nerd-fonts
214 | version: master
215 | clone: yes
216 | depth: 1
217 | update: yes
218 |
219 | - name: 安装nerd-fonts字体
220 | shell: "./install.sh"
221 | args:
222 | chdir: /tmp/nerd-fonts
223 |
224 | - name: -安装vim 插件管理器-
225 | git:
226 | repo: 'https://github.com/VundleVim/Vundle.vim.git'
227 | dest: ~/.vim/bundle/Vundle.vim
228 | version: master
229 | clone: yes
230 | update: yes
231 | - name: -安装vim_fugitive插件-
232 | git:
233 | repo: 'https://github.com/tpope/vim-fugitive.git'
234 | dest: ~/.vim/bundle/vim-fugitive
235 | version: master
236 | clone: yes
237 | update: yes
238 | - name: -安装Molokai color scheme for vim-
239 | git:
240 | repo: 'https://github.com/tomasr/molokai.git'
241 | dest: ~/.vim/colors
242 | version: master
243 | clone: yes
244 | - name: -字体主题插件拷贝-
245 | copy:
246 | src: ~/.vim/colors/colors/molokai.vim
247 | dest: ~/.vim/colors/molokai.vim
248 |
249 | - name: -下载fuzzy finder-
250 | git:
251 | repo: 'https://github.com/junegunn/fzf.git'
252 | dest: ~/.fzf
253 | version: master
254 | clone: yes
255 | - name: -安装fuzzy finder-
256 | shell: ./install --all
257 | args:
258 | chdir: ~/.fzf
259 | executable: /bin/bash
260 | - name: -拷贝vimrc模板文件-
261 | template:
262 | src: "{{ item }}"
263 | dest: ~/.vimrc
264 | mode: u=rw,g=r,o=r
265 | loop: "{{ query('first_found', { 'files': myfiles, 'paths': mypaths}) }}"
266 | vars:
267 | myfiles:
268 | - "{{ ansible_distribution}}{{ansible_distribution_major_version }}_vimrc.j2"
269 | - default_vimrc.j2
270 | mypaths: ['/etc/ansible/roles/vim/templates/']
271 | - name: 初始化vimrc配置文件
272 | shell: vim +PluginInstall +qall
273 |
274 | - block:
275 | - name: 安装go语言
276 | unarchive:
277 | src: https://dl.google.com/go/go{{ go_version }}.linux-amd64.tar.gz
278 | dest: /usr/local
279 | remote_src: yes
280 |
281 | - name: 初始化go环境
282 | lineinfile:
283 | path: /etc/profile
284 | line: 'PATH=$PATH:/usr/local/go/bin'
285 | create: yes
286 | state: present
287 | when: build_params.find('go') != -1
288 |
289 | - name: 安装YouCompleteMe插件
290 | shell: "git submodule update --init --recursive && python3 install.py {{ build_params}} --force-sudo"
291 | args:
292 | chdir: ~/.vim/bundle/YouCompleteMe
293 |
294 | - name: 拷贝YCM额外配置文件
295 | copy:
296 | src: global_extra_conf.py
297 | dest: ~/global_extra_conf.py
298 | mode: 0644
299 | - name: 安装bash powerline 插件
300 | pip:
301 | name: powerline-status
302 | state: present
303 | extra_args: -i https://mirrors.aliyun.com/pypi/simple
304 | executable: pip3
305 | - name: 初始化powerline
306 | blockinfile:
307 | path: /etc/profile
308 | block: |
309 | powerline-daemon -q
310 | POWERLINE_BASH_CONTINUATION=1
311 | POWERLINE_BASH_SELECT=1
312 | . /usr/local/lib/{{ powerline_python_version }}/site-packages/powerline/bindings/bash/powerline.sh
313 |
--------------------------------------------------------------------------------
/roles/vim/templates/CentOS7_vimrc.j2:
--------------------------------------------------------------------------------
1 | set nocompatible " be iMproved, required
2 | set number
3 | syntax on
4 | set guifont=Courier\ New:h3
5 | set t_Co=256
6 | set hlsearch
7 | set laststatus=2
8 | set backspace=2
9 | set lazyredraw
10 | set mouse=nv
11 | set guifont=DroidSansMonoForPowerlineNerdFont\ 12
12 | set pastetoggle=
13 | set autoread
14 | set shell=/bin/bash
15 | set encoding=utf-8
16 | set cursorline
17 | hi CursorLine cterm=NONE ctermbg=red ctermfg=white guibg=darkred guifg=white
18 | hi comment cterm=NONE ctermfg=green
19 |
20 | "###################vim terminal config map"
21 | map :terminal
22 |
23 | "++++++++++++++++++++++jedi-vim configuration"++++++++++++++++++++++
24 | let g:jedi#use_splits_not_buffers = "left"
25 | let g:jedi#documentation_command = "H"
26 | let g:jedi#show_call_signatures = "1"
27 | let g:jedi#max_doc_height = 30
28 | let g:jedi#smart_auto_mappings = 0
29 |
30 |
31 |
32 |
33 | "++++++++++++++++Asynchronous Lint Engine configuration++++++++++++++
34 | let g:ale_sign_column_always = 1
35 | "define the ale coin
36 | let g:ale_sign_error = '✗'
37 | let g:ale_sign_warning = '⚡'
38 | "let vim statusline combine ale
39 | let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK']
40 | let g:ale_echo_msg_error_str = 'E'
41 | let g:ale_echo_msg_warning_str = 'W'
42 | let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
43 | let g:ale_lint_on_enter = 1
44 | let g:ale_set_highlights = 0
45 | " Show 5 lines of errors (default: 10)
46 | let g:ale_list_window_size = 10
47 | " Set this. Airline will handle the rest.
48 | let g:airline#extensions#ale#enabled = 1
49 | "普通模式下,sp前往上一个错误或警告,sn前往下一个错误或警告
50 | nmap sp (ale_previous_wrap)
51 | nmap sn (ale_next_wrap)
52 | ""s触发/关闭语法检查
53 | nmap s :ALEToggle
54 | "d查看错误或警告的详细信息
55 | nmap d :ALEDetail
56 | let g:ale_linters = {
57 | \ 'python': ['pylint'],
58 | \ 'ansible': ['ansible'],
59 | \}
60 |
61 |
62 |
63 | "+++++++++++++++set config for indent++++++++++++
64 | set tabstop=2
65 | set autoindent
66 | set confirm
67 | set smartindent
68 | set shiftwidth=2
69 | "+++++++++++++++++++++vim-indent-line+++++++++++++++++
70 | let g:indentLine_color_term = 100
71 | let g:indentLine_char = '¦'
72 | let g:indentLine_concealcursor = 'inc'
73 | let g:indentLine_conceallevel = 2
74 | autocmd FIletype yaml setlocal tabstop=2 softtabstop=3 shiftwidth=2 autoindent smartindent
75 | autocmd FIletype python setlocal tabstop=4 expandtab shiftwidth=4 autoread nocompatible confirm autoindent smartindent
76 | "+++++++++++++++++++++++++++++++++++++++++++++++++++
77 | "++++++++++Airline Plugin settings++++++++++++++++++
78 | let g:airline_powerline_fonts = 1
79 | let g:airline_theme='dark'
80 | let g:airline_solarized_bg='dark'
81 | let g:airline#extensions#tabline#enabled = 1
82 | let g:airline#extensions#tabline#left_alt_sep = '+'
83 | let g:airline#extensions#tabline#formatter = 'default'
84 | "++++++++++++++++++++++++++++++++++++++++++++++++++++
85 | "height ligth cusor
86 | set bg=dark
87 | highlight CursorLine cterm=none ctermbg=236
88 | highlight CursorColumn cterm=none ctermbg=236
89 |
90 | "++++++++++++++++SimpylFold configuration ++++
91 | let g:SimpylFold_docstring_preview = 1
92 | "Enable folding
93 | set foldmethod=indent
94 | set foldlevel=99
95 | "Enable folding with the spacebar
96 | nnoremap za
97 |
98 | "++++++++++++++++undo tree configuration++++++++++++++
99 | map :UndotreeToggle
100 | set undodir=~/.undodir/
101 | set undofile
102 |
103 | "=================================================
104 | " File: plugin/undotree.vim
105 | " Description: Manage your undo history in a graph.
106 | " Author: Ming Bai
107 | " License: BSD
108 |
109 | " Avoid installing twice.
110 | if exists('g:loaded_undotree')
111 | finish
112 | endif
113 | let g:loaded_undotree = 0
114 |
115 | " At least version 7.3 with 005 patch is needed for undo branches.
116 | " Refer to https://github.com/mbbill/undotree/issues/4 for details.
117 | " Thanks kien
118 | if v:version < 703
119 | command! -n=0 -bar UndotreeToggle :echoerr "undotree.vim needs Vim version >= 7.3"
120 | finish
121 | endif
122 | if (v:version == 703 && !has("patch005"))
123 | command! -n=0 -bar UndotreeToggle :echoerr "undotree.vim needs vim7.3 with patch005 applied."
124 | finish
125 | endif
126 | let g:loaded_undotree = 1 " Signal plugin availability with a value of 1.
127 |
128 | "=================================================
129 | "Options:
130 |
131 | " Window layout
132 | " style 1
133 | " +----------+------------------------+
134 | " | | |
135 | " | | |
136 | " | undotree | |
137 | " | | |
138 | " | | |
139 | " +----------+ |
140 | " | | |
141 | " | diff | |
142 | " | | |
143 | " +----------+------------------------+
144 | " Style 2
145 | " +----------+------------------------+
146 | " | | |
147 | " | | |
148 | " | undotree | |
149 | " | | |
150 | " | | |
151 | " +----------+------------------------+
152 | " | |
153 | " | diff |
154 | " | |
155 | " +-----------------------------------+
156 | " Style 3
157 | " +------------------------+----------+
158 | " | | |
159 | " | | |
160 | " | | undotree |
161 | " | | |
162 | " | | |
163 | " | +----------+
164 | " | | |
165 | " | | diff |
166 | " | | |
167 | " +------------------------+----------+
168 | " Style 4
169 | " +-----------------------++----------+
170 | " | | |
171 | " | | |
172 | " | | undotree |
173 | " | | |
174 | " | | |
175 | " +------------------------+----------+
176 | " | |
177 | " | diff |
178 | " | |
179 | " +-----------------------------------+
180 | if !exists('g:undotree_WindowLayout')
181 | let g:undotree_WindowLayout = 1
182 | endif
183 |
184 | " e.g. using 'd' instead of 'days' to save some space.
185 | if !exists('g:undotree_ShortIndicators')
186 | let g:undotree_ShortIndicators = 0
187 | endif
188 |
189 | " undotree window width
190 | if !exists('g:undotree_SplitWidth')
191 | if g:undotree_ShortIndicators == 1
192 | let g:undotree_SplitWidth = 24
193 | else
194 | let g:undotree_SplitWidth = 30
195 | endif
196 | endif
197 |
198 | " diff window height
199 | if !exists('g:undotree_DiffpanelHeight')
200 | let g:undotree_DiffpanelHeight = 10
201 | endif
202 |
203 | " auto open diff window
204 | if !exists('g:undotree_DiffAutoOpen')
205 | let g:undotree_DiffAutoOpen = 1
206 | endif
207 |
208 | " if set, let undotree window get focus after being opened, otherwise
209 | " focus will stay in current window.
210 | if !exists('g:undotree_SetFocusWhenToggle')
211 | let g:undotree_SetFocusWhenToggle = 0
212 | endif
213 |
214 | " tree node shape.
215 | if !exists('g:undotree_TreeNodeShape')
216 | let g:undotree_TreeNodeShape = '*'
217 | endif
218 |
219 | " tree vertical shape.
220 | if !exists('g:undotree_TreeVertShape')
221 | let g:undotree_TreeVertShape = '|'
222 | endif
223 |
224 | " tree split shape.
225 | if !exists('g:undotree_TreeSplitShape')
226 | let g:undotree_TreeSplitShape = '/'
227 | endif
228 |
229 | " tree return shape.
230 | if !exists('g:undotree_TreeReturnShape')
231 | let g:undotree_TreeReturnShape = '\'
232 | endif
233 |
234 | if !exists('g:undotree_DiffCommand')
235 | let g:undotree_DiffCommand = "diff"
236 | endif
237 |
238 | " relative timestamp
239 | if !exists('g:undotree_RelativeTimestamp')
240 | let g:undotree_RelativeTimestamp = 1
241 | endif
242 |
243 | " Highlight changed text
244 | if !exists('g:undotree_HighlightChangedText')
245 | let g:undotree_HighlightChangedText = 1
246 | endif
247 |
248 | " Highlight changed text using signs in the gutter
249 | if !exists('g:undotree_HighlightChangedWithSign')
250 | let g:undotree_HighlightChangedWithSign = 1
251 | endif
252 |
253 | " Highlight linked syntax type.
254 | " You may chose your favorite through ":hi" command
255 | if !exists('g:undotree_HighlightSyntaxAdd')
256 | let g:undotree_HighlightSyntaxAdd = "DiffAdd"
257 | endif
258 | if !exists('g:undotree_HighlightSyntaxChange')
259 | let g:undotree_HighlightSyntaxChange = "DiffChange"
260 | endif
261 | if !exists('g:undotree_HighlightSyntaxDel')
262 | let g:undotree_HighlightSyntaxDel = "DiffDelete"
263 | endif
264 |
265 | " Deprecates the old style configuration.
266 | if exists('g:undotree_SplitLocation')
267 | echo "g:undotree_SplitLocation is deprecated,
268 | \ please use g:undotree_WindowLayout instead."
269 | endif
270 |
271 | " Show help line
272 | if !exists('g:undotree_HelpLine')
273 | let g:undotree_HelpLine = 1
274 | endif
275 |
276 | " Show cursorline
277 | if !exists('g:undotree_CursorLine')
278 | let g:undotree_CursorLine = 1
279 | endif
280 |
281 | "=================================================
282 | " User commands.
283 | command! -n=0 -bar UndotreeToggle :call undotree#UndotreeToggle()
284 | command! -n=0 -bar UndotreeHide :call undotree#UndotreeHide()
285 | command! -n=0 -bar UndotreeShow :call undotree#UndotreeShow()
286 | command! -n=0 -bar UndotreeFocus :call undotree#UndotreeFocus()
287 |
288 | " vim: set et fdm=marker sts=4 sw=4:
289 | "END+++++++++++++++++++++++++++++++++++++++++++++++++
290 |
291 |
292 | "+++++++++++++++YouCompleteMe configuration+++++++++++
293 | set completeopt=longest,menu
294 | let g:ycm_confirm_extra_conf=0
295 | let g:ycm_complete_in_comments = 1
296 | let g:ycm_complete_in_strings = 1
297 | let g:ycm_collect_identifiers_from_tags_files=1
298 | let g:ycm_collect_identifiers_from_comments_and_strings = 1
299 | let g:ycm_seed_identifiers_with_syntax=1
300 | let g:ycm_collect_identifiers_from_tags_files = 1
301 | let g:ycm_min_num_of_chars_for_completion=2
302 | let g:ycm_key_list_select_completion = ['']
303 | let g:ycm_key_list_previous_completion = ['']
304 | let g:ycm_confirm_extra_conf=0
305 | let g:ycm_cache_omnifunc=0
306 | let g:ycm_python_interpreter_path = '{{ ycm_python_binary_path }}'
307 | let g:ycm_python_sys_path = ['{{ ycm_python_third_party_package }}']
308 | let g:ycm_extra_conf_vim_data = [
309 | \ 'g:ycm_python_interpreter_path',
310 | \ 'g:ycm_python_sys_path'
311 | \]
312 | let g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'
313 |
314 | inoremap pumvisible() ? "\" : "\"
315 | inoremap pumvisible() ? "\" : "\"
316 | inoremap pumvisible() ? "\\\" :"\"
317 | inoremap pumvisible() ? "\\\" : "\"
318 | autocmd InsertLeave * if pumvisible() == 0|pclose|endif"
319 |
320 | "old version
321 | if !empty(glob("~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"))
322 | let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"
323 | endif
324 | " new version
325 | if !empty(glob("~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"))
326 | let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
327 | endif
328 | "mapping
329 | nmap gd :YcmDiags
330 | nnoremap gl :YcmCompleter GoToDeclaration
331 | nnoremap gf :YcmCompleter GoToDefinition
332 | nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration
333 | let g:ycm_key_invoke_completion = ''
334 | let g:ycm_filetype_blacklist = {
335 | \ 'tagbar' : 1,
336 | \ 'gitcommit' : 1,
337 | \}
338 |
339 | "+++++++++++++++++++++++++END+++++++++++++++++++++++
340 |
341 | "++++++++++++++++++ansible-vim Plugin++++++++++++++++
342 | let g:ansible_unindent_after_newline = 1
343 | let g:ansible_attribute_highlight = "b"
344 | let g:ansible_name_highlight = 'b'
345 | let g:ansible_extra_keywords_highlight = 1
346 | let g:ansible_normal_keywords_highlight = 'Constant'
347 | let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby', '*.yml': 'yaml.ansible','*.j2': 'ruby.jinja2' }
348 | au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
349 | au BufRead,BufNewFile /etc/ansible/roles/*/*/*.yml set filetype=yaml.ansible
350 | au BufRead,BufNewFile /etc/ansible/roles/*/templates/*.j2 set filetype=ruby.jinja2
351 | "++++++++++++++++++++++++++++++++++++++++++++++++++++
352 | nmap :NERDTree
353 | autocmd vimenter * NERDTree
354 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
355 | let g:NERDTreeDirArrowExpandable = '✚'
356 | let g:NERDTreeDirArrowCollapsible = '▾'
357 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
358 |
359 | "+++++++++++++++++++nerdtree configuration+++++++++++++++++
360 | let g:NERDTreeGitStatusIndicatorMapCustom = {
361 | \ "Modified" : "✹",
362 | \ "Staged" : "✚",
363 | \ "Untracked" : "✭",
364 | \ "Renamed" : "➜",
365 | \ "Unmerged" : "═",
366 | \ "Deleted" : "✖",
367 | \ "Dirty" : "✗",
368 | \ "Clean" : "✔︎",
369 | \ 'Ignored' : '☒',
370 | \ "Unknown" : "?"
371 | \ }
372 | let NERDTreeMinimalUI = 0
373 | let NERDTreeAutoCenter = 1
374 | let NERDTreeShowHidden = 1
375 | let NERDTreeWinSize = 35
376 | let NERDTreeShowBookmarks = 1
377 | let NERDTreeChDirMode = 2
378 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++
379 |
380 |
381 |
382 | "++++++++++++++++++++++++minibufferexplore config+++++++++++++++++++
383 | let g:miniBufExplMapWindowNavVim = 1
384 | let g:miniBufExplMapWindowNavArrows = 1
385 | let g:miniBufExplMapCTabSwitchBufs = 1
386 | let g:miniBufExplModSelTarget = 1
387 | let g:miniBufExplMoreThanOne=0
388 |
389 | " MiniBufExpl Colors
390 | hi MBENormal guifg=#808080 guibg=fg
391 | hi MBEChanged guifg=#CD5907 guibg=fg
392 | hi MBEVisibleNormal guifg=#5DC2D6 guibg=fg
393 | hi MBEVisibleChanged guifg=#F1266F guibg=fg
394 | hi MBEVisibleActiveNormal guifg=#A6DB29 guibg=fg
395 | hi MBEVisibleActiveChanged guifg=#F1266F guibg=fg
396 | map :MBEbp
397 | map :MBEbn
398 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
399 |
400 |
401 |
402 | "+++++++++++++++++++++++++++++tagbar configuration++++++
403 | nmap :TagbarToggle
404 | autocmd VimEnter * nested :TagbarOpen
405 | let g:tagbar_ctags_bin = 'ctags'
406 | let g:tagbar_width = 35
407 | let g:tagbar_indent = 1
408 | let g:tagbar_iconchars = ['▶', '▼']
409 | let g:tagbar_autoshowtag = 1
410 | let g:tagbar_vertical = 18
411 | let g:tagbar_compact = 1
412 | autocmd VimEnter * wincmd l
413 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++
414 | let g:molokai_original = 1
415 | let g:rehash256 = 1
416 | colorscheme molokai
417 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++
418 |
419 | "+++++++++++++++++check trailing whitespace+++++++++++++++++++++++++++++
420 | map :FixWhitespace
421 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
422 | "++++++++++++++++++++++++rainbow vim++++++++++++++++++++++++
423 | let g:rainbow_active = 1
424 |
425 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
426 | "+++++++++++++++++++++nerdcommenter config++++++++++++++++++++++++++++++
427 | " Add spaces after comment delimiters by default
428 | let g:NERDSpaceDelims = 1
429 | " Use compact syntax for prettified multi-line comments
430 | let g:NERDCompactSexyComs = 1
431 | " Align line-wise comment delimiters flush left instead of following code" indentation
432 | let g:NERDDefaultAlign = 'left'
433 | " Allow commenting and inverting empty lines (useful when commenting a region)
434 | let g:NERDCommentEmptyLines = 1
435 | " Enable trimming of trailing whitespace when uncommenting
436 | let g:NERDTrimTrailingWhitespace = 1
437 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
438 |
439 |
440 | "++++++++++++++++++++++++++++++++fuzzy finder config+++++++++++++++++++++++
441 | " If installed using git
442 | set rtp+=~/.fzf
443 | nnoremap f :Files
444 | nnoremap b :Buffers
445 | nnoremap a :Ag
446 | function! s:fzf_statusline()
447 | " Override statusline as you like
448 | highlight fzf1 ctermfg=161 ctermbg=251
449 | highlight fzf2 ctermfg=23 ctermbg=251
450 | highlight fzf3 ctermfg=237 ctermbg=251
451 | setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
452 | endfunction
453 |
454 | autocmd! User FzfStatusLine call fzf_statusline()
455 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
456 |
457 |
458 | ""for python docstring ", 特别有用
459 | au FileType python let b:delimitMate_nesting_quotes = ['"']
460 |
461 | filetype off " required
462 |
463 | " set the runtime path to include Vundle and initialize
464 | set rtp+=~/.vim/bundle/Vundle.vim
465 | set runtimepath+=~/.vim/bundle/nvim-yarp/
466 | set runtimepath+=~/.vim/bundle/vim-hug-neovim-rpc/
467 | call vundle#begin()
468 | " " alternatively, pass a path where Vundle should install plugins
469 | " "call vundle#begin('~/some/path/here')
470 | "
471 | " " let Vundle manage Vundle, required
472 | Plugin 'VundleVim/Vundle.vim'
473 | "
474 | " " The following are examples of different formats supported.
475 | " " Keep Plugin commands between vundle#begin/end.
476 | " " plugin on GitHub repo
477 | Plugin 'tpope/vim-fugitive'
478 | " " plugin from http://vim-scripts.org/vim/scripts.html
479 | " " Plugin 'L9'
480 | " " Git plugin not hosted on GitHub
481 | " " git repos on your local machine (i.e. when working on your own plugin)
482 | "Plugin 'file:///home/gmarik/path/to/plugin'
483 | " " The sparkup vim script is in a subdirectory of this repo called vim.
484 | " " Pass the path to set the runtimepath properly.
485 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
486 | Plugin 'vim-airline/vim-airline'
487 | Plugin 'vim-airline/vim-airline-themes'
488 | Plugin 'Glench/Vim-Jinja2-Syntax'
489 | Plugin 'pearofducks/ansible-vim'
490 | Plugin 'scrooloose/nerdtree'
491 | Plugin 'ryanoasis/vim-devicons'
492 | Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
493 | Plugin 'PhilRunninger/nerdtree-visual-selection'
494 | Plugin 'KabbAmine/zeavim.vim'
495 | Plugin 'ctrlpvim/ctrlp.vim'
496 | Plugin 'majutsushi/tagbar'
497 | Plugin 'Raimondi/delimitMate'
498 | Plugin 'airblade/vim-gitgutter'
499 | Plugin 'gregsexton/gitv'
500 | Plugin 'tpope/vim-git'
501 | Plugin 'tomasr/molokai'
502 | Plugin 'neutaaaaan/iosvkem'
503 | Plugin 'bronson/vim-trailing-whitespace'
504 | Plugin 'scrooloose/nerdcommenter'
505 | Plugin 'junegunn/fzf.vim'
506 | Plugin 'mhinz/vim-startify'
507 | Plugin 'Xuyuanp/nerdtree-git-plugin'
508 | Plugin 'fholgado/minibufexpl.vim'
509 | Plugin 'terryma/vim-multiple-cursors'
510 | Plugin 'dracula/vim'
511 | Plugin 'Yggdroot/indentLine'
512 | Plugin 'vim-scripts/indentpython.vim'
513 | Plugin 'tmhedberg/SimpylFold'
514 | Plugin 'Valloric/YouCompleteMe'
515 | Plugin 'mbbill/undotree'
516 | Plugin 'w0rp/ale'
517 | Plugin 'sheerun/vim-polyglot'
518 | Plugin 'luochen1990/rainbow'
519 | Plugin 'davidhalter/jedi-vim'
520 | Plugin 'plasticboy/vim-markdown'
521 | " " Install L9 and avoid a Naming conflict if you've already installed a
522 | " " different version somewhere else.
523 | " " Plugin 'ascenator/L9', {'name': 'newL9'}
524 | ""
525 | " " All of your Plugins must be added before the following line
526 | call vundle#end() " required
527 | filetype plugin indent on " required
528 | " " To ignore plugin indent changes, instead use:
529 | " "filetype plugin on
530 | " "
531 | " " Brief help
532 | " " :PluginList - lists configured plugins
533 | " " :PluginInstall - installs plugins; append `!` to update or just
534 | " :PluginUpdate
535 | " " :PluginSearch foo - searches for foo; append `!` to refresh local cache
536 | " " :PluginClean - confirms removal of unused plugins; append `!` to
537 | " auto-approve removal
538 | " "
539 | " " see :h vundle for more details or wiki for FAQ
540 | " " Put your non-Plugin stuff after this line
541 | autocmd BufNewFile *.c,*.cpp,*.sh,*.py,*.java exec ":call SetTitle()"
542 | func SetTitle()
543 | if (&filetype == 'c' || &filetype == 'cpp')
544 | call setline(1, "/*************************************************************************")
545 | call setline(2, "\ @Author: {{ author }}")
546 | call setline(3, "\ @Created Time : ".strftime("%c"))
547 | call setline(4, "\ @File Name: ".expand("%"))
548 | call setline(5, "\ @Description:")
549 | call setline(6, "\ *\ @HostName:{{ hostname }}")
550 | call setline(7, " ************************************************************************/")
551 | call setline(8,"")
552 | endif
553 | if &filetype == 'shell'
554 | call setline(1, "\#!/bin/sh")
555 | call setline(2, "\# Author: {{ author }}")
556 | call setline(3, "\# Created Time : ".strftime("%c"))
557 | call setline(4, "\# File Name: ".expand("%"))
558 | call setline(5, "\# Description:")
559 | call setline(6, "\ *\ @HostName:{{ hostname }}")
560 | call setline(7,"")
561 | endif
562 | if &filetype == 'python'
563 | call append(0, '#!/bin/env python3.7')
564 | call append(1, '# Version: v1.0.1')
565 | call append(2, '# Filename: '.expand("%"))
566 | call append(3, '# Author: {{ author }}')
567 | call append(4, '# Description: ---')
568 | call append(5, '# HostName: {{ hostname }}')
569 | call append(6, '# Create: '.strftime("%Y-%m-%d %H:%M:%S"))
570 | " call append(9, '')
571 | endif
572 | if &filetype == 'java'
573 | call setline(1, "//coding=utf8")
574 | call setline(2, "/**")
575 | call setline(3, "\ *\ @Author: {{ author }}")
576 | call setline(4, "\ *\ @Created Time : ".strftime("%Y-%m-%d %H:%M:%S")")
577 | call setline(5, "\ *\ @File Name: ".expand("%"))
578 | call setline(6, "\ *\ @Description:")
579 | call setline(7, "\ *\ @HostName:{{ hostname }}")
580 | call setline(8, "\ */")
581 | call setline(9,"")
582 | endif
583 | endfunc
584 | autocmd BufNewfile * normal G
585 |
--------------------------------------------------------------------------------
/roles/vim/templates/Rocky8_vimrc.j2:
--------------------------------------------------------------------------------
1 | set nocompatible " be iMproved, required
2 | set number
3 | syntax on
4 | set guifont=Courier\ New:h3
5 | set t_Co=256
6 | set hlsearch
7 | set laststatus=2
8 | set backspace=2
9 | set lazyredraw
10 | set mouse=nv
11 | set guifont=DroidSansMonoForPowerlineNerdFont\ 12
12 | set pastetoggle=
13 | set autoread
14 | set shell=/bin/bash
15 | set encoding=utf-8
16 | set cursorline
17 | hi CursorLine cterm=NONE ctermbg=red ctermfg=white guibg=darkred guifg=white
18 | hi comment cterm=NONE ctermfg=green
19 |
20 | "###################vim terminal config map"
21 | map :terminal
22 |
23 | "++++++++++++++++++++++jedi-vim configuration"++++++++++++++++++++++
24 | let g:jedi#use_splits_not_buffers = "left"
25 | let g:jedi#documentation_command = "H"
26 | let g:jedi#show_call_signatures = "1"
27 | let g:jedi#max_doc_height = 30
28 | let g:jedi#smart_auto_mappings = 0
29 |
30 |
31 |
32 |
33 | "++++++++++++++++Asynchronous Lint Engine configuration++++++++++++++
34 | let g:ale_sign_column_always = 1
35 | "define the ale coin
36 | let g:ale_sign_error = '✗'
37 | let g:ale_sign_warning = '⚡'
38 | "let vim statusline combine ale
39 | let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK']
40 | let g:ale_echo_msg_error_str = 'E'
41 | let g:ale_echo_msg_warning_str = 'W'
42 | let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
43 | let g:ale_lint_on_enter = 1
44 | let g:ale_set_highlights = 0
45 | " Show 5 lines of errors (default: 10)
46 | let g:ale_list_window_size = 10
47 | " Set this. Airline will handle the rest.
48 | let g:airline#extensions#ale#enabled = 1
49 | "普通模式下,sp前往上一个错误或警告,sn前往下一个错误或警告
50 | nmap sp (ale_previous_wrap)
51 | nmap sn (ale_next_wrap)
52 | ""s触发/关闭语法检查
53 | nmap s :ALEToggle
54 | "d查看错误或警告的详细信息
55 | nmap d :ALEDetail
56 | let g:ale_linters = {
57 | \ 'python': ['pylint'],
58 | \ 'ansible': ['ansible'],
59 | \}
60 |
61 |
62 |
63 | "+++++++++++++++set config for indent++++++++++++
64 | set tabstop=2
65 | set autoindent
66 | set confirm
67 | set smartindent
68 | set shiftwidth=2
69 | "+++++++++++++++++++++vim-indent-line+++++++++++++++++
70 | let g:indentLine_color_term = 100
71 | let g:indentLine_char = '¦'
72 | let g:indentLine_concealcursor = 'inc'
73 | let g:indentLine_conceallevel = 2
74 | autocmd FIletype yaml setlocal tabstop=2 softtabstop=3 shiftwidth=2 autoindent smartindent
75 | autocmd FIletype python setlocal tabstop=4 expandtab shiftwidth=4 autoread nocompatible confirm autoindent smartindent
76 | "+++++++++++++++++++++++++++++++++++++++++++++++++++
77 | "++++++++++Airline Plugin settings++++++++++++++++++
78 | let g:airline_powerline_fonts = 1
79 | let g:airline_theme='dark'
80 | let g:airline_solarized_bg='dark'
81 | let g:airline#extensions#tabline#enabled = 1
82 | let g:airline#extensions#tabline#left_alt_sep = '+'
83 | let g:airline#extensions#tabline#formatter = 'default'
84 | "++++++++++++++++++++++++++++++++++++++++++++++++++++
85 | "height ligth cusor
86 | set bg=dark
87 | highlight CursorLine cterm=none ctermbg=236
88 | highlight CursorColumn cterm=none ctermbg=236
89 |
90 | "++++++++++++++++SimpylFold configuration ++++
91 | let g:SimpylFold_docstring_preview = 1
92 | "Enable folding
93 | set foldmethod=indent
94 | set foldlevel=99
95 | "Enable folding with the spacebar
96 | nnoremap za
97 |
98 | "++++++++++++++++undo tree configuration++++++++++++++
99 | map :UndotreeToggle
100 | set undodir=~/.undodir/
101 | set undofile
102 |
103 | "=================================================
104 | " File: plugin/undotree.vim
105 | " Description: Manage your undo history in a graph.
106 | " Author: Ming Bai
107 | " License: BSD
108 |
109 | " Avoid installing twice.
110 | if exists('g:loaded_undotree')
111 | finish
112 | endif
113 | let g:loaded_undotree = 0
114 |
115 | " At least version 7.3 with 005 patch is needed for undo branches.
116 | " Refer to https://github.com/mbbill/undotree/issues/4 for details.
117 | " Thanks kien
118 | if v:version < 703
119 | command! -n=0 -bar UndotreeToggle :echoerr "undotree.vim needs Vim version >= 7.3"
120 | finish
121 | endif
122 | if (v:version == 703 && !has("patch005"))
123 | command! -n=0 -bar UndotreeToggle :echoerr "undotree.vim needs vim7.3 with patch005 applied."
124 | finish
125 | endif
126 | let g:loaded_undotree = 1 " Signal plugin availability with a value of 1.
127 |
128 | "=================================================
129 | "Options:
130 |
131 | " Window layout
132 | " style 1
133 | " +----------+------------------------+
134 | " | | |
135 | " | | |
136 | " | undotree | |
137 | " | | |
138 | " | | |
139 | " +----------+ |
140 | " | | |
141 | " | diff | |
142 | " | | |
143 | " +----------+------------------------+
144 | " Style 2
145 | " +----------+------------------------+
146 | " | | |
147 | " | | |
148 | " | undotree | |
149 | " | | |
150 | " | | |
151 | " +----------+------------------------+
152 | " | |
153 | " | diff |
154 | " | |
155 | " +-----------------------------------+
156 | " Style 3
157 | " +------------------------+----------+
158 | " | | |
159 | " | | |
160 | " | | undotree |
161 | " | | |
162 | " | | |
163 | " | +----------+
164 | " | | |
165 | " | | diff |
166 | " | | |
167 | " +------------------------+----------+
168 | " Style 4
169 | " +-----------------------++----------+
170 | " | | |
171 | " | | |
172 | " | | undotree |
173 | " | | |
174 | " | | |
175 | " +------------------------+----------+
176 | " | |
177 | " | diff |
178 | " | |
179 | " +-----------------------------------+
180 | if !exists('g:undotree_WindowLayout')
181 | let g:undotree_WindowLayout = 1
182 | endif
183 |
184 | " e.g. using 'd' instead of 'days' to save some space.
185 | if !exists('g:undotree_ShortIndicators')
186 | let g:undotree_ShortIndicators = 0
187 | endif
188 |
189 | " undotree window width
190 | if !exists('g:undotree_SplitWidth')
191 | if g:undotree_ShortIndicators == 1
192 | let g:undotree_SplitWidth = 24
193 | else
194 | let g:undotree_SplitWidth = 30
195 | endif
196 | endif
197 |
198 | " diff window height
199 | if !exists('g:undotree_DiffpanelHeight')
200 | let g:undotree_DiffpanelHeight = 10
201 | endif
202 |
203 | " auto open diff window
204 | if !exists('g:undotree_DiffAutoOpen')
205 | let g:undotree_DiffAutoOpen = 1
206 | endif
207 |
208 | " if set, let undotree window get focus after being opened, otherwise
209 | " focus will stay in current window.
210 | if !exists('g:undotree_SetFocusWhenToggle')
211 | let g:undotree_SetFocusWhenToggle = 0
212 | endif
213 |
214 | " tree node shape.
215 | if !exists('g:undotree_TreeNodeShape')
216 | let g:undotree_TreeNodeShape = '*'
217 | endif
218 |
219 | " tree vertical shape.
220 | if !exists('g:undotree_TreeVertShape')
221 | let g:undotree_TreeVertShape = '|'
222 | endif
223 |
224 | " tree split shape.
225 | if !exists('g:undotree_TreeSplitShape')
226 | let g:undotree_TreeSplitShape = '/'
227 | endif
228 |
229 | " tree return shape.
230 | if !exists('g:undotree_TreeReturnShape')
231 | let g:undotree_TreeReturnShape = '\'
232 | endif
233 |
234 | if !exists('g:undotree_DiffCommand')
235 | let g:undotree_DiffCommand = "diff"
236 | endif
237 |
238 | " relative timestamp
239 | if !exists('g:undotree_RelativeTimestamp')
240 | let g:undotree_RelativeTimestamp = 1
241 | endif
242 |
243 | " Highlight changed text
244 | if !exists('g:undotree_HighlightChangedText')
245 | let g:undotree_HighlightChangedText = 1
246 | endif
247 |
248 | " Highlight changed text using signs in the gutter
249 | if !exists('g:undotree_HighlightChangedWithSign')
250 | let g:undotree_HighlightChangedWithSign = 1
251 | endif
252 |
253 | " Highlight linked syntax type.
254 | " You may chose your favorite through ":hi" command
255 | if !exists('g:undotree_HighlightSyntaxAdd')
256 | let g:undotree_HighlightSyntaxAdd = "DiffAdd"
257 | endif
258 | if !exists('g:undotree_HighlightSyntaxChange')
259 | let g:undotree_HighlightSyntaxChange = "DiffChange"
260 | endif
261 | if !exists('g:undotree_HighlightSyntaxDel')
262 | let g:undotree_HighlightSyntaxDel = "DiffDelete"
263 | endif
264 |
265 | " Deprecates the old style configuration.
266 | if exists('g:undotree_SplitLocation')
267 | echo "g:undotree_SplitLocation is deprecated,
268 | \ please use g:undotree_WindowLayout instead."
269 | endif
270 |
271 | " Show help line
272 | if !exists('g:undotree_HelpLine')
273 | let g:undotree_HelpLine = 1
274 | endif
275 |
276 | " Show cursorline
277 | if !exists('g:undotree_CursorLine')
278 | let g:undotree_CursorLine = 1
279 | endif
280 |
281 | "=================================================
282 | " User commands.
283 | command! -n=0 -bar UndotreeToggle :call undotree#UndotreeToggle()
284 | command! -n=0 -bar UndotreeHide :call undotree#UndotreeHide()
285 | command! -n=0 -bar UndotreeShow :call undotree#UndotreeShow()
286 | command! -n=0 -bar UndotreeFocus :call undotree#UndotreeFocus()
287 |
288 | " vim: set et fdm=marker sts=4 sw=4:
289 | "END+++++++++++++++++++++++++++++++++++++++++++++++++
290 |
291 |
292 | "+++++++++++++++YouCompleteMe configuration+++++++++++
293 | set completeopt=longest,menu
294 | let g:ycm_confirm_extra_conf=0
295 | let g:ycm_complete_in_comments = 1
296 | let g:ycm_complete_in_strings = 1
297 | let g:ycm_collect_identifiers_from_tags_files=1
298 | let g:ycm_collect_identifiers_from_comments_and_strings = 1
299 | let g:ycm_seed_identifiers_with_syntax=1
300 | let g:ycm_collect_identifiers_from_tags_files = 1
301 | let g:ycm_min_num_of_chars_for_completion=2
302 | let g:ycm_key_list_select_completion = ['']
303 | let g:ycm_key_list_previous_completion = ['']
304 | let g:ycm_confirm_extra_conf=0
305 | let g:ycm_cache_omnifunc=0
306 | let g:ycm_python_interpreter_path = '{{ ycm_python_binary_path }}'
307 | let g:ycm_python_sys_path = ['{{ ycm_python_third_party_package }}']
308 | let g:ycm_extra_conf_vim_data = [
309 | \ 'g:ycm_python_interpreter_path',
310 | \ 'g:ycm_python_sys_path'
311 | \]
312 | let g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'
313 |
314 | inoremap pumvisible() ? "\" : "\"
315 | inoremap pumvisible() ? "\" : "\"
316 | inoremap pumvisible() ? "\\\" :"\"
317 | inoremap pumvisible() ? "\\\" : "\"
318 | autocmd InsertLeave * if pumvisible() == 0|pclose|endif"
319 |
320 | "old version
321 | if !empty(glob("~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"))
322 | let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"
323 | endif
324 | " new version
325 | if !empty(glob("~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"))
326 | let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
327 | endif
328 | "mapping
329 | nmap gd :YcmDiags
330 | nnoremap gl :YcmCompleter GoToDeclaration
331 | nnoremap gf :YcmCompleter GoToDefinition
332 | nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration
333 | let g:ycm_key_invoke_completion = ''
334 | let g:ycm_filetype_blacklist = {
335 | \ 'tagbar' : 1,
336 | \ 'gitcommit' : 1,
337 | \}
338 |
339 | "+++++++++++++++++++++++++END+++++++++++++++++++++++
340 |
341 | "++++++++++++++++++ansible-vim Plugin++++++++++++++++
342 | let g:ansible_unindent_after_newline = 1
343 | let g:ansible_attribute_highlight = "b"
344 | let g:ansible_name_highlight = 'b'
345 | let g:ansible_extra_keywords_highlight = 1
346 | let g:ansible_normal_keywords_highlight = 'Constant'
347 | let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby', '*.yml': 'yaml.ansible','*.j2': 'ruby.jinja2' }
348 | au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
349 | au BufRead,BufNewFile /etc/ansible/roles/*/*/*.yml set filetype=yaml.ansible
350 | au BufRead,BufNewFile /etc/ansible/roles/*/templates/*.j2 set filetype=ruby.jinja2
351 | "++++++++++++++++++++++++++++++++++++++++++++++++++++
352 | nmap :NERDTree
353 | autocmd vimenter * NERDTree
354 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
355 | let g:NERDTreeDirArrowExpandable = '✚'
356 | let g:NERDTreeDirArrowCollapsible = '▾'
357 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
358 |
359 | "+++++++++++++++++++nerdtree configuration+++++++++++++++++
360 | let g:NERDTreeGitStatusIndicatorMapCustom = {
361 | \ "Modified" : "✹",
362 | \ "Staged" : "✚",
363 | \ "Untracked" : "✭",
364 | \ "Renamed" : "➜",
365 | \ "Unmerged" : "═",
366 | \ "Deleted" : "✖",
367 | \ "Dirty" : "✗",
368 | \ "Clean" : "✔︎",
369 | \ 'Ignored' : '☒',
370 | \ "Unknown" : "?"
371 | \ }
372 | let NERDTreeMinimalUI = 0
373 | let NERDTreeAutoCenter = 1
374 | let NERDTreeShowHidden = 1
375 | let NERDTreeWinSize = 35
376 | let NERDTreeShowBookmarks = 1
377 | let NERDTreeChDirMode = 2
378 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++
379 |
380 |
381 |
382 | "++++++++++++++++++++++++minibufferexplore config+++++++++++++++++++
383 | let g:miniBufExplMapWindowNavVim = 1
384 | let g:miniBufExplMapWindowNavArrows = 1
385 | let g:miniBufExplMapCTabSwitchBufs = 1
386 | let g:miniBufExplModSelTarget = 1
387 | let g:miniBufExplMoreThanOne=0
388 |
389 | " MiniBufExpl Colors
390 | hi MBENormal guifg=#808080 guibg=fg
391 | hi MBEChanged guifg=#CD5907 guibg=fg
392 | hi MBEVisibleNormal guifg=#5DC2D6 guibg=fg
393 | hi MBEVisibleChanged guifg=#F1266F guibg=fg
394 | hi MBEVisibleActiveNormal guifg=#A6DB29 guibg=fg
395 | hi MBEVisibleActiveChanged guifg=#F1266F guibg=fg
396 | map :MBEbp
397 | map :MBEbn
398 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
399 |
400 |
401 |
402 | "+++++++++++++++++++++++++++++tagbar configuration++++++
403 | nmap :TagbarToggle
404 | autocmd VimEnter * nested :TagbarOpen
405 | let g:tagbar_ctags_bin = 'ctags'
406 | let g:tagbar_width = 35
407 | let g:tagbar_indent = 1
408 | let g:tagbar_iconchars = ['▶', '▼']
409 | let g:tagbar_autoshowtag = 1
410 | let g:tagbar_vertical = 18
411 | let g:tagbar_compact = 1
412 | autocmd VimEnter * wincmd l
413 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++
414 | let g:molokai_original = 1
415 | let g:rehash256 = 1
416 | colorscheme molokai
417 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++
418 |
419 | "+++++++++++++++++check trailing whitespace+++++++++++++++++++++++++++++
420 | map :FixWhitespace
421 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
422 | "++++++++++++++++++++++++rainbow vim++++++++++++++++++++++++
423 | let g:rainbow_active = 1
424 |
425 | "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
426 | "+++++++++++++++++++++nerdcommenter config++++++++++++++++++++++++++++++
427 | " Add spaces after comment delimiters by default
428 | let g:NERDSpaceDelims = 1
429 | " Use compact syntax for prettified multi-line comments
430 | let g:NERDCompactSexyComs = 1
431 | " Align line-wise comment delimiters flush left instead of following code" indentation
432 | let g:NERDDefaultAlign = 'left'
433 | " Allow commenting and inverting empty lines (useful when commenting a region)
434 | let g:NERDCommentEmptyLines = 1
435 | " Enable trimming of trailing whitespace when uncommenting
436 | let g:NERDTrimTrailingWhitespace = 1
437 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
438 |
439 |
440 | "++++++++++++++++++++++++++++++++fuzzy finder config+++++++++++++++++++++++
441 | " If installed using git
442 | set rtp+=~/.fzf
443 | nnoremap f :Files
444 | nnoremap b :Buffers
445 | function! s:fzf_statusline()
446 | " Override statusline as you like
447 | highlight fzf1 ctermfg=161 ctermbg=251
448 | highlight fzf2 ctermfg=23 ctermbg=251
449 | highlight fzf3 ctermfg=237 ctermbg=251
450 | setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
451 | endfunction
452 |
453 | autocmd! User FzfStatusLine call fzf_statusline()
454 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
455 |
456 |
457 | ""for python docstring ", 特别有用
458 | au FileType python let b:delimitMate_nesting_quotes = ['"']
459 |
460 | filetype off " required
461 |
462 | " set the runtime path to include Vundle and initialize
463 | set rtp+=~/.vim/bundle/Vundle.vim
464 | set runtimepath+=~/.vim/bundle/nvim-yarp/
465 | set runtimepath+=~/.vim/bundle/vim-hug-neovim-rpc/
466 | call vundle#begin()
467 | " " alternatively, pass a path where Vundle should install plugins
468 | " "call vundle#begin('~/some/path/here')
469 | "
470 | " " let Vundle manage Vundle, required
471 | Plugin 'VundleVim/Vundle.vim'
472 | "
473 | " " The following are examples of different formats supported.
474 | " " Keep Plugin commands between vundle#begin/end.
475 | " " plugin on GitHub repo
476 | Plugin 'tpope/vim-fugitive'
477 | " " plugin from http://vim-scripts.org/vim/scripts.html
478 | " " Plugin 'L9'
479 | " " Git plugin not hosted on GitHub
480 | " " git repos on your local machine (i.e. when working on your own plugin)
481 | "Plugin 'file:///home/gmarik/path/to/plugin'
482 | " " The sparkup vim script is in a subdirectory of this repo called vim.
483 | " " Pass the path to set the runtimepath properly.
484 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
485 | Plugin 'vim-airline/vim-airline'
486 | Plugin 'vim-airline/vim-airline-themes'
487 | Plugin 'Glench/Vim-Jinja2-Syntax'
488 | Plugin 'pearofducks/ansible-vim'
489 | Plugin 'scrooloose/nerdtree'
490 | Plugin 'ryanoasis/vim-devicons'
491 | Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
492 | Plugin 'PhilRunninger/nerdtree-visual-selection'
493 | Plugin 'KabbAmine/zeavim.vim'
494 | Plugin 'ctrlpvim/ctrlp.vim'
495 | Plugin 'majutsushi/tagbar'
496 | Plugin 'Raimondi/delimitMate'
497 | Plugin 'airblade/vim-gitgutter'
498 | Plugin 'gregsexton/gitv'
499 | Plugin 'tpope/vim-git'
500 | Plugin 'tomasr/molokai'
501 | Plugin 'neutaaaaan/iosvkem'
502 | Plugin 'bronson/vim-trailing-whitespace'
503 | Plugin 'scrooloose/nerdcommenter'
504 | Plugin 'junegunn/fzf.vim'
505 | Plugin 'mhinz/vim-startify'
506 | Plugin 'Xuyuanp/nerdtree-git-plugin'
507 | Plugin 'fholgado/minibufexpl.vim'
508 | Plugin 'terryma/vim-multiple-cursors'
509 | Plugin 'dracula/vim'
510 | Plugin 'Yggdroot/indentLine'
511 | Plugin 'vim-scripts/indentpython.vim'
512 | Plugin 'tmhedberg/SimpylFold'
513 | Plugin 'Valloric/YouCompleteMe'
514 | Plugin 'mbbill/undotree'
515 | Plugin 'w0rp/ale'
516 | Plugin 'sheerun/vim-polyglot'
517 | Plugin 'luochen1990/rainbow'
518 | Plugin 'davidhalter/jedi-vim'
519 | Plugin 'plasticboy/vim-markdown'
520 | " " Install L9 and avoid a Naming conflict if you've already installed a
521 | " " different version somewhere else.
522 | " " Plugin 'ascenator/L9', {'name': 'newL9'}
523 | ""
524 | " " All of your Plugins must be added before the following line
525 | call vundle#end() " required
526 | filetype plugin indent on " required
527 | " " To ignore plugin indent changes, instead use:
528 | " "filetype plugin on
529 | " "
530 | " " Brief help
531 | " " :PluginList - lists configured plugins
532 | " " :PluginInstall - installs plugins; append `!` to update or just
533 | " :PluginUpdate
534 | " " :PluginSearch foo - searches for foo; append `!` to refresh local cache
535 | " " :PluginClean - confirms removal of unused plugins; append `!` to
536 | " auto-approve removal
537 | " "
538 | " " see :h vundle for more details or wiki for FAQ
539 | " " Put your non-Plugin stuff after this line
540 | autocmd BufNewFile *.c,*.cpp,*.sh,*.py,*.java exec ":call SetTitle()"
541 | func SetTitle()
542 | if (&filetype == 'c' || &filetype == 'cpp')
543 | call setline(1, "/*************************************************************************")
544 | call setline(2, "\ @Author: {{ author }}")
545 | call setline(3, "\ @Created Time : ".strftime("%c"))
546 | call setline(4, "\ @File Name: ".expand("%"))
547 | call setline(5, "\ @Description:")
548 | call setline(6, "\ *\ @HostName:{{ hostname }}")
549 | call setline(7, " ************************************************************************/")
550 | call setline(8,"")
551 | endif
552 | if &filetype == 'shell'
553 | call setline(1, "\#!/bin/sh")
554 | call setline(2, "\# Author: {{ author }}")
555 | call setline(3, "\# Created Time : ".strftime("%c"))
556 | call setline(4, "\# File Name: ".expand("%"))
557 | call setline(5, "\# Description:")
558 | call setline(6, "\ *\ @HostName:{{ hostname }}")
559 | call setline(7,"")
560 | endif
561 | if &filetype == 'python'
562 | call append(0, '#!/bin/env python3.7')
563 | call append(1, '# Version: v1.0.1')
564 | call append(2, '# Filename: '.expand("%"))
565 | call append(3, '# Author: {{ author }}')
566 | call append(4, '# Description: ---')
567 | call append(5, '# HostName: {{ hostname }}')
568 | call append(6, '# Create: '.strftime("%Y-%m-%d %H:%M:%S"))
569 | " call append(9, '')
570 | endif
571 | if &filetype == 'java'
572 | call setline(1, "//coding=utf8")
573 | call setline(2, "/**")
574 | call setline(3, "\ *\ @Author: {{ author }}")
575 | call setline(4, "\ *\ @Created Time : ".strftime("%Y-%m-%d %H:%M:%S")")
576 | call setline(5, "\ *\ @File Name: ".expand("%"))
577 | call setline(6, "\ *\ @Description:")
578 | call setline(7, "\ *\ @HostName:{{ hostname }}")
579 | call setline(8, "\ */")
580 | call setline(9,"")
581 | endif
582 | endfunc
583 | autocmd BufNewfile * normal G
584 |
--------------------------------------------------------------------------------
/roles/vim/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/vim/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | remote_user: root
4 | roles:
5 | - vim
--------------------------------------------------------------------------------
/roles/vim/vars/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # vars file for vim
--------------------------------------------------------------------------------
/tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4 | !_TAG_PROGRAM_NAME Exuberant Ctags //
5 | !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6 | !_TAG_PROGRAM_VERSION 5.8 //
7 | Settings roles/vim/files/global_extra_conf.py /^def Settings( **kwargs ):$/;" f
8 |
--------------------------------------------------------------------------------
/update_plugin.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: vimide
3 | tasks:
4 | - name: 更新vim plugin
5 | shell: vim +PluginUpdate +qall
6 |
--------------------------------------------------------------------------------
/vim-ide.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: vimide
3 | roles:
4 | - {role: vim,when: ansible_os_family == 'RedHat'}
5 |
--------------------------------------------------------------------------------