michaeljsmith / vim-indent-object

Vim plugin that defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts, etc.
http://www.vim.org/scripts/script.php?script_id=3037
MIT License
735 stars 61 forks source link

sort a indent file #7

Open juanpabloaj opened 12 years ago

juanpabloaj commented 12 years ago

I use indent-object for sort a block of indent files (css, python) with this map

   nmap <Leader>ss vii!sort<cr>

example, in a css file

  width:100px;
  height:100px;

<leader>ss

  height:100px;
  width:100px;

but how I can sort a complete file ? example:

 footer {
        width:100px;
        height:100px;
 }
 body {
        color: #000;
 }

to

 body {
        color: #000;
 }
 footer {
        height:100px;
        width:100px;
 }
michaeljsmith commented 12 years ago

Hi Juan,

I'm afraid I'm not aware of any way to use sort to do this. Seems like you need some kind of sort command that works on whole subsections of files - perhaps with folds.

Sounds like an idea for another plugin :)

On 13 February 2012 04:12, JuanPablo reply@reply.github.com wrote:

I use indent-object for sort a block of indent files (css, python) with this map

      nmap ss vii!sort

example, in  a css file

     width:100px;      height:100px;

<leader>ss

     height:100px;      width:100px;

but how I can sort a complete file ? example:

    footer {            width:100px;            height:100px;     }     body {            color: #000;     }

to

    body {            color: #000;     }     footer {            height:100px;            width:100px;     }


Reply to this email directly or view it on GitHub: https://github.com/michaeljsmith/vim-indent-object/issues/7