Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version 0.2.8: First pre-alpha code release.

  • Loading branch information...
commit 7be20df48ac40b357801d3a1a7aca48fc1306e67 1 parent c8bb4b6
authored November 29, 2012 vim-scripts committed November 29, 2012

Showing 154 changed files with 23,702 additions and 112 deletions. Show diff stats Hide diff stats

  1. 577  README.md
  2. 112  VIM
  3. 15  addon-info.json
  4. 433  autoload/vimside.vim
  5. 111  autoload/vimside/browser.vim
  6. 43  autoload/vimside/cmdline.vim
  7. 183  autoload/vimside/command.vim
  8. 29  autoload/vimside/command/browse_reference_source_roots.vim
  9. 29  autoload/vimside/command/browse_source_roots.vim
  10. 101  autoload/vimside/command/completions.vim
  11. 23  autoload/vimside/command/ensime.vim
  12. 19  autoload/vimside/command/format_source.vim
  13. 84  autoload/vimside/command/hover.vim
  14. 81  autoload/vimside/command/hover/balloon.vim
  15. 99  autoload/vimside/command/hover/cmdline.vim
  16. 355  autoload/vimside/command/hover/term.vim
  17. 28  autoload/vimside/command/hover/util.vim
  18. 19  autoload/vimside/command/option_editor.vim
  19. 19  autoload/vimside/command/popup_menu.vim
  20. 39  autoload/vimside/command/position.vim
  21. 19  autoload/vimside/command/repl_config.vim
  22. 211  autoload/vimside/command/search.vim
  23. 185  autoload/vimside/command/selection.vim
  24. 207  autoload/vimside/command/selection/highlight.vim
  25. 47  autoload/vimside/command/selection/visual.vim
  26. 354  autoload/vimside/command/show_doc_symbol_at_point.vim
  27. 28  autoload/vimside/command/show_errors_and_warning.vim
  28. 19  autoload/vimside/command/symbol_at_point.vim
  29. 19  autoload/vimside/command/typecheck_all.vim
  30. 19  autoload/vimside/command/typecheck_file.vim
  31. 19  autoload/vimside/command/uses_of_symbol_at_point.vim
  32. 620  autoload/vimside/ensime/config.vim
  33. 139  autoload/vimside/ensime/io.vim
  34. 43  autoload/vimside/ensime/messages.vim
  35. 893  autoload/vimside/ensime/swank.vim
  36. 32  autoload/vimside/error.vim
  37. 635  autoload/vimside/forms/menu.vim
  38. 459  autoload/vimside/forms/optioneditor.vim
  39. 245  autoload/vimside/forms/sourcebrowser.vim
  40. 45  autoload/vimside/log.vim
  41. 295  autoload/vimside/options/default.vim
  42. 2,179  autoload/vimside/options/defined.vim
  43. 652  autoload/vimside/options/manager.vim
  44. 3,035  autoload/vimside/plugin/sourcebrowser.vim
  45. 158  autoload/vimside/preview.vim
  46. 83  autoload/vimside/quickfix.vim
  47. 409  autoload/vimside/scheduler.vim
  48. 916  autoload/vimside/sexp.vim
  49. 24  autoload/vimside/swank/event/clear_all_java_notes.vim
  50. 24  autoload/vimside/swank/event/clear_all_scala_notes.vim
  51. 26  autoload/vimside/swank/event/compiler_ready.vim
  52. 19  autoload/vimside/swank/event/debug_breakpoint.vim
  53. 20  autoload/vimside/swank/event/debug_death.vim
  54. 20  autoload/vimside/swank/event/debug_disconnect.vim
  55. 20  autoload/vimside/swank/event/debug_exception.vim
  56. 19  autoload/vimside/swank/event/debug_output.vim
  57. 20  autoload/vimside/swank/event/debug_start.vim
  58. 20  autoload/vimside/swank/event/debug_stop.vim
  59. 20  autoload/vimside/swank/event/debug_thread_death.vim
  60. 20  autoload/vimside/swank/event/debug_thread_start.vim
  61. 32  autoload/vimside/swank/event/full_typecheck_finished.vim
  62. 28  autoload/vimside/swank/event/indexer_ready.vim
  63. 93  autoload/vimside/swank/event/java_notes.vim
  64. 64  autoload/vimside/swank/event/scala_notes.vim
  65. 92  autoload/vimside/swank/rpc/builder_add_files.vim
  66. 86  autoload/vimside/swank/rpc/builder_init.vim
  67. 89  autoload/vimside/swank/rpc/builder_remove_files.vim
  68. 91  autoload/vimside/swank/rpc/builder_update_files.vim
  69. 94  autoload/vimside/swank/rpc/call_completion.vim
  70. 86  autoload/vimside/swank/rpc/cancel_refactor.vim
  71. 154  autoload/vimside/swank/rpc/completions.vim
  72. 93  autoload/vimside/swank/rpc/connection_info.vim
  73. 89  autoload/vimside/swank/rpc/debug_active_vm.vim
  74. 88  autoload/vimside/swank/rpc/debug_attach.vim
  75. 94  autoload/vimside/swank/rpc/debug_backtrace.vim
  76. 87  autoload/vimside/swank/rpc/debug_clear_all_breaks.vim
  77. 91  autoload/vimside/swank/rpc/debug_clear_break.vim
  78. 88  autoload/vimside/swank/rpc/debug_continue.vim
  79. 90  autoload/vimside/swank/rpc/debug_list_breakpoints.vim
  80. 92  autoload/vimside/swank/rpc/debug_locate_name.vim
  81. 89  autoload/vimside/swank/rpc/debug_next.vim
  82. 87  autoload/vimside/swank/rpc/debug_run.vim
  83. 89  autoload/vimside/swank/rpc/debug_set_break.vim
  84. 92  autoload/vimside/swank/rpc/debug_set_value.vim
  85. 89  autoload/vimside/swank/rpc/debug_start.vim
  86. 89  autoload/vimside/swank/rpc/debug_step.vim
  87. 88  autoload/vimside/swank/rpc/debug_step_out.vim
  88. 87  autoload/vimside/swank/rpc/debug_stop.vim
  89. 92  autoload/vimside/swank/rpc/debug_to_string.vim
  90. 92  autoload/vimside/swank/rpc/debug_value.vim
  91. 92  autoload/vimside/swank/rpc/exec_refactor.vim
  92. 96  autoload/vimside/swank/rpc/exec_undo.vim
  93. 109  autoload/vimside/swank/rpc/expand_selection.vim
  94. 97  autoload/vimside/swank/rpc/format_source.vim
  95. 101  autoload/vimside/swank/rpc/import_suggestions.vim
  96. 142  autoload/vimside/swank/rpc/init_project.vim
  97. 93  autoload/vimside/swank/rpc/inspect_package_by_path.vim
  98. 93  autoload/vimside/swank/rpc/inspect_type_at_point.vim
  99. 92  autoload/vimside/swank/rpc/inspect_type_by_id.vim
  100. 95  autoload/vimside/swank/rpc/method_bytecode.vim
  101. 92  autoload/vimside/swank/rpc/package_member_completion.vim
  102. 90  autoload/vimside/swank/rpc/patch_source.vim
  103. 103  autoload/vimside/swank/rpc/peek_undo.vim
  104. 108  autoload/vimside/swank/rpc/prepare_refactor.vim
  105. 153  autoload/vimside/swank/rpc/public_symbol_search.vim
  106. 89  autoload/vimside/swank/rpc/remove_file.vim
  107. 182  autoload/vimside/swank/rpc/repl_config.vim
  108. 80  autoload/vimside/swank/rpc/shutdown_server.vim
  109. 237  autoload/vimside/swank/rpc/symbol_at_point.vim
  110. 99  autoload/vimside/swank/rpc/symbol_designations.vim
  111. 92  autoload/vimside/swank/rpc/type_at_point.vim
  112. 93  autoload/vimside/swank/rpc/type_by_id.vim
  113. 90  autoload/vimside/swank/rpc/type_by_name.vim
  114. 93  autoload/vimside/swank/rpc/type_by_name_at_point.vim
  115. 89  autoload/vimside/swank/rpc/typecheck_all.vim
  116. 102  autoload/vimside/swank/rpc/typecheck_file.vim
  117. 95  autoload/vimside/swank/rpc/typecheck_files.vim
  118. 192  autoload/vimside/swank/rpc/uses_of_symbol_at_point.vim
  119. 209  autoload/vimside/swank/rpc/util.vim
  120. 175  autoload/vimside/util.vim
  121. 33  autoload/vimside/version.vim
  122. 43  autoload/vimside/vimplugins.vim
  123. 140  autoload/vimside/vimproc.vim
  124. 69  data/vimside/_ensime
  125. 1  data/vimside/build/classes/EMPTY
  126. 79  data/vimside/ensime_config.vim
  127. 40  data/vimside/example_options_project.vim
  128. 146  data/vimside/example_options_user.vim
  129. 23  data/vimside/example_plugin_user.vim
  130. 10  data/vimside/src/main/java/com/megaanum/wicket/EventCallback.java
  131. 22  data/vimside/src/main/scala/com/megaanum/Bar.scala
  132. 41  data/vimside/src/main/scala/com/megaanum/Foo.scala
  133. 11  data/vimside/src/main/scala/com/megaanum/wicket/Component.scala
  134. 26  data/vimside/src/main/scala/com/megaanum/wicket/DispatchToAnnotatedMethod.scala
  135. 11  data/vimside/src/main/scala/com/megaanum/wicket/IEvent.scala
  136. 1,482  doc/vimside.txt
  137. 7  ftplugin/scala.vim
  138. 215  plugin/vimside.vim
  139. 69  test/ensime
  140. 38  test/ensime_config.vim
  141. 3  test/make_clean
  142. 1  test/test001.msgout
  143. 13  test/test001.tap
  144. 56  test/test001.vim
  145. 75  test/test002.vim
  146. 57  test/test003.vim
  147. 52  test/test004.vim
  148. 46  test/test005.vim
  149. 41  test/test006.vim
  150. 183  test/test007.vim
  151. 19  test/test008.vim
  152. 20  test/test009.vim
  153. 21  test/test010.vim
  154. 17  test/x
577  README.md
Source Rendered
... ...
@@ -0,0 +1,577 @@
  1
+# vimside
  2
+
  3
+Vim Scala IDE (VimSIde) built upon ENSIME
  4
+
  5
+# Introduction
  6
+
  7
+This is a pre-alpha release of Vimside, a Vim Scala IDE.
  8
+Only a small number of all of the ENSIME capabilities have
  9
+been implemented and it has only been tested against the
  10
+very small Scala/Java test source project bundled with it.
  11
+
  12
+I have checked the source into github primarily so that
  13
+the source is somewhere other than on my local machines.
  14
+I expect to continue to update the sources on github
  15
+frequently, flushing out the features.
  16
+
  17
+Current Supported Ensime Commands:
  18
+
  19
+  Start Ensime
  20
+    This makes sure that the current environment and Option settings are
  21
+    correct and then launches the Ensime backend server. The Ensime server
  22
+    writes a file where it puts the socket port that its client should use.
  23
+    Vimside reads that file, gets the port number, and provides Ensime
  24
+    with configuration information.
  25
+
  26
+  Stop Ensime
  27
+    There is also an autocmd that will kill the Ensime server when the 
  28
+    user exists Vim.
  29
+
  30
+  Map <Tab> to Omni-Code Completion in insert mode
  31
+    This mapping maybe overridden by the mapping is some other plugin
  32
+    (like a snipmate binding), So, if it does not seem to work for you
  33
+    list the current mappings and see what is overriding it.
  34
+    Very Useful.
  35
+
  36
+  Symbol At Point
  37
+    With cursor on variable, jump to the definition of its symbol.
  38
+    One can easily jump back and forth.
  39
+    The Emacs key binding uses the Meta key. In GVim I could get this
  40
+    to work and so in GVim the key mapping mirrors the Emacs Ensime
  41
+    key binding. But, with Vim in an XTerm, I could not get the Meta/Alt
  42
+    key to be recognized (and there is NO single place where there is
  43
+    a definitive, failsafe guide for getting Meta/Alt key mappings to 
  44
+    work, so I have a different binding for Vim.
  45
+    Very useful.
  46
+    Implementations: 1
  47
+
  48
+  Selection Expand/Contract
  49
+    Select the surrounding syntactic context and easily shrink/grow the
  50
+    selection.
  51
+    Implementations: 2
  52
+
  53
+  Global Public Search
  54
+    Search for method or types through project code using space separated
  55
+    search terms.
  56
+    Useful.
  57
+    Implementations: 1
  58
+
  59
+  Hover To Symbol
  60
+    Place cursor (or mouse) over a variable and its Symbol will be 
  61
+    displayed. 
  62
+    Cute but requires frequent server polling.
  63
+    Implementations: 3
  64
+
  65
+  Open Browser Info
  66
+    With cursor over Scala/Java variable, type, etc. invoke the associated
  67
+    on-line web api documentation (if it exists).
  68
+    Useful.
  69
+    Implementations: 1
  70
+
  71
+  Use of Symbol At Point
  72
+    List all references to the symbol under the cursor.
  73
+    Very useful.
  74
+    Implementations: 1
  75
+
  76
+  Launch Repl
  77
+    Switch to the Scala interpreter, with project classes in the classpath.
  78
+    TBD: cut/paste code fragments into Repl.
  79
+    Implementations: 1
  80
+
  81
+  Typecheck Current File
  82
+    Typecheck the current file and display errors and warnings.
  83
+    Very useful.
  84
+    Implementations: 1
  85
+
  86
+  Typecheck All Files
  87
+    Typecheck the all files and display errors and warnings.
  88
+    Very useful.
  89
+    Implementations: 1
  90
+
  91
+  Re-Show Errors/Warnings
  92
+    Show all errors and warnings in the project.
  93
+    Very useful.
  94
+    Implementations: 1
  95
+
  96
+  Format Source
  97
+    Format the current Scala source file.
  98
+    Useful.
  99
+    Implementations: 1
  100
+
  101
+  Popup Menu
  102
+    Bring up Popup menu with all Vimside commands (requires Forms library).
  103
+    Useful for folks who have not yet learned the key mappings.
  104
+    Implementations: 1
  105
+
  106
+  Browse Source Roots
  107
+    Directory browser of project sources (project code base).
  108
+    Implementations: 2
  109
+
  110
+  Browse Reference Source Roots
  111
+    Directory browser of project reference sources (Java and Scala libraries).
  112
+    Implementations: 2
  113
+
  114
+  Option Viewer/Editor
  115
+    Bring up the Option Viewer/Editor (requires Forms library). Lets one
  116
+    see all of the Vimside configurable Options and their current value.
  117
+    To be implemented will be an Editor allowing for the modification of
  118
+    some "dynamic" Options at runtime.
  119
+    Implementations: 1
  120
+
  121
+  Completions
  122
+    OmmiCompletions using <c-x><c-o>.
  123
+    Very Useful.
  124
+    Implementations: 1
  125
+
  126
+
  127
+Ensime Capabilities to be Supported:
  128
+
  129
+  Package Inspector
  130
+    Inspect imported package, current file's package and the package
  131
+    specified in the ensime configuration ':package'.
  132
+
  133
+  Type Inspector
  134
+    Click on type and see information, Click on information and see its 
  135
+    information. Move about Inspector history.
  136
+
  137
+  SBT Command-Line
  138
+    Switch to the sbt command-line (works for sbt projects only)
  139
+
  140
+  Scalex
  141
+    Seems to be a dead project (see: http://scalex.org/)
  142
+
  143
+  Refactoring
  144
+    Rename the symbol at point.
  145
+    Organize imports.
  146
+    Extract local.
  147
+    Extract method.
  148
+    Inline local.
  149
+    Add import for type at point.
  150
+
  151
+  Building
  152
+    Build the entire project.
  153
+    Rebuild the project incrementally.
  154
+
  155
+  Run Application
  156
+
  157
+  Debug Application
  158
+    Start and run the debugger.
  159
+    Start and run the debugger.
  160
+    Set a breakpoint.
  161
+    Clear a breakpoint.
  162
+    Step.
  163
+    Step over.
  164
+    Step out.
  165
+    Continue from a breakpoint.
  166
+    Kill the debug session.
  167
+    Inspect the local variable at cursor.
  168
+    Show backtrace.
  169
+
  170
+  And others
  171
+
  172
+
  173
+# Installation
  174
+
  175
+## Download
  176
+
  177
+One can download a zip snapshot or use a Vim plugin manager (such
  178
+as VAM).
  179
+
  180
+## Dependency
  181
+
  182
+Vimside depends upon Vimproc 
  183
+[GitHup]( https://github.com/Shougo/vimproc)
  184
+for a C-language binding to sockets
  185
+(and, thus to the Ensime server) and Vimshell 
  186
+[GitHup]( https://github.com/Shougo/vimshell)
  187
+for launching and managing communications with the Scala Repl.
  188
+
  189
+
  190
+## Vimside Directory layout
  191
+
  192
+After unpacking the Vimside directory layout should look like:
  193
+
  194
+    $HOME/.vim/
  195
+      autoload/
  196
+        vimside.vim
  197
+        vimside/
  198
+          " vimside code
  199
+      data/
  200
+        " data that persists between invocations of a plugin
  201
+        vimside/
  202
+            " examples, local test Scala/Java source tree
  203
+      doc/
  204
+        vimside.txt
  205
+      plugin/
  206
+        vimside.vim
  207
+
  208
+
  209
+## Intalling from Vim.org
  210
+
  211
+Anyway, to get the Vimside zip file from vim.org go to
  212
+http://www.vim.org/scripts/script.php?script_id=4298
  213
+and download the latest version. Unzip it in your '.vim' or 'vimfiles'
  214
+directory.
  215
+
  216
+
  217
+Now, Vimside depends upon Vimshell and Vimproc.  It is recommended that 
  218
+you get the latest releases of these since they both were modified to add
  219
+some support for capabilities identified while creating Vimside. They are
  220
+located at:
  221
+[Vimproc](https://github.com/Shougo/vimproc)
  222
+[Vimshell](https://github.com/Shougo/vimshell)
  223
+Download them both and unzip them.
  224
+
  225
+For Vimproc, there is an additional step because it includes a C-language 
  226
+library. You must compile the library for your machine.  Vimproc comes with 
  227
+a number of make-files. Pick the right one and build the library. Since 
  228
+Vimside is for Scala programmers, I expect that building a C-library with 
  229
+a supplied makefile will not be too challenging :-)
  230
+
  231
+In addition, Vimside can be configured so that it can use the Vim
  232
+Forms and Self libraries. The latest version of these can be gotten
  233
+from github or you can get released versions from vim.org:
  234
+[Self](http://www.vim.org/scripts/script.php?script_id=4150)
  235
+[Forms]( http://www.vim.org/scripts/script.php?script_id=3072)
  236
+
  237
+For most of the Vimside commands there are associated Options that configure 
  238
+how the command can be used. Many such Options allow the user to run one 
  239
+of multiple possible implementations.  In particular, there might be a 
  240
+"native" Vim, non-Forms-based solution and also a Forms-based solution. The 
  241
+Forms-based solution is built upon "native" Vim but requires the downloading 
  242
+of the above two libraries: Self and Forms. Each such command with multiple 
  243
+implementations can be configure individually to use or not use Forms.
  244
+
  245
+What's more, the Forms library allows one to used a popup menu
  246
+(useful if you do not know all of the Vimside key-mappings yet).
  247
+And, it is expected that the package-inspector and the type-inspector
  248
+will only have Forms implementations - how to do a type-inspector
  249
+otherwise might be a challenge.
  250
+
  251
+## Intalling with vim-addon-manager (VAM)
  252
+
  253
+For more information about vim-addon-manager, see 
  254
+[vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) and 
  255
+[Vim-addon-manager getting started](https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-getting-started.txt)
  256
+
  257
+In your .vimrc, add self as shown below:
  258
+
  259
+    fun SetupVAM()
  260
+
  261
+      ...
  262
+
  263
+      let g:vim_addon_manager = {}
  264
+      let g:vim_addon_manager.plugin_sources = {}
  265
+
  266
+      ....
  267
+
  268
+      let g:vim_addon_manager.plugin_sources['self'] = {'type': 'git', 'url': 'git://github.com/megaannum/self'}
  269
+      let g:vim_addon_manager.plugin_sources['forms'] = {'type': 'git', 'url': 'git://github.com/megaannum/forms'}
  270
+      let g:vim_addon_manager.plugin_sources['vimproc'] = {'type': 'git', 'url': 'git://github.com/Shougo/vimproc'}
  271
+      let g:vim_addon_manager.plugin_sources['vimshell'] = {'type': 'git', 'url': 'git://github.com/Shougo/vimshell'}
  272
+      let g:vim_addon_manager.plugin_sources['ensime'] = {"type": "git", "url": "git://github.com/aemoncannon/ensime", "branch" : "scala-2.9"}
  273
+      let g:vim_addon_manager.plugin_sources['vimside'] = {'type': 'git', 'url': 'git://github.com/megaannum/vimside'}
  274
+
  275
+
  276
+      let plugins = [
  277
+        \ 'self',
  278
+        \ 'forms',
  279
+        \ 'vimproc',
  280
+        \ 'vimshell',
  281
+        \ 'ensime',
  282
+        \ 'vimside'
  283
+        \ ]
  284
+
  285
+      call vam#ActivateAddons(plugins,{'auto_install' : 0})
  286
+
  287
+      ...
  288
+
  289
+    endf
  290
+    call SetupVAM()
  291
+
  292
+
  293
+Note that to use Vimside, the 'self' and 'forms' libraries above are
  294
+optional. With the 'forms' library, Vimside supports additional 
  295
+features such as a popmenu of commands and the type and package inspectors
  296
+(not yet implemented).
  297
+
  298
+Also, when one downloads Vimproc, you MUST go into the vimproc
  299
+directory and build the C-language file 'proc.c' using one of the
  300
+supplied make files.
  301
+
  302
+Now start Vim. You will be asked by vim-addon-manager 
  303
+if you would like to download and install the plugins.
  304
+
  305
+## Installing with pathogen
  306
+
  307
+I do not use pathogen. An example usage would be welcome.
  308
+
  309
+## Ensime Install
  310
+
  311
+Ensime can be downloaded from https://github.com/aemoncannon/ensime
  312
+and its on-line manual is at: aemoncannon.github.com/ensime/index.html/.
  313
+
  314
+In addition, for ENSIME, there are pre-built releases available at:
  315
+https://github.com/aemoncannon/ensime/downloads.
  316
+I highly recommend getting these (Scala 2.9.2 and/or 2.10.0-SNAPSHOT)
  317
+rather than trying to build the Ensime Scala code yourself.
  318
+
  319
+Ensime is not a Vim plugin. It is a Scale program. It has to be installed
  320
+and built or a pre-build version has to be used. It can be downloaded
  321
+from:
  322
+
  323
+    https://github.com/aemoncannon/ensime
  324
+
  325
+One can the follow the instructions there and build it. 
  326
+
  327
+I have never done this. Rather, I have downloaded a pre-build bundle. 
  328
+One for Scala 2.9 and another for Scala 10.0. These can be found at:
  329
+
  330
+    https://github.com/aemoncannon/ensime/downloads
  331
+
  332
+The Ensime build directory has the following layout using
  333
+ensime_2.9.2-0.9.8.1 as an example:
  334
+
  335
+    ensime_2.9.2-0.9.8.1/
  336
+        bin/                 
  337
+        LICENSE
  338
+        elisp/
  339
+        lib/                 
  340
+        README.md
  341
+
  342
+or ensime_2.10.0-SNAPSHOT-0.9.7:
  343
+
  344
+    ensime_2.10.0-SNAPSHOT-0.9.7/
  345
+        bin/  
  346
+        elisp/  
  347
+        lib/  
  348
+        LICENSE  
  349
+        README.md
  350
+
  351
+It is important that the value of the 'vimside-scala-version'
  352
+Option agrees with the Ensime build version. For
  353
+ensime_2.9.2-0.9.8.1 (the default value):
  354
+
  355
+    call owner.Set("vimside-scala-version", "2.9.2")
  356
+
  357
+and for ensime_2.10.0-SNAPSHOT-0.9.7:
  358
+
  359
+    call owner.Set("vimside-scala-version", "2.10.0")
  360
+
  361
+These values can be set in 'data/vimside/options_user.vim'.
  362
+
  363
+In addition, the version of Java ($JAVA_HOME/bin/java -version)
  364
+in the window  that runs Vim (or launched GVim) must agree with
  365
+the value of the Option 'vimside-java-version'. This Option
  366
+has the default value of '1.6' and can be set, again, in
  367
+'data/vimside/options_user.vim':
  368
+
  369
+    call owner.Set("vimside-java-version", "1.6")
  370
+
  371
+Having built Ensime or downloaded a pre-built package, you must
  372
+set an Option in Vimside so that Vimside can locate the script
  373
+used to start the Ensime server. To set a Vimside Option, you
  374
+must copy the 'example_options_user.vim' located in
  375
+'data/vimside' to a file called 'options_user.vim' and
  376
+edit it.
  377
+
  378
+There is two different ways to do this.
  379
+
  380
+The first is to set the Option 'ensime-install-path' to the
  381
+location of downloaded Ensime source. If you use the VAM plugin manager,
  382
+then Ensime will be in the directory:
  383
+
  384
+    $HOME/.vim/vim-addons/ensime
  385
+
  386
+or
  387
+
  388
+    $HOME/vimfiles/vim-addons/ensime.
  389
+
  390
+so you would set the Option accordingly:
  391
+
  392
+    call owner.Set("ensime-install-path", $HOME . "/.vim/vim-addons/ensime")
  393
+
  394
+or
  395
+
  396
+    call owner.Set("ensime-install-path", $HOME . "/vimfiles/vim-addons/ensime")
  397
+
  398
+Then depending upon the name of the build directory, which is under the
  399
+'ensime-install-path' Option value directory location, you would
  400
+set the value of the Option 'ensime-dist-dir' to that directory name.
  401
+For example:
  402
+
  403
+    call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.1")
  404
+
  405
+or
  406
+
  407
+    call owner.Set("ensime-dist-dir", "ensime_2.10.0-SNAPSHOT-0.9.7")
  408
+
  409
+Alternatively, you can specify the full path to the ensime distribution
  410
+using the Option 'ensime-dist-path'. As an example, if you installed
  411
+an Ensime build package in some Scala directory, you might set
  412
+the Option as:
  413
+
  414
+    call owner.Set("ensime-dist-path", $HOME . "/scala/ensime/ensime_2.9.2-0.9.8.1")
  415
+
  416
+If you set the 'ensime-dist-path', it is checked first and if it exists it
  417
+is used rather than the 'ensime-install-path' and 'ensime-dist-dir' combination.
  418
+
  419
+Currently, Vimside does not support the Ensime SBT commands (yet to be
  420
+implemented). When such support is created, there is an additional
  421
+library, an SBT Plugin that supports integration with the ENSIME IDE:
  422
+https://github.com/aemoncannon/ensime-sbt-cmd
  423
+
  424
+# Usage
  425
+
  426
+Look at the plugin/vimside.vim file for key mappings: how to
  427
+start the Ensime server and the currently supported commands.
  428
+
  429
+RECOMMENDED for initial testing:
  430
+To run against test Scala/Java project, first in data/vimside directory
  431
+copy example_options_user.vim to options_user.vim.
  432
+
  433
+    > cd $HOME/.vim/data/vimside
  434
+    > /bin/cp example_options_user.vim options_user.vim
  435
+
  436
+Then, in options_user.vim uncomment the following two lines:
  437
+
  438
+    call a:option.Set("test-ensime-file-use", 1)
  439
+    call a:option.Set("ensime-config-file-name", "ensime_config.vim")
  440
+
  441
+This tells Vimside to use the test project code and to use the
  442
+ensime_config.vim as the source for Ensime Configuration.
  443
+
  444
+If one want to have one or more projects then one will most likely
  445
+want to have project specific Vimside configuration capabilities.
  446
+There is an Option for that.
  447
+
  448
+There is a single file to configure Vimside Options under '.vim', 
  449
+'data/vimside/options_user.vim'. This is sufficient if you only have
  450
+a single project on your machine. But, if you have or plan to have more
  451
+than one projects on your machine you might want to have project
  452
+specific option configuration files. There are two Options that 
  453
+control this.
  454
+
  455
+The first Option is: 'vimside-project-options-enabled' and if 
  456
+true (default is false), then Vimside will look for a configuration
  457
+file with name given by the second Option: 'vimside-project-options-file-name'.
  458
+
  459
+The default value of the 'vimside-project-options-file-name' Option
  460
+is 'options_project.vim'.
  461
+
  462
+While in the 'options_user.vim' file, an Option value is set using
  463
+the 'Set' function, e.g,:
  464
+
  465
+  call owner.Set("vimside-scala-version", "2.9.2")
  466
+
  467
+In the 'options_project.vim' file, the Option Update function must be used:
  468
+
  469
+  call owner.Update("vimside-scala-version", "2.10.0")
  470
+
  471
+This is because "Set" can only be called once per-Option (while, 'Update'
  472
+can be called any number of times).
  473
+
  474
+So, in the 'options_user.vim' one might have:
  475
+
  476
+  call owner.Set("vimside-scala-version", "2.9.2")
  477
+  call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.1")
  478
+  call owner.Set("ensime-config-file-name", "ensime_config.vim")
  479
+
  480
+in a project file there might be:
  481
+
  482
+  call owner.Update("vimside-scala-version", "2.10.0")
  483
+  call owner.Update("ensime-dist-dir", "ensime_2.10.0-SNAPSHOT-0.9.7")
  484
+  call owner.Update("ensime-config-file-name", "_ensime")
  485
+
  486
+An alternative approach is to also treat the 'data/vimside/' test code
  487
+as also a project, in that, it has its own 'options_project.vim' file.
  488
+To do this one must do the following:
  489
+
  490
+1) In the 'options_user.vim' file enable project local options files:
  491
+
  492
+    call owner.Set("vimside-project-options-enabled", 1)
  493
+
  494
+While one can also uncomment/add addition option value setting,
  495
+if one wants all projects to share some behavior or to set some
  496
+default behavior (which can be over-ridden on a project-by-project
  497
+basis), but enabling the above Option is all that is need in this file.
  498
+
  499
+2) In the 'data/vimside' directory create a 'options_project.vim' such as:
  500
+
  501
+    " full path to this file
  502
+    let s:full_path=expand('<sfile>:p')
  503
+
  504
+    " full path to this file's directory
  505
+    let s:full_dir=fnamemodify(s:full_path, ':h')
  506
+
  507
+    function! g:VimsideOptionsProjectLoad(owner)
  508
+      let owner = a:owner
  509
+
  510
+      "--------------
  511
+      " Enable logging
  512
+      call owner.Set("ensime-log-enabled", 1)
  513
+      call owner.Set("vimside-log-enabled", 1)
  514
+      "--------------
  515
+
  516
+      "--------------
  517
+      " Defined Java versions: '1.5', '1.6', '1.7'
  518
+      " Defined Scala versions: '2.9.2', '2.10.0'
  519
+      " Minor version numbers not needed
  520
+      " Scala version MUST match 'ensime-dist-dir' used.
  521
+      call owner.Set("vimside-java-version", "1.6")
  522
+      call owner.Set("vimside-scala-version", "2.9.2")
  523
+      "--------------
  524
+      
  525
+      "--------------
  526
+      " Which build version of Ensime to use. 
  527
+      call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.1")
  528
+      "--------------
  529
+
  530
+      "--------------
  531
+      " To run against ensime test project code
  532
+      " Location of test directory
  533
+      call owner.Set("test-ensime-file-dir", s:full_dir)
  534
+      " Uncomment to run against demonstration test code
  535
+      call owner.Set("test-ensime-file-use", 1)
  536
+      " The Ensime Config information is in a file called 'ensime_config.vim'
  537
+      call owner.Set("ensime-config-file-name", "ensime_config.vim")
  538
+      "--------------
  539
+
  540
+      "--------------
  541
+      " Vimside uses Forms library 
  542
+      call owner.Set("forms-use", 1)
  543
+      "--------------
  544
+
  545
+      "--------------
  546
+      " Hover Options
  547
+      call owner.Set("vimside-hover-balloon-enabled", 0)
  548
+      call owner.Set("vimside-hover-term-balloon-enabled", 0)
  549
+      "--------------
  550
+    endfunction
  551
+
  552
+This will instruct Vimside to use the "test" source code and configuration
  553
+files.
  554
+
  555
+3) In all your other projects on this machine, create their own 
  556
+project-specific 'options_project.vim' files.
  557
+
  558
+This is a very flexible way of configuring Vimside.
  559
+
  560
+# Supported Platforms
  561
+
  562
+Ought to work most everywhere
  563
+
  564
+## Tutorial
  565
+
  566
+None available yet.
  567
+
  568
+## Acknowledgements and thanks
  569
+
  570
+Daniel Spiewak has a JEdit binding to Ensime and a simply great video
  571
+explaining why a true editor with Ensime is better than an Eclipse 
  572
+Ide (https://www.youtube.com/watch?v=cd2LV0xy9G8 MUST SEE) 
  573
+and usage examples (http://vimeo.com/28597033).
  574
+
  575
+Jeanluc Chasseriau who wrote the python-based Envim Vim binding
  576
+to Ensime: https://github.com/jlc/envim.
  577
+
112  VIM
... ...
@@ -1,112 +0,0 @@
1  
-Vim
2  
-
3  
-=================================================
4  
-description
5  
-=================================================
6  
-
7  
-This is the pre-alpha release of Vimside (Vim Scala IDE).
8  
-Vimside is built upon the ENSIME server:
9  
-github: https://github.com/aemoncannon/ensime
10  
-manual: http://aemoncannon.github.com/ensime/index.html
11  
-
12  
-I have checked the source into github primarily so that
13  
-the source is somewhere other than on my local machines.
14  
-I expect to continue to update the sources on github
15  
-on a pretty reason rate, flushing out the features.
16  
-
17  
-Vimside communicates with the Ensime server using 
18  
-Shougo vimproc ( git://github.com/Shougo/vimproc ),
19  
-a very clean and elegant C-language binding to sockets
20  
-(and also pipes, ptys, files, etc.).
21  
-Vimside also uses Shougo vimshell to launch and communicate with
22  
-the Scala Repl.
23  
-
24  
-The current pre-alpha has only be run against the Ensime
25  
-pre-built ensime_2.9.2-0.9.8.1.tar.gz download.
26  
-
27  
-=================================================
28  
-install details
29  
-=================================================
30  
-
31  
-Currently, the zip file on www.vim.org is, basically,
32  
-empty; its a place holder. 
33  
-To install one must get the source from github
34  
-[githup](http://github.com/megaannum/vimside).
35  
-
36  
-
37  
-If as a developer, one wants fixes as they appear, one can clone the 
38  
-github {Vimside} repository and, as updates appear, copy the files
39  
-over to you Vim home location.
40  
-
41  
-Vim has a number of third-party plugin managers. If you are using one
42  
-you can configure it to automatically download and install {Vimside}.
43  
-
44  
-After unpacking the Vimside directory layout should look like:
45  
-
46  
-    $HOME/.vim/
47  
-      autoload/
48  
-        vimside.vim
49  
-        vimside/
50  
-          " vimside code
51  
-      data/
52  
-        " data that persists between invocations of a plugin
53  
-        vimside/
54  
-            " examples, local test scala/java source tree
55  
-      doc/
56  
-        vimside.txt
57  
-      plugin/
58  
-        vimside.vim
59  
-
60  
-Intalling with vim-addon-manager (VAM)
61  
-
62  
-For more information about vim-addon-manager, see [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) and [Vim-addon-manager getting started](https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-getting-started.txt)
63  
-
64  
-In your .vimrc, add self as shown below:
65  
-
66  
-    fun SetupVAM()
67  
-
68  
-      ...
69  
-
70  
-      let g:vim_addon_manager = {}
71  
-      let g:vim_addon_manager.plugin_sources = {}
72  
-
73  
-      ....
74  
-
75  
-      let g:vim_addon_manager.plugin_sources['self'] = {'type': 'git', 'url': 'git://github.com/megaannum/self'}
76  
-      let g:vim_addon_manager.plugin_sources['forms'] = {'type': 'git', 'url': 'git://github.com/megaannum/forms'}
77  
-      let g:vim_addon_manager.plugin_sources['vimproc'] = {'type': 'git', 'url': 'git://github.com/Shougo/vimproc'}
78  
-      let g:vim_addon_manager.plugin_sources['vimshell'] = {'type': 'git', 'url': 'git://github.com/Shougo/vimshell'}
79  
-      let g:vim_addon_manager.plugin_sources['vimside'] = {'type': 'git', 'url': 'git://github.com/megaannum/vimside'}
80  
-
81  
-
82  
-      let plugins = [
83  
-        \ 'self',
84  
-        \ 'forms',
85  
-        \ 'vimproc',
86  
-        \ 'vimshell',
87  
-        \ 'vimside'
88  
-        \ ]
89  
-
90  
-      call vam#ActivateAddons(plugins,{'auto_install' : 0})
91  
-
92  
-      ...
93  
-
94  
-    endf
95  
-    call SetupVAM()
96  
-
97  
-Note that to use Vimside, the 'self' and 'forms' libraries above are
98  
-optional. With the 'forms' library, Vimside supports additional 
99  
-features such as a popmenu of commands and the type and package inspectors
100  
-(not yet implemented).
101  
-
102  
-Now start Vim. You will be asked by vim-addon-manager 
103  
-if you would like to download and install the plugins.
104  
-
105  
-In addition, for ENSIME, there are pre-built releases available at:
106  
-https://github.com/aemoncannon/ensime/downloads.
107  
-I highly recommend getting these (Scala 2.9.2 and/or 2.10.0-SNAPSHOT)
108  
-rather than trying to build the Ensime Scala code yourself.
109  
-
110  
-
111  
-Installing with pathogen:
112  
-I do not use pathogen. An example usage would be welcome.
15  addon-info.json
... ...
@@ -0,0 +1,15 @@
  1
+{
  2
+  "name" : "vimside",
  3
+  "version" : "0.2",
  4
+  "author" : "Richard Emberson <richard . emberson at gmail com>",
  5
+  "maintainer" : "Richard Emberson <richard . emberson at gmail com>",
  6
+  "repository" : {"type": "git", "url":
  7
+"git://github.com/megaannum/vimside.git", "branch" : "master"},
  8
+  "dependencies" : {
  9
+    "self": {},
  10
+    "forms": {},
  11
+    "vimproc": {},
  12
+    "vimshell": {}
  13
+  },
  14
+  "description" : "Vim Scala Ide"
  15
+}
433  autoload/vimside.vim
... ...
@@ -0,0 +1,433 @@
  1
+" ============================================================================
  2
+" vimside.vim
  3
+"
  4
+" File:          vimside.vim
  5
+" Summary:       Vimside top level file
  6
+" Author:        Richard Emberson <richard.n.embersonATgmailDOTcom>
  7
+" Last Modified: 2012
  8
+" Version:       See: autoload/vimside/version.vim
  9
+" Modifications:
  10
+"
  11
+" Tested on vim 7.3 on Linux
  12
+"
  13
+" Depends upon: NONE
  14
+"
  15
+" ============================================================================
  16
+" Intro: {{{1
  17
+" ============================================================================
  18
+
  19
+
  20
+function! vimside#version()
  21
+  return vimside#version#Str()
  22
+endfunction
  23
+
  24
+let s:LOG = function("vimside#log#log")
  25
+let s:ERROR = function("vimside#log#error")
  26
+
  27
+
  28
+let g:vimside = {} 
  29
+let g:vimside.started = 0
  30
+let g:vimside.errors = []
  31
+let g:vimside.warns = []
  32
+
  33
+let g:vimside.ensime = {} 
  34
+let g:vimside.ensime.info = {} 
  35
+
  36
+let g:vimside.plugins = {} 
  37
+
  38
+" actions to be invoked on next ping (then cleared from list)
  39
+let g:vimside.ping = {}
  40
+" XXXXXXXXXXXXX
  41
+" let g:vimside.ping.actions = []
  42
+let g:vimside.ping.info = {}
  43
+let g:vimside.ping.info.read_timeout = 0
  44
+let g:vimside.ping.info.updatetime = 500
  45
+let g:vimside.ping.info.char_count = 10
  46
+
  47
+" will hold
  48
+"   info
  49
+"   scala_notes
  50
+"   java_notes
  51
+let g:vimside.project = {} 
  52
+" will hold
  53
+"   name
  54
+"   source_roots
  55
+let g:vimside.project.info = {} 
  56
+" will hold
  57
+let g:vimside.project.scala_notes = []
  58
+let g:vimside.project.java_notes = []
  59
+" [bufnum, [0, lnum, col, offset]]
  60
+let g:vimside.project.positions = []
  61
+
  62
+
  63
+" waiting for a response
  64
+" ping-info: expecting/not-expecting rpc and/or event
  65
+let g:vimside.swank = {} 
  66
+let g:vimside.swank.rpc = {} 
  67
+" waiting = { id: rr }
  68
+let g:vimside.swank.rpc.waiting = {} 
  69
+let g:vimside.swank.events = '0'
  70
+" holds 'read_timeout', 'updatetime' and 'char_count'
  71
+" set by command handler when it needs to override default
  72
+" behavior in swank s:PostHandle
  73
+let g:vimside.swank.ping_data = {}
  74
+
  75
+
  76
+" how often each event has been recieved
  77
+let g:vimside.status = {} 
  78
+" default handlers are in autoload/swank/rpc/
  79
+let g:vimside.event_handlers = {} 
  80
+let g:vimside.debug_event_handlers = {} 
  81
+let g:vimside.event_trigger = {} 
  82
+let g:vimside.debug_trigger = {} 
  83
+
  84
+let g:vimside.os = {}
  85
+let g:vimside.os.name = 'unknown'
  86
+for osn in ["unix", 
  87
+          \ "win16", "win32", "win64", "win32unix", "win95", "dos32", 
  88
+          \ "mac", "macunix", "amiga", "os2", "qnx", "beos", "vms"]
  89
+  if has(osn)
  90
+    let g:vimside.os.name = osn
  91
+    break
  92
+  endif
  93
+endfor
  94
+
  95
+let g:vimside.os.is_cygwin = 0
  96
+let g:vimside.os.is_unix = 0
  97
+let g:vimside.os.is_mswin = 0
  98
+let g:vimside.os.is_macunix = 0
  99
+let g:vimside.os.is_unknown = 0
  100
+
  101
+if has("win32unix") && has("unix") 
  102
+  let g:vimside.os.kind = "cygwin"
  103
+  let g:vimside.os.is_cygwin = 1
  104
+elseif !has("win32unix") && has("unix") && !has("macunix")
  105
+  let g:vimside.os.kind = "unix"
  106
+  let g:vimside.os.is_unix = 1
  107
+elseif has('win16') || has('win32') || has('win64') || has('dos32')
  108
+  let g:vimside.os.kind = "mswin"
  109
+  let g:vimside.os.is_mswin = 1
  110
+elseif has('macunix'
  111
+  let g:vimside.os.kind = "macunix"
  112
+  let g:vimside.os.is_macunix = 1
  113
+else
  114
+  let g:vimside.os.kind = "unknown"
  115
+  let g:vimside.os.is_unknown = 1
  116
+endif
  117
+
  118
+function! g:ResponsePending()
  119
+  return ! empty(g:vimside.rpc.waiting)
  120
+endfunction
  121
+let g:vimside.ResponsePending = function('g:ResponsePending')
  122
+
  123
+function! g:CompilerReady()
  124
+  " defined in vimside/ensime/swank
  125
+  return g:vimside.status.compiler_ready
  126
+endfunction
  127
+let g:vimside.CompilerReady = function('g:CompilerReady')
  128
+
  129
+function! g:IndexerReady()
  130
+  " defined in vimside/ensime/swank
  131
+  return g:vimside.status.indexer_ready
  132
+endfunction
  133
+let g:vimside.IndexerReady = function('g:IndexerReady')
  134
+
  135
+
  136
+
  137
+
  138
+
  139
+function! vimside#StartEnsime()
  140
+  if ! g:vimside.started 
  141
+    let msg = "Starting Ensime Engine ..."
  142
+    call vimside#cmdline#Display(msg)
  143
+
  144
+
  145
+    " Ok, are all of the plugins we need avaiable
  146
+    call vimside#vimplugins#Check()
  147
+
  148
+    if len(g:vimside.errors) != 0
  149
+      throw "Plugin Error: ". string(g:vimside.errors)
  150
+    endif
  151
+
  152
+    " Next, load options
  153
+    call vimside#options#manager#Load()
  154
+
  155
+    if len(g:vimside.errors) != 0
  156
+      throw "Option Load Errors: ". string(g:vimside.errors)
  157
+    endif
  158
+
  159
+
  160
+    " Next, load event handlers
  161
+    call vimside#ensime#swank#load_handlers()
  162
+
  163
+    if len(g:vimside.errors) != 0
  164
+      throw "Load Handlers Errors: ". string(g:vimside.errors)
  165
+    endif
  166
+
  167
+    " Now, load rpc and event ping info
  168
+    call vimside#ensime#swank#load_ping_info()
  169
+
  170
+    if len(g:vimside.errors) != 0
  171
+      throw "Load Ping Info Errors: ". string(g:vimside.errors)
  172
+    endif
  173
+
  174
+    call vimside#StartEnsimeServer()
  175
+    let g:vimside.started = 1
  176
+
  177
+sleep 4
  178
+
  179
+    call vimside#GetPortEnsime()
  180
+
  181
+    let l:name = "ping_ensime_server"
  182
+    let l:Func = function("vimside#PingEnsimeServer")
  183
+    let l:sec = 1
  184
+    let l:msec = 0
  185
+    let l:charcnt = 200
  186
+    let l:repeat = 1
  187
+    call vimside#scheduler#AddJob(l:name, l:Func, l:sec, l:msec, l:charcnt, l:repeat)
  188
+
  189
+sleep 2
  190
+call s:LOG("vimside#StartEnsime get connection") 
  191
+    let g:vimside['socket'] = vimside#GetConnectionSocketEnsime()
  192
+
  193
+call s:LOG("vimside#StartEnsime call vimside#swank#rpc#connection_info#Run") 
  194
+    call vimside#swank#rpc#connection_info#Run()
  195
+call s:LOG("vimside#StartEnsime call vimside#swank#rpc#init_project#Run") 
  196
+    call vimside#swank#rpc#init_project#Run()
  197
+  else
  198
+    let msg = "Ensime Engine Already Running ..."
  199
+    call vimside#cmdline#Display(msg)
  200
+  endif
  201
+endfunction
  202
+
  203
+
  204
+function! vimside#StopEnsime()
  205
+  if g:vimside.started
  206
+" XXXXXXXXXXXXX
  207
+    " call vimside#RemoveAutoCmds()
  208
+    vimside#scheduler#ClearAuto()
  209
+    call vimside#swank#rpc#shutdown_server#Run()
  210
+
  211
+    call vimside#ensime#io#close()
  212
+    let g:vimside.started = 0
  213
+  endif
  214
+endfunction
  215
+
  216
+function! vimside#StartEnsimeServer()
  217
+  let [found, portfile] = g:vimside.GetOption('ensime-port-file-path')
  218
+  if ! found
  219
+    echoerr "Option not found: "'ensime-port-file-path'"
  220
+  endif
  221
+
  222
+call s:LOG("vimside#StartEnsimeServer portfile=" . portfile) 
  223
+  let [found, dpath] = g:vimside.GetOption('ensime-dist-path')
  224
+  if ! found
  225
+    echoerr "Option not found: "'ensime-dist-path'"
  226
+  endif
  227
+
  228
+  let cmd = 'cd ' . dpath . ' && ./bin/server ' . shellescape(portfile)
  229
+
  230
+  let [s:found, l:log_enabled] = g:vimside.GetOption('ensime-log-enabled')
  231
+  if ! s:found
  232
+    echoerr "Option not found: "'ensime-log-enabled'"
  233
+  endif
  234
+
  235
+" echo "StartEnsimeServer: log_enabled=" . l:log_enabled
  236
+  if l:log_enabled
  237
+    let lines = [
  238
+      \ "##################################################################",
  239
+      \ "Title: Ensime Server log file",
  240
+      \ "Date: " . strftime("%Y%m%d %T"),
  241
+      \ "##################################################################"
  242
+      \ ]
  243
+
  244
+    let [found, l:logfile] = g:vimside.GetOption('ensime-log-file-path')
  245
+    if ! found
  246
+      echoerr "Option not found: "'ensime-log-file-path'"
  247
+    endif
  248
+
  249
+    call writefile(lines, l:logfile)
  250
+
  251
+    execute "silent !" . cmd . " &>> " . l:logfile . " &"
  252
+
  253
+  else
  254
+    " TODO remove
  255
+    " if has('win16') || has('win32') || has('win64')
  256
+    
  257
+    if g:vimside.os.is_mswin 
  258
+      " Note: do not know if this is correct
  259
+      let l:logfile = "NUL"
  260
+    else
  261
+      let l:logfile = "/dev/null"
  262
+    endif
  263
+
  264
+    execute "silent !" . cmd . " &> " . l:logfile . " &"
  265
+  endif
  266
+
  267
+endfunction
  268
+
  269
+function! vimside#GetPortEnsime()
  270
+call s:LOG("vimside#GetPortEnsime TOP") 
  271
+  let [found, portfile] = g:vimside.GetOption('ensime-port-file-path')
  272
+  if ! found
  273
+    echoerr "Option not found: "'ensime-port-file-path'"
  274
+  endif
  275
+
  276
+  " wait for port file to be created and written to
  277
+  let cnt = 0
  278
+  let [found, max_cnt] = g:vimside.GetOption('ensime-port-file-max-wait')
  279
+  if ! found
  280
+    echoerr "Option not found: "'ensime-port-file-max-wait'"
  281
+  endif
  282
+
  283
+call s:LOG("vimside#GetPortEnsime max_cnt=" . max_cnt) 
  284
+  while ! filereadable(portfile) && cnt < max_cnt
  285
+    sleep 1
  286
+    let cnt += 1
  287
+  endwhile
  288
+
  289
+  if ! filereadable(portfile)
  290
+    echoerr "Vimside Failed to start Ensime Server port file does not exists"
  291
+  endif
  292
+
  293
+  let portfile_lines = readfile(portfile)
  294
+  if len(portfile_lines) != 1
  295
+    echoerr "Vimside Ensime Server port file not single line: " . string(portfile_lines)
  296
+  endif
  297
+
  298
+  let portstr = portfile_lines[0]
  299
+  let port = 0 + portstr
  300
+  call g:vimside.SetOption('ensime_port_number', port)
  301
+call s:LOG("vimside#GetPortEnsime BOTTOM") 
  302
+endfunction
  303
+
  304
+function! vimside#GetConnectionSocketEnsime()
  305
+call s:LOG("vimside#GetConnectionSocketEnsime TOP") 
  306
+
  307
+  let [found, port] = g:vimside.GetOption('ensime_port_number')
  308
+  if ! found
  309
+    echoerr "Option not found: "'ensime_port_number'"
  310
+  endif
  311
+
  312
+  let [found, host] = g:vimside.GetOption('ensime-host-name')
  313
+  if ! found
  314
+    echoerr "Option not found: "'ensime-host-name'"
  315
+  endif
  316
+
  317
+call s:LOG("host:port=" . host .":". port) 
  318
+
  319
+  let l:socket = vimside#ensime#io#open(host, port)
  320
+" call s:LOG("socket=" . string(l:socket)) 
  321
+  return l:socket
  322
+endfunction
  323
+
  324
+" ============================================================================
  325
+" Ping
  326
+" ============================================================================
  327
+
  328
+function! vimside#PingEnsimeServer()
  329
+call s:LOG("vimside#PingEnsimeServer") 
  330
+  let timeout = g:vimside.ping.info.read_timeout
  331
+  let success = vimside#ensime#io#ping(timeout)
  332
+  while success
  333
+    let success = vimside#ensime#io#ping(timeout)
  334
+  endwhile
  335
+endfunction
  336
+
  337
+if 0 " YYYYYYYYYYYYYYY
  338
+" ============================================================================
  339
+" Completion code
  340
+" ============================================================================
  341
+"
  342
+" 1) get completions
  343
+"   GetCompletions
  344
+" 2) display completions
  345
+"   DisplayCompletions
  346
+"
  347
+"
  348
+
  349
+let s:completions_phase = 0
  350
+let g:completions_in_process = 0
  351
+let s:completions_start = 0
  352
+let g:completions_base = ''
  353
+let g:completions_results = []
  354
+
  355
+function!  vimside#Completions(findstart, base)
  356
+" call s:LOG("vimside#Completions findstart=". a:findstart .", base=". a:base) 
  357
+  if ! g:vimside.started
  358
+    return
  359
+  endif
  360
+" call s:LOG("vimside#Completions completions_phase=". s:completions_phase) 
  361
+
  362
+  if s:completions_phase == 0
  363
+    " Get Completions
  364
+    if a:findstart 
  365
+      let g:completions_in_process = 1
  366
+      w
  367
+      let line = getline('.')
  368
+      let pos = col('.') -1
  369
+      let bc = strpart(line,0,pos)
  370
+      let match_text = matchstr(bc, '\zs[^ \t#().[\]{}\''\";: ]*$')
  371
+" call s:LOG("vimside#Completions match_text=". match_text) 
  372
+      let s:completions_start = len(bc)-len(match_text)
  373
+" call s:LOG("vimside#Completions completions_start=". s:completions_start) 
  374
+      call vimside#StartAutoCmdCompletions()
  375
+      return s:completions_start 
  376
+    elseif ! g:completions_in_process
  377
+      return []
  378
+    else
  379
+      if len(a:base) > 0
  380
+        let g:completions_base = a:base
  381
+        let g:completions_results = []
  382
+        call vimside#swank#rpc#completions#Run()
  383
+        let s:completions_phase = 1
  384
+      else
  385
+        let s:completions_phase = 0
  386
+      endif
  387
+" call s:LOG("vimside#Completions return []")
  388
+      return []
  389
+    endif
  390
+  elseif ! g:completions_in_process
  391
+    if a:findstart 
  392
+      return ''
  393
+    else
  394
+      return []
  395
+    endif
  396
+  else
  397
+    " Display Completions
  398
+    if a:findstart 
  399
+" call s:LOG("vimside#Completions completions_start=". s:completions_start) 
  400
+      return s:completions_start
  401
+    else
  402
+      let s:completions_phase = 0
  403
+      let g:completions_base = ''
  404
+" call s:LOG("vimside#Completions g:completions_results=". string(g:completions_results))
  405
+      let g:completions_in_process = 0
  406
+      call vimside#StopAutoCmdCompletions()
  407
+      return g:completions_results
  408
+    endif
  409
+
  410
+  endif
  411
+endfunction
  412
+
  413
+function!  vimside#AbortCompletions()
  414
+" call s:LOG("vimside#AbortCompletions") 
  415
+  if pumvisible() == 0
  416
+    let s:completions_phase = 0
  417
+    let g:completions_in_process = 0
  418
+    call vimside#StopAutoCmdCompletions()
  419
+  endif
  420
+endfunction
  421
+
  422
+function!  vimside#StartAutoCmdCompletions()
  423
+  augroup VIMSIDE_COMPLETIONS
  424
+    au!
  425
+    autocmd CursorMovedI,InsertLeave *.scala call vimside#AbortCompletions()
  426
+  augroup end
  427
+endfunction
  428
+function!  vimside#StopAutoCmdCompletions()
  429
+  augroup VIMSIDE_COMPLETIONS
  430
+    au!
  431
+  augroup END
  432
+endfunction
  433
+endif " YYYYYYYYYYYYYYY
111  autoload/vimside/browser.vim