Insert current line

2 Points

Romain Lafourcade Romain Lafourcade

3 years ago

Like <C-r><C-w> but for the line under the cursor.

cnoremap <C-r><C-l> <C-r>=getline('.')<CR>

Sérgio Luiz Araújo Silva

Sérgio Luiz Araújo Silva 1 year ago

My contribution:

nnoremap <leader>c :<C-r>=getline('.')<CR>

even in normal mode insert current line in command line

Antoine Snyers

Antoine Snyers 6 months ago

Similar idea if you are going to execute the line as-is anyway

nnoremap <leader>:: Y:@"<cr> nnoremap <leader>:; dd:@"<cr>