On Fri, Sep 11, 2009 at 07:39:09AM -0700, Joseph Boiteau wrote:
> I would like to use the reindenting functionality (ie: "gg=G") based
> on vim indent files, but without getting into vim..

If I interpret this correctly, you seem to want to use vim commands
outside of interactive vim?

> I recently discover /usr/share/vim/vim72/macros/less.sh, which use the
> vim power to make a less-like command with syntax highlighting.
> I'm pretty sure the same is possible to reindent any source file.

I  played  with the old vimsh vimscript-from-commandline a while  ago.
The experimental results are at

http://www.vim.org/scripts/script.php?script_id=2768

Seems  to  work  for me, except for a bug I don't understand  at  all:
printing  commands  (seen  with  g//p)  don't  seem  to  allow  proper
redirection  to  a register and kind of spew their output on  the  tty
plus  variable  plus excess white-space. So use :w or echo  to  "sane"
generate output.

Just  tested:  While vim still has excess tty interaction  and  screen
blanking, I actually managed to run the vimscript even from a cronjob,
"35  12 * * * vimscript.range 13 15" did work and correctly replied by
email with "13 14 15", much to my surprise: 

  1:0 for headless vim against jakobi :)

  #!/usr/bin/env vimscript
  # vimscript.range - trivial example to count from $1 to $2

  if $ARG0<2 | echo "Usage: ".expand("%:t")." fromNr toNr" | return | endif
  let nr=$ARG1+0 
  while nr <= $ARG2+0
     echon nr.' '
     let nr=nr+1
  endwhile 
  echo ''


-- 
cu
Peter l Jakobi
[email protected]

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

Reply via email to