Commits

Tamas Kovacs committed b3c2b7f

Version 0.7.2

Added autodetection for /usr/local/bin/clojure on Linux, added special characters to Lisp keyword selection (iskeyword), run Vim's original ftplugin/lisp.vim for Clojure filetype, bugfixes: PareditWrap error when g:paredit_shortmaps=1 (thanks to Jon Thacker), buffer selection problems in case of three of more buffers (thanks to Philipp Marek), conflicting keybindings for SlimvGenerateTags, unmap error messages when g:paredit_mode=0.

Comments (0)

Files changed (4)

-*slimv.txt*                    Slimv                 Last Change: 07 Nov 2010
+*slimv.txt*                    Slimv                 Last Change: 16 Nov 2010
 
 Slimv                                                                  *slimv*
-                               Version 0.7.1
+                               Version 0.7.2
 
 The Superior Lisp Interaction Mode for Vim.
 This plugin is aimed to help Lisp development by interfacing between Vim and
 ===============================================================================
 CHANGE LOG                                                    *slimv-changelog*
 
+0.7.2  - Added autodetection for /usr/local/bin/clojure on Linux.
+       - Added special characters to Lisp keyword selection (iskeyword).
+       - Run Vim's original ftplugin/lisp.vim for Clojure filetype.
+       - Bugfix: PareditWrap error when g:paredit_shortmaps=1 (thanks to
+         Jon Thacker).
+       - Bugfix: buffer selection problems in case of three of more buffers
+         (thanks to Philipp Marek).
+       - Bugfix: conflicting keybindings for SlimvGenerateTags.
+       - Bugfix: unmap error messages when g:paredit_mode=0.
+
 0.7.1  - Added option g:slimv_browser_cmd for opening hyperspec in a custom
          webbrowser (on behalf of Andreas Salwasser).
        - Added paredit handling for d<motion>, c<motion>, p and P commands:
 Taylor R. Campbell for the Emacs paredit.el script.
 Thanks to the Vim community for testing, commenting and patching the script,
 especially to Philipp Marek, Vlad Hanciuta, Marcin Fatyga, Dmitry Petukhov,
-Daniel Solano G�mez, Brian Kropf, Len Weincier, Andreas Salwasser.
+Daniel Solano G�mez, Brian Kropf, Len Weincier, Andreas Salwasser, Jon Thacker.
 Last but not least many thanks to my wife Andrea (for the Italians out there:
 hey, this is a female name in Hungary :) for her support and patience.
 

ftplugin/clojure/slimv-clojure.vim

 " slimv-clojure.vim:
 "               Clojure filetype plugin for Slimv
-" Version:      0.6.1
-" Last Change:  27 Apr 2010
+" Version:      0.7.2
+" Last Change:  14 Nov 2010
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
         endif
     else
         " Try to find Clojure in the home directory
-        "TODO: add /usr/local/bin/clojure
+        let lisps = split( globpath( '/usr/local/bin/*clojure*', 'clojure*.jar' ), '\n' )
+        if len( lisps ) > 0
+            return b:SlimvBuildStartCmd( lisps )
+        endif
         let lisps = split( globpath( '~/*clojure*', 'clojure*.jar' ), '\n' )
         if len( lisps ) > 0
             return b:SlimvBuildStartCmd( lisps )
 endfunction
 
 " Source Slimv general part
+runtime ftplugin/**/lisp.vim
 runtime ftplugin/**/slimv.vim
 

ftplugin/slimv.vim

 " slimv.vim:    The Superior Lisp Interaction Mode for VIM
-" Version:      0.7.1
-" Last Change:  31 Oct 2010
+" Version:      0.7.2
+" Last Change:  14 Nov 2010
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
         return
     endif
 
+    let repl_buf = bufnr( s:repl_name )
+    if repl_buf == -1
+        " REPL buffer not loaded
+        return
+    endif
     let size = getfsize( s:repl_name )
     if size == s:last_size
         " REPL output file did not change since the last refresh
         return
     endif
     let s:last_size = size
-
-    let repl_buf = bufnr( s:repl_name )
-    if repl_buf == -1
-        " REPL buffer not loaded
-        return
-    endif
     let this_buf = bufnr( "%" )
     if repl_buf != this_buf
         " Switch to the REPL buffer/window
     let s:last_update = localtime()
 
     try
-        "execute "silent edit! " . s:repl_name
-        "silent execute "view! " . s:repl_name
         execute "silent view! " . s:repl_name
     catch /.*/
         " Oops, something went wrong, the buffer will not be refreshed this time
 
 " Select extended symbol under cursor and copy it to register 's'
 function! SlimvSelectSymbolExt()
-    let oldkw = &iskeyword
+    " Make sure to include special characters in 'iskeyword'
+    " in case they are accidentally removed
     if SlimvGetFiletype() == 'clojure'
         setlocal iskeyword+=~,#,&,\|,{,},!,?
     else
         setlocal iskeyword+=~,#,&,\|,{,},[,],!,?
     endif
     normal! viw"sy
-    let &iskeyword = oldkw
 endfunction
 
 " Select bottom level form the cursor is inside and copy it to register 's'
         if g:slimv_repl_split && repl_win == -1
             execute "normal! \<C-w>p"
         elseif repl_buf == -1
-            buf #
+            execute "buf " . s:repl_name
         endif
     endif
 endfunction
     if bufnr( s:repl_name ) != bufnr( "%" )
         " REPL is not the current window, activate it
         call SlimvOpenReplBuffer()
+    else
+        try
+            execute "silent view! " . s:repl_name
+        catch /.*/
+            " Oops, something went wrong, the buffer will not be refreshed this time
+        endtry
     endif
 endfunction
 
     noremap <Leader>ds  :call SlimvDescribeSymbol()<CR>
     noremap <Leader>da  :call SlimvApropos()<CR>
     noremap <Leader>dh  :call SlimvHyperspec()<CR>
-    noremap <Leader>dt  :call SlimvGenerateTags()<CR>
+    noremap <Leader>dg  :call SlimvGenerateTags()<CR>
 
     " REPL commands
     noremap <Leader>rc  :call SlimvConnectServer()<CR>

plugin/paredit.vim

 " paredit.vim:
 "               Paredit mode for Slimv
-" Version:      0.7.1
-" Last Change:  07 Nov 2010
+" Version:      0.7.2
+" Last Change:  13 Nov 2010
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
 
 " Buffer specific initialization
 function! PareditInitBuffer()
+    " Make sure to include special characters in 'iskeyword'
+    " in case they are accidentally removed
+    if &ft == 'clojure'
+        setlocal iskeyword+=~,#,&,\|,{,},!,?
+    else
+        setlocal iskeyword+=~,#,&,\|,{,},[,],!,?
+    endif
+
     if g:paredit_mode
         " Paredit mode is on: add buffer specific keybindings
         inoremap <buffer> <expr>   (            PareditInsertOpening('(',')')
             nnoremap <buffer> <silent> >            :<C-U>call PareditMoveRight()<CR>
             nnoremap <buffer> <silent> O            :<C-U>call PareditSplit()<CR>
             nnoremap <buffer> <silent> J            :<C-U>call PareditJoin()<CR>
-            nnoremap <buffer> <silent> W            :<C-U>call PareditWrap()<CR>
-            vnoremap <buffer> <silent> W            :<C-U>call PareditWrapSelection()<CR>
+            nnoremap <buffer> <silent> W            :<C-U>call PareditWrap('(',')')<CR>
+            vnoremap <buffer> <silent> W            :<C-U>call PareditWrapSelection('(',')')<CR>
             nnoremap <buffer> <silent> S            :<C-U>call PareditSplice()<CR>
             nnoremap <buffer> <silent> <Leader><    :<C-U>normal! <<CR>
             nnoremap <buffer> <silent> <Leader>>    :<C-U>normal! ><CR>
         endif
     else
         " Paredit mode is off: remove keybindings
-        iunmap <buffer> (
-        iunmap <buffer> )
-        iunmap <buffer> [
-        iunmap <buffer> ]
-        iunmap <buffer> "
-        iunmap <buffer> <BS>
-        iunmap <buffer> <Del>
-        unmap  <buffer> (
-        unmap  <buffer> )
-        unmap  <buffer> x
-        unmap  <buffer> <Del>
-        unmap  <buffer> X
-        unmap  <buffer> s
-        unmap  <buffer> D
-        unmap  <buffer> C
-        unmap  <buffer> d
-        unmap  <buffer> c
-        unmap  <buffer> dd
-        unmap  <buffer> cc
+        silent! iunmap <buffer> (
+        silent! iunmap <buffer> )
+        silent! iunmap <buffer> [
+        silent! iunmap <buffer> ]
+        silent! iunmap <buffer> "
+        silent! iunmap <buffer> <BS>
+        silent! iunmap <buffer> <Del>
+        silent! unmap  <buffer> (
+        silent! unmap  <buffer> )
+        silent! unmap  <buffer> x
+        silent! unmap  <buffer> <Del>
+        silent! unmap  <buffer> X
+        silent! unmap  <buffer> s
+        silent! unmap  <buffer> D
+        silent! unmap  <buffer> C
+        silent! unmap  <buffer> d
+        silent! unmap  <buffer> c
+        silent! unmap  <buffer> dd
+        silent! unmap  <buffer> cc
     endif
 endfunction