Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian)
  • Search

ritorno a capo in emacs/vim

Questa è la sezione italiana del forum gentoo destinata a fornire supporto all'omonima distribuzione.

Moderator: ago

Post Reply
  • Print view
Advanced search
13 posts • Page 1 of 1
Author
Message
DaVe&OpenMOsix
Apprentice
Apprentice
User avatar
Posts: 213
Joined: Tue Dec 30, 2003 10:42 pm
Contact:
Contact DaVe&OpenMOsix
Website

ritorno a capo in emacs/vim

  • Quote

Post by DaVe&OpenMOsix » Wed Jul 27, 2005 9:38 am

Ciao a tutti!
nonostante sia un estimatore di emacs, da qualche giorno ho qualche problema (non ho fatto cambiamenti volontari e/o coscienti nelle impostazioni...)
se creo un file in emacs con più righe e dopo lo apro con vim, o less per esempio, vedo in realtà una riga sola.
i separatori di riga, che dovrebbero essere i <cr><lf> li vedo visualizzati come ^M.
tipo così:

Code: Select all

prima riga^Mseconda riga^Mterza riga^M
(invece dentro a emacs si vedono bene).
per rimettere a posto i file che ho creato in questo modo, ho provato a dare un

Code: Select all

sed 's/^M/$/g' file > nuovofile
secondo una guida di sed ma non cambia niente.
(il ^M l'ho fatto, come da istruzioni con CTRL-V e CTRL-M).

quindi le domande sono:
- sapete come ripristinare i ritorni a capo giusti in emacs?
- e recuperare con sed quelli messi male?
- devo abiurare emacs per vim :oops: ?
ciao
DV
-- Siccome sono un informatico ho votato PCI convinto di aumentare gli slot di espansione della società --
-^v^v^v^v^v^v^v^v^v^-
DaVe the WaVe
http://dave.ccni.it
http://www.davethewave.it
-^v^v^v^v^v^v^v^v^v^-
Top
neon
l33t
l33t
User avatar
Posts: 759
Joined: Mon Aug 04, 2003 11:47 am
Location: Catania, Italy, Europe

Re: ritorno a capo in emacs/vim

  • Quote

Post by neon » Wed Jul 27, 2005 11:34 am

Code: Select all

* app-text/dos2unix
     Available versions:  3.1
     Installed:           no
     Homepage:            I HAVE NO HOME :(
     Description:         Dos2unix converts DOS or MAC text files to UNIX format
converte i file con la ^M in file con ritorno a capo unix ;)
DaVe&OpenMOsix wrote:devo abiurare emacs per vim :oops: ?
http://hackles.org/cgi-bin/archives.pl?request=94
Io credo che le tecnologie siano moralmente neutrali fino a quando non le utilizziamo - William Gibson

LINEE GUIDA DEL FORUM
Top
GiRa
l33t
l33t
Posts: 717
Joined: Thu Apr 07, 2005 1:33 pm

  • Quote

Post by GiRa » Wed Jul 27, 2005 11:36 am

Configura i tuoi editor in modo che utilizzino la medesima configurazione.
Top
neon
l33t
l33t
User avatar
Posts: 759
Joined: Mon Aug 04, 2003 11:47 am
Location: Catania, Italy, Europe

  • Quote

Post by neon » Wed Jul 27, 2005 11:48 am

GiRa wrote:Configura i tuoi editor in modo che utilizzino la medesima configurazione.
Yeah, in breve:

Code: Select all

emerge -C emacs && ln -s /usr/bin/vim /usr/bin/emacs
Io credo che le tecnologie siano moralmente neutrali fino a quando non le utilizziamo - William Gibson

LINEE GUIDA DEL FORUM
Top
GiRa
l33t
l33t
Posts: 717
Joined: Thu Apr 07, 2005 1:33 pm

  • Quote

Post by GiRa » Wed Jul 27, 2005 11:56 am

Se fossi un moderatore ti tirerei le orecchie: questo è flame gratuito.
Top
neon
l33t
l33t
User avatar
Posts: 759
Joined: Mon Aug 04, 2003 11:47 am
Location: Catania, Italy, Europe

  • Quote

Post by neon » Wed Jul 27, 2005 12:28 pm

GiRa wrote:Se fossi un moderatore ti tirerei le orecchie: questo è flame gratuito.
Don't worry, be happy ;)

Partendo dal presupposto che scherzavo ed ero sicuro al 100% che DaVe&OpenMOsix (nemmeno per errore) esseguisse il mio consiglio.
Giuro che nella mia innocenza non sospettavo nemmeno che la "battuta" potesse suscitare una flame war
(che come segnalato in hackles e' attiva dalla nascita dei due editor ed ovviamente irrisolta in quanto ognuno usa quello che gli piace)
Io credo che le tecnologie siano moralmente neutrali fino a quando non le utilizziamo - William Gibson

LINEE GUIDA DEL FORUM
Top
DaVe&OpenMOsix
Apprentice
Apprentice
User avatar
Posts: 213
Joined: Tue Dec 30, 2003 10:42 pm
Contact:
Contact DaVe&OpenMOsix
Website

  • Quote

Post by DaVe&OpenMOsix » Wed Jul 27, 2005 12:48 pm

emerge -C emacs && ln -s /usr/bin/vim /usr/bin/emacs
lascia perdere GiRa... :lol: Neon è un ottimo utente del forum, avevo capito lo scherzo!
quando pensavo di abiurare emacs, cmq, pensavo a questo... :wink:

ottimo cmq dos2unix, lo provo stasera.
ma nessuna idea col sed? credevo si facesse facilmente...
e riguardo la configurazione, sapete dove guardare?
ciao
DV
-- Siccome sono un informatico ho votato PCI convinto di aumentare gli slot di espansione della società --
-^v^v^v^v^v^v^v^v^v^-
DaVe the WaVe
http://dave.ccni.it
http://www.davethewave.it
-^v^v^v^v^v^v^v^v^v^-
Top
Guglie
Apprentice
Apprentice
User avatar
Posts: 240
Joined: Mon Mar 01, 2004 1:04 pm
Location: switzerland - zürich
Contact:
Contact Guglie
Website

  • Quote

Post by Guglie » Wed Jul 27, 2005 12:59 pm

DaVe&OpenMOsix wrote:ma nessuna idea col sed? credevo si facesse facilmente...
da http://billharlan.com/pub/papers/Bourne ... dioms.html

Code: Select all

Convert dos text files to unix, and vice versa:
dos2unix file.txt
unix2dos file.txt
tr -d '\015' < win.txt > unix.txt  # if you can't find dos2unix
sed -e 's/$/\r/' < unix.txt > win.txt  # if you can't find unix2dos
A! Elbereth Gilthoniel! silivren penna míriel o menel aglar elenath!
Top
DaVe&OpenMOsix
Apprentice
Apprentice
User avatar
Posts: 213
Joined: Tue Dec 30, 2003 10:42 pm
Contact:
Contact DaVe&OpenMOsix
Website

  • Quote

Post by DaVe&OpenMOsix » Wed Jul 27, 2005 1:03 pm

thanks Guglie!
-- Siccome sono un informatico ho votato PCI convinto di aumentare gli slot di espansione della società --
-^v^v^v^v^v^v^v^v^v^-
DaVe the WaVe
http://dave.ccni.it
http://www.davethewave.it
-^v^v^v^v^v^v^v^v^v^-
Top
neon
l33t
l33t
User avatar
Posts: 759
Joined: Mon Aug 04, 2003 11:47 am
Location: Catania, Italy, Europe

  • Quote

Post by neon » Wed Jul 27, 2005 1:14 pm

DaVe&OpenMOsix wrote:ma nessuna idea col sed? credevo si facesse facilmente...
http://www.vasudevaservice.com/document ... text_files
usano awk, perl, tr, emacs ma di sed nemmeno l'ombra, io non ho mai imparato ad usarlo quindi non ti sono molto di aiuto ;)

DaVe&OpenMOsix wrote:e riguardo la configurazione, sapete dove guardare?
Il man di emacs dice questo:
In addition, if Emacs recognizes from a file's contents that it uses newline rather than carriage-return linefeed as its line separator, it does not perform EOL conversion when reading or writing that file. Thus, you can read and edit files from GNU and Unix systems on MS-DOS with no special effort, and they will retain their Unix-style end-of-line convention after you edit them.
[..]
To visit a file and specify whether it uses DOS-style or Unix-style end-of-line, specify a coding system (see section Q.9 Specifying a Coding System). For example, C-x RET c unix RET C-x C-f foobar.txt visits the file `foobar.txt' without converting the EOLs; if some line ends with a carriage-return linefeed pair, Emacs will display `^M' at the end of that line. Similarly, you can direct Emacs to save a buffer in a specified EOL format with the C-x RET f command. For example, to save a buffer with Unix EOL format, type C-x RET f unix RET C-x C-s. If you visit a file with DOS EOL conversion, then save it with Unix EOL format, that effectively converts the file to Unix EOL style, like dos2unix.
Mi pare di aver capito che se un file e' in una codifica lui lo salva come era originariamente, quindi dos->dos unix->unix
Se vuoi farlo salvare in un altro modo devi usare un diverso "Coding System"
Non ho capito molto ma qui c'e' il link http://jamesthornton.com/emacs/chapter/ ... tml#SEC222
Io credo che le tecnologie siano moralmente neutrali fino a quando non le utilizziamo - William Gibson

LINEE GUIDA DEL FORUM
Top
GiRa
l33t
l33t
Posts: 717
Joined: Thu Apr 07, 2005 1:33 pm

  • Quote

Post by GiRa » Thu Jul 28, 2005 10:31 am

neon wrote: Partendo dal presupposto che scherzavo ed ero sicuro al 100% che DaVe&OpenMOsix (nemmeno per errore) esseguisse il mio consiglio.
OK!

Ultimamente vedo un sacco di post che chiedono sempre le stesse cose, tanti che non usano nemmeno il man e quindi sono suscettibile... :lol:
Top
DaVe&OpenMOsix
Apprentice
Apprentice
User avatar
Posts: 213
Joined: Tue Dec 30, 2003 10:42 pm
Contact:
Contact DaVe&OpenMOsix
Website

  • Quote

Post by DaVe&OpenMOsix » Thu Jul 28, 2005 10:46 am

tanti che non usano nemmeno il man e quindi sono suscettibile... :lol:
hai ragione, ma stavolta non avevo man sottomano...
sono in ufficio col caro $sistema_operativo_che_ti_dà_l'eXPerienza ... :wink:
ciao
-- Siccome sono un informatico ho votato PCI convinto di aumentare gli slot di espansione della società --
-^v^v^v^v^v^v^v^v^v^-
DaVe the WaVe
http://dave.ccni.it
http://www.davethewave.it
-^v^v^v^v^v^v^v^v^v^-
Top
GiRa
l33t
l33t
Posts: 717
Joined: Thu Apr 07, 2005 1:33 pm

  • Quote

Post by GiRa » Thu Jul 28, 2005 11:51 am

Non mi riferivo a te! Infatti per creare il file di configurazione di emacs la cosa migliore è scaricarselo dal sito!!!
Top
Post Reply
  • Print view

13 posts • Page 1 of 1

Return to “Forum italiano (Italian)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic