Permalink
Browse files

added vim plugins

  • Loading branch information...
1 parent cc2b054 commit 8f95f81cc05de9ddf7618db004a0b7d7b5efd6a1 Tammer Saleh committed Feb 18, 2012
Showing with 2,427 additions and 84 deletions.
  1. +5 −0 vim/bundle/neocomplcache/README.md
  2. +80 −41 vim/bundle/neocomplcache/autoload/neocomplcache.vim
  3. +9 −3 vim/bundle/neocomplcache/autoload/neocomplcache/sources/filename_complete.vim
  4. +7 −4 vim/bundle/neocomplcache/autoload/neocomplcache/sources/omni_complete.vim
  5. +7 −4 vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete.vim
  6. +15 −3 vim/bundle/neocomplcache/autoload/neocomplcache/util.vim
  7. +43 −3 vim/bundle/neocomplcache/doc/neocomplcache.txt
  8. +27 −2 vim/bundle/neocomplcache/plugin/neocomplcache.vim
  9. +17 −2 vim/bundle/nerdtree/plugin/NERD_tree.vim
  10. +16 −14 vim/bundle/vim-javascript/indent/javascript.vim
  11. +10 −6 vim/bundle/vim-javascript/syntax/javascript.vim
  12. +1 −0 vim/bundle/vim-pasta/.gitignore
  13. +111 −0 vim/bundle/vim-pasta/README.md
  14. +41 −0 vim/bundle/vim-pasta/doc/pasta.txt
  15. +66 −0 vim/bundle/vim-pasta/plugin/pasta.vim
  16. +3 −0 vim/bundle/vim-ruby-refactoring/.gitignore
  17. +2 −0 vim/bundle/vim-ruby-refactoring/.rvmrc
  18. +2 −0 vim/bundle/vim-ruby-refactoring/.travis.yml
  19. +10 −0 vim/bundle/vim-ruby-refactoring/Gemfile
  20. +52 −0 vim/bundle/vim-ruby-refactoring/Gemfile.lock
  21. +57 −0 vim/bundle/vim-ruby-refactoring/README.md
  22. +22 −0 vim/bundle/vim-ruby-refactoring/Rakefile
  23. +79 −0 vim/bundle/vim-ruby-refactoring/autoload/common.vim
  24. +3 −0 vim/bundle/vim-ruby-refactoring/cucumber.yml
  25. +68 −0 vim/bundle/vim-ruby-refactoring/doc/rubyrefactoring.txt
  26. +26 −0 vim/bundle/vim-ruby-refactoring/features/README.markdown
  27. +79 −0 vim/bundle/vim-ruby-refactoring/features/add_parameter.feature
  28. +43 −0 vim/bundle/vim-ruby-refactoring/features/add_parameter_without_using_brackets.feature
  29. +32 −0 vim/bundle/vim-ruby-refactoring/features/extract_constant.feature
  30. +46 −0 vim/bundle/vim-ruby-refactoring/features/extract_let.feature
  31. +57 −0 vim/bundle/vim-ruby-refactoring/features/extract_local_variable.feature
  32. +188 −0 vim/bundle/vim-ruby-refactoring/features/extract_method.feature
  33. +160 −0 vim/bundle/vim-ruby-refactoring/features/inline_temp.feature
  34. +90 −0 vim/bundle/vim-ruby-refactoring/features/introduce_variable.feature
  35. +39 −0 vim/bundle/vim-ruby-refactoring/features/post_conditional.feature
  36. +25 −0 vim/bundle/vim-ruby-refactoring/features/rename_instance_variable.feature
  37. +26 −0 vim/bundle/vim-ruby-refactoring/features/rename_local_variable.feature
  38. +4 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/add_parameter_steps.rb
  39. +10 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/extract_constant_steps.rb
  40. +26 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/extract_let_steps.rb
  41. +5 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/extract_local_variable_steps.rb
  42. +37 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/extract_method_steps.rb
  43. +7 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/introduce_variable_steps.rb
  44. +9 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/rename_instance_variable_steps.rb
  45. +9 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/rename_local_variable_steps.rb
  46. +1 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/robot_vim.rb
  47. +21 −0 vim/bundle/vim-ruby-refactoring/features/step_definitions/shared_steps.rb
  48. +36 −0 vim/bundle/vim-ruby-refactoring/features/support/shared_methods.rb
  49. +36 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/addparameter.vim
  50. +27 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/addparameternb.vim
  51. +21 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/extractconstant.vim
  52. +283 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/extractmethod.vim
  53. +32 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/extractvariable.vim
  54. +33 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/inlinetemp.vim
  55. +31 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/introducevariable.vim
  56. +70 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/postconditional.vim
  57. +47 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/renameinstancevariable.vim
  58. +25 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/renamelocalvariable.vim
  59. +16 −0 vim/bundle/vim-ruby-refactoring/plugin/refactorings/general/rspec_extractlet.vim
  60. +58 −0 vim/bundle/vim-ruby-refactoring/plugin/ruby-refactoring.vim
  61. +15 −0 vim/bundle/vim-ruby-refactoring/test/testcases.rb
  62. +4 −2 vim/update_bundles
@@ -27,6 +27,11 @@ script from Mr.thinca.
http://gist.github.com/422503
+Snippets feature(snippets\_complete source) was splitted from Ver.7.
+If you used it, please install snippets\_complete source manually.
+
+https://github.com/Shougo/neocomplcache-snippets-complete
+
Screen shots
============
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: neocomplcache.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 10 Feb 2012.
+" Last Modified: 17 Feb 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
@@ -43,18 +43,27 @@ if !exists('s:is_enabled')
endif
function! neocomplcache#enable() "{{{
- augroup neocomplcache "{{{
+ " Auto commands."{{{
+ augroup neocomplcache
autocmd!
" Auto complete events
autocmd InsertLeave * call s:on_insert_leave()
- augroup END "}}}
+ augroup END
- if g:neocomplcache_enable_cursor_hold_i
- autocmd neocomplcache CursorHoldI * call neocomplcache#do_auto_complete()
+ if g:neocomplcache_enable_insert_char_pre
+ \ && (v:version > 703 || v:version == 703 && has('patch418'))
+ autocmd neocomplcache InsertCharPre *
+ \ call s:do_auto_complete('InsertCharPre')
+ elseif g:neocomplcache_enable_cursor_hold_i
+ autocmd neocomplcache CursorHoldI *
+ \ call s:do_auto_complete('CursorHoldI')
else
- autocmd neocomplcache InsertEnter * call s:on_insert_enter()
- autocmd neocomplcache CursorMovedI * call neocomplcache#do_auto_complete()
+ autocmd neocomplcache InsertEnter *
+ \ call s:on_insert_enter()
+ autocmd neocomplcache CursorMovedI *
+ \ call s:do_auto_complete('CursorMovedI')
endif
+ "}}}
" Disable beep.
set vb t_vb=
@@ -399,7 +408,7 @@ function! neocomplcache#enable() "{{{
\])
call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
\ 'vim', [
- \ {'filetype' : 'python', 'start' : '^\s*python <<\s*\(\h\w*\)', 'end' : '^\1'},
+ \ {'filetype' : 'python', 'start' : '^\s*python3\? <<\s*\(\h\w*\)', 'end' : '^\1'},
\ {'filetype' : 'ruby', 'start' : '^\s*ruby <<\s*\(\h\w*\)', 'end' : '^\1'},
\])
call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
@@ -454,7 +463,7 @@ function! neocomplcache#enable() "{{{
call neocomplcache#set_dictionary_helper(g:neocomplcache_ctags_arguments_list, 'default', '')
call neocomplcache#set_dictionary_helper(g:neocomplcache_ctags_arguments_list, 'vim',
\"--extra=fq --fields=afmiKlnsStz --regex-vim='/function!? ([a-z#:_0-9A-Z]+)/\\1/function/'")
- if !neocomplcache#is_win() && (has('macunix') || system('uname') =~? '^darwin')
+ if !neocomplcache#is_windows() && (has('macunix') || system('uname') =~? '^darwin')
call neocomplcache#set_dictionary_helper(g:neocomplcache_ctags_arguments_list, 'c',
\'--c-kinds=+p --fields=+iaS --extra=+q -I__DARWIN_ALIAS,__DARWIN_ALIAS_C,__DARWIN_ALIAS_I,__DARWIN_INODE64
\ -I__DARWIN_1050,__DARWIN_1050ALIAS,__DARWIN_1050ALIAS_C,__DARWIN_1050ALIAS_I,__DARWIN_1050INODE64
@@ -578,24 +587,28 @@ function! neocomplcache#manual_complete(findstart, base)"{{{
let s:complete_words = []
let s:is_prefetch = 0
let &l:completefunc = 'neocomplcache#manual_complete'
- return g:neocomplcache_enable_prefetch ?
+ return (g:neocomplcache_enable_prefetch
+ \ || g:neocomplcache_enable_insert_char_pre) ?
\ -1 : -2
endif
" Get cur_keyword_pos.
if s:is_prefetch && !empty(s:complete_results)
" Use prefetch results.
else
- let s:complete_results = neocomplcache#get_complete_results(s:get_cur_text())
+ let s:complete_results =
+ \ neocomplcache#get_complete_results(s:get_cur_text())
endif
- let cur_keyword_pos = neocomplcache#get_cur_keyword_pos(s:complete_results)
+ let cur_keyword_pos =
+ \ neocomplcache#get_cur_keyword_pos(s:complete_results)
if cur_keyword_pos < 0
let s:cur_keyword_str = ''
let s:complete_words = []
let s:is_prefetch = 0
let s:complete_results = {}
- return g:neocomplcache_enable_prefetch ?
+ return (g:neocomplcache_enable_prefetch
+ \ || g:neocomplcache_enable_insert_char_pre) ?
\ -1 : -2
endif
@@ -608,9 +621,15 @@ function! neocomplcache#manual_complete(findstart, base)"{{{
let s:cur_keyword_str = a:base
let s:is_prefetch = 0
- return (v:version > 703 || v:version == 703 && has('patch418')) ?
- \ { 'words' : s:complete_words, 'refresh' : 'always' } :
- \ s:complete_words
+ if v:version > 703 || v:version == 703 && has('patch418')
+ let dict = { 'words' : s:complete_words }
+
+ " Note: Vim Still have broken register-. problem.
+ " let dict.refresh = 'always'
+ return dict
+ else
+ return s:complete_words
+ endif
endfunction"}}}
function! neocomplcache#sources_manual_complete(findstart, base)"{{{
@@ -653,7 +672,7 @@ function! neocomplcache#auto_complete(findstart, base)"{{{
return neocomplcache#manual_complete(a:findstart, a:base)
endfunction"}}}
-function! neocomplcache#do_auto_complete()"{{{
+function! s:do_auto_complete(event)"{{{
if (&buftype !~ 'nofile\|nowrite' && b:changedtick == s:changedtick)
\ || g:neocomplcache_disable_auto_complete
\ || neocomplcache#is_locked()
@@ -674,15 +693,17 @@ function! neocomplcache#do_auto_complete()"{{{
99verbose setl completefunc
redir END
call neocomplcache#print_error(output)
- call neocomplcache#print_error('Another plugin set completefunc! Disabled neocomplcache.')
+ call neocomplcache#print_error(
+ \ 'Another plugin set completefunc! Disabled neocomplcache.')
NeoComplCacheLock
return
endif
endif
" Detect AutoComplPop.
if exists('g:acp_enableAtStartup') && g:acp_enableAtStartup
- call neocomplcache#print_error('Detected enabled AutoComplPop! Disabled neocomplcache.')
+ call neocomplcache#print_error(
+ \ 'Detected enabled AutoComplPop! Disabled neocomplcache.')
NeoComplCacheLock
return
endif
@@ -693,21 +714,24 @@ function! neocomplcache#do_auto_complete()"{{{
99verbose set paste
redir END
call neocomplcache#print_error(output)
- call neocomplcache#print_error('Detected set paste! Disabled neocomplcache.')
+ call neocomplcache#print_error(
+ \ 'Detected set paste! Disabled neocomplcache.')
return
endif
" Get cursor word.
let cur_text = s:get_cur_text()
+ if a:event ==# 'InsertCharPre'
+ let cur_text .= v:char
+ endif
+
" Prevent infinity loop.
if cur_text == ''
\ || cur_text == s:old_cur_text
- \ || (!neocomplcache#is_eskk_enabled()
- \ && exists('b:skk_on') && b:skk_on)
- \ || (!neocomplcache#is_eskk_enabled()
- \ && char2nr(split(cur_text, '\zs')[-1]) > 0x80)
\ || (neocomplcache#is_eskk_enabled()
\ && cur_text !~ '')
+ \ || (!neocomplcache#is_eskk_enabled() && (exists('b:skk_on') && b:skk_on)
+ \ || char2nr(split(cur_text, '\zs')[-1]) > 0x80)
let s:cur_keyword_str = ''
let s:complete_words = []
return
@@ -733,6 +757,7 @@ function! neocomplcache#do_auto_complete()"{{{
let &l:completefunc = 'neocomplcache#auto_complete'
if g:neocomplcache_enable_prefetch
+ \ && !g:neocomplcache_enable_insert_char_pre
" Do prefetch.
let s:complete_results =
\ neocomplcache#get_complete_results(s:get_cur_text())
@@ -838,9 +863,14 @@ function! neocomplcache#keyword_filter(list, cur_keyword_str)"{{{
return a:list
elseif neocomplcache#check_match_filter(cur_keyword_str)
" Match filter.
- return filter(a:list, printf(
- \ 'v:val.word =~ %s && v:val.word !=? cur_keyword_str',
- \ string('^' . neocomplcache#keyword_escape(cur_keyword_str))))
+ let expr = printf('v:val.word =~ %s',
+ \ string('^' . neocomplcache#keyword_escape(cur_keyword_str)))
+ if neocomplcache#is_auto_complete()
+ " Don't complete cursor word.
+ let expr .= ' && v:val.word !=? a:cur_keyword_str'
+ endif
+
+ return filter(a:list, expr)
else
" Use fast filter.
return neocomplcache#head_filter(a:list, cur_keyword_str)
@@ -873,7 +903,12 @@ function! neocomplcache#head_filter(list, cur_keyword_str)"{{{
\ string(a:cur_keyword_str))
endif
- return filter(a:list, expr . ' && v:val.word !=? a:cur_keyword_str')
+ if neocomplcache#is_auto_complete()
+ " Don't complete cursor word.
+ let expr .= ' && v:val.word !=? a:cur_keyword_str'
+ endif
+
+ return filter(a:list, expr)
endfunction"}}}
function! neocomplcache#fuzzy_filter(list, cur_keyword_str)"{{{
let ret = []
@@ -904,7 +939,8 @@ function! neocomplcache#fuzzy_filter(list, cur_keyword_str)"{{{
while i < max
let j = 1
while j < max
- let m[i][j] = min([m[i-1][j]+1, m[i][j-1]+1, m[i-1][j-1]+(str1[i-1] != cur_keyword_str[j-1])])
+ let m[i][j] = min([m[i-1][j]+1, m[i][j-1]+1,
+ \ m[i-1][j-1]+(str1[i-1] != cur_keyword_str[j-1])])
let j += 1
endwhile
@@ -1124,8 +1160,11 @@ endfunction"}}}
function! neocomplcache#is_text_mode()"{{{
return s:is_text_mode
endfunction"}}}
+function! neocomplcache#is_windows()"{{{
+ return neocomplcache#util#is_windows()
+endfunction"}}}
function! neocomplcache#is_win()"{{{
- return has('win32') || has('win64')
+ return neocomplcache#is_windows()
endfunction"}}}
function! neocomplcache#is_source_enabled(plugin_name)"{{{
return !get(g:neocomplcache_source_disable, a:plugin_name, 0)
@@ -1479,13 +1518,9 @@ function! s:set_complete_results_words(complete_results)"{{{
endfor
endfunction"}}}
-" Set pattern helper.
-function! neocomplcache#set_dictionary_helper(variable, keys, pattern)"{{{
- for key in split(a:keys, ',')
- if !has_key(a:variable, key)
- let a:variable[key] = a:pattern
- endif
- endfor
+" Set default pattern helper.
+function! neocomplcache#set_dictionary_helper(variable, keys, value)"{{{
+ return neocomplcache#util#set_default_dictionary_helper(a:variable, a:keys, a:value)
endfunction"}}}
" Complete filetype helper.
@@ -1839,7 +1874,8 @@ function! neocomplcache#start_manual_complete(...)"{{{
return "\<C-x>\<C-u>\<C-p>"
endfunction"}}}
function! neocomplcache#start_manual_complete_list(cur_keyword_pos, cur_keyword_str, complete_words)"{{{
- let [s:cur_keyword_pos, s:cur_keyword_str, s:complete_words] = [a:cur_keyword_pos, a:cur_keyword_str, a:complete_words]
+ let [s:cur_keyword_pos, s:cur_keyword_str, s:complete_words] =
+ \ [a:cur_keyword_pos, a:cur_keyword_str, a:complete_words]
" Set function.
let &l:completefunc = 'neocomplcache#auto_complete'
@@ -1851,7 +1887,8 @@ endfunction"}}}
" Event functions."{{{
function! s:on_insert_enter()"{{{
- if &updatetime > g:neocomplcache_cursor_hold_i_time
+ if g:neocomplcache_enable_cursor_hold_i &&
+ \ &updatetime > g:neocomplcache_cursor_hold_i_time
" Change updatetime.
let s:update_time_save = &updatetime
let &updatetime = g:neocomplcache_cursor_hold_i_time
@@ -1866,7 +1903,8 @@ function! s:on_insert_leave()"{{{
let s:skip_next_complete = 0
let s:is_prefetch = 0
- if g:neocomplcache_enable_cursor_hold_i && &updatetime < s:update_time_save
+ if g:neocomplcache_enable_cursor_hold_i &&
+ \ &updatetime < s:update_time_save
" Restore updatetime.
let &updatetime = s:update_time_save
endif
@@ -1911,7 +1949,8 @@ endfunction"}}}
" Internal helper functions."{{{
function! s:get_cur_text()"{{{
"let s:cur_text = col('.') < pos ? '' : matchstr(getline('.'), '.*')[: col('.') - pos]
- let s:cur_text = matchstr(getline('.'), '^.*\%' . col('.') . 'c' . (mode() ==# 'i' ? '' : '.'))
+ let s:cur_text = matchstr(getline('.'),
+ \ '^.*\%' . col('.') . 'c' . (mode() ==# 'i' ? '' : '.'))
" Save cur_text.
return s:cur_text
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: filename_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 04 Feb 2012.
+" Last Modified: 15 Feb 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
@@ -221,6 +221,12 @@ function! s:get_glob_files(cur_keyword_str, path)"{{{
let files = copy(s:cached_files[getcwd()])
else
+ let ftype = getftype(glob)
+ if ftype != '' && ftype !=# 'dir'
+ " Note: If glob() device files, Vim may freeze!
+ return []
+ endif
+
if a:path == ''
let files = neocomplcache#util#glob(glob)
else
@@ -264,7 +270,7 @@ function! s:get_glob_files(cur_keyword_str, path)"{{{
if a:cur_keyword_str =~ '^\$\h\w*'
let env = matchstr(a:cur_keyword_str, '^\$\h\w*')
let env_ev = eval(env)
- if neocomplcache#is_win()
+ if neocomplcache#is_windows()
let env_ev = substitute(env_ev, '\\', '/', 'g')
endif
let len_env = len(env_ev)
@@ -294,7 +300,7 @@ function! s:get_glob_files(cur_keyword_str, path)"{{{
if g:neocomplcache_enable_auto_delimiter
let dict.word .= '/'
endif
- elseif neocomplcache#is_win()
+ elseif neocomplcache#is_windows()
if '.'.fnamemodify(dict.word, ':e') =~ exts
let abbr .= '*'
endif
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: omni_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 04 Feb 2012.
+" Last Modified: 12 Feb 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
@@ -64,9 +64,6 @@ function! s:source.initialize()"{{{
"call neocomplcache#set_dictionary_helper(g:neocomplcache_omni_patterns,
"\'cpp',
"\'\h\w*\%(\.\|->\)\h\w*\|\h\w*::')
- call neocomplcache#set_dictionary_helper(g:neocomplcache_omni_patterns,
- \'vimshell',
- \'\%(\\[^[:alnum:].-]\|[[:alnum:]@/.-_+,#$%~=*]\)\{2,}')
call neocomplcache#set_dictionary_helper(g:neocomplcache_omni_patterns,
\'objc',
\'\h\w\+\|\h\w*\%(\.\|->\)\h\w*')
@@ -158,6 +155,9 @@ function! s:source.get_keyword_pos(cur_text)"{{{
try
let cur_keyword_pos = call(omnifunc, [1, ''])
catch
+ call neocomplcache#print_error(
+ \ 'Error occured calling omnifunction: ' . omnifunc)
+ call neocomplcache#print_error(v:throwpoint)
call neocomplcache#print_error(v:exception)
let cur_keyword_pos = -1
endtry
@@ -214,6 +214,9 @@ function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str)"{{{
\ [0, omnifunc ==# 'rubycomplete#Complete' ?
\ '' : cur_keyword_str])
catch
+ call neocomplcache#print_error(
+ \ 'Error occured calling omnifunction: ' . omnifunc)
+ call neocomplcache#print_error(v:throwpoint)
call neocomplcache#print_error(v:exception)
let list = []
endtry
Oops, something went wrong.

0 comments on commit 8f95f81

Please sign in to comment.