- change all text to uppercase (ref):
:%s/.*/\U&/
2. change all text to lowercase:
:%s/.*/\L&/
3. Add string (e.g., *) to end of every line (ref):
:%norm A*
4. Add string to beginning of every line:
:%norm I*
5. delete last character on every line:
:%s/.$//
6. Find your vi config file by typing:
vim --version
On Mac OS I see:
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
You can now edit $HOME/.vimrc to create global configuration. e.g., to set tab spaces to 4 (instead of 8):
set ts=4
7. Turn on line numbering:
:set nu
8. list scripts loaded:
:scriptnames