Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
plugins: install core plugins at first start, closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
NTBBloodbath committed May 5, 2021
1 parent 706c62b commit 0551e61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
15 changes: 2 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BYellow='\033[1;33m' # Yellow
# }}}

# Doom Nvim version
DoomNvimVersion='2.1.4'
DoomNvimVersion='2.1.5'
# System OS
System="$(uname -s)"

Expand Down Expand Up @@ -189,14 +189,6 @@ install_nvim_nightly() {
log_success "Successfully installed Neovim Nightly under $HOME/.local/bin/ directory"
}

install_packer() {
if [[ ! -d "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]]; then
log_info "Installing packer.nvim ..."
git clone -q https://github.com/wbthomason/packer.nvim $HOME/.local/share/nvim/site/pack/packer/start/packer.nvim
log_success "Successfully installed packer.nvim"
fi
}

install_fonts() {
if [[ ! -d "$HOME/.local/share/fonts" ]]; then
mkdir -p $HOME/.local/share/fonts
Expand All @@ -219,7 +211,7 @@ install_fonts() {

download_font() {
# Download patched Nerd Fonts
url="https://github.com/ryanoasis/nerd-fonts/raw/2.1.4/patched-fonts/FiraCode/Regular/complete/${1// /%20}"
url="https://github.com/ryanoasis/nerd-fonts/raw/2.1.5/patched-fonts/FiraCode/Regular/complete/${1// /%20}"
download_path="$HOME/.local/share/fonts/$1"
if [[ -f "$download_path" && ! -s "$download_path" ]]; then
rm "$download_path"
Expand Down Expand Up @@ -332,7 +324,6 @@ main() {
welcome
check_all
update_repo "main"
install_packer
install_fonts
backup_neovim
install_done
Expand All @@ -342,7 +333,6 @@ main() {
welcome
check_all
update_repo "develop"
install_packer
install_fonts
backup_neovim
install_done
Expand Down Expand Up @@ -379,7 +369,6 @@ main() {
check_all
update_repo "main"
backup_neovim
install_packer
install_fonts
check_requirements
install_done
Expand Down
12 changes: 8 additions & 4 deletions lua/doom/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- License: MIT --
---[[---------------------------------------]]---
-- Doom Nvim version
Doom_version = '2.1.4'
Doom_version = '2.1.5'

-- Check if running Neovim or Vim and fails if:
-- 1. Running Vim instead of Neovim
Expand All @@ -21,7 +21,7 @@ else
)
end

-- If packer.nvim is not installed then install it
-- If packer.nvim is not installed then install it and install core plugins after that
local packer_install_path = Fn.stdpath('data')
.. '/site/pack/packer/start/packer.nvim'
if Fn.empty(Fn.glob(packer_install_path)) > 0 then
Expand All @@ -30,6 +30,10 @@ if Fn.empty(Fn.glob(packer_install_path)) > 0 then
.. packer_install_path
)
Execute('packadd packer.nvim')

-- Install plugins and then reload configs
Execute('PackerInstall')
Execute('luafile $MYVIMRC')
end

-- Set some configs on load
Expand All @@ -44,7 +48,7 @@ end
-- Search for a configuration file (doomrc)
Check_BFC()
if Doom_bfc then
Load_BFC()
Load_BFC()
end
-- Set which separator should be used for paths
Which_os()
Expand All @@ -57,5 +61,5 @@ require('doom.config.load_plugins')

Custom_commands()
if Doom.check_updates then
Check_updates()
Check_updates()
end

0 comments on commit 0551e61

Please sign in to comment.