Re: autocmds general usage

"D. Ben Knoble" <[email protected]> Fri, 3 Apr 2026 09:14:34 -0700 (PDT)
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
------=_Part_246488_241248038.1775232874458
Content-Type: multipart/alternative; 
	boundary="----=_Part_246489_1003322397.1775232874458"

------=_Part_246489_1003322397.1775232874458
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wednesday, April 1, 2026 at 10:43:09=E2=80=AFAM UTC-4 Christopher wrote:

I have a general question about *autocmd*, how can I use it without always=
=20
having invoke it by using ":" then loading the appropriate commands then=20
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=
=20
':'", etc.?), but:

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

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

--=20
--=20
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

---=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/75d=
80253-9b2f-414c-af30-6b8909714b86n%40googlegroups.com.

------=_Part_246489_1003322397.1775232874458
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div><div dir=3D"auto">On Wednesday, April 1, 2026 at 10:43:09=E2=80=AFAM U=
TC-4 Christopher wrote:<br /></div><blockquote style=3D"margin: 0px 0px 0px=
 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div=
>I have a general question about <i>autocmd</i>, how can I use it without a=
lways having invoke it by using ":" then loading the appropriate commands t=
hen finally the file to which I want it to apply or must I script it ?</div=
></blockquote><div><br /></div><div>I don't understand the question (what d=
o you mean "use it" without "using ':'", etc.?), but:</div><div><br /></div=
><div>The typical practice for autocommands is to put them in your vimrc (~=
/.vim/vimrc, etc.) or a local plugin (~/.vim/plugin/&lt;name&gt;.vim) so th=
ey are established during startup.</div><div><br /></div><div>Some customiz=
ations don't required autocommands, though: if you're customizing the behav=
ior of a particular filetype, then use an ftplugin, indent, or syntax scrip=
t. (Or your filetype may already have knobs to tweak; see `:help :syn-file-=
remarks`, `:help ftplugin-docs`, `:help local-additions`, etc. Completing w=
ith `:help ft-&lt;filetype&gt;&lt;Ctrl-d&gt;` is usually good too.)</div></=
div>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_use&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_use&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_use+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_use/75d80253-9b2f-414c-af30-6b8909714b86n%40googlegroups.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/75d=
80253-9b2f-414c-af30-6b8909714b86n%40googlegroups.com</a>.<br />

------=_Part_246489_1003322397.1775232874458--

------=_Part_246488_241248038.1775232874458--