Files
my-nvim/after/ftplugin/yaml_ansible.lua
T

26 lines
663 B
Lua

-- update this configuration of nvim-surround
-- to handle {{ }} structure in ansible
-- I want to be able to add and delete those braces
local surround = require('nvim-surround')
surround.buffer_setup({
surrounds = {
['v'] = {
add = { '{{ ', ' }}' },
find = '{{[^}]-}}',
delete = '({{%s+)().+(%s+}})()$',
}
}
})
local ansible_paths = {}
local fname = vim.api.nvim_buf_get_name(0)
if fname:find('tasks/') then
ansible_paths = {
vim.fs.dirname(fname:gsub('tasks', 'files')),
vim.fs.dirname(fname:gsub('tasks', 'templates'))
}
end
vim.bo.path = table.concat(ansible_paths, ',')