diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 4ef7535..d85df69 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -94,11 +94,6 @@ function! s:initialize()"{{{ hi def link neosnippetExpandSnippets Special - " Select mode mappings."{{{ - if g:neosnippet#disable_select_mode_mappings - autocmd neosnippet BufEnter * call s:clear_select_mode_mappings() - endif"}}} - " Caching _ snippets. call neosnippet#make_cache('_') @@ -956,7 +951,11 @@ function! s:trigger(function)"{{{ \ a:function, string(cur_text), col) endfunction"}}} -function! s:clear_select_mode_mappings()"{{{ +function! neosnippet#clear_select_mode_mappings()"{{{ + if !g:neosnippet#disable_select_mode_mappings + return + endif + redir => mappings silent! smap redir END @@ -970,6 +969,14 @@ function! s:clear_select_mode_mappings()"{{{ silent! execute 'sunmap' map silent! execute 'sunmap ' map endfor + + " Define default select mode mappings. + snoremap a + snoremap a + snoremap a + snoremap a + snoremap a + snoremap bi endfunction"}}} " Plugin key-mappings. diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index ae4cccf..a35fb4d 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -457,6 +457,7 @@ CHANGELOG *neosnippet-changelog* 2012-10-29 - Improved parse of snippets file. - Improved syntax of markers. +- Improved clear select mode mappings. 2012-10-28 - Improved snipMate compatibility. diff --git a/plugin/neosnippet.vim b/plugin/neosnippet.vim index 64f9014..df6cdcd 100644 --- a/plugin/neosnippet.vim +++ b/plugin/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 19 Oct 2012. +" Last Modified: 29 Oct 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -85,6 +85,8 @@ augroup neosnippet"{{{ " Recaching events autocmd BufWritePost *.snip,*.snippets \ call neosnippet#recaching() + autocmd BufEnter * + \ call neosnippet#clear_select_mode_mappings() augroup END"}}} " Commands."{{{