Vi mode and fix nvm sourcing