Merge branch 'master' of github.com:ChristianChiarulli/LunarVim into stable

This commit is contained in:
christianchiarulli 2021-07-07 00:00:29 -04:00
commit 01fc816f31
4 changed files with 108 additions and 106 deletions

View file

@ -8,6 +8,9 @@ require "lv-galaxyline"
require "lv-treesitter" require "lv-treesitter"
require "lv-which-key" require "lv-which-key"
require "lv-neoformat" require "lv-neoformat"
if O.plugin.dashboard.active then
require("lv-dashboard").config()
end
require "lsp" require "lsp"
if O.lang.emmet.active then if O.lang.emmet.active then
require "lsp.emmet-ls" require "lsp.emmet-ls"

View file

@ -1,13 +1,13 @@
--if not package.loaded['nvim-tree.view'] then -- --if not package.loaded['nvim-tree.view'] then
-- return -- -- return
--end -- --end
--
local M = {} local M = {}
local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
if not status_ok then if not status_ok then
return return
end end
--
M.config = function() M.config = function()
local g = vim.g local g = vim.g
@ -69,9 +69,6 @@ local view_status_ok, view = pcall(require, "nvim-tree.view")
if not view_status_ok then if not view_status_ok then
return return
end end
--local view = require "nvim-tree.view"
M.toggle_tree = function() M.toggle_tree = function()
if view.win_open() then if view.win_open() then
require("nvim-tree").close() require("nvim-tree").close()
@ -86,5 +83,5 @@ M.toggle_tree = function()
require("nvim-tree").find_file(true) require("nvim-tree").find_file(true)
end end
end end
--
return M return M

View file

@ -61,7 +61,9 @@ return require("packer").startup(function(use)
use { use {
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
-- event = "BufEnter",
-- cmd = "NvimTreeToggle", -- cmd = "NvimTreeToggle",
commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
config = function() config = function()
require("lv-nvimtree").config() require("lv-nvimtree").config()
end, end,
@ -128,9 +130,9 @@ return require("packer").startup(function(use)
"ChristianChiarulli/dashboard-nvim", "ChristianChiarulli/dashboard-nvim",
event = "BufWinEnter", event = "BufWinEnter",
-- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" }, -- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
config = function() -- config = function()
require("lv-dashboard").config() -- require("lv-dashboard").config()
end, -- end,
disable = not O.plugin.dashboard.active, disable = not O.plugin.dashboard.active,
-- opt = true, -- opt = true,
} }

View file

@ -4,25 +4,25 @@ set -o nounset # error when referencing undefined variable
set -o errexit # exit when command fails set -o errexit # exit when command fails
installnodemac() { installnodemac() {
brew install lua brew install lua
brew install node brew install node
brew install yarn brew install yarn
} }
installnodeubuntu() { installnodeubuntu() {
sudo apt install nodejs sudo apt install nodejs
sudo apt install npm sudo apt install npm
} }
moveoldnvim() { moveoldnvim() {
echo "Not installing LunarVim" echo "Not installing LunarVim"
echo "Please move your ~/.config/nvim folder before installing" echo "Please move your ~/.config/nvim folder before installing"
exit exit
} }
installnodearch() { installnodearch() {
sudo pacman -S nodejs sudo pacman -S nodejs
sudo pacman -S npm sudo pacman -S npm
} }
installnodefedora() { installnodefedora() {
@ -31,35 +31,35 @@ installnodefedora() {
} }
installnodegentoo() { installnodegentoo() {
echo "Printing current node status..." echo "Printing current node status..."
emerge -pqv net-libs/nodejs emerge -pqv net-libs/nodejs
echo "Make sure the npm USE flag is enabled for net-libs/nodejs" echo "Make sure the npm USE flag is enabled for net-libs/nodejs"
echo "If it isn't enabled, would you like to enable it with flaggie? (Y/N)" echo "If it isn't enabled, would you like to enable it with flaggie? (Y/N)"
read answer read answer
[ "$answer" != "${answer#[Yy]}" ] && sudo flaggie net-libs/nodejs +npm [ "$answer" != "${answer#[Yy]}" ] && sudo flaggie net-libs/nodejs +npm
sudo emerge -avnN net-libs/nodejs sudo emerge -avnN net-libs/nodejs
} }
installnode() { installnode() {
echo "Installing node..." echo "Installing node..."
[ "$(uname)" == "Darwin" ] && installnodemac [ "$(uname)" == "Darwin" ] && installnodemac
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installnodeubuntu [ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installnodeubuntu
[ -f "/etc/arch-release" ] && installnodearch [ -f "/etc/arch-release" ] && installnodearch
[ -f "/etc/artix-release" ] && installnodearch [ -f "/etc/artix-release" ] && installnodearch
[ -f "/etc/fedora-release" ] && installnodefedora [ -f "/etc/fedora-release" ] && installnodefedora
[ -f "/etc/gentoo-release" ] && installnodegentoo [ -f "/etc/gentoo-release" ] && installnodegentoo
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
sudo npm i -g neovim sudo npm i -g neovim
} }
installpiponmac() { installpiponmac() {
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py python3 get-pip.py
rm get-pip.py rm get-pip.py
} }
installpiponubuntu() { installpiponubuntu() {
sudo apt install python3-pip >/dev/null sudo apt install python3-pip >/dev/null
} }
installpiponarch() { installpiponarch() {
@ -67,85 +67,85 @@ installpiponarch() {
} }
installpiponfedora() { installpiponfedora() {
sudo dnf install -y pip >/dev/nul sudo dnf install -y pip >/dev/nul
} }
installpipongentoo() { installpipongentoo() {
sudo emerge -avn dev-python/pip sudo emerge -avn dev-python/pip
} }
installpip() { installpip() {
echo "Installing pip..." echo "Installing pip..."
[ "$(uname)" == "Darwin" ] && installpiponmac [ "$(uname)" == "Darwin" ] && installpiponmac
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installpiponubuntu [ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installpiponubuntu
[ -f "/etc/arch-release" ] && installpiponarch [ -f "/etc/arch-release" ] && installpiponarch
[ -f "/etc/fedora-release" ] && installpiponfedora [ -f "/etc/fedora-release" ] && installpiponfedora
[ -f "/etc/gentoo-release" ] && installpipongentoo [ -f "/etc/gentoo-release" ] && installpipongentoo
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
} }
installpynvim() { installpynvim() {
echo "Installing pynvim..." echo "Installing pynvim..."
if [ -f "/etc/gentoo-release" ]; then if [ -f "/etc/gentoo-release" ]; then
echo "Installing using Portage" echo "Installing using Portage"
sudo emerge -avn dev-python/pynvim sudo emerge -avn dev-python/pynvim
else else
pip3 install pynvim --user pip3 install pynvim --user
fi fi
} }
installpacker() { installpacker() {
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
} }
cloneconfig() { cloneconfig() {
echo "Cloning LunarVim configuration" echo "Cloning LunarVim configuration"
git clone --branch stable https://github.com/ChristianChiarulli/lunarvim.git ~/.config/nvim git clone https://github.com/ChristianChiarulli/lunarvim.git ~/.config/nvim
mv $HOME/.config/nvim/utils/installer/lv-config.example.lua $HOME/.config/nvim/lv-config.lua mv $HOME/.config/nvim/utils/installer/lv-config.example.lua $HOME/.config/nvim/lv-config.lua
# mv $HOME/.config/nvim/utils/init.lua $HOME/.config/nvim/init.lua # mv $HOME/.config/nvim/utils/init.lua $HOME/.config/nvim/init.lua
nvim -u $HOME/.config/nvim/init.lua +PackerInstall nvim -u $HOME/.config/nvim/init.lua +PackerInstall
# rm $HOME/.config/nvim/init.lua # rm $HOME/.config/nvim/init.lua
# mv $HOME/.config/nvim/init.lua.tmp $HOME/.config/nvim/init.lua # mv $HOME/.config/nvim/init.lua.tmp $HOME/.config/nvim/init.lua
} }
asktoinstallnode() { asktoinstallnode() {
echo "node not found" echo "node not found"
echo -n "Would you like to install node now (y/n)? " echo -n "Would you like to install node now (y/n)? "
read answer read answer
[ "$answer" != "${answer#[Yy]}" ] && installnode [ "$answer" != "${answer#[Yy]}" ] && installnode
} }
asktoinstallpip() { asktoinstallpip() {
# echo "pip not found" # echo "pip not found"
# echo -n "Would you like to install pip now (y/n)? " # echo -n "Would you like to install pip now (y/n)? "
# read answer # read answer
# [ "$answer" != "${answer#[Yy]}" ] && installpip # [ "$answer" != "${answer#[Yy]}" ] && installpip
echo "Please install pip3 before continuing with install" echo "Please install pip3 before continuing with install"
exit exit
} }
installonmac() { installonmac() {
brew install ripgrep fzf ranger brew install ripgrep fzf ranger
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
pipinstallueberzug() { pipinstallueberzug() {
which pip3 >/dev/null && pip3 install ueberzug || echo "Not installing ueberzug pip not found" which pip3 >/dev/null && pip3 install ueberzug || echo "Not installing ueberzug pip not found"
} }
installonubuntu() { installonubuntu() {
sudo apt install ripgrep fzf ranger sudo apt install ripgrep fzf ranger
sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev
pip3 install ueberzug pip3 install ueberzug
pip3 install neovim-remote pip3 install neovim-remote
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installonarch() { installonarch() {
sudo pacman -S ripgrep fzf ranger sudo pacman -S ripgrep fzf ranger
which yay >/dev/null && yay -S python-ueberzug-git || pipinstallueberzug which yay >/dev/null && yay -S python-ueberzug-git || pipinstallueberzug
pip3 install neovim-remote pip3 install neovim-remote
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installonfedora() { installonfedora() {
@ -155,19 +155,19 @@ installonfedora() {
} }
installongentoo() { installongentoo() {
sudo emerge -avn sys-apps/ripgrep app-shells/fzf app-misc/ranger dev-python/neovim-remote virtual/jpeg sys-libs/zlib sudo emerge -avn sys-apps/ripgrep app-shells/fzf app-misc/ranger dev-python/neovim-remote virtual/jpeg sys-libs/zlib
pipinstallueberzug pipinstallueberzug
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installextrapackages() { installextrapackages() {
[ "$(uname)" == "Darwin" ] && installonmac [ "$(uname)" == "Darwin" ] && installonmac
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installonubuntu [ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installonubuntu
[ -f "/etc/arch-release" ] && installonarch [ -f "/etc/arch-release" ] && installonarch
[ -f "/etc/artix-release" ] && installonarch [ -f "/etc/artix-release" ] && installonarch
[ -f "/etc/fedora-release" ] && installonfedora [ -f "/etc/fedora-release" ] && installonfedora
[ -f "/etc/gentoo-release" ] && installongentoo [ -f "/etc/gentoo-release" ] && installongentoo
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
} }
# Welcome # Welcome
@ -186,18 +186,18 @@ which node >/dev/null && echo "node installed, moving on..." || asktoinstallnode
pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on..." || installpynvim pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on..." || installpynvim
if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
echo 'packer already installed' echo 'packer already installed'
else else
installpacker installpacker
fi fi
if [ -e "$HOME/.config/nvim/init.lua" ]; then if [ -e "$HOME/.config/nvim/init.lua" ]; then
echo 'LunarVim already installed' echo 'LunarVim already installed'
else else
# clone config down # clone config down
cloneconfig cloneconfig
# echo 'export PATH=$HOME/.config/nvim/utils/bin:$PATH' >>~/.zshrc # echo 'export PATH=$HOME/.config/nvim/utils/bin:$PATH' >>~/.zshrc
# echo 'export PATH=$HOME/.config/lunarvim/utils/bin:$PATH' >>~/.bashrc # echo 'export PATH=$HOME/.config/lunarvim/utils/bin:$PATH' >>~/.bashrc
fi fi
echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts" echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"