~hristoast/hristoast

hristoast/site/using-gui-emacs-editor-ansible-vault-fish-shell.html -rw-r--r-- 892 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<h1 id="title">Using GUI Emacs as an editor for ansible-vault with fish-shell</h1>

<div id="dates">
  <span>Posted: <time id="post-date">2017-11-23</time></span>
</div>

<p>
  If you didn't know, <a href="http://docs.ansible.com/ansible/latest/playbooks_vault.html"><code>ansible-vault</code></a> is a nifty tool that lets you encrypt things for use with Ansible.  For some reason that I've not yet discovered, <code>ansible-vault</code> doesn't care if you've <code>set EDITOR /usr/bin/emacs</code> in your <code>fish.config</code>.  To work around this, I use the following alias function:
</p>

<pre><code>function ansible-vault
	bash -c "EDITOR=/usr/bin/emacs \$(which ansible-vault) $argv"
end</pre></code>

<p>
  With this I can use <code>ansible-vault</code> and it works like I expect it to (that is, it uses the editor I've defined as <code>$EDITOR</code>.)  Happy encrypting!
</p>