Commits

Tamas Kovacs committed c7530a6

Paredit initialization autommands on filetype instead of filename extension

Comments (0)

Files changed (3)

-*paredit.txt*                   Paredit              Last Change: 20 Nov 2012
+*paredit.txt*                   Paredit              Last Change: 15 Dec 2012
 
 Paredit Mode for Vim                                  *paredit* *slimv-paredit*
-                               Version 0.9.9
+                               Version 0.9.10
 
 The paredit.vim plugin performs structured editing of s-expressions used in
 the Lisp, Clojure, Scheme programming languages. It may come as part of Slimv
     let g:paredit_mode = 0
 
 You can enable paredit mode for other file types as well. Here is how to set
-it for Arc files (meant to be added to your .vimrc file):
+it for Arc files in your .vimrc (assuming you have a filetype 'arc' defined):
 
-    au BufNewFile,BufRead *.arc call PareditInitBuffer()
+    au FileType arc call PareditInitBuffer()
 
 Paredit is part of Slimv, but it is also distributed separately as a standalone
 plugin. If you indend to use the SWANK client and/or Slimv's indentation and

ftplugin/slimv.vim

 " slimv.vim:    The Superior Lisp Interaction Mode for VIM
 " Version:      0.9.10
-" Last Change:  10 Dec 2012
+" Last Change:  15 Dec 2012
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
 function! SlimvOpenReplBuffer()
     call SlimvOpenBuffer( g:slimv_repl_name )
     call b:SlimvInitRepl()
-    call PareditInitBuffer()
     if g:slimv_repl_syntax
         call SlimvSetSyntaxRepl()
     else

plugin/paredit.vim

 " paredit.vim:
 "               Paredit mode for Slimv
 " Version:      0.9.10
-" Last Change:  10 Dec 2012
+" Last Change:  15 Dec 2012
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
 "  Autocommands
 " =====================================================================
 
-au BufNewFile,BufRead *.lisp call PareditInitBuffer()
-au BufNewFile,BufRead *.cl   call PareditInitBuffer()
-au BufNewFile,BufRead *.clj  call PareditInitBuffer()
-au BufNewFile,BufRead *.cljs call PareditInitBuffer()
-au BufNewFile,BufRead *.scm  call PareditInitBuffer()
-au BufNewFile,BufRead *.rkt  call PareditInitBuffer()
+au FileType lisp      call PareditInitBuffer()
+au FileType *clojure* call PareditInitBuffer()
+au FileType scheme    call PareditInitBuffer()
+au FileType racket    call PareditInitBuffer()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.