summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris <[email protected]>2021-03-14 22:25:28 -0400
committerChris <[email protected]>2021-03-14 22:25:28 -0400
commit90980295d06a2b78c8d0efdd1769eeb6b4f35133 (patch)
tree005e2de81270c2e69bdf04c9d3b6cfa7ae445de4
parent9a3ee3a3c6298bb3bb639aee3b474aaad2d37dec (diff)
udpate readme add installer
-rw-r--r--README.md16
-rw-r--r--init.lua1
-rw-r--r--lua/lsp/bash-ls.lua2
-rwxr-xr-xutils/installer/install-nv-code.sh134
4 files changed, 153 insertions, 0 deletions
diff --git a/README.md b/README.md
index 8329c5ca..2d18684d 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,22 @@
If you are looking for my old configs checkout the two snapshot branches on this repo, there is one for CoC and one for Native LSP
+## Install in one command
+
+bash <(curl -s https://raw.githubusercontent.com/ChristianChiarulli/nvcode/master/utils/installer/install-nv-code.sh)
+
+## Get the latest version of Neovim
+
+```bash
+cd ~
+sudo rm -r neovim
+git clone https://github.com/neovim/neovim
+cd neovim
+sudo make CMAKE_BUILD_TYPE=Release install
+cd ~
+sudo rm -r neovim
+```
+
## TODO
- Fix quickscope colors
- fix annyoing comment nonsense
diff --git a/init.lua b/init.lua
index f818aadf..4ae54a39 100644
--- a/init.lua
+++ b/init.lua
@@ -26,4 +26,5 @@ vim.cmd('source ~/.config/nvim/lua/nv-whichkey/init.vim')
require('lsp')
require('utils')
require('lsp.lua-ls')
+require('lsp.bash-ls')
diff --git a/lua/lsp/bash-ls.lua b/lua/lsp/bash-ls.lua
new file mode 100644
index 00000000..8be0383a
--- /dev/null
+++ b/lua/lsp/bash-ls.lua
@@ -0,0 +1,2 @@
+-- npm i -g bash-language-server
+require'lspconfig'.bashls.setup{}
diff --git a/utils/installer/install-nv-code.sh b/utils/installer/install-nv-code.sh
new file mode 100755
index 00000000..846a504c
--- /dev/null
+++ b/utils/installer/install-nv-code.sh
@@ -0,0 +1,134 @@
+#!/bin/bash
+
+set -o nounset # error when referencing undefined variable
+set -o errexit # exit when command fails
+
+installnodemac() { \
+ brew install lua
+ brew install node
+ brew install yarn
+}
+
+installnodeubuntu() { \
+ sudo apt install nodejs
+ sudo apt install npm
+}
+
+installnodearch() { \
+ sudo pacman -S nodejs
+ sudo pacman -S npm
+}
+
+installnode() { \
+ echo "Installing node..."
+ [ "$(uname)" == "Darwin" ] && installnodemac
+ [ -n "$(uname -a | grep Ubuntu)" ] && installnodeubuntu
+ [ -f "/etc/arch-release" ] && installnodearch
+ [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
+ sudo npm i -g neovim
+}
+
+installpiponmac() { \
+ sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
+ python3 get-pip.py
+ rm get-pip.py
+}
+
+installpiponubuntu() { \
+ sudo apt install python3-pip > /dev/null
+}
+
+installpiponarch() { \
+ pacman -S python-pip
+}
+
+installpip() { \
+ echo "Installing pip..."
+ [ "$(uname)" == "Darwin" ] && installpiponmac
+ [ -n "$(uname -a | grep Ubuntu)" ] && installpiponubuntu
+ [ -f "/etc/arch-release" ] && installpiponarch
+ [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
+}
+
+installpynvim() { \
+ echo "Installing pynvim..."
+ pip3 install pynvim --user
+}
+
+cloneconfig() { \
+ echo "Cloning NVCode configuration"
+ git clone https://github.com/ChristianChiarulli/nvcode.git ~/.config/nvcode
+}
+
+asktoinstallnode() { \
+ echo "node not found"
+ echo -n "Would you like to install node now (y/n)? "
+ read answer
+ [ "$answer" != "${answer#[Yy]}" ] && installnode
+}
+
+asktoinstallpip() { \
+ # echo "pip not found"
+ # echo -n "Would you like to install pip now (y/n)? "
+ # read answer
+ # [ "$answer" != "${answer#[Yy]}" ] && installpip
+ echo "Please install pip3 before continuing with install"
+ exit
+}
+
+installonmac() { \
+ brew install ripgrep fzf ranger
+}
+
+pipinstallueberzug() { \
+ which pip3 > /dev/null && pip3 install ueberzug || echo "Not installing ueberzug pip not found"
+}
+
+installonubuntu() { \
+ sudo apt install ripgrep fzf ranger
+ sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev
+ pip3 install ueberzug
+ pip3 install neovim-remote
+}
+
+
+installonarch() { \
+ sudo pacman -S install ripgrep fzf ranger
+ which yay > /dev/null && yay -S python-ueberzug-git || pipinstallueberzug
+ pip3 install neovim-remote
+}
+
+installextrapackages() { \
+ [ "$(uname)" == "Darwin" ] && installonmac
+ [ -n "$(uname -a | grep Ubuntu)" ] && installonubuntu
+ [ -f "/etc/arch-release" ] && installonarch
+ [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
+}
+
+# Welcome
+echo 'Installing NVCode'
+
+# install pip
+which pip3 > /dev/null && echo "pip installed, moving on..." || asktoinstallpip
+
+# install node and neovim support
+which node > /dev/null && echo "node installed, moving on..." || asktoinstallnode
+
+
+# install pynvim
+pip3 list | grep pynvim > /dev/null && echo "pynvim installed, moving on..." || installpynvim
+
+# move old nvim directory if it exists
+# [ -d "$HOME/.config/nvim" ] && moveoldnvim
+
+# clone config down
+cloneconfig
+
+echo 'export PATH=/home/$USER/.config/nvcode/utils/bin:$PATH' >> ~/.zshrc
+echo 'export PATH=/home/$USER/.config/nvcode/utils/bin:$PATH' >> ~/.bashrc
+
+echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"
+
+echo "I also recommend you add 'set preview_images_method ueberzug' to ~/.config/ranger/rc.conf"
+
+echo 'export PATH=/home/$USER/.config/nvcode/utils/bin:$PATH appending to zshrc/bashrc'