Skip to content

Commit

Permalink
file breakdown
Browse files Browse the repository at this point in the history
  • Loading branch information
themobileprof authored Sep 15, 2023
1 parent 8bfdc30 commit 4b9b0fc
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 201 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"develop"
]
}
27 changes: 27 additions & 0 deletions apps_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
source env

# Install applications

# Main function
main(){
# Install Applications
echo ">>> Installing Nodejs & npm ..."
echo "# NodeJs enables server-side Javascript"
install nodejs


echo ">>> Installing PHP ..."
echo "# PHP is the most used Server sided language"
install php


# echo ">>> Installing Python 3 ..."
echo "# Python is a robust programming and scripting language"
install python


}

# The main app
main
121 changes: 121 additions & 0 deletions editor_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/bin/bash
source env

# Install Neovim Code editor

# Main function
main(){

echo ">>> Installing Neovim ..."
echo "# Neovim is a robust terminal code editor that is forked from Vim"
install neovim


# Configure Neovim
configure_neovim

# Clean up
rm -rf env
}

# Configure Neovim
configure_neovim()
{
echo ">>> Setup Neovim ..."
sleep $WAITSMALL
# Install vim-plug
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

# Ensure ~/.config/nvim has been created
NVIMDIR=~/.config/nvim
if [[ ! -d "$NVIMDIR" ]]
then
mkdir -p $NVIMDIR
fi

# Ensure ~/env/init.vim exists
NVIMFILE=~/env/init.vim
if [[ ! -f "$NVIMFILE" ]]
then
git clone https://github.com/scripts/files/env ~/env
fi

# Copy the Neovim config file to ~/.config/nvim
cp $NVIMFILE $NVIMDIR


# Select Max or Mini
echo "Do you want the full installation? Y/n"
read SIZE
if [ "${SIZE,,}" = "y" ]; then
neovim_plugins
else
neovim_plugins mini
fi

}



# Configure COC on NVIM and enable language support
neovim_lang_support ()
{
if [ "${2,,}" = "y" ]; then
REPLY="Y"
else
echo "Enable $1 support for Neovim? Y/n"
read REPLY
fi

if [ "${REPLY,,}" = "y" ]; then
nvim +"CocInstall -sync coc-${1^^}" +qall
echo "Enabled $1
+++++++"
sleep $WAITSMALL
else
echo "${1^^} not enabled
-------"
fi
}



neovim_plugins()
{
# Run :PlugInstall on Neovim to install plugins in the config directory
echo ">>> Installing Neovim plugins ..."
sleep $WAITSMALL
nvim --headless +PlugInstall +qall



# Install Prettier
echo "Installing prettier ..."
nvim +'CocInstall -sync coc-prettier' +qall


# For a mini installation
if [ "${1,,}" != "mini" ]; then
# Install languages support for Neovim
languages=(css html tsserver pyright phpls yaml git sql json bash)



# Ascertain if user would like to autoinstall Neovim language support plugins
echo "Auto install all languages support in Neovim? Y/n"
read ALLYES

for lang in "${languages[@]}"; do neovim_lang_support $lang $ALLYES; done
fi


# Finalize config
echo "
Finalizing Neovim plugin configurations"
sleep $WAITLONG
nvim +CocUpdateSync +qall
}

# Main App
main
14 changes: 14 additions & 0 deletions env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Install applications

# Constants ########
readonly WAITLONG=3
readonly WAITSMALL=1
####################

install()
{
sleep $WAITLONG
pkg install -y $1
}
53 changes: 53 additions & 0 deletions files/env/init.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
" ~/.config/nvim/init.vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'preservim/nerdtree'
Plug 'mattn/emmet-vim'
Plug 'junegunn/fzf'
Plug 'itchyny/lightline.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'preservim/nerdcommenter'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-surround'
Plug 'junegunn/fzf.vim'
call plug#end()

set nocompatible " disable compatibility to old-time vi
set showmatch " show matching brackets.
set ignorecase " case insensitive matching
set hlsearch " highlight search results
set tabstop=4 " number of columns occupied by a tab character
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set shiftwidth=4 " width for autoindents
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
"set cc=80 " set an 80 column border for good coding style
filetype plugin indent on " allows auto-indenting depending on file type
syntax on " syntax highlighting

nmap <C-o> :NERDTreeToggle<CR>
let g:user_emmet_leader_key=','

" Use Ctrl-space to trigger completion
inoremap <silent><expr> <c-space> coc#refresh()
" Open file for edit use Ctrl+P hotkey, to search text in project use Alt+F
nnoremap <A-f> :Ag<CR>
nnoremap <C-p> :Files<CR>
" Configure Prettier
command! -nargs=0 Prettier :CocCommand prettier.formatFile

" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
50 changes: 50 additions & 0 deletions gcp_cli_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
source env

# Install Google Cloud CLI

# Main function
main(){
install_gcloud_cli
}


# Get Device 32bit/64bit
device_64_bit(){
cpu=`uname -m`
if [[ $cpu == *"64"* ]]
then
return 0
elif [[ $cpu == *"armv7"* ]]
then
return 1
else
return 0
fi
}



# Download and Install Google Cloud CLI
install_gcloud_cli(){
device_64_bit
bit64=$?
if [ $bit64 -e 0 ]
then
curl -Lo google-cloud.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-345.0.0-linux-x86_64.tar.gz
else
curl -Lo google-cloud.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-345.0.0-linux-x86.tar.gz
fi

# Extract .tar.gz file
tar -xzf google-cloud.tar.gz

# Run installation script
./google-cloud-sdk/install.sh

# Clean up
rm google-cloud.tar.gz
}

# Main App
main
Loading

0 comments on commit 4b9b0fc

Please sign in to comment.