diff --git a/install.sh b/install.sh index 8d6e76a..69a02fb 100755 --- a/install.sh +++ b/install.sh @@ -7,14 +7,12 @@ lsp_langs="" choose_langs() { read -p "Would you like to install $1 lsp?(y/n)" lang - if [ "$lang" = "y" ] - then + if [ "$lang" = "y" ]; then lsp_langs+="$1 " fi } -for lang in $default_lsp_langs -do +for lang in $default_lsp_langs; do choose_langs $lang done @@ -26,11 +24,11 @@ heading() { get_platform() { case "$(uname -s)" in - Linux*) platform=Linux;; - Darwin*) platform=Mac;; - CYGWIN*) platform=Cygwin;; - MINGW*) platform=MinGw;; - *) platform="UNKNOWN:${unameOut}" + Linux*) platform=Linux ;; + Darwin*) platform=Mac ;; + CYGWIN*) platform=Cygwin ;; + MINGW*) platform=MinGw ;; + *) platform="UNKNOWN:${unameOut}" ;; esac echo $platform } @@ -39,17 +37,17 @@ heading "installing packer" if [[ ! -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ]]; then heading "Installing packer" - git clone https://github.com/wbthomason/packer.nvim\ + git clone https://github.com/wbthomason/packer.nvim \ ~/.local/share/nvim/site/pack/packer/start/packer.nvim fi heading "Linking config" heading "old nvim config will be deleted so watchout :0" -# copying config +# copying config rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim -cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim +cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim # change shell for nvim read -p "which shell do you use?: " shellname @@ -72,10 +70,10 @@ echo "shell changed to $shellname on nvim successfully!" #nvim --headless +TSUpdate +qa echo -fn_exists() { declare -F "$1" > /dev/null; } +fn_exists() { declare -F "$1" >/dev/null; } warn_path=false -install_node_deps () { +install_node_deps() { if [[ -z $(which npm) ]]; then echo "npm not installed" return @@ -83,14 +81,6 @@ install_node_deps () { sudo npm install -g $@ } -install_python_deps () { - if [[ -z $(which pip) && -z $(which pip3) ]]; then - echo "python/pip not installed" - return - fi - sudo python3 -m pip install $@ -} - install_ts() { install_node_deps typescript typescript-language-server prettier } @@ -114,21 +104,21 @@ install_rust() { fi } -install_python(){ - install_python_deps 'python-language-server[all]' +install_python() { + install_node_deps pyright } for lang in ${lsp_langs}; do - if fn_exists install_$lang ; then + if fn_exists install_$lang; then heading "Installing $lang language server" install_$lang else echo $lang setup not implemented - echo + echo fi done -if [[ ${warn_path} = true ]]; then +if [[ ${warn_path} == true ]]; then echo "" echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable" fi diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index a5eb803..6ea9906 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -39,7 +39,7 @@ function on_attach(client) end end -local servers = {"tsserver", "cssls", "html" , "pyls"} +local servers = {"tsserver", "cssls", "html" , "pyright"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end