Friday, April 3, 2026

Re: autocmds general usage

On Wednesday, April 1, 2026 at 10:43:09 AM UTC-4 Christopher wrote:
I have a general question about autocmd, how can I use it without always having invoke it by using ":" then loading the appropriate commands then finally the file to which I want it to apply or must I script it ?

I don't understand the question (what do you mean "use it" without "using ':'", etc.?), but:

The typical practice for autocommands is to put them in your vimrc (~/.vim/vimrc, etc.) or a local plugin (~/.vim/plugin/<name>.vim) so they are established during startup.

Some customizations don't required autocommands, though: if you're customizing the behavior of a particular filetype, then use an ftplugin, indent, or syntax script. (Or your filetype may already have knobs to tweak; see `:help :syn-file-remarks`, `:help ftplugin-docs`, `:help local-additions`, etc. Completing with `:help ft-<filetype><Ctrl-d>` is usually good too.)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/75d80253-9b2f-414c-af30-6b8909714b86n%40googlegroups.com.

No comments: