How do you write a character "o" with upper-line in Ubuntu? Is it possible?
If you haven't already done this, configure a compose key by going into System Settings > Keyboard > Layout Settings > Options... > Compose key position. (I've set mine to Right Alt.)
Then, all you have to do is type Compose + -, then o and you'll get an ō. This works for the other letters, too, as well as several different types of accents. For example, ' instead of - will give you an acute accent, ` will give you a grave accent, , will give you a cedilla, ^ a circumflex, and ", an umlaut.
Is this what you mean:
In Ubuntu, we have an application similar to Windows' Character Map called...well, Character Map. Go into it and look around at what all you can do :)
As for a keyboard shortcut, there are keyboard shortcuts listed on the character map. :)
In vim, you can do it with digraphs.
E.g., in insert mode ō is Ctrl + K and then
Ō is Ctrl + K and
See here for a more complete explanation.