Skip to content

Commit

Permalink
Add option g:slimv_indent_disable to disable slimv's indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
kovisoft committed Jan 22, 2021
1 parent aa6359e commit f8c2f99
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
12 changes: 10 additions & 2 deletions doc/slimv.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*slimv.txt* Slimv Last Change: 05 Oct 2019
*slimv.txt* Slimv Last Change: 22 Jan 2021

Slimv *slimv*
Version 0.9.14
Expand Down Expand Up @@ -165,10 +165,13 @@ For the Swank options plese visit |swank-configuration|.

|g:slimv_impl| The Lisp implementation. Defaults to 'clisp'.

|g:slimv_indent_disable| Disable slimv indenting, fallback to vim's
default lispindent() method.

|g:slimv_indent_keylists| Enable special indentation for keyword lists.

|g:slimv_indent_maxlines| Maximum number of lines searched backwards for
indenting special forms
indenting special forms.

|g:slimv_inspect_name| Name of the Inspect buffer.

Expand Down Expand Up @@ -581,6 +584,11 @@ the end of the form is not echoed, so paren balance is kept.
If this option is set to zero then no line is echoed at all, if set to -1
then all lines are always echoed.

*g:slimv_indent_disable*
Disable slimv indenting and use vim's built-in ispindent() method.
Please note that this option does not completely disable the indenting,
only changes the way s-expressions are indented.

*g:slimv_indent_keylists*
If nonzero then Slimv indents keyword lists like that:

Expand Down
12 changes: 8 additions & 4 deletions ftplugin/slimv.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" slimv.vim: The Superior Lisp Interaction Mode for VIM
" Version: 0.9.14
" Last Change: 30 Sep 2019
" Last Change: 22 Jan 2021
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand Down Expand Up @@ -1929,9 +1929,13 @@ endfunction

" Indentation routine, keeps original cursor position
function! SlimvIndent( lnum )
let oldpos = getpos( '.' )
let indent = SlimvIndentUnsafe( a:lnum )
call cursor( oldpos[1], oldpos[2] )
if exists("g:slimv_indent_disable") && g:slimv_indent_disable
let indent = lispindent( a:lnum )
else
let oldpos = getpos( '.' )
let indent = SlimvIndentUnsafe( a:lnum )
call cursor( oldpos[1], oldpos[2] )
endif
return indent
endfunction

Expand Down
5 changes: 3 additions & 2 deletions indent/clojure.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" clojure.vim:
" Clojure indent plugin for Slimv
" Version: 0.9.14
" Last Change: 05 Apr 2017
" Last Change: 22 Jan 2021
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand All @@ -10,7 +10,8 @@
" =====================================================================
"
" Load Once:
if exists("b:did_indent") || exists("b:slimv_did_indent") || exists("g:slimv_disable_clojure")
if exists("b:did_indent") || exists("b:slimv_did_indent") || exists("g:slimv_disable_clojure") ||
\ (exists("g:slimv_indent_disable") && g:slimv_indent_disable)
finish
endif

Expand Down
6 changes: 3 additions & 3 deletions indent/lisp.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" lisp.vim:
" Lisp indent plugin for Slimv
" Version: 0.9.5
" Last Change: 21 Feb 2012
" Version: 0.9.14
" Last Change: 22 Jan 2021
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand All @@ -10,7 +10,7 @@
" =====================================================================
"
" Load Once:
if exists("b:did_indent")
if exists("b:did_indent") || (exists("g:slimv_indent_disable") && g:slimv_indent_disable)
finish
endif

Expand Down
5 changes: 3 additions & 2 deletions indent/scheme.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" scheme.vim:
" Scheme indent plugin for Slimv
" Version: 0.9.5
" Last Change: 21 Feb 2012
" Version: 0.9.14
" Last Change: 22 Jan 2021
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand All @@ -11,6 +11,7 @@
"
" Load Once:
if exists("b:did_indent") || exists("g:slimv_disable_scheme")
\ (exists("g:slimv_indent_disable") && g:slimv_indent_disable)
finish
endif

Expand Down

0 comments on commit f8c2f99

Please sign in to comment.