Tuesday, August 18, 2009

Re: Automatically formatting (adding spaces)

On 17/08/09 12:08, visiondude wrote:
>
>> nnoremap<f6> :%!astyle<Enter><C-o>
>
> OK, but this will reformat the entire file at once. However, I need to
> reformat only a single function, or any block of selected code. As
> mentioned earlier, the solution with equalprg works for me, the
> strange behavior on one single line of code without selection is not a
> real issue.

What about something on the lines of

:vnoremap <F6> :!astyle<CR><C-O>

? IIUC, Vim should insert :'<,'>! when the mapping is executed (not
defined) -- if it doesn't, use trial and error.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
103. When you find yourself in the "Computer" section of Barnes & Noble
enjoying yourself.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments:

Post a Comment