Saturday, April 27, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 537  / 1 Year ago, sun, december 18, 2022, 5:25:43

I installed the text-editor "VIM" on my Ubuntu desktop 12.04 (running as a guest vm on a Win 7 host via VirtualBox). I used the command "sudo apt-get install vim", and the following "recommended additions" came up:



ctags vim-doc vim-scripts


I am still relatively new to Linux and am learning the basic commands, so I have little to no idea what these recommended additions are or if I should download them. I mostly downloaded VIM as a practice for the "apt-get" command.



Also, upon starting VIM up (sudo VIM), I can go into insert mode via pressing 'a' and escape insert mode via pressing 'esc', but beyond that, I don't know how to quit VIM (asides from forcing the terminal to close by manually x'ing out of it) or how to save changes I've made. For example, I have a word doc saved in /home/documents/VMtext.odt
Does it make sense to use the command sudo VIM /home/documents/VMtext.odt to edit the word doc through VIM, as opposed to just opening the word doc and editing it directly?


More From » software-recommendation

 Answers
2

Not exactly sure what those extra files are but just install them they could be part of some dependancy. Quickly overview of vim bellow:



To quit INSERT MODE press Esc button.



To save and quit press:



:wq


w for write, q for quit.



To quit without saving changes press:



:q


If vim complains after this command press:



:q!


! is for force quit



This video explains a lot about vim - http://youtu.be/ImK_dHPOTIE


[#37484] Monday, December 19, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leddre

Total Points: 180
Total Questions: 113
Total Answers: 108

Location: France
Member since Thu, Oct 27, 2022
2 Years ago
;