├── .gitignore ├── ftdetect └── karel.vim ├── README.md ├── LICENSE.txt └── syntax └── karel.vim /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /ftdetect/karel.vim: -------------------------------------------------------------------------------- 1 | au BufNewFile,BufRead *.kl setf karel 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VIM-KAREL 2 | 3 | This vim bundle adds syntax highlighting for FANUC's KAREL programming language. 4 | 5 | ## Installing and Using 6 | 7 | - Install [pathogen](http://www.vim.org/scripts/script.php?script_id=2332) into `~/.vim/autoload/` and add the 8 | following line to your `~/.vimrc`: 9 | 10 | call pathogen#infect() 11 | 12 | - Make a clone of the `vim-karel` repository: 13 | 14 | $ mkdir -p ~/.vim/bundle 15 | $ cd ~/.vim/bundle 16 | $ git clone https://github.com/onerobotics/vim-karel 17 | 18 | - OR use [vundle](https://github.com/gmarik/vundle), adding this line to your `~/.vimrc`: 19 | 20 | Bundle 'onerobotics/vim-karel' 21 | 22 | - OR use git submodules: 23 | 24 | $ git submodule add https://github.com/onerobotics/vim-karel.git bundle/vim-karel 25 | $ git submodule init 26 | 27 | ## License ## 28 | 29 | MIT 30 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2014 ONE Robotics Company LLC 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | 10 | -------------------------------------------------------------------------------- /syntax/karel.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: KAREL 3 | " Maintainer: Jay Strybis 4 | " URL: http://github.com/onerobotics/vim-karel 5 | " License: MIT 6 | 7 | if exists("b:current_syntax") 8 | finish 9 | endif 10 | 11 | if version < 600 12 | syntax clear 13 | endif 14 | 15 | " KAREL is case-insensitive 16 | syntax case ignore 17 | 18 | " Identifiers 19 | syn match karelIdentifier /[a-zA-Z0-9_]\+/ 20 | hi def link karelIdentifier Identifier 21 | 22 | " Constants 23 | syn keyword karelConstant CR 24 | syn region karelString start="'" end="'" 25 | syn match karelReal /\d\+\.\d\+/ 26 | syn match karelInteger /\d\+/ 27 | syn keyword karelBoolean true false 28 | hi def link karelConstant Constant 29 | hi def link karelString String 30 | hi def link karelInteger Number 31 | hi def link karelReal Float 32 | hi def link karelBoolean Boolean 33 | 34 | " Directives 35 | syn match karelDirective /%[a-zA-Z]\+/ 36 | hi def link karelDirective PreProc 37 | 38 | " Operators 39 | syn keyword karelOperator AND OR NOT DIV MOD 40 | syn match karelOperator /[\+\-\*\/\<\=\>\:\#\@]/ 41 | syn match karelOperator /<=/ 42 | syn match karelOperator />=/ 43 | syn match karelOperator /<>/ 44 | syn match karelOperator />=