Basic configuration for a JavaScript full-stack developer using Vim, tailored for macOS with Zsh, Git, and npm.
This repository provides my dotfiles
for a streamlined development environment, optimized for JavaScript development with Vim as the primary editor. It configures Zsh for shell productivity, Vim for editing, Git for version control, and npm for package management.
dotfiles/
├── .bash_profile # Bash login shell configuration
├── .bashenv # Bash environment variables
├── .gitconfig # Git user settings and credential helper
├── .mongorc.js # MongoDB shell configuration
├── .npmrc # npm configuration for GitHub Packages
├── .vimrc # Vim settings for JavaScript development
├── .zprofile # Zsh login shell configuration
├── .zsh_dev_env/ # Modular Zsh environment settings
│ ├── aliases # Zsh aliases for development tasks
│ ├── base # Base Zsh environment setup
│ └── main # Entry point for Zsh environment
├── .zshenv # Zsh environment variables
└── .zshrc # Zsh interactive shell configuration
.bash_profile
: Configures the Bash login shell, minimal setup for compatibility..bashenv
: Defines Bash environment variables, used in non-Zsh environments..gitconfig
:- Sets
vim
as the default Git editor. - Uses
osxkeychain
for secure credential storage on macOS.
- Sets
.mongorc.js
: Configures the MongoDB shell for database interactions..npmrc
: Enables npm to use GitHub Packages withPACKAGES_AUTH_TOKEN
..vimrc
:- Optimizes Vim for JavaScript development with plugins (e.g., Airline, ALE disabled).
- Stores backup, swap, and undo files in
~/.vim/tmp/
for a clean workspace.
.zprofile
:- Sets
PATH
,CDPATH
,PROJ_CFG_PATH
(~/Projects/config
), andCODE_CFG_PATH
(~/code/config
). - Configures Zsh function paths (
fpath
) for project scripts.
- Sets
.zsh_dev_env/main
:- Entry point for Zsh environment, sources
base
andaliases
. - Defines
PACKAGES_AUTH_TOKEN
for GitHub authentication (modify with your token).
- Entry point for Zsh environment, sources
.zsh_dev_env/base
:- Configures
pyenv
,rbenv
,nvm
, and Java for development. - Sets
vim
as the default editor and enables Vi mode.
- Configures
.zsh_dev_env/aliases
:- Defines aliases for file operations (
cp -i
,mv -i
,rm -i
), Vim editing (v
,vimcfg
,zshrcfg
), and development tasks (cppcompile
,jsctags
). - Includes
cv
(interactive) andccv
(forceful) to clean backup files (*~
,.*~
) in the current directory.
- Defines aliases for file operations (
.zshenv
: Sets Zsh environment variables for all shells..zshrc
: Configures the Zsh interactive shell, sourcing.zsh_dev_env/main
.
-
Clone the repository:
git clone https://github.com/minixli/dotfiles.git ~/dotfiles
-
Create symbolic links:
ln -s ~/dotfiles/.bash_profile ~/.bash_profile ln -s ~/dotfiles/.bashenv ~/.bashenv ln -s ~/dotfiles/.gitconfig ~/.gitconfig ln -s ~/dotfiles/.mongorc.js ~/.mongorc.js ln -s ~/dotfiles/.npmrc ~/.npmrc ln -s ~/dotfiles/.vimrc ~/.vimrc ln -s ~/dotfiles/.zprofile ~/.zprofile ln -s ~/dotfiles/.zsh_dev_env ~/.zsh_dev_env ln -s ~/dotfiles/.zshenv ~/.zshenv ln -s ~/dotfiles/.zshrc ~/.zshrc
-
Set up directories:
mkdir -p ~/Projects/config ~/code/config ~/.vim/tmp chmod u+rwx ~/Projects/config ~/code/config ~/.vim/tmp
-
Configure GitHub token:
- Edit
~/dotfiles/.zsh_dev_env/main
to setPACKAGES_AUTH_TOKEN
:Generate a Personal Access Token at GitHub Settings with scopes likeexport PACKAGES_AUTH_TOKEN=ghp_your_token
read:packages
.
- Edit
-
Install dependencies:
- Install
pyenv
,rbenv
,nvm
, Java, npm, and MongoDB as needed. - Install Vim plugins referenced in
.vimrc
(e.g., Airline).
- Install
- Token management: Set
PACKAGES_AUTH_TOKEN
in.zsh_dev_env/main
. Avoid hardcoding sensitive data. - Backup cleanup: Use
cv
(interactive) orccv
(forceful) to remove*~
and.*~
files in the current directory. - macOS-specific:
.gitconfig
usesosxkeychain
for credential storage, suitable for macOS only. - Vim: Ensure
~/.vim/tmp
exists to store backup, swap, and undo files.