andreyorst / smarttab.kak

Automatic handling different styles of indentation and alignment.
MIT License
62 stars 4 forks source link

How to set default mode? #13

Closed bound-variable closed 2 years ago

bound-variable commented 2 years ago

I understand that this plugin provides commands. I can run these commands manually from within a Kakoune buffer. But how do I set one of the commands in my kakrc so it becomes the default? For example, I added expandtab at the end of my kakrc, but it didn't work. Also, I don't think I can set expandtab as an option a la, set-option global expandtab. So how can I do it?

Thanks

andreyorst commented 2 years ago

all these commands operate on a buffer level, so you need a hook that will run on each new buffer. Probably something like this should do:

hook global BufOpenFile .* expandtab
hook global BufNewFile  .* expandtab
bound-variable commented 2 years ago

Yes, that works, at least on my initial attempt.

Thanks