Compare commits

...

2 Commits

Author SHA1 Message Date
Sam A. f3338f96bc
Fix install.sh 2023-05-11 20:03:49 +02:00
Sam A. 1400fc6aa3
Remove unneeded parantheses and commas 2023-05-11 19:08:30 +02:00
2 changed files with 38 additions and 34 deletions

View File

@ -27,37 +27,26 @@ for pkg in "$@"; do
echo " -> Stowing $pkg" echo " -> Stowing $pkg"
# Symlink only the individual files instead of the entire directory # Symlink only the individual files instead of the entire directory
[ "$pkg" = "nvim" ] && NVIM=1 && mkdir -p "$HOME/.config/$pkg" [ "$pkg" = "nvim" ] && NVIM=1 && mkdir -p "$HOME/.config/$pkg"
[ "$pkg" = "scripts" ] && DASH=1 && mkdir -p "$HOME/.local/bin" [ "$pkg" = "scripts" ] && DASH=1 && mkdir -p "$HOME/.local/bin"
[ "$pkg" = "zsh" ] && ZSH=1 && mkdir -p "$HOME/.config/$pkg" [ "$pkg" = "zsh" ] && ZSH=1 && mkdir -p "$HOME/.config/$pkg"
LC_ALL="C" stow -t "$HOME" --ignore="README.md" "$pkg" LC_ALL="C" stow -t "$HOME" --ignore="README.md" "$pkg"
done done
if [ -n "$ZSH" ]; then if [ -n "$NVIM" ] && [ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/pack/packer/start/packer.nvim" ]; then
if ! grep -q "$(id -nu).*/zsh$" /etc/passwd; then command -v nvim >/dev/null 2>&1 ||
command -v zsh >/dev/null 2>&1 || sleep 0.5 && { sleep 0.5;
echo "=> Installing Zsh" && $INSTALL zsh echo "=> Installing Neovim";
$INSTALL nvim; }
sleep 0.5
chsh -s /bin/zsh
fi
sleep 0.5 sleep 0.5
echo "=> Initializing Zsh" echo "=> Installing packer for Neovim"
echo " :: Please run the following command from Zsh:" git clone --quiet --depth 1 "https://github.com/wbthomason/packer.nvim" \
echo " $ fast-theme ~/.config/zsh/fast-theme.ini" "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/pack/packer/start/packer.nvim"
fi echo " :: The LSP servers will be installed automatically when you open a file in Neovim."
echo " :: Please run the following Normal mode command in Neovim to install the plugins:"
if [ -n "$NVIM" ] && [ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/autoload/plug.vim" ]; then echo " :PackerSync"
command -v nvim >/dev/null 2>&1 || sleep 0.5 &&
echo "=> Installing Neovim" && $INSTALL nvim
sleep 0.5
echo "=> Installing vim-plug and plugins for Neovim"
curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/autoload/plug.vim" --create-dirs \
"https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
nvim --headless +PlugInstall +qa
fi fi
if [ -n "$DASH" ] && ! command -v dash >/dev/null 2>&1; then if [ -n "$DASH" ] && ! command -v dash >/dev/null 2>&1; then
@ -66,6 +55,22 @@ if [ -n "$DASH" ] && ! command -v dash >/dev/null 2>&1; then
$INSTALL dash $INSTALL dash
fi fi
if [ -n "$ZSH" ]; then
if ! grep -q "$(id -nu).*/zsh$" /etc/passwd; then
command -v zsh >/dev/null 2>&1 ||
{ sleep 0.5;
echo "=> Installing Zsh";
$INSTALL zsh; }
sleep 0.5
chsh -s /bin/zsh
fi
sleep 0.5
echo "=> Initializing Zsh"
echo " :: Please run the following command from Zsh:"
echo " $ fast-theme ~/.config/zsh/fast-theme.ini"
fi
sleep 0.5 sleep 0.5
echo "=> Done!" echo "=> Done!"

View File

@ -14,10 +14,7 @@ require('packer').startup(function(use)
use { use {
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
requires = { requires = {
{ 'williamboman/mason.nvim',
'williamboman/mason.nvim',
run = ':MasonUpdate'
},
'neovim/nvim-lspconfig' 'neovim/nvim-lspconfig'
} }
} }
@ -60,7 +57,7 @@ vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
}) })
-- appearance -- appearance
vim.cmd.highlight({ 'Normal', 'guibg=NONE', 'ctermbg=NONE' }) vim.cmd.highlight { 'Normal', 'guibg=NONE', 'ctermbg=NONE' }
vim.g.background = 'dark' vim.g.background = 'dark'
-- lightline config -- lightline config
@ -105,7 +102,7 @@ cmp.setup {
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm { ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true
}, },
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
@ -124,12 +121,12 @@ cmp.setup {
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { 'i', 's' })
}, },
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' }, { name = 'luasnip' }
}, }
} }
cmp.setup.cmdline('/', { cmp.setup.cmdline('/', {
@ -149,9 +146,11 @@ cmp.setup.cmdline(':', {
-- lsp config -- lsp config
require('mason').setup {} require('mason').setup {}
require("mason-registry").refresh()
require('mason-lspconfig').setup { require('mason-lspconfig').setup {
automatic_installation = true automatic_installation = true
} }
local lsp = require('lspconfig') local lsp = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()