Closed Itto1992 closed 2 years ago
If you don't need to prompt, you can set default value like below.
let g:sonictemplate_vim_vars = {
\ 'python': {
\ 'variable_name': 'default value',
\ },
\}
If you want the prompt, please try https://github.com/mattn/vim-sonictemplate/pull/59
{{_input_:name:default value}}
In your use-case, it should be
for {{_input_:variable_name:ii}} in range(N):
@mattn I just tried #59. This is exactly what I wanted! Thank you for your super quick work!
Thank you
English
How can I set a default value for
{{_input_}}
? In other words, when asked to type{{_input_}}
, is there any way to input the default value by just typing enter key?For example, I made the following snippet for python loop.
In most cases, I use
i
as a cursor. However, in some cases, e.g., making a double loop, I want to use another cursor such asj
. Thus, I want{{_input_:i}}
to filli
by default and want to fill it if I needed. Is there any way to do this? Thank you in advance.日本語
{{_input_}}
オプションを使うにあたってデフォルト値の設定は可能ですか? 例えば、ほとんどのケースではデフォルト値でよいが、特定のケースではカスタマイズした値を入れたいと言った場合に、デフォルト値をエンターキーを押すだけといった簡単な動作で達成できるとうれしいです。