Commits

Meikel Brandmeyer  committed 37dc30d

Make keyboard mappings configurable

  • Participants
  • Parent commits d315c09

Comments (0)

Files changed (2)

File vim/autoload/vimclojure.vim

 	let vimclojure#UseErrorBuffer = 1
 endif
 
+if !exists("g:vimclojure#SetupKeyMap")
+	let vimclojure#SetupKeyMap = 1
+endif
+
 function! vimclojure#ReportError(msg)
 	if g:vimclojure#UseErrorBuffer
 		let buf = g:vimclojure#ResultBuffer.New()
 endfunction
 
 function! vimclojure#MapPlug(mode, keys, plug)
-	if !hasmapto("<Plug>Clojure" . a:plug, a:mode)
+	if exists("g:vimclojure#SetupKeyMap" . a:plug)
+		execute "let doSetup = g:vimclojure#SetupKeyMap" . a:plug
+	else
+		let doSetup = 1
+	endif
+
+	if g:vimclojure#SetupKeyMap
+				\ && doSetup
+				\ && !hasmapto("<Plug>Clojure" . a:plug, a:mode)
 		execute a:mode . "map <buffer> <unique> <silent> <LocalLeader>" . a:keys
 					\ . " <Plug>Clojure" . a:plug
 	endif

File vim/doc/clojure.txt

 >
         aucmd BufRead,BufNewFile *.clj nmap xyz <Plug>ClojureEvalToplevel
 <
+To inhibit all mappings set the global flag to zero:
+>
+        let vimclojure#SetupKeyMap = 0
+<
+To inhibit only single mappings append the plug name:
+>
+        let vimclojure#SetupKeyMapEvalToplevel = 0
+<
 
 <LocalLeader>et                                 *et* *EvalToplevel*
                         Send off the toplevel sexpression currently