From 52649b32a038de9c21a22bf084f9348fde56a0ad Mon Sep 17 00:00:00 2001 From: Andrejus Date: Wed, 23 Dec 2020 21:06:46 +0000 Subject: [PATCH] feat: elm support --- files/.config/nvim/coc-settings.json | 12 +++++++++ files/.config/nvim/plugins.vim | 9 ++++++- install/17-elm.sh | 37 +++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/files/.config/nvim/coc-settings.json b/files/.config/nvim/coc-settings.json index a3cf719..56a0d26 100644 --- a/files/.config/nvim/coc-settings.json +++ b/files/.config/nvim/coc-settings.json @@ -2,6 +2,7 @@ "coc.preferences.formatOnSaveFiletypes": [ "css", "dockerfile", + "elm", "html", "javascript", "javascriptreact", @@ -38,6 +39,17 @@ "filetypes": ["tf", "terraform"], "initializationOptions": {}, "settings": {} + }, + "elmLS": { + "command": "elm-language-server", + "filetypes": ["elm"], + "rootPatterns": ["elm.json"], + "initializationOptions": { + "elmPath": "elm", + "elmFormatPath": "elm-format", + "elmTestPath": "elm-test", + "elmAnalyseTrigger": "change" + } } }, diff --git a/files/.config/nvim/plugins.vim b/files/.config/nvim/plugins.vim index 67ecc84..dabbae8 100644 --- a/files/.config/nvim/plugins.vim +++ b/files/.config/nvim/plugins.vim @@ -50,7 +50,7 @@ Plug 'vim-airline/vim-airline-themes' " Enable caching of syntax highlighting groups let g:airline_highlighting_cache = 1 - + " Enable tabline let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#left_sep = ' ' @@ -87,6 +87,9 @@ Plug 'junegunn/rainbow_parentheses.vim' Plug 'unblevable/quick-scope' Plug 'ntpeters/vim-better-whitespace' +" heuristic whitepsace +Plug 'tpope/vim-sleuth' + " better motion Plug 'tpope/vim-surround' Plug 'justinmk/vim-sneak' @@ -162,6 +165,10 @@ Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} \ ] " }}} +" elm +Plug 'andys8/vim-elm-syntax' + + " debugger Plug 'puremourning/vimspector' " {{{ diff --git a/install/17-elm.sh b/install/17-elm.sh index f9b5359..32e7b73 100755 --- a/install/17-elm.sh +++ b/install/17-elm.sh @@ -2,5 +2,40 @@ source "$(dirname $0)/utils.sh" if not_installed "elm"; then - npm install -g elm + # Download the 0.19.1 binary for Linux. + # + # +-----------+----------------------+ + # | FLAG | MEANING | + # +-----------+----------------------+ + # | -L | follow redirects | + # | -o elm.gz | name the file elm.gz | + # +-----------+----------------------+ + # + curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz + + # There should now be a file named `elm.gz` on your Desktop. + # + # The downloaded file is compressed to make it faster to download. + # This next command decompresses it, replacing `elm.gz` with `elm`. + # + gunzip elm.gz + + # There should now be a file named `elm` on your Desktop! + # + # Every file has "permissions" about whether it can be read, written, or executed. + # So before we use this file, we need to mark this file as executable: + # + chmod +x elm + + # The `elm` file is now executable. That means running `~/Desktop/elm --help` + # should work. Saying `./elm --help` works the same. + # + # But we want to be able to say `elm --help` without specifying the full file + # path every time. We can do this by moving the `elm` binary to one of the + # directories listed in your `PATH` environment variable: + # + sudo mv elm /usr/local/bin/ + rm {elm,elm.gz} fi + +npm install -g @elm-tooling/elm-language-server elm-format elm-test