![]() Other 'put' commands may be more useful for you: :help p :help P :help gp :help gP In the example above, the uppercase P at the end inserts before the current character, which allows datestamps inserted at the beginning of an existing line. Press F5 in normal mode or in insert mode to insert the current datestamp: :help i_CTRL-R :nnoremap "=strftime("%c")P To store the return value of the function, the "= register ( :help "=) is used. Quotation marks have to be escaped in this usage so as not to terminate the line because a quote starts a comment. This will enter something like the following in your file buffer: To insert a timestamp in the default strftime format "%c", type either of the following commands: Most systems support strftime(), but some don't. Vim's internal strftime() function ( :help strftime()) returns a date/time string formatted in a way you specify with a format string. ![]() 1.1 Some strftime() format string examples.
0 Comments
Leave a Reply. |