i'm writing custom function in vim asks user rename current file to:
let b:newname = input('rename to: ', expand('%')) it prepopulates input field filename such examplefile.php. position cursor before . more not, users renaming file opposed extension.
however, cannot figure out way move cursor. <left><left><left> suffice if work
you can insert special keys in double quote string \<xxx>. check expr-quote. concatenate string:
let b:newname = input('rename to: ', expand('%') . "\<left>\<left>\<left>\<left>")
Comments
Post a Comment