Question

I'm using vim 7.3 with slimv to edit *.lisp files.

Unfortunately, slimv pretty much ignores my vim indentation settings which causes a mess from time to time. I want to use tabs for indenting and have following lines in vimrc:

set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab
let g:paredit_mode = 0

Slimv ignores those settings and insist on using spaces for indentation, 2 spaces per indent. I managed to fix "tab" behavior (so it no longer inserts 2 spaces instead of tab) by commenting out

setlocal expandtab

in Vim\vimfiles\indent\lisp.vim, however, I'm not quite sure how to fix autoindentation when I insert new line in the middle of lisp form. In this scenario slimv again ignores my settings and aligns new line using spaces instead of tabs, 2 spaces per indentation level.

As far as I can tell, indentation is handled in function! SlimvIndent( lnum ) which is located in `Vim/vimfiles/ftplugin/slimv.vim", but I'm not quite sure how to fix this function (and it doesn't seem to have any configurable settings anywhere).

How can I fix tab behavior in slimv? It has useful shortcuts (,e to evaluate form, etc), but the tab problem is quite annoying.

Ideas?

Was it helpful?

Solution

I have fixed slimv so that it inserts tabs (plus spaces for the remaining columns) when indenting, if noexpandtab is set after the file is loaded. Slimv still defines expandtab by default, so it is not enough to just add :set noexpandtab to your .vimrc, but you can override this by a 'post' or 'after' command, for example:

au BufReadPost *.lisp set noexpandtab

Or just simply enter :set noexpandtab in the editor any time you wish.

Please fetch the most recent version from the Slimv repository. I still advise against using tabs in lisp source files, see my comments below the original post on why.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top