Vim fails to indent racket code sorrectly after installing SLIMV

391 views Asked by At

I am using vim for editing racket files, and I've recently installed SLIMV. Before that, hitting enter before the last paren in the following code in a .rkt or .scm file:

(define (f a b)|)

got me this:

(define (f a b)
  |)

And now I am getting this

(define (f a b)
  |
  )

which is definitely not what I want. I've checked everything mentioned in this answer, seems to be correct. SLIMV is from the repository. Here is my .vimrc:

fun! <SID>StripTrailingWhitespaces()
        let l = line(".")
        let c = col(".")
        %s/\s\+$//e
        call cursor(l, c)
endfun

set ic
set hls
set is
set winminheight=0
set noequalalways
set winheight=9999
set iskeyword=@,48-57,_,192-255
set ts=8
set shiftwidth=8
set showcmd
set linebreak
set dy=lastline
syntax on
set number
set smartindent
set nocompatible
set scrolloff=4
set wildmenu
set hidden
set wildignore=*.o,*.obj,*.bak,*.exe,*.py[co],*.swp,*~,*.pyc,.svn
set langmap=йq,цw,уe,кr,еt,нy,гu,шi,щo,зp,х[,ъ],фa,ыs,вd,аf,пg,рh,оj,лk,дl,ж\\;,э',яz,чx,сc,мv,иb,тn,ьm,б\\,,ю.,ЙQ,ЦW,УE,КR,ЕT,НY,ГU,ШI,ЩO,ЗP,Х{,Ъ},ФA,ЫS,ВD,АF,ПG,РH,ОJ,ЛK,ДL,Ж\:,Э\",ЯZ,ЧX,СC,МV,ИB,ТN,ЬM,Б<,Ю>
set dir-=.
set dir+=/home/inni/.vim_backup
execute pathogen#infect()
filetype plugin indent on
let g:lisp_rainbow=1
if has("autocmd")
  au BufReadPost *.rkt,*.rktl set filetype=scheme | set expandtab | set nohls
  au filetype racket set lisp
  "au filetype racket set autoindent
  au BufWritePre * :call <SID>StripTrailingWhitespaces() | :retab
endif

How can I get indentation working as it did before?

1

There are 1 answers

0
Innot Kauker On BEST ANSWER

Solved! Setting the g:paredit_electric_return to 0 did the trick.

Actually, didn't search enough.