From 359cc044b24048dc028272a4944aa92d8a978383 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Mon, 18 Oct 2021 13:26:55 +0700 Subject: [PATCH] neovim + chore neovim: lsp: add ansiblels chore: cleanup shebang (remove 'sh -e' pattern) --- home/.config/nvim/lua/modules/lsp.lua | 12 ++++++++++++ home/.config/nvim/lua/modules/tools.lua | 3 ++- home/.config/nvim/scripts/lsp/ansiblels | 19 +++++++++++++++++++ home/.config/nvim/scripts/lsp/bashls | 2 +- home/.config/nvim/scripts/lsp/cmake | 2 +- home/.config/nvim/scripts/lsp/dockerls | 2 +- home/.config/nvim/scripts/lsp/efm | 2 +- home/.config/nvim/scripts/lsp/emmet_ls | 2 +- home/.config/nvim/scripts/lsp/gopls | 2 +- home/.config/nvim/scripts/lsp/pyright | 2 +- home/.config/nvim/scripts/lsp/sqls | 2 +- home/.config/nvim/scripts/lsp/sumneko_lua | 2 +- home/.config/nvim/scripts/lsp/tailwindcss | 2 +- home/.config/nvim/scripts/lsp/tsserver | 2 +- home/.config/nvim/scripts/lsp/vimls | 2 +- home/.config/nvim/scripts/lsp/vscode | 2 +- home/.config/nvim/scripts/lsp/yamlls | 2 +- home/.local/bin/Wayland/wofiswaywin.py | 2 +- home/.local/bin/extract | 2 +- home/firefox/userjs-update.sh | 2 +- setup/Anime4K.sh | 2 +- setup/afetch.sh | 2 +- setup/bsp-layout.sh | 2 +- setup/cbonsai.sh | 2 +- setup/mpvpaper.sh | 2 +- setup/nnn.sh | 2 +- setup/river.sh | 2 +- setup/tt.sh | 2 +- setup/vscode-icons.sh | 2 ++ setup/wayland-logout.sh | 4 +--- setup/zkc.sh | 2 +- 31 files changed, 62 insertions(+), 30 deletions(-) create mode 100755 home/.config/nvim/scripts/lsp/ansiblels diff --git a/home/.config/nvim/lua/modules/lsp.lua b/home/.config/nvim/lua/modules/lsp.lua index cb4e091..353c0ee 100644 --- a/home/.config/nvim/lua/modules/lsp.lua +++ b/home/.config/nvim/lua/modules/lsp.lua @@ -186,6 +186,18 @@ function M.lsp_conf() } } + -- Ansible + lspconf.ansiblels.setup { + on_attach = on_attach, + capabilities = capabilities, + cmd = {'node', servers_path .. '/ansiblels/out/server/src/server.js', '--stdio'}, + filetypes = {'yaml', 'yaml.ansible'}, + settings = { + -- python = {interpreterPath = 'python3'}, + executionEnvironment = {enabled = false} + } + } + -- Tailwind -- lspconf.tailwindcss.setup { -- on_attach = on_attach, diff --git a/home/.config/nvim/lua/modules/tools.lua b/home/.config/nvim/lua/modules/tools.lua index 16faade..5eb02c8 100644 --- a/home/.config/nvim/lua/modules/tools.lua +++ b/home/.config/nvim/lua/modules/tools.lua @@ -308,7 +308,8 @@ function M.filetype_conf() complex = { ['*_log'] = 'log', ['G*_LOG'] = 'log', - ['.*waybar/config'] = 'jsonc' + ['.*waybar/config'] = 'jsonc', + ['.*lf/lfrc'] = 'sh' } } } diff --git a/home/.config/nvim/scripts/lsp/ansiblels b/home/.config/nvim/scripts/lsp/ansiblels new file mode 100755 index 0000000..dc54860 --- /dev/null +++ b/home/.config/nvim/scripts/lsp/ansiblels @@ -0,0 +1,19 @@ +#!/bin/sh + +current_path="$PWD" +server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/ansiblels" + +# Clone / Update +if [ -d "${server_path}" ]; then + cd ${server_path} + git pull +else + git clone https://github.com/ansible/ansible-language-server ${server_path} + cd ${server_path} +fi + +# Build +npm ci +npm run compile + +cd ${current_path} diff --git a/home/.config/nvim/scripts/lsp/bashls b/home/.config/nvim/scripts/lsp/bashls index 0e6d8b1..b84abb7 100755 --- a/home/.config/nvim/scripts/lsp/bashls +++ b/home/.config/nvim/scripts/lsp/bashls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/bashls" diff --git a/home/.config/nvim/scripts/lsp/cmake b/home/.config/nvim/scripts/lsp/cmake index e652e05..cf19be9 100755 --- a/home/.config/nvim/scripts/lsp/cmake +++ b/home/.config/nvim/scripts/lsp/cmake @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/cmake" diff --git a/home/.config/nvim/scripts/lsp/dockerls b/home/.config/nvim/scripts/lsp/dockerls index 349d73d..8b18d7b 100755 --- a/home/.config/nvim/scripts/lsp/dockerls +++ b/home/.config/nvim/scripts/lsp/dockerls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/dockerls" diff --git a/home/.config/nvim/scripts/lsp/efm b/home/.config/nvim/scripts/lsp/efm index dce584a..e533cb7 100755 --- a/home/.config/nvim/scripts/lsp/efm +++ b/home/.config/nvim/scripts/lsp/efm @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/efm" diff --git a/home/.config/nvim/scripts/lsp/emmet_ls b/home/.config/nvim/scripts/lsp/emmet_ls index ed38dfe..27e4272 100755 --- a/home/.config/nvim/scripts/lsp/emmet_ls +++ b/home/.config/nvim/scripts/lsp/emmet_ls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/emmet_ls" diff --git a/home/.config/nvim/scripts/lsp/gopls b/home/.config/nvim/scripts/lsp/gopls index 889f69e..7266124 100755 --- a/home/.config/nvim/scripts/lsp/gopls +++ b/home/.config/nvim/scripts/lsp/gopls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/gopls" diff --git a/home/.config/nvim/scripts/lsp/pyright b/home/.config/nvim/scripts/lsp/pyright index 164a9db..db0e866 100755 --- a/home/.config/nvim/scripts/lsp/pyright +++ b/home/.config/nvim/scripts/lsp/pyright @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/pyright" diff --git a/home/.config/nvim/scripts/lsp/sqls b/home/.config/nvim/scripts/lsp/sqls index 5ec1b94..3749810 100755 --- a/home/.config/nvim/scripts/lsp/sqls +++ b/home/.config/nvim/scripts/lsp/sqls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/sqls" diff --git a/home/.config/nvim/scripts/lsp/sumneko_lua b/home/.config/nvim/scripts/lsp/sumneko_lua index 03839c3..01fa46b 100755 --- a/home/.config/nvim/scripts/lsp/sumneko_lua +++ b/home/.config/nvim/scripts/lsp/sumneko_lua @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/sumneko_lua" diff --git a/home/.config/nvim/scripts/lsp/tailwindcss b/home/.config/nvim/scripts/lsp/tailwindcss index b27cecb..728a18c 100755 --- a/home/.config/nvim/scripts/lsp/tailwindcss +++ b/home/.config/nvim/scripts/lsp/tailwindcss @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/tailwindcss" diff --git a/home/.config/nvim/scripts/lsp/tsserver b/home/.config/nvim/scripts/lsp/tsserver index 7f8ad7f..d62efe3 100755 --- a/home/.config/nvim/scripts/lsp/tsserver +++ b/home/.config/nvim/scripts/lsp/tsserver @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/tsserver" diff --git a/home/.config/nvim/scripts/lsp/vimls b/home/.config/nvim/scripts/lsp/vimls index f6bc408..48bd20a 100755 --- a/home/.config/nvim/scripts/lsp/vimls +++ b/home/.config/nvim/scripts/lsp/vimls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/vimls" diff --git a/home/.config/nvim/scripts/lsp/vscode b/home/.config/nvim/scripts/lsp/vscode index 5c9e25d..7d07bc4 100755 --- a/home/.config/nvim/scripts/lsp/vscode +++ b/home/.config/nvim/scripts/lsp/vscode @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/vscode" diff --git a/home/.config/nvim/scripts/lsp/yamlls b/home/.config/nvim/scripts/lsp/yamlls index e240624..6d03f74 100755 --- a/home/.config/nvim/scripts/lsp/yamlls +++ b/home/.config/nvim/scripts/lsp/yamlls @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/yamlls" diff --git a/home/.local/bin/Wayland/wofiswaywin.py b/home/.local/bin/Wayland/wofiswaywin.py index 1dd813d..7e26745 100755 --- a/home/.local/bin/Wayland/wofiswaywin.py +++ b/home/.local/bin/Wayland/wofiswaywin.py @@ -1,4 +1,4 @@ -#!/bin/python3 +#!/usr/bin/env python from argparse import ArgumentParser import subprocess import json diff --git a/home/.local/bin/extract b/home/.local/bin/extract index 5bd981a..7cee9db 100755 --- a/home/.local/bin/extract +++ b/home/.local/bin/extract @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh if [ -n "$1" ]; then if [ -f "$1" ]; then diff --git a/home/firefox/userjs-update.sh b/home/firefox/userjs-update.sh index 40fb3af..b6c0646 100755 --- a/home/firefox/userjs-update.sh +++ b/home/firefox/userjs-update.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # Use in conjunction with `firefox-sync` script # (need to open Firefox at least once to generate a profile) diff --git a/setup/Anime4K.sh b/setup/Anime4K.sh index 2e8e11f..3de94c9 100755 --- a/setup/Anime4K.sh +++ b/setup/Anime4K.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh echo "Number of make jobs: " | tr -d '\n' # 4 read -r mj diff --git a/setup/afetch.sh b/setup/afetch.sh index e9232a7..cc344de 100755 --- a/setup/afetch.sh +++ b/setup/afetch.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh git clone https://github.com/13-CF/afetch cd afetch diff --git a/setup/bsp-layout.sh b/setup/bsp-layout.sh index 726dd77..3b63e81 100755 --- a/setup/bsp-layout.sh +++ b/setup/bsp-layout.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh git clone https://github.com/phenax/bsp-layout.git cd bsp-layout diff --git a/setup/cbonsai.sh b/setup/cbonsai.sh index ba490bd..1731684 100755 --- a/setup/cbonsai.sh +++ b/setup/cbonsai.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # You need ncurses-devel diff --git a/setup/mpvpaper.sh b/setup/mpvpaper.sh index 720745b..f7a424e 100755 --- a/setup/mpvpaper.sh +++ b/setup/mpvpaper.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # You need mpv-devel, meson, ninja, pkg-config diff --git a/setup/nnn.sh b/setup/nnn.sh index 6415616..0e410c8 100755 --- a/setup/nnn.sh +++ b/setup/nnn.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # Needs musl-fts, ncurses-devel diff --git a/setup/river.sh b/setup/river.sh index adf1a98..32434b2 100755 --- a/setup/river.sh +++ b/setup/river.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # Need wlroots-devel to build git clone https://github.com/ifreund/river.git diff --git a/setup/tt.sh b/setup/tt.sh index d07c011..cc85d50 100755 --- a/setup/tt.sh +++ b/setup/tt.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # You need ncurses-devel git clone https://github.com/runrin/tt.git diff --git a/setup/vscode-icons.sh b/setup/vscode-icons.sh index 9ea3b5b..b6c9dae 100755 --- a/setup/vscode-icons.sh +++ b/setup/vscode-icons.sh @@ -1,2 +1,4 @@ +#!/bin/sh + curl -fLo ~/.local/share/fonts/vscode.ttf https://github.com/Canop/broot/blob/master/resources/icons/vscode/vscode.ttf fc-cache -fv diff --git a/setup/wayland-logout.sh b/setup/wayland-logout.sh index 14c601b..09b6c4d 100755 --- a/setup/wayland-logout.sh +++ b/setup/wayland-logout.sh @@ -1,6 +1,4 @@ -#!/bin/sh -e - -set -e +#!/bin/sh git clone https://github.com/soreau/wayland-logout.git cd wayland-logout diff --git a/setup/zkc.sh b/setup/zkc.sh index 3aecc7f..d8afbf5 100755 --- a/setup/zkc.sh +++ b/setup/zkc.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # You need sqlite-devel git clone https://git.sr.ht/~fancycade/zkc