LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2014, 12:52 AM   #1
bangnagr
Member
 
Registered: Jan 2013
Posts: 48

Rep: Reputation: 4
Save and Continue in vi/vim


Hello all,

Is there any 'key' to save and continue editing in vim, just like there is :wq to save and quit (also ZZ)? Right now I use :w and i keys to save and continue. I keep saving file every other minute and wondering is there any short-cut for that. Not that :w + i are too many key-presses, just for curiosity i want to know.

Thanks
 
Old 11-29-2014, 03:57 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
Why not just look to make backups automatically? http://vim.wikia.com/wiki/Keep_incre...f_edited_files
 
1 members found this post helpful.
Old 11-29-2014, 04:34 AM   #3
bangnagr
Member
 
Registered: Jan 2013
Posts: 48

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by acid_kewpie View Post
Why not just look to make backups automatically? http://vim.wikia.com/wiki/Keep_incre...f_edited_files
Thanks, while looking at your link and further goggling for auto save, i stumbled upon this forum, and it pretty much solves the problem. Although it ends up with more key presses, still, it serves the problem.

While in insert mode,
  1. press Ctrl+o
  2. enter :w
  3. continue editing...

I'll just stick with :w + i for now...

Thanks
 
Old 04-12-2015, 12:26 PM   #4
dragoraexpirafuego
Member
 
Registered: Apr 2015
Location: 9800 Savage Rd, Ft Meade, MD 20755
Distribution: TAILS, Dragora, BLAG, Parabola, Trisquel, Guix, gNewSense, Kali, PHLAK, BackBox, BlackArch, Slackwar
Posts: 34

Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie
blahblahblah
hi @acid I couldn't figure out how to message you so I am posting here.
anyway: all your links are either out of date or offline for some reason.
I cannot connect to zegeniestudios.net/ldc or untrepid.com.
 
Old 04-12-2015, 01:21 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I use this little snippet in my .vimrc:
Code:
noremap <C-Z> :update<CR>
vnoremap <C-Z> <C-C>:update<CR>
inoremap <C-Z> <C-O>:update<CR>
This enables me to just press Ctrl+z at any time in any mode and get the file saved without leaving the current mode. Works without any problems for me.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you save and exit VIM in Ubuntu server skinney Linux - Newbie 4 10-12-2012 03:22 PM
[SOLVED] vim: to input a single character and continue in command mode: what key? stf92 Linux - Newbie 12 06-24-2011 08:45 PM
save and kill vim from shellscript RudraB Programming 1 10-21-2008 03:45 AM
Vim Save Hooks dlublink Linux - Software 2 09-24-2006 08:55 PM
Vim: ftp save no longer works after reinstall GreenPenInc Linux - Software 0 06-14-2005 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration