On 2012-01-09, jz wrote:
> I write shell scripts using vim.  There is no issue to set my color
> scheme with .colorscheme in .vimrc when I edit .sh files.   But how
> can I force vim to use color schema when I edit file without .sh
> extension?   Shell function files are typically without .sh extension.

You didn't say how you are setting ".colorscheme" in your .vimrc,
but Vim is capable of detecting many file types including shell
scripts from their extension, if present, or from their contents if
there is no extension, or if the extension belongs to more than one
file type.

Take a look at

    :help filetypes

Note that Vim does not set the filetype until after it reads .vimrc,
so any filetype-dependent settings will have to be made by FileType
autocommands or by putting them in the appropriate filetype plugin.

For setting filetype-dependent coloring, all that is normally needed
is this in your .vimrc:

    syntax on

See

    :help :filetype-overview

HTH,
Gary

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

Reply via email to