3

I'm reinstalling everything after a hdd failure on my netbook (fresh install of Ubuntu Netbook Edition 10.04), and am trying to get the excellent SLIMV working again.

It was working fine on the previous installation, but with this one, parenthesis matching works, but auto-indenting Lisp code does not. Hitting return starts the cursor back in column 1 of the next line, no matter where it is in the nested parens.

I've been digging through the docs to see if there's a commandline or .vimrc switch that needs to be activated to enable indention, but don't see anything.

Am I just missing it? Any suggestions appreciated.

bgibson
  • 17,379
  • 8
  • 29
  • 45

1 Answers1

5
  • Check that function SlimvIndent is defined by calling :echo SlimvIndent(lnum) where lnum is the line number to be indented. It should return the indentation value for the line.
  • Check that lisp mode is off with the :verbose set lisp? command, that also prints the location where this option was last set. It should be "nolisp", otherwise the default lisp indenting is used by Vim.
  • Check that Slimv's indentation is set with the :verbose set indentexpr? command. It should be "SlimvIndent(v:lnum)".
  • Some indentation methods work only if Slimv is connected to the Swank server, because it needs runtime information about the form to be indented (e.g. macro definition with &body argument).
  • Make sure you use the latest Slimv version (0.8.4 at the moment), because it has indentation related bugfixes.
  • Do not checkout the Slimv repository right into the vimfiles directory, because files in the .hg directory may interfere with the Slimv installation. Checkout the files to somewhere else instead and copy only the Slimv files into vimfiles.

If you still have problems with making the indentation work, then drop me a mail and we can discuss the additional steps. I'm the author of Slimv, you can find my email address in the documentation or on my vim.org page.

Tamas Kovacs
  • 1,495
  • 7
  • 9
  • I don't know how you're so quick to find my Slimv questions here, but thanks so much! The problem is indentexpr, which was unset. Setting it manually to SlimvIndent(v:lnum) fixes the problem temporarily, until I restart vim, then it reverts to unset. However it looks like it is set in indent/lisp.vim, so not sure why that's not getting loaded when vim starts. Any idea? I can email you if you prefer. – bgibson Jun 22 '11 at 19:17
  • OK, so it seems that either indent/lisp.vim is not sourced or another plugin has already set the b:did_indent variable (the first statements in indent/lisp.vim checks this). I suggest two tests: 1) comment out the if ... endif part in indent/lisp.vim 2) run vim with the -V10 argument that prints all the scripts sourced, e.g. vim -V10 something.lisp – Tamas Kovacs Jun 23 '11 at 07:48
  • @ByronGibson Please let me know the test results, because if there is a bug in Slimv then I'd like to fix it. Thanks! – Tamas Kovacs Jun 25 '11 at 17:07
  • One more thing just came to my mind: check if you have `filetype indent on`, if not then add it to your .vimrc. – Tamas Kovacs Jun 28 '11 at 19:57
  • Hi Tamas, sorry for the delay, just got back from vacation and am catching up on things. Filetype indent on fixed it, thanks so much. It was commented out in ~/.vimrc, uncommenting solved the problem. Sorry for the SUE, don't know how or why I commented that out... – bgibson Jun 29 '11 at 23:14