0

I am using Neocomplete and vdav/chef-vim plugin to write chef code using a snippet. I see the following snippet:

 # Template resource
template "/path/to/file" do # Path to the file
  <`2:#`>cookbook <`3:nil`> # Specify the cookbook where the template is located, default is current cookbook
  <`4:#`>source <`5:nil`> # Template source file. Found in templates/default for the cookbook
  <`6:#`>variables <`7`> # Variables to use in the template
  <`8:#`>local <`9:false`> # Is the template already present on the node?
  <`10:#`>backup <`11:5`> # How many backups of this file to keep. Set to false if you want no backups.
  <`12:#`>owner <`13`> # The owner for the file
  <`14:#`>group <`15`> # The group owner of the file (string or id)
  <`16:#`>mode <`17`> # The octal mode of the file (4-digit format)
  <`18:#`>content <`19:nil`> # A string to write to the file. This will replace any previous content if set

  <`20:#`><`21:action :create`> # Create the file (Default)
  <`22:#`><`23:action :delete`> # Delete this file
  <`24:#`><`0:action :touch`> # Touch this file (update the mtime/atime)
end

The code snippet however should have been as follows:

# Template resource
template "/path/to/file" do # Path to the file
  cookbook nil # Specify the cookbook where the template is located, default is current cookbook
  source nil # Template source file. Found in templates/default for the cookbook
  variables  # Variables to use in the template
  local false # Is the template already present on the node?
  backup 5 # How many backups of this file to keep. Set to false if you want no backups.
  owner  # The owner for the file
  group  # The group owner of the file (string or id)
  mode  # The octal mode of the file (4-digit format)
  content nil # A string to write to the file. This will replace any previous content if set

  action :create # Create the file (Default)
  action :delete # Delete this file
  action :touch # Touch this file (update the mtime/atime)
end

How do I remove this additional symbolic <#> text <#:text> text generated in Vim?

I tried using nnoremap :let _s=@/:%s/\s+$//e:let @/=_s to remove it, however it did not help. May be I am not doing it correctly too.

My .vimrc and .vimrc.local can be found here.

1 Answer 1

1

You can do

:%s/<[^>]*>//g

If you want to use it multiple times make a map for it like

nnoremap g<space> :%s/<[^>]*>//g<CR>

So you can use it by pressing g (you can change that of course)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.