LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   creating a file using vim (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-file-using-vim-4175493636/)

cfeehan 02-03-2014 11:12 PM

creating a file using vim
 
I'm taking an intro to Linux class and one of our lab exercises is to create a file "practice" using a vim editor.. but the text doesn't give examples and I've yet to find a tutorial. I'm lost. Can anyone tell me how to create a "practice" file using vim?

chrism01 02-03-2014 11:57 PM

Code:

vim filename
Try
Code:

vimtutor
# or
vim

for the tutorial ;)
See also www.vim.org

zhjim 02-04-2014 01:49 AM

http://www.openvim.com/tutorial.html

using vim tutorial in a search engine :(

padalia.rushabh 02-04-2014 02:01 AM

Code:

vim filename
This will open vim editor

Press i to switch to insert mode before the current position.(This will allow you to type)
Type the stuff you want to and

Then press ESC and type
Code:

:wq
to save and exit

w means to write and q means to quit

for interactive tutorial: http://www.openvim.com/tutorial.html

chrism01 02-04-2014 03:12 AM

Code:

:x
to save and exit ;)

':wq' is the slow way :)

pirozhok 02-04-2014 04:45 AM

Quote:

Originally Posted by chrism01 (Post 5111083)
Code:

:x
to save and exit ;)

':wq' is the slow way :)

Or just ZZ. :)

TobiSGD 02-04-2014 07:09 AM

Quote:

Originally Posted by chrism01 (Post 5111083)
Code:

:x
to save and exit ;)

':wq' is the slow way :)

Too late, :wq is already burnt in. I even had to set up an alias from :wq to exit in my shell to avoid errors.

On topic: There are also a couple of sites with good video tutorials for using, configuring and extending Vim, like for example http://vimcasts.org/
Can be very helpful to see what a feature actually does, sometimes just reading about it doesn't really help.

cfeehan 02-13-2014 01:57 PM

Thanks
 
Thanks everyone, all the information really helped. I got it down now!


All times are GMT -5. The time now is 12:29 PM.