You are not logged in.
I'm trying to create a macro that cuts the text from the current line up to the beginning of the file and then outputs it to a new file with a name that I will provide, keeping the window without the yanked text open. So like this:
Top half of file
cursor_here
--------------------
bottom half of fileI type in <leader>S and then the Top half of file will be removed and then I would type in the name of the new file and Top half of file would be placed in that file, but only the file with bottom half of file would be opened. Hopefully this makes sense.
I've got this set up that will yank the text, and output it to a file, but it won't delete the text.
:nnoremap <leader>S ma gg mb :'a,'bwI can't put g'a d'b after it, because I need to type in the filename obviously. How could I change this macro to get it to work like I want?
Edit: Got it to work with some help from #vim on irc
:nnoremap <leader>S :1,!cat > Last edited by bslackr (2013-01-15 01:07:52)
Offline