How to programming with vi?
I having a problem while doing programming with vi. After I entered all the source codes, how do I save it and debug ??
It said :w is to save :q is exit But when I entered both nothing happen.... Please tell me step by step.Thanks |
:wq
together is the command to write and quit mate |
debug?
how do I debug it? what command?
|
once its save cant you debug with gcc??
Code:
5.3 Debugger gdb http://www.cs.auckland.ac.nz/referen...m-HOWTO-5.html |
Hi,
Vi (vim, actually) is 'just' an editor. There's no standard feature that debug's program X's code. You can extend Vim to include such a feature. Create your own code snippet to do just that (or go on-line and search for one). Here's one that compiles gcc code and runs it, while still inside vim: Code:
" ----------------------------------------------------------------------------- This will only compile the gcc code when pressing F3: Code:
" ----------------------------------------------------------------------------- Depending on the language you are programming in and how often you program you could start looking for a specialized editor for that specific language. But vim will do nicely most of the time. Personally I do all my programming in vim. Hope this clears things up a bit. |
Use emacs :D ...
I just prefer emacs over vi but that's only my opinnion. It's 'easier' to use than vi. But you should check some online information about vi so you know what it's capable of so you can alter it to your preferences. |
Well actually vi and vim are in different formats so it just depends on what format you like better. And for the commands
press escape twice to get out of input mode then shift and zz at the same time to exit to main and save. To compile use gcc then to run the program use a.out. |
Actually, in vi & vim (vim = vi improved, so vi + extra capabilities) the cmds are
:w - write to disk :q - quit, no changes saved :x - exit+save changes and many many more; google vi or vim cheatsheet. |
All times are GMT -5. The time now is 05:28 PM. |