Almost 5 years ago, used to do something like VIEDIT (forgot exact word I used to use).

Usecase - when I want paste bunch of lines of program or strings I do something like viedit (again I forgot the exact name) and paste over there, instead of all mess it looks clean excited what I mention on that editor.

closed as unclear what you're asking by Jesse_b, G-Man, peterph, muru, Rui F Ribeiro Apr 24 at 15:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Possible duplicate of What is the difference between vi and vim? – Jesse_b Apr 20 at 17:49
  • @jesse_b it is not, unfortunately I am not looking for diff on vi and vim. It is something diff altogether.. – Vajra Apr 20 at 17:52
  • You are looking for vi/vim. There are literally thousands of questions/answers about them on here that will answer your question. That was the most generic one I could find. You could also just google "how do I edit a file on linux" and you will surely find guides on vim/nano – Jesse_b Apr 20 at 17:52
  • 1
    If you just want to paste something into a fresh file, do cat >filename then paste, then press Ctrl+D when done. – Kusalananda Apr 20 at 17:56
  • 1
    Or if you have xsel you can: xsel --clipboard --output >filename – Jesse_b Apr 20 at 17:58

I'm not sure I understand you, but you may be looking for the fc shell builtin.


will let you edit in vi your last command line.

  • Yes , Yes , Yes.. this is what I am looking for .. Thank you so much @mosvy for understanding :) – Vajra Apr 20 at 20:21

I'm not quite sure this question is about vim. However if you do Cx-Ce (which is hold control then press x and press e) it will open an editor where you can copy paste your code. The code will be executed after you save and close editor.

The editor is configurable and it could be vim.

Not the answer you're looking for? Browse other questions tagged or ask your own question.