LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2012, 02:33 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
How to switch to Latin1 with vim and still have my dead keys?


Hi!
I work with vim and latex to write files in different languages (French, German, English). That's why my file are encoded in latin1. But vim has UTF-8 as default encoding which makes troubles when I create a new file (with old files vim detects automatically the right encoding).

I first tried to change the vim configuration in vimrc:
Quote:
set encoding=latin-1
But then vim wouldn't write any accent correctly anymore (things like "" or ""...). So I switched back to the default configuration. Then I converted my file in latin1:

Quote:
iconv -cs -f UTF-8 -t ISO-8859-1 file > newfile
It works fine now but I'm not satisfied with the solution because I don't want to have to convert each new file I create!
How can I do ? Can I have vim in UTF-8 and still "keep" the same keyboard?
 
Old 12-05-2012, 03:06 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
In the SlackDocs we have a page about localization, there's also explained how one can define shortcuts for changing the keyboard layout. http://docs.slackware.com/slackware:...keyboard_setup Take a look at "Using multiple keyboard layouts".

But I'm not sure if this meets your requirements, but what I understand is, that you want to toggle between
Code:
Option "XkbVariant" "nodeadkeys"
and
Code:
Option "XkbVariant" ""
which can also be done in a terminal with
Code:
setxkbmap -variant nodeadkeys
or
Code:
setxkbmap -variant ""
respectively.

Markus
 
Old 12-05-2012, 04:14 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Well, the problem is: right my dead keys work fine. Only when I sent the encoding to Latin1 in vim, then all my accents keys don't work anymore under vim.
 
Old 12-05-2012, 04:19 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Are you using vim in a terminal? which terminal? or gvim?

Markus
 
Old 12-05-2012, 12:40 PM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
Why do you think you need Latin-1? Every character in that encoding is present in Unicode at exactly the same code-point! And Unicode will give you the French œ as well.
 
Old 12-07-2012, 03:47 AM   #6
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
I use vim in a terminal, MATE-Terminal 1.2.1.

If I don't use Latin1, French seems to work but then I get error messages for German! So far Latin1 seems to be the only encoding that makes everybody happy.
 
Old 12-07-2012, 12:14 PM   #7
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
I never use dead keys myself. The Compose key seems more convenient: Comp + " + a for .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
de-latin1.ktl and de-latin1-nodeadkeys.ktl: from where can I donwnload them? floppy_stuttgart Linux - Newbie 2 10-12-2011 01:49 PM
How to switch from ISO-latin1( 8859-1) to UTF-8 and reciprocally? xpucto Linux - Newbie 3 05-17-2008 05:50 PM
dead keys issue kreng Linux - Newbie 1 08-22-2007 06:31 PM
VIM and the arrow keys Buto Linux - Software 1 09-16-2004 08:38 PM
Dead F-Keys in X cothrige Linux - Newbie 7 05-10-2004 04:34 AM


All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration