You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

93 lines
3.5 KiB

  1. "=============================================================================
  2. " FILE: neosnippet.vim
  3. " AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
  4. " License: MIT license
  5. "=============================================================================
  6. " Global options definition.
  7. call neosnippet#util#set_default(
  8. \ 'g:neosnippet#disable_runtime_snippets', {})
  9. call neosnippet#util#set_default(
  10. \ 'g:neosnippet#scope_aliases', {})
  11. call neosnippet#util#set_default(
  12. \ 'g:neosnippet#snippets_directory', '')
  13. call neosnippet#util#set_default(
  14. \ 'g:neosnippet#disable_select_mode_mappings', 1)
  15. call neosnippet#util#set_default(
  16. \ 'g:neosnippet#enable_snipmate_compatibility', 0)
  17. call neosnippet#util#set_default(
  18. \ 'g:neosnippet#expand_word_boundary', 0)
  19. call neosnippet#util#set_default(
  20. \ 'g:neosnippet#enable_conceal_markers', 1)
  21. call neosnippet#util#set_default(
  22. \ 'g:neosnippet#enable_completed_snippet', 0,
  23. \ 'g:neosnippet#enable_complete_done')
  24. call neosnippet#util#set_default(
  25. \ 'g:neosnippet#enable_optional_arguments', 1)
  26. call neosnippet#util#set_default(
  27. \ 'g:neosnippet#enable_auto_clear_markers', 1)
  28. call neosnippet#util#set_default(
  29. \ 'g:neosnippet#completed_pairs', {})
  30. call neosnippet#util#set_default(
  31. \ 'g:neosnippet#_completed_pairs',
  32. \ {'_':{ '(' : ')', '{' : '}', '"' : '"', '[' : ']' }})
  33. function! neosnippet#expandable_or_jumpable() abort
  34. return neosnippet#mappings#expandable_or_jumpable()
  35. endfunction
  36. function! neosnippet#expandable() abort
  37. return neosnippet#mappings#expandable()
  38. endfunction
  39. function! neosnippet#jumpable() abort
  40. return neosnippet#mappings#jumpable()
  41. endfunction
  42. function! neosnippet#anonymous(snippet) abort
  43. return neosnippet#mappings#_anonymous(a:snippet)
  44. endfunction
  45. function! neosnippet#expand(trigger) abort
  46. return neosnippet#mappings#_expand(a:trigger)
  47. endfunction
  48. function! neosnippet#get_snippets_directory() abort
  49. return neosnippet#helpers#get_snippets_directory()
  50. endfunction
  51. function! neosnippet#get_user_snippets_directory() abort
  52. return copy(neosnippet#variables#snippets_dir())
  53. endfunction
  54. function! neosnippet#get_runtime_snippets_directory() abort
  55. return copy(neosnippet#variables#runtime_dir())
  56. endfunction
  57. " Get marker patterns.
  58. function! neosnippet#get_placeholder_target_marker_pattern() abort
  59. return '\%(\\\@<!\|\\\\\zs\)\${\d\+:\(#:\)\?TARGET\%(:.\{-}\)\?\\\@<!}'
  60. endfunction
  61. function! neosnippet#get_placeholder_marker_pattern() abort
  62. return '<`\d\+\%(:.\{-}\)\?\\\@<!`>'
  63. endfunction
  64. function! neosnippet#get_placeholder_marker_substitute_pattern() abort
  65. return '\%(\\\@<!\|\\\\\zs\)\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}'
  66. endfunction
  67. function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() abort
  68. return '\%(\\\@<!\|\\\\\zs\)\${\([1-9]\d*\%(:.\{-}\)\?\\\@<!\)}'
  69. endfunction
  70. function! neosnippet#get_placeholder_marker_substitute_zero_pattern() abort
  71. return '\%(\\\@<!\|\\\\\zs\)\${\(0\%(:.\{-}\)\?\\\@<!\)}'
  72. endfunction
  73. function! neosnippet#get_placeholder_marker_default_pattern() abort
  74. return '<`\d\+:\zs.\{-}\ze\\\@<!`>'
  75. endfunction
  76. function! neosnippet#get_sync_placeholder_marker_pattern() abort
  77. return '<{\d\+\%(:.\{-}\)\?\\\@<!}>'
  78. endfunction
  79. function! neosnippet#get_sync_placeholder_marker_default_pattern() abort
  80. return '<{\d\+:\zs.\{-}\ze\\\@<!}>'
  81. endfunction
  82. function! neosnippet#get_mirror_placeholder_marker_pattern() abort
  83. return '<|\d\+|>'
  84. endfunction
  85. function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() abort
  86. return '\\\@<!\$\(\d\+\)'
  87. endfunction