This is not intended as a public example of good management of VIM dotFiles although I do make every attempt to apply best practices in maintaining this configuration purely for my own ease of use and reference.
Like the Vim bonsai logo, it all starts with a seed and then you nurture and prune it for your own environment. Each person's Vim journey is different for this reason.
A lot of this has evolved since I first started so the tooling and dev dependencies need updating.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install neovim node python3 pyenv
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
For now the thing that is constant is cloning this repo and copying some key dotfiles that source into this repo.
Symlinks aren't always available so I have chosen to always cop these files that act as the symlinks.
DOTFILES=$HOME/dotfiles
[ ! -d "$HOME/dotfiles/.git" ] && git clone https://github.com/neozenith/dotfiles $HOME/dotfiles
[ ! -d "$HOME/dotfiles/zsh/scripts/aliases_work.sh" ] && touch $HOME/dotfiles/zsh/scripts/aliases_work.sh
[ ! -d "$HOME/dotfiles/bash/aliases_work.sh" ] && touch $HOME/dotfiles/scripts/aliases_work.sh
[ ! -d "$HOME/dotfiles/.vim/autoload/.git" ] && git clone https://github.com/junegunn/vim-plug.git $HOME/dotfiles/.vim/autoload
cp -rv $DOTFILES/.gitconfig ~/.gitconfig
cp -rv $DOTFILES/.zshrc_link ~/.zshrc
cp -rv $DOTFILES/.bashrc_link ~/.bashrc
cp -rv $DOTFILES/.vimrc_link ~/.vimrc
cp -rv $DOTFILES/.tmux_link.conf ~/.tmux.conf
cp -rv $DOTFILES/nvim ~/.config/nvim
# Plugins: Install / Update / Prune
nvim +PlugInstall +PlugUpdate +PlugClean! +qall
nvim +checkhealth
python3 $DOTFILES/scripts/latest_pyenv_versions.py
List latest available Python3 versions in PyEnv
curl -fsSL https://raw.githubusercontent.com/neozenith/python-onboarding-guide/main/latest_penv_versions.py | python3
From here you'll have to manually explore the respective <shell>/scripts/
folders for what is needed.
To change default shell to zsh
.
sudo chsh -s /bin/zsh <myUserName>
- Font: Sauce Code Pro (Download link)
- Plugin Manager: Vim Plug
junegunn/vim-plug
- Use any github repo slug to reference a plugin and it downloads in parallel. Quickest setup.
- Autocomplete: YouCompleteMe
Valloric/YouCompleteMe
- Hooks into Vim's autocomplete API and depending upon filetype, it asynchronously uses the right parsing engine to reference the best autocomplete and even load documentation for function specs.
- Linting Engine: ALE (Async Linting Engine)
w0rp/ale
- File Management / Git:
Inspired by the beautiful piece of bash scripting that is Git Radar yet having been in companies where due to their git security setup it made git-radar unusable.
So I have built out a basic version of git-radar
. This version does not run
git fetch automatically in the background so you will need to run that manually.
If you want it without my complete dotfiles setup then:
Download bash-scripts/function_parse_git_prompt.sh
to your home directory
curl -o $HOME/function_parse_git_prompt.sh https://github.com/neozenith/dotfiles/blob/master/bash-scripts/function_parse_git_prompt.sh
and add the following to your .bash_profile
or .bashrc
.
source $HOME/function_parse_git_prompt.sh
export PS1="\e[0;32m\w\e[m"
export PS1="$PS1 \$(parse_git_prompt)"
export PS1="$PS1\nλ "
.vimrc
- The key entry file for vim configuration.
- This should only source vim scripts for features and commenting out one shouldn't affect others.
.vim/mysubcript.vim
- Supporting files are located in
.vim/
and are sourced using theruntime
path.
install.sh / install.bat
- These have 5-7 goals:
- Install supporting tools like Ruby / Python / CMake / Node
- (Optional) Install and build latest Vim from Source
- Install
.vimrc
- Install
.vim/
and associated.vim/*.vim
scripts. - Install Vim-Plug into
.vim/bundle/Plug.vim/autoload
- Start Vim to run
vim +PlugInstall +PlugUpdate +qall
to install plugins managed by Plug. - (Optional) Build and install YouCompleteMe
- Rerunning the install.sh / install.bat should shortcut the install and just update plugins.
nvim/init.vim
- This file should not change but will get symlinked to
~/.config/nvim/init.vim
- This file will
source ~/.vimrc
and match existing plugin configuration.
vim +PlugUpdate +qall
Getting Started and Getting Advanced with Vim
These blogs have been hugely influential and informative in making the switch.
Onboarding
vimtutor
- Vim Adventures - Online game of Vim Tutor
Core
- VimCasts - Video Tutorials
- Vim Text Objects: The Definitive Guide
- Vim Revisted - Good for explaining core navigation shortcuts
- Coming Home to Vim - Steve Losh
Extending
Huge thanks for everything you have done for the VIM community.