Wikia

Vim Tips Wiki

Changes: Script:1839

Edit

Back to page

(adjust Template:ScriptComments to remove id as no longer needed; minor tweaks)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 30: Line 30:
 
Then, check the filetype of the buffer you wish to use the javascript indent rules on. If Vim has not automatically set it for you, you can set the filetype manually to javascript to use the indent rules. Vim will automatically apply the indent rules as you type, or you can manually re-indent lines using the {{help|prefix=no|id==}} command.
 
Then, check the filetype of the buffer you wish to use the javascript indent rules on. If Vim has not automatically set it for you, you can set the filetype manually to javascript to use the indent rules. Vim will automatically apply the indent rules as you type, or you can manually re-indent lines using the {{help|prefix=no|id==}} command.
   
Use <tt>:set filetype?</tt> to see the current filetype for your buffer, or <tt>:set filetype=javascript</tt> to set it as you need for this plugin.
+
Use <code>:set filetype?</code> to see the current filetype for your buffer, or <code>:set filetype=javascript</code> to set it as you need for this plugin.
   
 
--[[User:Fritzophrenic|Fritzophrenic]] 18:48, July 2, 2010 (UTC)
 
--[[User:Fritzophrenic|Fritzophrenic]] 18:48, July 2, 2010 (UTC)

Latest revision as of 09:42, July 14, 2012

Use this page to discuss script 1839 IndentAnything: write indentations or enhance existing indentations without writing code

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Documentation errorEdit

Comments in /plugin/IndentAnything.vim read:

"   Included with this script is Javascript indentation, an example that
"   explains the configurable values.
"
" Installation:
"
"   Place this file in your home directory under ~/.vim/indent/, or replace
"   the system indent/javascript.vim file to affect all users.

Both wrong (I suppose you mean that HTML script?) and highly confusing (which file should I put there? The plugin?).

CommentsEdit

How do you use this, once it's installed? As an example, I also installed javascript.vim in the indent directory, but I have no idea how it's used.


I have neither used nor looked at this script. However, from the note above, it sounds like this plugin has 2 files. One, the IndentAnything.vim file, sounds like a global plugin that provides functions used by indent plugins which you create. This means you should place IndentAnything.vim in your ~/.vim/plugin directory.

The second, javascript.vim, is an example indent plugin. This means that you place javascript.vim in your ~/.vim/indent directory.

In general, indent plugins all work the same way. First, you need to turn on per-filetype indentation, usually in your .vimrc:

:filetype plugin indent on

Then, check the filetype of the buffer you wish to use the javascript indent rules on. If Vim has not automatically set it for you, you can set the filetype manually to javascript to use the indent rules. Vim will automatically apply the indent rules as you type, or you can manually re-indent lines using the = command.

Use :set filetype? to see the current filetype for your buffer, or :set filetype=javascript to set it as you need for this plugin.

--Fritzophrenic 18:48, July 2, 2010 (UTC)

Around Wikia's network

Random Wiki