Wikia

Vim Tips Wiki

Changes: Script:2611

Edit

Back to page

(format)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 5: Line 5:
   
 
Quoth from the XPT help (xptemplate.txt):
 
Quoth from the XPT help (xptemplate.txt):
:'''NOTE''' with some European keyboards <tt>&lt;C-\&gt;</tt> does NOT work.
+
:'''NOTE''' with some European keyboards <code>&lt;C-\&gt;</code> does NOT work.
 
:In this case you need to specify another key to trigger snippets.
 
:In this case you need to specify another key to trigger snippets.
   
 
For some reason, I had to change xptemplate.conf.vim:
 
For some reason, I had to change xptemplate.conf.vim:
:<tt>call XPT#setIfNotExist('g:xptemplate_key' , '&lt;''new_key''&gt;' )</tt>
+
:<code>call XPT#setIfNotExist('g:xptemplate_key' , '&lt;''new_key''&gt;' )</code>
:<tt>call XPT#setIfNotExist('g:xptemplate_key_pum_only' , '&lt;S-''new_key''&gt;')</tt>
+
:<code>call XPT#setIfNotExist('g:xptemplate_key_pum_only' , '&lt;S-''new_key''&gt;')</code>
   
 
It was not enough to change the keys within my vimrc file or at runtime like this:
 
It was not enough to change the keys within my vimrc file or at runtime like this:
:<tt>let g:xptemplate_key = '&lt;''new_key''&gt;'</tt>
+
:<code>let g:xptemplate_key = '&lt;''new_key''&gt;'</code>
:<tt>let g:xptemplate_key_pum_only = '&lt;S-''new_key''&gt;'</tt>
+
:<code>let g:xptemplate_key_pum_only = '&lt;S-''new_key''&gt;'</code>
 
Cheers, Oliver May 23, 2010
 
Cheers, Oliver May 23, 2010
   

Latest revision as of 09:45, July 14, 2012

Use this page to discuss script 2611 xptemplate: snippet template engine

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

How to change key bindings to trigger snippetsEdit

Script version: 0.4.8-r852

Quoth from the XPT help (xptemplate.txt):

NOTE with some European keyboards <C-\> does NOT work.
In this case you need to specify another key to trigger snippets.

For some reason, I had to change xptemplate.conf.vim:

call XPT#setIfNotExist('g:xptemplate_key' , '<new_key>' )
call XPT#setIfNotExist('g:xptemplate_key_pum_only' , '<S-new_key>')

It was not enough to change the keys within my vimrc file or at runtime like this:

let g:xptemplate_key = '<new_key>'
let g:xptemplate_key_pum_only = '<S-new_key>'

Cheers, Oliver May 23, 2010

CommentsEdit

Is this xptemplate plugin support java? How can I get below code after I use the key <C-\>? My file name is 'TestXptemplate.java'.

1.
public class 'TestXptemplate{
    cursor
}

Remark: the TestXptemplate should be appeared automatically.

2.
System.out.println(); or System.out.print();

3.
Can you get the i++ correctly after typing the 'for<C-\>'?
what I got is for(i=0;i<len;++i), it's not my purpose.

--February 4, 2012


Around Wikia's network

Random Wiki