Skip to content

Instantly share code, notes, and snippets.

@Beatz748
Last active March 21, 2021 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Beatz748/e07c8392c3ed218c256a4706f7925bd9 to your computer and use it in GitHub Desktop.
Save Beatz748/e07c8392c3ed218c256a4706f7925bd9 to your computer and use it in GitHub Desktop.
Installation for .vim and brew with some packages for 42 school
set runtimepath^=~/.vim
call plug#begin('~/.vim/plugged')
"Plug 'Valloric/YouCompleteMe'
" Use release branch (recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-highlight', {'do': 'yarn install --frozen-lockfile'}
" Or build from source code by using yarn: https://yarnpkg.com
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
Plug 'skanehira/badapple.vim'
Plug 'AndrewRadev/dealwithit.vim'
Plug 'scrooloose/nerdtree'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'
Plug 'jiangmiao/auto-pairs'
"Plug 'sainnhe/sonokai'
"Plug 'rip-rip/clang_complete'
Plug 'rhysd/vim-clang-format'
"Plug 'octol/vim-cpp-enhanced-highlight'
call plug#end()
"set paste
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]
autocmd vimenter * NERDTree
if has('termguicolors')
set termguicolors
endif
" The configuration options should be placed before `colorscheme sonokai`.
"let g:sonokai_style = 'andromeda'
" colorscheme sonokai
syntax on
" path to directory where library can be found
" let g:clang_library_path='/Library/Developer/CommandLineTools/usr/lib'
"set
retab
set backspace=indent,eol,start
set laststatus=2
set noshowmode
set mouse=a
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set number
set hlsearch
set incsearch
"end set
autocmd TextChanged,TextChangedI <buffer> silent write
let g:neocomplcache_enable_at_startup = 1
augroup autosave
autocmd!
autocmd BufRead * if &filetype == "" | setlocal ft=text | endif
autocmd FileType * autocmd TextChanged,InsertLeave <buffer> if &readonly == 0 | silent write | endif
augroup END
augroup project
autocmd!
autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
augroup END
map <C-n> :NERDTreeToggle<CR>
# EDIT .VIMRC
rm -rf $HOME/.vimrc
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -OL https://raw.githubusercontent.com/Beatz748/.vimrc/master/.vimrc
# Delete and reinstall Homebrew from Github repo
rm -rf $HOME/goinfre/.brew
git clone --depth=1 https://github.com/Homebrew/brew $HOME/goinfre/.brew
# Create .brewconfig script in home directory
cat > $HOME/.brewconfig.zsh <<EOL
# HOMEBREW CONFIG
# Add brew to path
export PATH=\$HOME/goinfre/.brew/bin:\$PATH
# Set Homebrew temporary folders
export HOMEBREW_CACHE=/tmp/\$USER/Homebrew/Caches
export HOMEBREW_TEMP=/tmp/\$USER/Homebrew/Temp
mkdir -p \$HOMEBREW_CACHE
mkdir -p \$HOMEBREW_TEMP
# If NFS session
# Symlink Locks folder in /tmp
if df -T autofs,nfs \$HOME 1>/dev/null
then
HOMEBREW_LOCKS_TARGET=/tmp/\$USER/Homebrew/Locks
HOMEBREW_LOCKS_FOLDER=\$HOME/goinfre/.brew/var/homebrew
mkdir -p \$HOMEBREW_LOCKS_TARGET
mkdir -p \$HOMEBREW_LOCKS_FOLDER
# Symlink to Locks target folders
# If not already a symlink
if ! [[ -L \$HOMEBREW_LOCKS_FOLDER && -d \$HOMEBREW_LOCKS_FOLDER ]]
then
echo "Creating symlink for Locks folder"
rm -rf \$HOMEBREW_LOCKS_FOLDER
ln -s \$HOMEBREW_LOCKS_TARGET \$HOMEBREW_LOCKS_FOLDER
fi
fi
EOL
# Add .brewconfig sourcing in your .zshrc if not already present
if ! grep -q "# Load Homebrew config script" $HOME/.zshrc
then
cat >> $HOME/.zshrc <<EOL
# Load Homebrew config script
source \$HOME/.brewconfig.zsh
EOL
fi
source $HOME/.brewconfig.zsh
rehash
brew update
echo "\nPlease open a new shell to finish installation"
##### INSTALL PACKAGES
#echo "brew install neovim"
#brew install neovim
echo "brew install tree"
brew install tree
# echo "brew install vim"
# brew install vim
echo "brew install iterm"
brew install iterm
echo "brew install htop"
brew install htop
#echo "brew install tmux"
#brew install tmux
#echo "brew install thefuck"
#brew install thefuck
echo "brew install highlight"
brew install highlight
echo "brew install zsh-syntax-highlighting"
brew install zsh-syntax-highlighting
echo "brew install python3"
brew install python3 node neovim
#echo "brew install nmap"
#brew install nmap
echo "brew install ohmyzsh"
brew install ohmyzsh
#echo "brew install gdb"
#brew install gdb
#echo "brew install valgrind"
#brew install valgrind
#echo "brew install netcat"
#brew install netcat
git clone https://github.com/mokevnin/dotfiles
cd dotfiles
make nvim-install
python3 -m pip install --user --upgrade pynvim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment