LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-27-2015, 02:44 AM   #1
Mavman
Member
 
Registered: Mar 2008
Distribution: Debian
Posts: 44

Rep: Reputation: 1
Vi carriage return issue


So this is a weird issue I can't seem to find online. Whenever I create or edit files with Vi, if I hit enter for a carriage return it instead inserts a newline above the one I was working on and automatically adds an 'M' character to the new line, but to clarify it's not a '^M'. I tried doing a ':set all&' and it still occurs. I'm not seeing a config file for Vi otherwise in my user profile. It seems to occur under any user account on my system, but I'm not seeing a global configuration file either. Can anyone shed some light for me please? This is a Debian OS.

Last edited by Mavman; 06-27-2015 at 02:45 AM.
 
Old 06-27-2015, 03:06 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Mavman View Post
So this is a weird issue I can't seem to find online. Whenever I create or edit files with Vi, if I hit enter for a carriage return it instead inserts a newline above the one I was working on and automatically adds an 'M' character to the new line, but to clarify it's not a '^M'. I tried doing a ':set all&' and it still occurs. I'm not seeing a config file for Vi otherwise in my user profile. It seems to occur under any user account on my system, but I'm not seeing a global configuration file either. Can anyone shed some light for me please? This is a Debian OS.
I would try the :map (colon map) command to see if your enter key has been reprogrammed (if that's possible at all).

Also, there are commands that show you all the environment variables and all the startup files. Perhaps there is a setting that you haven't seen yet. Unfortunately I don't remember details; you need to investigate some more.
 
Old 06-27-2015, 03:23 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,490

Rep: Reputation: Disabled
Possibly it is vim that you are using as vi on Debian, do you have a .vimrc file?
 
Old 06-27-2015, 03:45 AM   #4
Mavman
Member
 
Registered: Mar 2008
Distribution: Debian
Posts: 44

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by fatmac View Post
Possibly it is vim that you are using as vi on Debian, do you have a .vimrc file?
Oh, sure enough I found a bunch of symlinks that redirect it to /usr/bin/vim.tiny

But I still can't find a .vimrc file.
 
Old 06-29-2015, 12:51 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Do you have teh file '/etc/inputrc'.

Also why 'vi' is symlinked to 'vim.tiny'. You should install normal version of it. Also always use 'vim' and not 'vi'. vim is the advanced version while 'vi' is 'vi' emulation done by 'vim' package.
 
Old 06-29-2015, 04:59 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can create .vimrc in your home and put the following line into it: set ffs=unix
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script read command issue with carriage return itamarm Linux - General 3 06-17-2013 07:37 AM
[SOLVED] Unwanted Carriage Return hossf Programming 8 11-29-2011 08:09 AM
carriage return mike2008 Linux - Newbie 3 10-15-2009 12:03 AM
vsftpd carriage return issue taylorjp75 Linux - Software 1 07-14-2009 06:55 AM
pppd...carriage return?!? icyfire Linux - Software 1 02-14-2002 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:28 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