The positioning commands (like h, j, k, l, w, b, $, ^, G, etc.) in vi only work when you are in Command mode. In Insert mode, typing these characters simply inserts them as text. You must first exit Insert mode (press Esc) to use positioning commands. Execute mode and Search mode are not standard vi modes.