Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h1>Filetype Plugin</h1> <p>This is what you're probably looking for, and is a very neat approach. You'll need to set <code>filetype plugin on</code> in your vimrc to get this to work. A file must then be created at <code>~/.vim/ftplugin/&lt;language&gt;.vim</code> which will be loaded automatically for any buffers using that language.</p> <p>For example, instead of writing your JavaScript settings to <code>~/.vimrc_js</code>, write them to <code>~/.vim/ftplugin/javascript.vim</code>.</p> <h1>Autocmd</h1> <p><code>autocmd</code> is the simplest way to set something on a language-specific basis:</p> <pre><code>autocmd Filetype &lt;language&gt; &lt;setting&gt; </code></pre> <p>This goes directly in your vimrc and will load settings for a specified filetype only.</p> <p>To enable spellcheck across various text files, for example, one could use:</p> <pre><code>autocmd FileType markdown,tex,textile setlocal spell </code></pre> <p>You can set multiple settings at once by separating them with a pipe, those this quickly becomes unwieldy:</p> <pre><code>autocmd FileType php setlocal shiftwidth=4 tabstop=4|let php_sql_query=1 </code></pre> <h1>AutoCMD + Source</h1> <p>On rare occasions you might have enough settings to warrant a separate file, but would like to load them for multiple languages. Using filetype plugins, you'll end up with duplicate files or symlinks.</p> <p>A simple alternative is to fall back to autocmd, but instead of writing the settings in one big line, you can instead source a file. For example:</p> <pre><code>autocmd FileType markdown,tex,textile source ~/.vim/lang_settings/text.vim </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload