diff options
author | christianchiarulli <[email protected]> | 2021-08-11 16:33:41 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-08-11 16:33:41 -0400 |
commit | 83013c0d4f1467f546c38719c61909decfcb8151 (patch) | |
tree | 143773ea73c64d953db699e6e621926e44653fc2 /utils | |
parent | f6407e0bdb9c2875bc8f186929ce183af391b2a9 (diff) | |
parent | 5a7630cac761e91335d2f25cb07a81271569c791 (diff) |
Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/bin/lvim | 2 | ||||
-rw-r--r-- | utils/docker/Dockerfile | 11 | ||||
-rwxr-xr-x | utils/docker/script.sh | 23 | ||||
-rw-r--r-- | utils/installer/config.example-no-ts.lua (renamed from utils/installer/lv-config.example-no-ts.lua) | 52 | ||||
-rw-r--r-- | utils/installer/config.example.lua (renamed from utils/installer/lv-config.example.lua) | 65 | ||||
-rwxr-xr-x | utils/installer/install.sh | 43 | ||||
-rwxr-xr-x | utils/installer/install_stylua.sh | 4 | ||||
-rwxr-xr-x | utils/installer/uninstall.sh | 10 | ||||
-rw-r--r-- | utils/lush-template/lua/lush_theme/lush_template.lua | 1 |
9 files changed, 150 insertions, 61 deletions
diff --git a/utils/bin/lvim b/utils/bin/lvim index 0ef96a90..b94d544f 100755 --- a/utils/bin/lvim +++ b/utils/bin/lvim @@ -1,3 +1,3 @@ #!/bin/sh -nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" "$@" +exec nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" "$@" diff --git a/utils/docker/Dockerfile b/utils/docker/Dockerfile new file mode 100644 index 00000000..58760001 --- /dev/null +++ b/utils/docker/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3 + +SHELL ["/bin/bash", "-c"] + +ENV DEBIAN_FRONTEND=noninteractive + +COPY script.sh /tmp/script.sh + +RUN bash -c "/tmp/script.sh" + +ENTRYPOINT ["/bin/bash"] diff --git a/utils/docker/script.sh b/utils/docker/script.sh new file mode 100755 index 00000000..35257147 --- /dev/null +++ b/utils/docker/script.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Updating the package list +apt-get update + +# Installing dependencies +apt-get -y install tzdata sudo git nodejs npm git ripgrep fzf ranger curl fonts-hack-ttf + +pip3 install ueberzug neovim-remote +npm install tree-sitter-cli neovim + +# Installing Neovim +mkdir -p /tmp/neovim +cd /tmp/neovim || exit +curl -L -o nvim.appimage https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage +chmod u+x nvim.appimage +./nvim.appimage --appimage-extract +mv squashfs-root /usr/local/neovim +ln -s /usr/local/neovim/usr/bin/nvim /usr/bin/nvim +rm ./nvim.appimage + +# Installing LunarVim +LVBRANCH=master bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/rolling/utils/installer/install.sh) diff --git a/utils/installer/lv-config.example-no-ts.lua b/utils/installer/config.example-no-ts.lua index ab12309d..4303d264 100644 --- a/utils/installer/lv-config.example-no-ts.lua +++ b/utils/installer/config.example-no-ts.lua @@ -5,25 +5,26 @@ lvim.format_on_save = true lvim.lint_on_save = true lvim.colorscheme = "spacegray" --- keymappings +-- keymappings [view all the defaults by pressing <leader>Lk] lvim.leader = "space" --- overwrite the key-mappings provided by LunarVim for any mode, or leave it empty to keep them --- lvim.keys.normal_mode = { --- Page down/up --- {'[d', '<PageUp>'}, --- {']d', '<PageDown>'}, --- --- Navigate buffers --- {'<Tab>', ':bnext<CR>'}, --- {'<S-Tab>', ':bprevious<CR>'}, +-- add your own keymapping +lvim.keys.normal_mode["<C-s>"] = ":w<cr>" +-- unmap a default keymapping +-- lvim.keys.normal_mode["<C-Up>"] = "" +-- edit a default keymapping +-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" + +-- Use which-key to add extra bindings with the leader-key prefix +-- lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{}<CR>", "Projects" } +-- lvim.builtin.which_key.mappings["t"] = { +-- name = "+Trouble", +-- r = { "<cmd>Trouble lsp_references<cr>", "References" }, +-- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" }, +-- d = { "<cmd>Trouble lsp_document_diagnostics<cr>", "Diagnosticss" }, +-- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" }, +-- l = { "<cmd>Trouble loclist<cr>", "LocationList" }, +-- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnosticss" }, -- } --- if you just want to augment the existing ones then use the utility function --- require("utils").add_keymap_insert_mode({ silent = true }, { --- { "<C-s>", ":w<cr>" }, --- { "<C-c>", "<ESC>" }, --- }) --- you can also use the native vim way directly --- vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true }) -- TODO: User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile @@ -48,6 +49,21 @@ lvim.builtin.treesitter.highlight.enabled = true -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") -- end +-- set a formatter if you want to override the default lsp one (if it exists) +-- lvim.lang.python.formatters = { +-- { +-- exe = "black", +-- args = {} +-- } +-- } +-- set an additional linter +-- lvim.lang.python.linters = { +-- { +-- exe = "flake8", +-- args = {} +-- } +-- } + -- Additional Plugins -- lvim.plugins = { -- {"folke/tokyonight.nvim"}, { @@ -61,5 +77,3 @@ lvim.builtin.treesitter.highlight.enabled = true -- lvim.autocommands.custom_groups = { -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" }, -- } - --- Additional Leader bindings for WhichKey diff --git a/utils/installer/lv-config.example.lua b/utils/installer/config.example.lua index 681f5f65..0aee0275 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/config.example.lua @@ -9,29 +9,31 @@ an executable -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT -- general - +lvim.log.level = "warn" lvim.format_on_save = true lvim.lint_on_save = true lvim.colorscheme = "spacegray" --- keymappings + +-- keymappings [view all the defaults by pressing <leader>Lk] lvim.leader = "space" --- overwrite the key-mappings provided by LunarVim for any mode, or leave it empty to keep them --- lvim.keys.normal_mode = { --- Page down/up --- {'[d', '<PageUp>'}, --- {']d', '<PageDown>'}, --- --- Navigate buffers --- {'<Tab>', ':bnext<CR>'}, --- {'<S-Tab>', ':bprevious<CR>'}, +-- add your own keymapping +lvim.keys.normal_mode["<C-s>"] = ":w<cr>" +-- unmap a default keymapping +-- lvim.keys.normal_mode["<C-Up>"] = "" +-- edit a default keymapping +-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" + +-- Use which-key to add extra bindings with the leader-key prefix +-- lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{}<CR>", "Projects" } +-- lvim.builtin.which_key.mappings["t"] = { +-- name = "+Trouble", +-- r = { "<cmd>Trouble lsp_references<cr>", "References" }, +-- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" }, +-- d = { "<cmd>Trouble lsp_document_diagnostics<cr>", "Diagnosticss" }, +-- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" }, +-- l = { "<cmd>Trouble loclist<cr>", "LocationList" }, +-- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnosticss" }, -- } --- if you just want to augment the existing ones then use the utility function --- require("utils").add_keymap_insert_mode({ silent = true }, { --- { "<C-s>", ":w<cr>" }, --- { "<C-c>", "<ESC>" }, --- }) --- you can also use the native vim way directly --- vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true }) -- TODO: User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile @@ -56,7 +58,20 @@ lvim.builtin.treesitter.highlight.enabled = true -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") -- end --- python +-- set a formatter if you want to override the default lsp one (if it exists) +-- lvim.lang.python.formatters = { +-- { +-- exe = "black", +-- args = {} +-- } +-- } +-- set an additional linter +-- lvim.lang.python.linters = { +-- { +-- exe = "flake8", +-- args = {} +-- } +-- } -- Additional Plugins -- lvim.plugins = { @@ -71,15 +86,3 @@ lvim.builtin.treesitter.highlight.enabled = true -- lvim.autocommands.custom_groups = { -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" }, -- } - --- Additional Leader bindings for WhichKey --- lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{}<CR>", "Projects" } --- lvim.builtin.which_key.mappings["t"] = { --- name = "+Trouble", --- r = { "<cmd>Trouble lsp_references<cr>", "References" }, --- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" }, --- d = { "<cmd>Trouble lsp_document_diagnostics<cr>", "Diagnosticss" }, --- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" }, --- l = { "<cmd>Trouble loclist<cr>", "LocationList" }, --- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnosticss" }, --- } diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 5778fb3a..25b67f12 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -1,6 +1,7 @@ #!/bin/sh #Set Variable to master is not set differently LVBRANCH="${LVBRANCH:-master}" +USER_BIN_DIR="/usr/local/bin" set -o nounset # error when referencing undefined variable set -o errexit # exit when command fails @@ -15,6 +16,10 @@ installnodeubuntu() { sudo apt install npm } +installnodetermux() { + apt install nodejs +} + moveoldlvim() { echo "Not installing LunarVim" echo "Please move your ~/.local/share/lunarvim folder before installing" @@ -49,6 +54,7 @@ installnode() { [ -f "/etc/artix-release" ] && installnodearch [ -f "/etc/fedora-release" ] && installnodefedora [ -f "/etc/gentoo-release" ] && installnodegentoo + [ -d "/data/data/com.termux" ] && installnodetermux [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" sudo npm i -g neovim } @@ -63,6 +69,10 @@ installpiponubuntu() { sudo apt install python3-pip >/dev/null } +installpipontermux() { + apt install python +} + installpiponarch() { sudo pacman -S python-pip } @@ -82,6 +92,7 @@ installpip() { [ -f "/etc/arch-release" ] && installpiponarch [ -f "/etc/fedora-release" ] && installpiponfedora [ -f "/etc/gentoo-release" ] && installpipongentoo + [ -d "/data/data/com.termux" ] && installpipontermux [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" } @@ -100,6 +111,12 @@ installpacker() { } cloneconfig() { + if [ -d "/data/data/com.termux" ]; then + sudo() { + eval "$@" + } + USER_BIN_DIR="$HOME/../usr/bin" + fi echo "Cloning LunarVim configuration" mkdir -p ~/.local/share/lunarvim case "$@" in @@ -108,12 +125,13 @@ cloneconfig() { cp -r "$(pwd)" ~/.local/share/lunarvim/lvim ;; *) - git clone --branch "$LVBRANCH" https://github.com/ChristianChiarulli/lunarvim.git ~/.local/share/lunarvim/lvim + git clone --branch "$LVBRANCH" https://github.com/lunarvim/lunarvim.git ~/.local/share/lunarvim/lvim ;; esac mkdir -p "$HOME/.config/lvim" - sudo cp "$HOME/.local/share/lunarvim/lvim/utils/bin/lvim" "/usr/local/bin" - cp "$HOME/.local/share/lunarvim/lvim/utils/installer/lv-config.example-no-ts.lua" "$HOME/.config/lvim/lv-config.lua" + sudo cp "$HOME/.local/share/lunarvim/lvim/utils/bin/lvim" "$USER_BIN_DIR" + sudo chmod a+rx "$USER_BIN_DIR"/lvim + cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example-no-ts.lua" "$HOME/.config/lvim/config.lua" nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \ +'autocmd User PackerComplete sleep 100m | qall' \ @@ -126,9 +144,9 @@ cloneconfig() { printf "\nCompile Complete\n" if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then - echo 'lv-config already present' + echo 'config.lua already present' else - cp "$HOME/.local/share/lunarvim/lvim/utils/installer/lv-config.example.lua" "$HOME/.config/lvim/lv-config.lua" + cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example.lua" "$HOME/.config/lvim/config.lua" fi } @@ -140,6 +158,11 @@ asktoinstallnode() { [ "$answer" != "${answer#[Yy]}" ] && installnode } +asktoinstallgit() { + echo "git not found, please install git" + exit +} + asktoinstallpip() { # echo "pip not found" # echo -n "Would you like to install pip now (y/n)? " @@ -161,6 +184,12 @@ installonubuntu() { npm install -g tree-sitter-cli } +installtermux() { + apt install ripgrep fzf + pip install neovim-remote + npm install -g tree-sitter-cli +} + installonarch() { sudo pacman -S ripgrep fzf pip3 install neovim-remote @@ -184,6 +213,7 @@ installextrapackages() { [ -f "/etc/artix-release" ] && installonarch [ -f "/etc/fedora-release" ] && installonfedora [ -f "/etc/gentoo-release" ] && installongentoo + [ -d "/data/data/com.termux" ] && installtermux [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" } @@ -202,6 +232,9 @@ esac # move old lvim directory if it exists [ -d "$HOME/.local/share/lunarvim" ] && moveoldlvim +# install node and neovim support +(command -v git >/dev/null && echo "git installed, moving on...") || asktoinstallgit + # install pip (command -v pip3 >/dev/null && echo "pip installed, moving on...") || asktoinstallpip diff --git a/utils/installer/install_stylua.sh b/utils/installer/install_stylua.sh index cd8b3942..2a33de7e 100755 --- a/utils/installer/install_stylua.sh +++ b/utils/installer/install_stylua.sh @@ -30,7 +30,7 @@ function download_stylua() { exit 1 fi - echo "Installtion in progress.." + echo "Installation in progress.." unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR" if [ -f "$DOWNLOAD_DIR/stylua" ]; then @@ -43,7 +43,7 @@ function download_stylua() { } function verify_install() { - echo "Verifying installtion.." + echo "Verifying installation.." local DOWNLOADED_VER DOWNLOADED_VER="$("$INSTALL_DIR/stylua" -V | awk '{ print $2 }')" if [ "$DOWNLOADED_VER" != "$RELEASE" ]; then diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 0615e219..b9a27252 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -1,5 +1,11 @@ #!/bin/sh - +USER_BIN_DIR="/usr/local/bin" +if [ -d "/data/data/com.termux" ]; then + sudo() { + eval "$@" + } + USER_BIN_DIR="$HOME/../usr/bin" +fi rm -rf ~/.local/share/lunarvim -sudo rm /usr/local/bin/lvim +sudo rm "$USER_BIN_DIR"/lvim rm -rf ~/.local/share/applications/lvim.desktop diff --git a/utils/lush-template/lua/lush_theme/lush_template.lua b/utils/lush-template/lua/lush_theme/lush_template.lua index 26b04d8b..75d9ed7e 100644 --- a/utils/lush-template/lua/lush_theme/lush_template.lua +++ b/utils/lush-template/lua/lush_theme/lush_template.lua @@ -43,7 +43,6 @@ -- `:lua require('lush').ify()` local lush = require "lush" -local hsl = lush.hsl local theme = lush(function() return { |