Text editor

Discussion in 'C++' started by sid, Mar 20, 2008.

  1. sid

    sid Guest

    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.
     
    sid, Mar 20, 2008
    #1
    1. Advertising

  2. sid wrote:
    > 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 !
     
    Gianni Mariani, Mar 20, 2008
    #2
    1. Advertising

  3. sid

    Guest

    On Mar 20, 5:35 am, sid <> wrote:
    > 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
     
    , Mar 20, 2008
    #3
  4. sid

    Paavo Helde Guest

    sid <> wrote in news:f3103bba-029d-47fc-a804-
    :

    > 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
     
    Paavo Helde, Mar 20, 2008
    #4
  5. sid

    James Kanze Guest

    On 20 mar, 15:11, Paavo Helde <> wrote:
    > sid <> wrote in news:f3103bba-029d-47fc-a804-
    > :


    > > 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?


    > 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.)

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Mar 22, 2008
    #5
  6. James Kanze <> wrote:

    > 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.

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
     
    Thomas Dickey, Mar 22, 2008
    #6
  7. sid

    James Kanze Guest

    On 22 mar, 15:03, Thomas Dickey <> wrote:
    > James Kanze <> wrote:
    > > 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.


    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.)

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Mar 22, 2008
    #7
  8. sid

    Jeff Schwab Guest

    James Kanze wrote:

    > 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.
     
    Jeff Schwab, Mar 22, 2008
    #8
  9. sid

    Guest

    On Mar 22, 12:20 pm, Jeff Schwab <> wrote:
    > James Kanze wrote:
    > > 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.


    Emacs is the best of all. Vim sucks. Also Windows has way better text
    editors than Linux.
     
    , Mar 22, 2008
    #9
  10. sid

    red floyd Guest

    wrote:
    > On Mar 22, 12:20 pm, Jeff Schwab <> wrote:
    >> James Kanze wrote:
    >>> 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.

    >
    > 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.
     
    red floyd, Mar 22, 2008
    #10
  11. James Kanze <> wrote:
    > On 22 mar, 15:03, Thomas Dickey <> wrote:
    >> James Kanze <> wrote:
    >> > 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.


    > 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

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
     
    Thomas Dickey, Mar 23, 2008
    #11
  12. sid

    James Kanze Guest

    On 22 mar, 17:20, Jeff Schwab <> wrote:
    > James Kanze wrote:
    > > 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.


    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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Mar 23, 2008
    #12
  13. sid

    James Kanze Guest

    On 22 mar, 18:01, ""
    <> wrote:
    > On Mar 22, 12:20 pm, Jeff Schwab <> wrote:


    > > James Kanze wrote:
    > > > 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.


    > 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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Mar 23, 2008
    #13
  14. sid

    James Kanze Guest

    On 23 mar, 01:39, Thomas Dickey <> wrote:
    > James Kanze <> wrote:
    > > On 22 mar, 15:03, Thomas Dickey <> wrote:
    > >> James Kanze <> wrote:
    > >> > 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.

    > > 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


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

    > > 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).


    As I said, the ones I've seen (Mandriva, SuSE and RedHat). Of
    course, any administrator can change this anyway he wishes.

    > > 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).


    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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Mar 23, 2008
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    738
    Stylus Studio
    Aug 3, 2004
  2. Hatem KNANI
    Replies:
    2
    Views:
    678
    Morphon Technologies
    Aug 4, 2003
  3. Stylus Studio
    Replies:
    0
    Views:
    512
    Stylus Studio
    Aug 3, 2004
  4. SyncRO Soft
    Replies:
    0
    Views:
    518
    SyncRO Soft
    Jul 21, 2005
  5. Mark Hahn
    Replies:
    0
    Views:
    364
    Mark Hahn
    Sep 1, 2003
Loading...

Share This Page