Text editor

S

sid

Hi!
I am sorry that I am asking a little off topic question, but I am
sure some of you can surely help me. I am writiing a VI like text
editor in C++ for the console. I would like to know some opensource
tools that would help me build it faster. Also, What would be the best
approach to build it?
Thank You.
 
G

Gianni Mariani

sid said:
Hi!
I am sorry that I am asking a little off topic question, but I am
sure some of you can surely help me. I am writiing a VI like text
editor in C++ for the console. I would like to know some opensource
tools that would help me build it faster. Also, What would be the best
approach to build it?

gcc?

I'm sorry, your answer is too nonspecific to even being to pointing out
possible help, let alone the question being off topic.

Read the faq, that will certainly help in getting good C++ code when you
do get to write it. If you have any questions about the FAQ then you're
in luck here !
 
J

jason.cipriani

Hi!
I am sorry that I am asking a little off topic question, but I am
sure some of you can surely help me. I am writiing a VI like text
editor in C++ for the console. I would like to know some opensource
tools that would help me build it faster. Also, What would be the best
approach to build it?

How about VI? It provides VI-like text editor functionality that you
can add to your console application with just a single API call:

system("vi");
Thank You.

Jason
 
P

Paavo Helde

Hi!
I am sorry that I am asking a little off topic question, but I am
sure some of you can surely help me. I am writiing a VI like text
editor in C++ for the console. I would like to know some opensource
tools that would help me build it faster. Also, What would be the best
approach to build it?
Thank You.

To reuse vi code? The Linux implementation should be open-source AFAIK. If
this does not suit you you could at least use ncurses (these are a bit
portable so should be not totally outlawed in this ng).

hth
Paavo
 
J

James Kanze

(e-mail address removed):
To reuse vi code? The Linux implementation should be
open-source AFAIK. If this does not suit you you could at
least use ncurses (these are a bit portable so should be not
totally outlawed in this ng).

Linux doesn't really have vi, only vim. And although vim does
have a vi compatible mode, it also has a lot more.

The original poster didn't say why he was implementing such a
thing. If the reason is just that he needs it for some reason,
then using vim is the obvious answer (providing there are no
licensing problems). If the motivation is more pedagogic, I
would strongly recommend "Programming Tools in Pascal", by
Kernighan and Plauger. I would, in fact, strongly recommend it
for any beginning programmer, despite its age. (And don't be
put off by the Pascal in the title: the actual code is C, forced
to Pascal syntax. Also, it's very clean, well written C, and
could be adapted to C++ very easily.)
 
T

Thomas Dickey

James Kanze said:
Linux doesn't really have vi, only vim. And although vim does
have a vi compatible mode, it also has a lot more.

Actually, Linux doesn't "have" any particular editor.

Linux distributions and users can "have" a choice of editors.
For example, I have (on Linux...) elvis, nvi, vim and vile
(as well as some other editors). nvi is closer to vi than vim.
 
J

James Kanze

Actually, Linux doesn't "have" any particular editor.
Linux distributions and users can "have" a choice of editors.
For example, I have (on Linux...) elvis, nvi, vim and vile (as
well as some other editors). nvi is closer to vi than vim.

In a certain sense, that's true of all systems. And the
"official" standard editor of Posix (and presumably Posix-like)
systems, like Linux, is ed. Still, there is a generally
accepted sense in which vi is the "standard" Unix editor, and at
least in the Linux distributions I've seen, /usr/bin/vi is a
symbolic link to vim. (Of course, if you actually have any real
editing job to do, you'll invoke gvim or emacs. At least under
Unix or Windows---people working on mainframes have different
habits.)
 
J

Jeff Schwab

James said:
least in the Linux distributions I've seen, /usr/bin/vi is a
symbolic link to vim. (Of course, if you actually have any real
editing job to do, you'll invoke gvim or emacs.

Why gvim, as opposed to vim? I almost exclusively use vim inside GNU
screen, inside a terminal emulator.
 
J

jason.cipriani

Why gvim, as opposed to vim? I almost exclusively use vim inside GNU
screen, inside a terminal emulator.

Emacs is the best of all. Vim sucks. Also Windows has way better text
editors than Linux.
 
R

red floyd

Emacs is the best of all. Vim sucks. Also Windows has way better text
editors than Linux.

Yeah, if you like taking your hands off the keyboard. Vi (or even --
gasp -- emacs) is much better if you're a touch typist.
 
T

Thomas Dickey

In a certain sense, that's true of all systems. And the
"official" standard editor of Posix (and presumably Posix-like)
systems, like Linux, is ed. Still, there is a generally

vi's been standard for a while...

http://www.opengroup.org/onlinepubs/009695399/utilities/vi.html
accepted sense in which vi is the "standard" Unix editor, and at
least in the Linux distributions I've seen, /usr/bin/vi is a
symbolic link to vim. (Of course, if you actually have any real

Most of them (not all).
editing job to do, you'll invoke gvim or emacs. At least under
Unix or Windows---people working on mainframes have different
habits.)

probably not (though I've started each this week, it was only to check
a detail).

hand
 
J

James Kanze

Why gvim, as opposed to vim? I almost exclusively use vim
inside GNU screen, inside a terminal emulator.

Because:). I don't really know why---if I'm inside an xterm,
I'll often invoke vim, but most of the time, I want to edit and
invoke make from a separate window.
 
J

James Kanze

Why gvim, as opposed to vim? I almost exclusively use vim inside GNU
screen, inside a terminal emulator.
[/QUOTE]
Emacs is the best of all. Vim sucks. Also Windows has way
better text editors than Linux.

I've never had the occasion to really use any purely Windows
editors intensively enough to form an opinion, but all of the
best Windows programmers I've met seem to use emacs or vim (most
often emacs), rather than a purely Windows editor.

My own experience with emacs is that I causes carpal tunnel
syndrome, because of the complicated positions it requires my
hand to take. (Escape-Meta-Alt-Control-Shift:).) Perhaps with
a different keyboard layout, but I've never taken the time to
study the possibilities. And this does seem to be personal, I
know more than a few very competent programmers who swear by
emacs (and who touch type, like I do), and don't seem to have
problems with it.

What I like about vim, of course, is that I never have to move
my hand from the base position for touch typing, and I rarely
have to use key combinations other than with shift (and the
shift key is placed in a way to make this comfortable). The
result is that I can work considerably faster with vim than with
any other editor.
 
J

James Kanze

vi's been standard for a while...

Still, I've used Unix where it wasn't present. (I *can* work
with ed if I have to.)
Most of them (not all).

As I said, the ones I've seen (Mandriva, SuSE and RedHat). Of
course, any administrator can change this anyway he wishes.
probably not (though I've started each this week, it was only
to check a detail).

Some six or seven years ago, I was working on a project where we
where communicating with mainframes. I was offered an
introductory course, so that I could work on them as well. The
first day, they presented the editor. It was 3270 based, with
all of the commands on the function keys, and you had to mark
the lines before editing them. (The actual "editing" took place
locally, on the terminal.) At least there, that was the
standard way of working on the mainframe, and it was a far cry
from anything I've seen under Windows or Unix. Or anything I
really wanted to get into:).

Thinking about it, of course, it wouldn't surprise me if a lot
of mainframe programmers simply downloaded the files, edited
them on a Windows machine, then uploaded them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top