LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01:33 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

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, 02:06 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
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, 03:14 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

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, 03:19 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

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

Markus
 
Old 12-05-2012, 11:40 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,140

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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, 02:47 AM   #6
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

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, 11:14 AM   #7
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,140

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


Reply



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 12:49 PM
How to switch from ISO-latin1( 8859-1) to UTF-8 and reciprocally? xpucto Linux - Newbie 3 05-17-2008 04:50 PM
dead keys issue kreng Linux - Newbie 1 08-22-2007 05:31 PM
VIM and the arrow keys Buto Linux - Software 1 09-16-2004 07:38 PM
Dead F-Keys in X cothrige Linux - Newbie 7 05-10-2004 03:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:46 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
Open Source Consulting | Domain Registration