Skip to content

Instantly share code, notes, and snippets.

@333fred
Created March 9, 2016 23:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 333fred/41f2891c766898923b00 to your computer and use it in GitHub Desktop.
Save 333fred/41f2891c766898923b00 to your computer and use it in GitHub Desktop.
Basic Racket Vim Config
set nocompatible
" Use Line Numbers
set number
set backspace=indent,eol,start
set showmode
set visualbell
syntax on
" Vundle Config
" You MUST clone vundle into ~/.vim/bundle/Vundle.vim
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'wlangstroth/vim-racket'
Plugin 'scrooloose/syntastic'
Plugin 'kien/rainbow_parentheses.vim'
call vundle#end() " required
filetype plugin indent on " required
" Syntastic config
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
if has("autocmd")
au BufReadPost *.rkt,*.rktl set filetype=racket
au filetype racket set lisp
au filetype racket set autoindent
endif
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_racket_checkers = ['racket']
" Rainbow-Paren Config
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces

Overview

This is a basic Vim config for coding Racket. It sets up Vundle, installs a few plugins, and sets up a few Vim niceties.

Installation instructions:

On Ubuntu, install the racket package with:

sudo apt-get install racket

On Arch Linux, install racket with:

sudo pacman -S racket

On Windows, install Racket from racket-lang.org. Put Racket.exe and Raco.exe on your path.

Once Racket is installed, you need to install the plai-typed language. To do this, run: raco pkg install plai-typed in the console.

To install the Vim config, first clone the Vundle repository by running:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Next, copy and paste the contents of .vimrc into ~/.vimrc. Run Vim, ignore any errors that pop up, and run :VundleInstall. Restart Vim, and you should be set.

Packages

  • vim-racket - Provides racket highlighting, autoindent support.
  • Syntastic - Provides syntax checking on file save.
  • Rainbow_parenthesis - Colorizes parenthesis so they can easily be told apart and matched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment