Quantcast
Viewing all articles
Browse latest Browse all 74

How to Execute Vim Command to Delete All Empty Lines in VSCode and VSCodeVim?

I'm using VSCode and the VSCodeVim plugin. I'm attempting to create a key mapping to delete all empty lines in a file, but I'm encountering issues.

Here's the code snippet that I've added to my VSCode configuration:

{"before": ["<Leader>", "q"],"after": [],"commands": [    {"command": ":s/^\\s*\\n//g<Enter>","args": []    }  ]}

When I use the above configuration, I get a "trailing spaces" error. If I remove the Enter from the command, it gets posted to the command line but doesn't get executed. Pressing colon afterwards deletes the command. I have also not been able to switch focus over to the command line without deleting the current contents.


Viewing all articles
Browse latest Browse all 74

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>