How do you record a macro that inserts a date stamp?
qaA <C-r>=strftime('%Y-%m-%d')\n<Esc>jq
Record a macro that appends a date stamp using the expression register with strftime().
189 results for ""+y"
qaA <C-r>=strftime('%Y-%m-%d')\n<Esc>jq
Record a macro that appends a date stamp using the expression register with strftime().
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
<C-y>
The command scrolls the window up one line at a time while keeping the cursor position fixed.
y (in visual mode)
In visual mode, pressing y yanks (copies) the selected text into the default register.
"+y and "+p
The "+ register is linked to the system clipboard.
y/\V<C-r>"<CR>
By yanking a visual selection and pasting it into the search prompt with \V (very nomagic), you can search for exact text including special characters.
"=strftime('%Y-%m-%d %H:%M')<CR>p
The expression register lets you evaluate Vimscript on demand and paste the result immediately.
registers #registers #expression-register #automation #timestamps
y/<C-r>"<CR>
To search for the exact text you have selected in visual mode, yank it and paste it into the search prompt.
:set cedit=<C-y>
Vim's command-line window is invaluable for editing long : commands, search patterns, and complex substitutions with normal-mode tools.
<C-r>=strftime('%Y-%m-%d')<CR>
The expression register ("=) lets you evaluate any Vimscript expression and insert its result inline.
registers #registers #insert-mode #expression-register #dates
:g/pattern/y A
The :g/pattern/y A command yanks every line matching the pattern and appends it to register a.
command-line #command-line #registers #global #ex-commands #filtering
y/{pattern}<CR>
Any operator in Vim can take a search motion as its argument.
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
<C-y> and <C-e>
In Insert mode, copies the character at the same column position from the line above the cursor, and copies the character from the line below.
:put =strftime('%Y-%m-%d')
The :put = command inserts the result of a Vimscript expression directly into the buffer as a new line.
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.
:set statusline=%f\ %y\ [%l/%L]
Vim's statusline option lets you build a custom status bar from format items.
<C-e> / <C-y> (insert mode)
In insert mode, copies the character directly below the cursor (from the next line) and copies the character directly above (from the previous line).
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.