vi is one of the most horrible things to work with due to its design model where you have to go to command mode or editing mode; therefore, I find the command "`." to be of incredible use.
At some point I find myself switching from command line to editing mode more often than I probably should. In fact I have remmapped the keyboard so that CapsLock is my Escape Key. I often hit some editing key while in command line and my cursor ends up somewhere in the code. I find it most convinient to hit "`." which takes me back to the last line I edited. Bookmarking commands such as "ma" to make a bookmark that can be referenced by a is quite convenient as well. The "`a" command would take you to the bookmark a just like "`g" would take you to the bookmark "g" if you had use the command "mg" to create the bookmark. I am thinking of getting me one of those Midi-Keyboard-Pedals and attempt to interface it with vi so that I can use my foot to switch between editing and command line :-) take care, Alvaro Zuniga Brad Bendily wrote: > > > I simply said "I should not have to read a manpage to use an editor", > > then it snowballed from there, starting with Joey Kelly's post giving me > > some features of VI that I dont' need. Has nothing to do with whether > > > I have to agree, vi is a tough tool to learn. If you don't have a > specific need/reason to use some of it's advanced features then it's > really hard to remember them to be able to use the next time you > need it. That's why I have two cheat sheets taped to my wall by my > desk. I think they've been there about 5 years, and I barely look > at them anymore! Here's some of the day to day stuff I use: > > yy copy a line > dd cuts a line > p paste your copy/cut > P paste your copy/cut on the line above the one you're on > dw delete a word > cw delete a word then put yourself into insert mode > x delete a character > r replace a character with the next button you type > i puts you in insert mode > a puts you in insert mode > ESC takes you out of insert mode and puts you back in command mode > h left one character at a time > j down one line at a time > k up one line at a time > l right one character at a time > w move forward one word at a time > b move back one word at a time > Ctrl-f page down > Ctrl-b page up > / to search for text, type your search word after the / > n find next occurance of your search > ^ or 0 move cursor to begging of the line > $ move cursor to end of the line > [[ move to top of file > ]] move to bottom of file > o open a blank line below current line > O open a blank line above current line > :q quit the file > :q! quit the file without saving > :w write the file > :wq write the file and quit > > > Now, the next couple things are the reasons I wanted to > and currently do use vi. It's the search/replace functions. > > :s/oldword/replacedword/g > > that will replace every instance of oldword with repacedword > on one line. if you add a % it will do it in the whole file: > > :%s/oldword/replacedword/g > > also, you can do this, add some text to the begining of every line > in a file: > > :%s/^/addtext/g > > or add text to the end of every line in a file: > > :%s/$/addtext/g > > You can read in a file: > :r filename > > > The search/replace stuff is what I use most often, while creating > scripts or editing files. > > Does anyone else have some cool feature of vi that they use that > they would like to add to the cool feature list?? > > > BB > > > _______________________________________________ > General mailing list > [email protected] > http://brlug.net/mailman/listinfo/general_brlug.net
