ciaranm / detectindent

Vim script for automatically detecting indent settings
173 stars 48 forks source link

Auto run on file open #10

Closed jgallen23 closed 13 years ago

jgallen23 commented 13 years ago

I want to auto run detectindent when I open a file. It would be nice to have an option that I can pass for it to auto load. Is there a command I can put in my .vimrc to get this working until then?

ciaranm commented 13 years ago

You can do this using an autocmd, :help autocmd.txt . I don't think this is something that should be built in to the script, since Vim already has a generic mechanism for this kind of thing.

arsane commented 12 years ago

I think it's better to add to the doc, so the user can do the autocmd like:

autocmd BufRead * DetectIndent

ciaranm commented 12 years ago

Individual plugins shouldn't be covering basic Vim functionality in their docs.

xaviervalarino commented 8 years ago

@ciaranm for what its worth, I found this ticket to be very helpful as someone who is new to Vim and was unaware of this built-in functionality.