vim/vi
Install
Ubuntu
sudo apt install vim
Delete blank Lines
:g/^$/d
colorscheme
(vim only)To change the colorscheme in your vi session (e.g. so that comments appear in a better colour than the default dark blue)...
colorscheme desert
Alternatively, to make vi appear with no colours (as it does in AIX)
syntax off
To make a colorscheme change permanent add something like this to your .vimrc file in your home directory
syntax on
colorscheme desert
To step through the list of available colorschemes use...
colorscheme [space] [tab]
To get a list of available colorschemes use...
colorscheme [space] [ctrl-d]
You can also see the install colorschemes from the shell prompt using...
ls /usr/share/vim/vim*/colors
You can add colorschemes by downloading them to /usr/share/vim/vim*/colors (to make them available to everyone) or to ~/.vim/colors (to make them available to only you).
Folding
(vim only)This functionality is useful if you are coding (Java, Python, KSH etc) and want to collapse a section of your code for easier visibility of nesting levels etc.
For example, to enable folding of sections of a Java program delineated by { and }...
:setlocal foldmethod=manual
Move to the start of the code block and type: zfa}
Use za to toggle the fold off when you are done with it.
There are many other folding options which are nicely documented here...
https://vim.fandom.com/wiki/FoldingBibliography
https://vimhelp.org/vim_faq.txt.html#faq-1.4https://alvinalexander.com/linux-unix/vi-vim-delete-blank-lines-empty-lines/https://mediatemple.net/community/products/dv/204644480/enabling-vi-syntax-colorshttps://stackoverflow.com/questions/7331940/how-to-get-the-list-of-all-installed-color-schemes-in-vimhttps://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=creation_date&direction=descending&search=searchhttps://vim.fandom.com/wiki/Folding