drmingdrmer / xptemplate

Code snippets engine for Vim, with snippets library. XPTemplate let you write codes in a smooth, quick and comfortable way.
http://www.vim.org/scripts/script.php?script_id=2611
315 stars 41 forks source link

Unable to get example template 'skeleton' to work #100

Open ModernTrollfare opened 1 year ago

ModernTrollfare commented 1 year ago

Issue: Snippet generated by 'skeleton' is not loaded by xptemplate after a :XPTreload.

Steps taken:

  1. Write a new file using template skeleton.
    " Save this file as ~/.vim/ftplugin/c/hello.xpt.vim(or
    " ~/vimfiles/ftplugin/c/hello.xpt.vim).
    " Then you can use it in C language file:
    "     vim xpt.c
    " And type:
    "     helloxpt<C-\>
    "
    XPT helloxpt " tips about what this snippet do
    Say hello to `xpt^.
    `xpt^ says hello.
  2. Following the above instructions, Save the file to ~/.vim/ftplugin/c/hello.xpt.vim.
  3. Run :XPTreload.
  4. in a .h file, type helloxpt then press <C->.

Expected results: Observe template 'helloxpt' being generated.

Outcome: Observe helloxpt\^ in the .h file.

Alternative steps taken: Place the file in an alternative path present in runtimepath; e.g.: /path/in/runtimepath/ftplugin/c/hello.xpt.vim

Outcome: Again, no template is being generated.

At the time of failure, I have used Date<C-\> as a sanity test and the date is shown as expected.

Can advise if there's anything wrong with the above steps, or is there a bug somewhere?

drmingdrmer commented 1 year ago

Can you see your script is loaded correctly with :scriptnames?

There should be line like:

...
233: ~/.vim/ftplugin/c/hello.xpt.vim
...