Skip to main content
deleted 51 characters in body
Source Link
nobe4
  • 16.3k
  • 4
  • 50
  • 83

I have created some indentation commands like set shiftwidth=4 set autoindentset shiftwidth=4, set autoindent and so on.... in my .vimrc file atin my home folder and I'm able to get new files autoindentedauto-indented happily.
What

What I want to know is if there is some script or way to indent existing file as per a particulatparticular indentation (say indentation script written by me (.vimrc) or default indentation standard for a particular extension that vim is intelligent enough to do.... ) 

The existing file has no consistent indentation used. Hope the question is clear.

I have created some indentation commands like set shiftwidth=4 set autoindent and so on.... in .vimrc file at home folder and able to get new files autoindented happily.
What I want to know is some script or way to indent existing file as per a particulat indentation (say indentation script written by me (.vimrc) or default indentation standard for a particular extension that vim is intelligent enough to do.... ) The existing file has no consistent indentation used. Hope the question is clear.

I have created some indentation commands like set shiftwidth=4, set autoindent and so on.... in my .vimrc file in my home folder and I'm able to get new files auto-indented happily.

What I want to know is if there is some script or way to indent existing file as per a particular indentation (say indentation script written by me (.vimrc) or default indentation standard for a particular extension that vim is intelligent enough to do.... ) 

The existing file has no consistent indentation used. Hope the question is clear.

Source Link

indent an existing unindented file as per some indentation commands supposedly written for autoindenting new files

I have created some indentation commands like set shiftwidth=4 set autoindent and so on.... in .vimrc file at home folder and able to get new files autoindented happily.
What I want to know is some script or way to indent existing file as per a particulat indentation (say indentation script written by me (.vimrc) or default indentation standard for a particular extension that vim is intelligent enough to do.... ) The existing file has no consistent indentation used. Hope the question is clear.