Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ appears as end of line characters and it's unremovable please help #34

Closed
ericntd-legacy opened this issue Oct 2, 2013 · 5 comments
Closed

Comments

@ericntd-legacy
Copy link

Thanks a lot for your helpful .vimrc.

The issue with the $ character is driving me insane though. When I try to execute my script I got "^M" is an invalid character but in Vim, I see $ upon entering ":set list"

I tried :%s/^V^M//g but it says "^M" pattern is not found. I'm really stuck

Please help, I can't lose this particular script

@tdwebste
Copy link

Some more information please,

What operating system are you running?
What do you see when you?

cat "filename"
cat -evt "filename"

Can you please attach one line as an example?
The second cat will show me the control char in a readable form
By compairing the first and second cat, I can tell what is a control char and what is a printable char.

Thx

@amix
Copy link
Owner

amix commented Nov 16, 2013

I have a mapping m that removes ^M from the file.

Hope this helps!

Amir

@amix amix closed this as completed Nov 16, 2013
@ericntd-legacy
Copy link
Author

In the end, I decided to retyped the script, it didn't take that long.

I believe this issue emerged because someone else in my team who has access to the same script tried to view/ edit it using Notepad++ in Windows while I was using Fedora all that while.

The issue may not have to do with your vimrc config at all. Sorry for the trouble and thanks for your attention!

@loonies
Copy link

loonies commented Nov 27, 2013

The problem is probably with Unix/Windows line endings. Simple $ dos2unix /path/to/file fixes the problem.

^M character is entered by CTRL+v, CTRL+m.

Hope that helps next time :)

@alphaCTzo7G
Copy link
Contributor

You can do this with <leader>m with this vimrc:

" Remove the Windows ^M - when the encodings gets messed up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants