[from now] 2013/01/04 09:03:38

diff --git a/.vimrc b/.vimrc
index 8ae129b..bf393e6 100644
--- a/.vimrc
+++ b/.vimrc
@@ -101,6 +101,7 @@ Bundle 'kana/vim-textobj-indent.git'
 Bundle 'mklabs/vim-fetch'
 Bundle 'banyan/recognize_charcode.vim'
 Bundle 'tomasr/molokai'
+Bundle 'groenewege/vim-less'

 filetype plugin indent on

@@ -343,9 +344,6 @@ let g:neocomplcache_enable_underbar_completion = 1
 " SmartCase補完
 let g:neocomplcache_enable_smart_case = 0

-" 補完候補ソートアルゴリズム
-" let g:neocomplcache_compare_function = 'neocomplcache#compare_rank'
-
 " inoremap <expr><TAB> pumvisible() ? neocomplcache#close_popup() : "<TAB>"
 " inoremap <expr><CR>  pumvisible() ? neocomplcache#close_popup() : "<CR>"

@@ -354,10 +352,35 @@ let g:neocomplcache_enable_smart_case = 0
 nnoremap <Space>s :<C-u>Unite snippet<CR>

 inoremap <expr>[close_popup] neocomplcache#close_popup()
-imap <expr><TAB> neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<TAB>"
-smap <expr><TAB> neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<TAB>"
-imap <expr><CR>  neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<CR>"
-smap <expr><CR>  neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<CR>"
+
+imap <expr><TAB> (pumvisible() && neosnippet#expandable()) ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : neosnippet#jumpable() ? "<Plug>(neosnippet_jump)" : "<TAB>"
+smap <expr><TAB> (pumvisible() && neosnippet#expandable()) ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : neosnippet#jumpable() ? "<Plug>(neosnippet_jump)" : "<TAB>"
+imap <expr><CR>  (pumvisible() && neosnippet#expandable()) ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : neosnippet#jumpable() ? "<Plug>(neosnippet_jump)" : "<CR>"
+smap <expr><CR>  (pumvisible() && neosnippet#expandable()) ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : neosnippet#jumpable() ? "<Plug>(neosnippet_jump)" : "<CR>"
+
+" imap <expr><TAB> neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<TAB>"
+" smap <expr><TAB> neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<TAB>"
+" imap <expr><CR>  neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<CR>"
+" smap <expr><CR>  neosnippet#expandable() ? "<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "[close_popup]" : "<CR>"
+
+" function! eexpand_or_jump()
+  " <Plug>(neosnippet_expand)
+  " " if pumvisible()
+    " " if neosnippet#expandable()
+      " " <Plug>(neosnippet_expand)
+    " " else
+      " " [close_popup]
+    " " endif
+  " " else
+    " " if neosnippet#jumpable()
+      " " <Plug>(neosnippet_jump)
+    " " else
+      " " <TAB>
+    " " endif
+  " " endif
+" endfunction
+" imap <TAB>  :call eexpand_or_jump()<CR>
+

 " set 3rd-party snippets
 let g:neosnippet#snippets_directory='~/.vim/bundle/snipmate-snippets/snippets'
@@ -370,6 +393,6 @@ let g:neosnippet#disable_runtime_snippets = {
 "****************************************
 " zencoding
 " complete tags using omnifunc
-let g:use_zen_complete_tag = 1
+" let g:use_zen_complete_tag = 1

 "}}}