this post was submitted on 02 Jan 2024
11 points (92.3% liked)

Neovim

2161 readers
3 users here now

founded 1 year ago
MODERATORS
 

So I just had an issue where my shebang lines weren't parsing properly for a python script I was attempting to execute. A quick google revealed that it was probably because I wrote the scripts on windows and now I was trying to run them on Linux (so happy i finally made the switch btw. using the computer is fun again!). So i took the advice I found and tried to run :%s/^M/ (using C-v, C-m to insert the escape character), and it failed to find any matches. I tried the same command in vanilla vi and it worked.

Is there some setting I don't have configured properly? I would prefer to be able to do this sort of thing within neovim.

you are viewing a single comment's thread
view the rest of the comments
[–] kbal@fedia.io 3 points 10 months ago

Vim (and presumably neovim) will detect that it's in "DOS mode" and hide the '^M's for you. In vim you can just do ":set ff=unix" and then save.