Looking over the way gome-terminal works, it looks like you need to do a couple things:
- Create a new profile, go into Edit -> Current Profile -> Title and Command
- Select the option to Keep/Prepend/Append the shell-supplied title (to suit)
- Run the command gnome-terminal --title="Wheeee" --profile="The New Profile"
It appears as though the config-file saving is really for session saving (i.e. it stores all your open windows), and it does not save any command-line provided titles, so you can get what you want via a command-line + profile, but not via the config file.
I've taken the liberty of reporting the lack of command-line option saving in the save-config switch against G-T at https://bugzilla.gnome.org/show_bug.cgi?id=645207
When Vim reads an existing file, it tries to detect the file encoding. When writing out the file, Vim uses the file encoding that it detected (except when you tell it differently). So a file detected as UTF-8 is written as UTF-8, a file detected as Latin-1 is written as Latin-1, and so on.
By default, the detection process is crude. Every file that you open with Vim will be assumed to be Latin-1, unless it detects a Unicode byte-order mark at the top. A UTF-8 file without a byte-order mark will be hard to edit because any multibyte characters will be shown in the buffer as character sequences instead of single characters.
Worse, Vim, by default, uses Latin-1 to represent the text in the buffer. So a UTF-8 file with a byte-order mark will be corrupted by down-conversion to Latin-1.
The solution is to configure Vim to use UTF-8 internally. This is, in fact, recommended in the Vim documentation, and the only reason it is not configured that way out of the box is to avoid creating enormous confusion among users who expect Vim to operate basically as a Latin-1 editor.
In your .vimrc
, add set encoding=utf-8
and restart Vim.
Or instead, set the LANG
environment variable to indicate that UTF-8
is your preferred character encoding. This will affect not just Vim
but any software which relies on LANG
to determine how it should
represent text. For example, to indicate that text should appear in
English (en
), as spoken in the United States (US
), encoded as UTF-8
(utf-8
), set LANG=en_US.utf-8
.
Now Vim will use UTF-8 to represent the text in the buffer. Plus, it will also make a more determined effort to detect the UTF-8 encoding in a file. Besides looking for a byte-order mark, it will also check for UTF-8 without a byte-order mark before falling back to Latin-1. So it will no longer corrupt a file coded in UTF-8, and it should properly display the UTF-8 characters during the editing session.
For more information on how Vim detects the file encoding, see the
fileencodings
option in the Vim
documentation.
For more information on setting the encoding that Vim uses
internally, see the encoding
option.
If you need to override the encoding used when writing a file back
to disk, see the fileencoding
option.
Best Answer
I believe that gnome-terminal will Just Work with UTF-8 is enabled in the shell, so all you need to do is enable that. Put
in
~/.bashrc
and there you go.EDIT:
Okay, so, the answer is currently you can't set this. Gnome Terminal follows the current environment's LANG setting and uses the encoding for that as the default. So you need to get LANG to contain UTF-8 before gnome-terminal is launched. Setting this in
~/.bashrc
should do it — you'll just need to log out and log in again.(Note that it's actually better to put this in
~/.bash_profile
so you can override it for subshells, but I'm not sure that bash is necessarily run as a login shell as part of setting up the Gnome environment. That's worth testing....)