This is a syntax file for the rc shell scripting language.
For unix (not plan9) users, there are two slightly different rc available. One is plan9port and 9base's version and the other is Byron Rakitzis' (as packaged by Debian and other *nix software distribution).
This syntax file is compatible with both versions.
This syntax is comptible with Vim 5.7-6.4.
If you use Vundle, add the following line to your
Then run inside Vim:
:so ~/.vimrc :PluginInstall
If you use Pathogen, do this:
cd ~/.vim/bundle git clone https://github.com/weakish/rcshell.vim.git
If you are not using any package manager, download the tarball and do this:
cd ~/.vim tar --strip=1 -zxf path/to/master.tar.gz
rcrc and files with a shebang of
rc will be highlighted.
If you want to add other file extensions, you can add the following lines in
au BufRead,BufNewFile *.your_exetension set filetype=rcshell
If you want to use
*.rc for other file type, you specify the file type in
For example, if you want to reverse
.rc for M$ Resource file:
au BufRead,BufNewFile *.rc set filetype=rc
rc is the default file type in Vim, you can also use this line instead:
au BufRead,BufNewFile *.your_exetension setfiletype rcshell
:setfiletype will only set 'filetype' if no file type was detected yet.
:help filetype and
:help setfiletype for more information.
If you want to disable this syntax file, add the following line in your
let g:loaded_rcshell = 1
- Repository: http://github.com/weakish/rcshell.vim
- Issue tracker: https://github.com/weakish/rcshell.vim/issues
This is based on Andy Spencer's work for the plan9 rc shell.
There is a minor trade off for maintain compatibility with two versions of rc mentioned above:
(ba)sh like substitution syntax error detection.
This is not related to syntax directly, but I think users who codes rc shell script in Vim may have interests.
If you want to use
rc as the embedded shell in vim,
add the following lines to your .vimrc:
set shell=/usr/bin/rc\ -l " or /bin/rc or /usr/local/bin/rc or /opt/local /bin/rc, etc set shellcmdflag=-c set shellpipe=>[2=1]\|\ tee set shellredir=>%s\ >[2=1]