Skip to content

Commit

Permalink
scala metals support
Browse files Browse the repository at this point in the history
  • Loading branch information
arron-green committed Feb 20, 2019
1 parent d733d1f commit b17e307
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
20 changes: 20 additions & 0 deletions metals-vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
source ./common

COURSIER_BIN=${MY_BIN}/coursier
METALS_VIM_BIN=${MY_BIN}/metals-vim
METALS_VERSION="2.12:0.4.4"

[[ -e ${COURSIER_BIN} ]] || curl --silent -L -o ${COURSIER_BIN} https://git.io/coursier
[[ -e ${COURSIER_BIN} ]] && [[ -x ${COURSIER_BIN} ]] || chmod +x ${COURSIER_BIN}

coursier bootstrap \
--java-opt -XX:+UseG1GC \
--java-opt -XX:+UseStringDeduplication \
--java-opt -Xss4m \
--java-opt -Xms100m \
--java-opt -Dmetals.client=vim-lsc \
org.scalameta:metals_${METALS_VERSION} \
-r bintray:scalacenter/releases \
-r sonatype:snapshots \
-o ${METALS_VIM_BIN} -f
1 change: 1 addition & 0 deletions profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ function ack-json-log {
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
export GRADLE_HOME="${BREW_PREFIX}/opt/gradle"

export SBT_OPTS="-XX:MaxMetaspaceSize=512m -Xms2048m -Xmx2048m"
# default to scala 2.11
BREW_SCALA_HOME="${BREW_PREFIX}/opt/[email protected]"
if [[ -d "${BREW_SCALA_HOME}/bin" ]]; then
Expand Down
20 changes: 19 additions & 1 deletion vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,30 @@ Plug 'ajh17/Spacegray.vim'
" jvm
Plug 'vim-scripts/log4j.vim'
Plug 'tfnico/vim-gradle'
Plug 'derekwyatt/vim-scala'
Plug 'gurpreetatwal/vim-avro', {'as': 'vim-avro-avdl'} "only avdl support
Plug 'AoLab/vim-avro', {'as': 'vim-avro-avsc'} "only avsc support
Plug 'GEverding/vim-hocon'
Plug 'neo4j-contrib/cypher-vim-syntax'

" scala/metals support
Plug 'derekwyatt/vim-scala'
Plug 'natebosch/vim-lsc'

" Configuration for vim-scala
au BufRead,BufNewFile *.sbt set filetype=scala

" Configuration for vim-lsc
let g:lsc_enable_autocomplete = v:false
let g:lsc_server_commands = {
\ 'scala': {
\ 'command': 'metals-vim',
\ 'log_level': 'Log'
\ }
\}
let g:lsc_auto_map = {
\ 'GoToDefinition': 'gd',
\}

" javascript/json
Plug 'mustache/vim-mustache-handlebars'
Plug 'moll/vim-node'
Expand Down

0 comments on commit b17e307

Please sign in to comment.