Yaml ansible项目的ctags
我正在尝试通过从我的ansible项目生成标记。但它仍然没有选择正确的条件。下面是我的同事。我错过了什么?成功运行后,我希望有一个包含所有任务名称的。/.tags文件。我正在使用来自的ctags 5.8 顺便说一句,我从这里开始-- 命令:Yaml ansible项目的ctags,yaml,ansible,exuberant-ctags,Yaml,Ansible,Exuberant Ctags,我正在尝试通过从我的ansible项目生成标记。但它仍然没有选择正确的条件。下面是我的同事。我错过了什么?成功运行后,我希望有一个包含所有任务名称的。/.tags文件。我正在使用来自的ctags 5.8 顺便说一句,我从这里开始-- 命令:/usr/local/ceral/ctags/5.8\u 1/bin/ctags-f.tags-recurse. ./.ctags 示例任务文件 我不坚持CTAG。我的目标是为Atom编辑器提供符号,我可以使用这些符号快速浏览我的Ansible项目。恢复到链
/usr/local/ceral/ctags/5.8\u 1/bin/ctags-f.tags-recurse.
./.ctags
示例任务文件
我不坚持CTAG。我的目标是为Atom编辑器提供符号,我可以使用这些符号快速浏览我的Ansible项目。恢复到链接页面上的示例,使其正常工作。我想我在从自制软件安装ctags之前做了一些不必要的更改,
ctags
命令有许多不同的实现
使用GNU Emacs提供的ctags
,我在以下方面取得了成功:
ctags--language=none--regex='^[\t]*-[\t]*名称:[\t]*\(.*?\)[\t]*$'*.yml角色/*/tasks/*.yml角色/*/handlers/*.yml
这也适用于。通用ctags具有内置(但不完整)的ansible playbook支持
[jet@localhost]~/var/ctags% cat foo.yml
---
- name: install docker-py
pip: name=docker-py version=1.7.2
become: yes
- name: Install tmux
yum:
name: tmux
state: present
update_cache: yes
become: yes
[jet@localhost]~/var/ctags% ./ctags --version
Universal Ctags 0.0.0(5567535e), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 26 2017, 04:24:17
URL: https://ctags.io/
Optional compiled features: +wildcards, +regex, +multibyte, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +aspell
[jet@localhost]~/var/ctags% ./ctags --fields=+Kl -o - foo.yml
Install tmux foo.yml /^- name: Install tmux$/;" play language:AnsiblePlaybook
install docker-py foo.yml /^- name: install docker-py$/;" play language:AnsiblePlaybook
---
- name: install docker-py
pip: name=docker-py version=1.7.2
become: yes
- name: Install tmux
yum:
name: tmux
state: present
update_cache: yes
become: yes
[jet@localhost]~/var/ctags% cat foo.yml
---
- name: install docker-py
pip: name=docker-py version=1.7.2
become: yes
- name: Install tmux
yum:
name: tmux
state: present
update_cache: yes
become: yes
[jet@localhost]~/var/ctags% ./ctags --version
Universal Ctags 0.0.0(5567535e), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 26 2017, 04:24:17
URL: https://ctags.io/
Optional compiled features: +wildcards, +regex, +multibyte, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +aspell
[jet@localhost]~/var/ctags% ./ctags --fields=+Kl -o - foo.yml
Install tmux foo.yml /^- name: Install tmux$/;" play language:AnsiblePlaybook
install docker-py foo.yml /^- name: install docker-py$/;" play language:AnsiblePlaybook