added autoinstall a requirments

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2023-03-27 03:53:14 +10:00
parent 32017c9f63
commit 80d0dd2a15
2 changed files with 181 additions and 36 deletions

View File

@ -4,64 +4,209 @@
if test (string match -ri "ru" "$LANG") if test (string match -ri "ru" "$LANG")
function print -a TYPE PARAM1 PARAM2 -d "Текст сообщений" function print -a TYPE PARAM1 PARAM2 -d "Текст сообщений"
switch $TYPE switch $TYPE
case REPOSITORY_EXISTS case PACKER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Репозиторий \"wbthomason/packer.nvim\" уже существует. Переустановить? (y/N) "; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить Packer? (\"wbthomason/packer.nvim\") (y/N) ";
case REPOSITORY_CREATED case PACKER_EXISTS
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Репозиторий \"wbthomason/packer.nvim\" установлен"; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Packer уже установлен. Переустановить? (y/N) ";
case PACKER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен Packer";
case LSP_INTELEPHENSE_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для PHP? (\"bmewburn/vscode-intelephense\") (y/N) ";
case LSP_INTELEPHENSE_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для PHP (\"bmewburn/vscode-intelephense\")";
case LSP_VSCODE-LANGSERVERS_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервера от VSCode (JSON, HTML, CSS)? (\"hrsh7th/vscode-langservers-extracted\") (y/N) ";
case LSP_VSCODE-LANGSERVERS_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлены LSP-сервера от VSCode (JSON, HTML, CSS) (\"hrsh7th/vscode-langservers-extracted\")";
case LSP_EMMET_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для набора инструментов Emmet (HTML из CSS)? (\"aca/emmet-ls\") (y/N) ";
case LSP_EMMET_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для набора инструментов Emmet (HTML из CSS) (\"aca/emmet-ls\")";
case LSP_CSSMODULES_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для CSS (форматировщик)? (\"antonk52/cssmodules-language-server\") (y/N) ";
case LSP_CSSMODULES_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для CSS (форматировщик) (\"antonk52/cssmodules-language-server\")";
case LSP_DENO_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для JavaScript и PostScript? (\"denoland/deno\") (y/N) ";
case LSP_DENO_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для JavaScript и PostScript (\"denoland/deno\")";
case LSP_LUA_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для Lua? (\"luals/lua-language-server\") (y/N) ";
case LSP_LUA_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для Lua (\"luals/lua-language-server\")";
case FORMATTER_NGINX_INSTALL case FORMATTER_NGINX_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить форматировщик для NGINX? (\"vasilevich/nginxbeautifier\") (y/N) "; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить форматировщик для NGINX? (\"vasilevich/nginxbeautifier\") (y/N) ";
case FORMATTER_NGINX_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен форматировщик для NGINX (\"vasilevich/nginxbeautifier\")";
end end
end end
else else
function print -a TYPE PARAM1 PARAM2 -d "Messages text" function print -a TYPE PARAM1 PARAM2 -d "Messages text"
switch $TYPE switch $TYPE
case REPOSITORY_EXISTS case PACKER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "The \"wbthomason/packer.nvim\" repository already exists. Reinstall? (y/N) "; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install Packer? (\"wbthomason/packer.nvim\") (y/N) ";
case REPOSITORY_CREATED case PACKER_EXISTS
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Repository \"wbthomason/packer.nvim\" installed"; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Packer already installed. Reinstall? (y/N) ";
case PACKER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed Packer";
case LSP_INTELEPHENSE_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for PHP? (\"bmewburn/vscode-intelephense\") (y/N) ";
case LSP_INTELEPHENSE_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for PHP (\"bmewburn/vscode-intelephense\")";
case LSP_VSCODE-LANGSERVERS_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-servers from VSCode (JSON, HTML, CSS)? (\"hrsh7th/vscode-langservers-extracted\") (y/N) ";
case LSP_VSCODE-LANGSERVERS_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-servers from VSCode (JSON, HTML, CSS) (\"hrsh7th/vscode-langservers-extracted\")";
case LSP_EMMET_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for Emmet toolkit (HTML из CSS)? (\"aca/emmet-ls\") (y/N) ";
case LSP_EMMET_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for Emmet toolkit (HTML из CSS) (\"aca/emmet-ls\")";
case LSP_CSSMODULES_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for CSS (formatter)? (\"antonk52/cssmodules-language-server\") (y/N) ";
case LSP_CSSMODULES_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Install the LSP-server for CSS (formatter) (\"antonk52/cssmodules-language-server\")";
case LSP_DENO_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for JavaScript и PostScript? (\"denoland/deno\") (y/N) ";
case LSP_DENO_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for JavaScript и PostScript (\"denoland/deno\")";
case LSP_LUA_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for Lua? (\"luals/lua-language-server\") (y/N) ";
case LSP_LUA_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for Lua (\"luals/lua-language-server\")";
case FORMATTER_NGINX_INSTALL case FORMATTER_NGINX_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the formatter for NGINX? (\"vasilevich/nginxbeautifier\") (y/N) "; set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the formatter for NGINX? (\"vasilevich/nginxbeautifier\") (y/N) ";
end case FORMATTER_NGINX_INSTALLED
end set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the formatter for NGINX (\"vasilevich/nginxbeautifier\")";
end
end
end end
if test -d ~/.local/share/nvim/site/pack/packer/start/packer.nvim # Installation request
# Найден репозиторий "wbthomason/packer.nvim" set RESPONSE (read -n 1 -p "print PACKER_INSTALL")
bind -e y
# Запрос выбора действия с репозиторием if test (string match -ri 'y' "$RESPONSE")
set RESPONSE (read -n 1 -p "print REPOSITORY_EXISTS") if test -d ~/.local/share/nvim/site/pack/packer/start/packer.nvim
bind -e y # Найден репозиторий "wbthomason/packer.nvim"
if test (string match -ri 'y' "$RESPONSE") # Installation request
# Запрошена переустановка set RESPONSE (read -n 1 -p "print PACKER_EXISTS")
bind -e y
# Деинициализация старого репозитория if test (string match -ri 'y' "$RESPONSE")
rm -rf ~/.local/share/nvim/site/pack/packer/start/packer.nvim # Запрошена переустановка
# Инициализация репозиторий # Деинициализация старого репозитория
git clone --depth 1 https://github.com/wbthomason/packer.nvim\ rm -rf ~/.local/share/nvim/site/pack/packer/start/packer.nvim 1> /dev/null 2> /dev/null
~/.local/share/nvim/site/pack/packer/start/packer.nvim
print REPOSITORY_CREATED # Инициализация репозитория
end git clone --depth 1 https://github.com/wbthomason/packer.nvim\
else ~/.local/share/nvim/site/pack/packer/start/packer.nvim 1> /dev/null 2> /dev/null
# Не найден репозиторий "wbthomason/packer.nvim"
# Инициализация репозитория print PACKER_INSTALLED
git clone --depth 1 https://github.com/wbthomason/packer.nvim\ end
~/.local/share/nvim/site/pack/packer/start/packer.nvim else
# Не найден репозиторий "wbthomason/packer.nvim"
print REPOSITORY_CREATED # Инициализация репозитория
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim 1> /dev/null 2> /dev/null
print PACKER_INSTALLED
end
end end
# Запрос выбора действия с репозиторием # Installation request
set RESPONSE (read -n 1 -p "print LSP_INTELEPHENSE_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "bmewburn/vscode-intelephense"
# Установка
npm i intelephense 1> /dev/null 2> /dev/null
print LSP_INTELEPHENSE_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print LSP_VSCODE-LANGSERVERS_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "hrsh7th/vscode-langservers-extracted"
# Установка
npm i vscode-langservers-extracted 1> /dev/null 2> /dev/null
print LSP_VSCODE-LANGSERVERS_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print LSP_EMMET_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "aca/emmet-ls"
# Установка
npm i emmet-ls 1> /dev/null 2> /dev/null
print LSP_EMMET_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print LSP_CSSMODULES_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "antonk52/cssmodules-language-server"
# Установка
npm i cssmodules-language-server 1> /dev/null 2> /dev/null
print LSP_CSSMODULES_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print LSP_DENO_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "denoland/deno"
# Установка
curl -fsSL https://deno.land/install.sh | sh 1> /dev/null 2> /dev/null
print LSP_DENO_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print LSP_LUA_INSTALL")
bind -e y
if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка "luals/lua-language-server"
# Установка
cd ~/
git clone https://github.com/LuaLS/lua-language-server 1> /dev/null 2> /dev/null
cd lua-language-server
fish ./make.sh 1> /dev/null 2> /dev/null
fish_add_path $(realpath ./)/bin 1> /dev/null 2> /dev/null
print LSP_LUA_INSTALLED
end
# Installation request
set RESPONSE (read -n 1 -p "print FORMATTER_NGINX_INSTALL") set RESPONSE (read -n 1 -p "print FORMATTER_NGINX_INSTALL")
bind -e y bind -e y
if test (string match -ri 'y' "$RESPONSE") if test (string match -ri 'y' "$RESPONSE")
# Запрошена установка 'vasilevich/nginxbeautifier' # Запрошена установка "vasilevich/nginxbeautifier"
# Установка # Установка
npm install -g nginxbeautifier npm i nginxbeautifier 1> /dev/null 2> /dev/null
end
print FORMATTER_NGINX_INSTALLED
end

View File

@ -10,7 +10,7 @@ local coq = require('coq')
-- Инициализация LSP-серверов -- Инициализация LSP-серверов
-- Инициализация "intelephense" (LSP-сервер для PHP) -- Инициализация "bmewburn/vscode-intelephense" (LSP-сервер для PHP)
lspconfig.intelephense.setup({ lspconfig.intelephense.setup({
on_attach = lspconfig_on_attach, on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(), coq.lsp_ensure_capabilities(),
@ -46,7 +46,7 @@ lspconfig.emmet_ls.setup({
capabilities = capabilities capabilities = capabilities
}) })
-- Инициализация "hrsh7th/vscode-langservers-extracted" (LSP-сервер для JS, вспомогательный для CSS) -- Инициализация "hrsh7th/vscode-langservers-extracted" (LSP-сервер для CSS)
lspconfig.cssls.setup({ lspconfig.cssls.setup({
settings = { settings = {
css = { css = {