LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-19-2013, 12:25 AM   #16
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,862

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638

Quote:
Originally Posted by gezley View Post
And if a "plain text editor" is not enough? I don't think that you should request advice if you are dead set on rejecting two of the best and most powerful editors available...

On another note, another person in this thread recommended the rxvt-unicode terminal emulator. I second this; the developer has put some effort into unicode and non-Latin alphabet support.
I agree with gezley, you should not reject vim or emacs from consideration. In fact I would suggest topping your list with those and then trying to decide which best meets your needs. I am a seriously old guy with, what was it... oh yea, increasing memory problems, but long time Vim user who learns new tricks with it regularly!

I think the learning curve problem is more of a mental block than a real impediment to using either (especially Vim). Frankly, learning the mode control and basic editing keystrokes with Vim is really no more complex than learning the corresponding keystrokes with any of the "simple" editors, and with vim or emacs the online help available has great depth.

I also second use of rxvt-unicode. I was a long time konsole user but switched to rxvt-unicode and tmux about a year ago, very nice!

Last edited by astrogeek; 05-19-2013 at 12:26 AM.
 
1 members found this post helpful.
Old 05-19-2013, 04:52 PM   #17
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,862

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
There are many vi tutorials online and I recommend that you do your own search to find something more complete. And of course use vimtutor on your Slackware box.

But I have recommended Vim as a good choice for you, so I want to be as helpful and encouraging as possible to get you introduced to it as painlessly as possible. To that end I hope that you will find the following notes helpful - they assume that you have not previously used Vim so I hope they are not too simplistic.

First, make sure that you are using Vim!

There are several common Vi clones, and on most Linux systems when you invoke vi you are actually running something else.

On a clean Slackware installation vi is actually a symlink to elvis, another vi clone. Elvis is a fine vi replacement, but it has enough differences from Vim that the first thing I do when installing Slackware is change the symlink to point to Vim instead. As root...

Code:
cd /usr/bin
rm vi
ln -s vim vi
You could also simply invoke it as vim, of course. But if you are going to learn and use vi(m) changing the symlink is worthwhile.

Next, get oriented quickly!

I think the most difficult thing for people who simply open vi or a clone is that they see the blank page and begin typing - and weird stuff happens! Then they can't get out of it and they leave in frustration thinking the learning curve is too steep!

So to get past that point as quickly as possible note the following:

1. Vi(m) has two modes - command mode and insert mode (also called normal mode and edit mode respectively).
2. When you first start vi it is always in command mode, so key presses are interpreted as commands, not text.
3. To enter insert mode from command mode simply press i, then begin typing your text.
4. To return to command mode at any time simply press the ESC key.

You will see helpful status messages in the lower left corner of the terminal window as you change modes.

To leave vi you must be in command mode (pres ESC if not sure) then try one of these:

ZZ (shift-zz) - writes (saves) the current edits and exits.
:wq - writes (saves) the current edits and quits (same as ZZ).
:q - quit, prompts you to save any unsaved edits first (:w will write the to file)
:q! - quits without saving edits.

Now use it as simply as any plain text editor!

Open a new play file to edit...

Code:
vi playfile.txt
Enter insert mode...

Code:
i
Type a few lines as with any other editor. ENTER for line breaks, BKSP and arrows for moving around, most everything will work just as you expect it to.

Return to command mode, save and exit...

Code:
ESC
ZZ
To modify your new file simply open it again, return to insert mode, change and exit.

Now what is difficult about that? If you learned no other commands this will allow you to use it as the proverbial "plain text" editor... but of course, you really want to do a little more than that so now the way is open for you!

Learn more...

Now that you know the way in and out, and how to toggle between command mode and insert mode, use vimtutor to learn a few more keystrokes and expand your horizons.

Granted there are MANY more things that you can learn - that is what makes it so powerful! On the other hand, you only need to learn the things that you need to use, so the learning curve is only as steep as your intended usage!

A few quick and useful commands (in command mode of course...)

/something - Search for "something" forward in the document. ENTER to move to the first occurance.
/ENTER - Repeat previous search, move to next occurance.
?something - Search backward...
?ENTER - Repeat previous search backward, move to previous occurance

(Searches are actually full regular expression matches)

dd - Delete the current line
x - delete the current character
yy - Yank (copy) the current line
p - paste the last yanked line at the current position

Learn what you need and don't feel as if you need to learn it all just to get started! I think it will grow on you!

Good luck!

Last edited by astrogeek; 05-19-2013 at 04:59 PM.
 
6 members found this post helpful.
Old 05-19-2013, 05:38 PM   #18
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 527
Blog Entries: 3

Rep: Reputation: 126Reputation: 126
I agree that Vim is a great editor and it would be my suggestion as well, but if the guy wants to use joe then that's fine too..

I had a Uni lecturer tell me once that a persons editor of choice is a very personal choice, and for some reason that stuck with me.
 
2 members found this post helpful.
Old 05-19-2013, 06:20 PM   #19
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,494

Rep: Reputation: 437Reputation: 437Reputation: 437Reputation: 437Reputation: 437
Emacs has a vi-mode so you don't have to learn new keystrokes.

One of the fastest coders that I ever worked with used emacs with vi-mode.
 
Old 05-20-2013, 10:12 AM   #20
paulb2
LQ Newbie
 
Registered: Feb 2011
Location: Evansville, IN USA
Distribution: Slackware64 14.1(multilib) and Win7
Posts: 20

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by astrogeek View Post
There are many vi tutorials online and I recommend that you do your own search to find something more complete. And of course use vimtutor on your Slackware box.

But I have recommended Vim as a good choice for you, so I want to be as helpful and encouraging as possible to get you introduced to it as painlessly as possible. To that end I hope that you will find the following notes helpful - they assume that you have not previously used Vim so I hope they are not too simplistic.

-- much good help deleted --

Good luck!
First of all, I apologize to all who thought (appropriately) I was being too narrow-minded. I acknowledge (to my chagrin) that my message(s) were more emotional than rational, probably because of my frustration at being unable to find information I had wanted, and this probably because I did not know the correct search terms needed to find it.

To close this thread happily, I found a site yesterday morning that was pertinent to my need and, after following leads all day, I had found more than I had even hoped for. This covers not only my question about editors, but also about creating custom keymaps.

To astrogeek: "Thank you" is hardly enough. Many people comment with praise about the level of mutual help available in the linux community. And now I have experienced that for myself. My hope is that, sometime in the future, I will be able to provide such help to others. I will feel driven to do so, whenever I am able, by your example. Thank you.
 
4 members found this post helpful.
Old 05-20-2013, 10:31 AM   #21
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, SLAX, OpenSuSE
Posts: 1,600

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by paulb2 View Post
[...]
To close this thread happily, I found a site yesterday morning that was pertinent to my need and, after following leads all day, I had found more than I had even hoped for. This covers not only my question about editors, but also about creating custom keymaps.

[...]
Would you share the link to this site? I am trying to learn VI Improved a bit better, currently, myself.
Thanks!

gargamel
 
Old 05-20-2013, 12:15 PM   #22
paulb2
LQ Newbie
 
Registered: Feb 2011
Location: Evansville, IN USA
Distribution: Slackware64 14.1(multilib) and Win7
Posts: 20

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by gargamel View Post
Would you share the link to this site? I am trying to learn VI Improved a bit better, currently, myself.
Thanks!

gargamel
Sure thing, Gargamel. I don't remember the first site; it just gave me a lead to another site. Here are the three sites that I bookmarked. If you do not already know the most important one, it is:

www.vim.org

If you do a search for < vim editor >, you will find many additional sites that may offer the help you want.

Secondly, my post was tagged with "unicode", and I found much help here:

www.duganchan.ca/writings/slackware/fonts/

Thirdly, I wanted to learn how to write a custom keymap file, and this site provides an example:

http://www.computertechdoc.org/os/li...eymapfile.html

HTH, Good luck!

Added comment: I see that the third url is too long to be displayed fully in the forum message. When I click on the url in the message, I get a TimeWarnerCable search page; the failed url is shown at the top of that page; but the url as shown there is missing an underscore; so,I will try to reproduce the correct url here on separate lines:

computertechdoc.org/os/linux/
howlinuxworks/
linux_hlkeymapfile.html

Another note to avoid possible confusion: my former ISP was bought by TWC last year, and the switch-over began at my location on May 1, this year. That's the reason I get the TWC search page.

Last edited by paulb2; 05-20-2013 at 02:48 PM. Reason: Add comment
 
Old 05-20-2013, 12:53 PM   #23
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046
For learning and customizing Vim I would add these links:
http://vim.wikia.com/wiki/Vim_Tips_Wiki
http://vimcasts.org/
http://www.derekwyatt.org/vim/vim-tutorial-videos/
http://usevim.com/
 
2 members found this post helpful.
Old 05-20-2013, 01:08 PM   #24
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, SLAX, OpenSuSE
Posts: 1,600

Rep: Reputation: 142Reputation: 142
Thanks for the links!

Of course, I knew the VIM homepage, and I had also come across Dugan Chen's very well-designed pages, but like the Computertech site they seem to be currently unreachable (at least, from here, but I cannot reach some other pages, too, today). I'll try again by the end of the week.

Best regards,

gargamel
 
Old 05-20-2013, 01:17 PM   #25
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,067

Rep: Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788
Quote:
Originally Posted by paulb2 View Post
I will undoubtedly be back later, asking for pointers (i.e., where can I look for help) on creating custom keymaps. I've used MKLC (Microsoft Keyboard Layout Creator) in Win7 with success. And I downloaded (from somewhere, don't remember) the source file for an Arabic keyboard, which I imported into MKLC, et voilą, a workable keyboard with Arabic characters and RTL direction. But I will need to learn how to write the source file for a custom keyboard in Linux. I've spent way too many hours searching for myself - so far in vain.
Linux keyboard drivers are quite simple. They are actually compiled on the fly after log in from C source! The ingredients are /usr/share/X11/xkb (or that might be /etc/X11/xkb on Slackware).

If you use the command "setxkbmap -print" you'll see the files, like
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete+caps(internal_nocancel)" };
xkb_compat { include "complete+ledscroll(group_lock)" };
xkb_symbols { include "pc+gb+gr:2+astro:3+inet(evdev)+group(shift_caps_toggle)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc105)" };
};

evdev translates keycodes to designations and the symbols files exchange these for characters and actions. Thus by altering evdev I've put group shift <GPSH> (change drivers) where the scroll lock <SCLK> used to be. By changing the symbols scripts, I've altered the third and fourth levels:
key <AC01> {[ a, A, schwa, SCHWA ]};

You can also customise the compose key sequences by using your own file in .XCompose and setting your input module to xim. I've added things like
<Multi_key> <underscore> <t> : "ṯ" U1E6F # Latin small T with line below
 
1 members found this post helpful.
Old 05-20-2013, 02:06 PM   #26
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 13.37 kernel 2.6.39 gcc 4.5.2
Posts: 157

Rep: Reputation: 8
I use Joe myself for a lot of console edits. It helps to have used Wordstar in the DOS days though to find it easy as it is a clone of Wordstar. It is easy enough to learn though without Wordstar experience as you can just do ctrl-K H to pop up a Wordstar like help menu for the key strokes and ctrl-K H to turn it off again. Also Midnight Commander has a very easy to use text editor as well. I also use this one a lot when I am in Midnight Commander.
 
Old 05-20-2013, 03:51 PM   #27
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,616

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Working with Linux/UNIX without having at least some basic Vi skills is like learning to drive a car without knowing how to shift gears.

It's possible, but hey.
 
Old 05-20-2013, 04:40 PM   #28
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,517

Rep: Reputation: 90
Quote:
Originally Posted by gargamel View Post
Thanks for the links!

Of course, I knew the VIM homepage, and I had also come across Dugan Chen's very well-designed pages, but like the Computertech site they seem to be currently unreachable (at least, from here, but I cannot reach some other pages, too, today). I'll try again by the end of the week.

Best regards,

gargamel
Maybe this will help, I think it's a typo : http://www.comptechdoc.org/os/linux/...eymapfile.html
 
1 members found this post helpful.
Old 05-20-2013, 06:56 PM   #29
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, SLAX, OpenSuSE
Posts: 1,600

Rep: Reputation: 142Reputation: 142
Much better, thanks!

gargamel
 
Old 05-20-2013, 10:28 PM   #30
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,494

Rep: Reputation: 437Reputation: 437Reputation: 437Reputation: 437Reputation: 437
Quote:
Originally Posted by kikinovak View Post
Working with Linux/UNIX without having at least some basic Vi skills is like learning to drive a car without knowing how to shift gears.

It's possible, but hey.
The most important vi skill is memorizing the key sequence of...

:q!

...
 
  


Reply

Tags
command line, text editor, unicode


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
command line//text editor Fred Caro Linux - Newbie 6 02-18-2009 11:23 AM
Command-line output to GUI text editor hex1a4 Linux - General 2 04-10-2008 11:49 AM
Enhanced command line text editor netsoft2005 Linux - Software 2 07-14-2005 07:42 AM
Mandrake 9.1 installed command line text editor plexi100 Linux - Newbie 1 11-07-2003 10:25 PM
VI text editor in command line InSane103 Linux - Software 4 07-09-2003 09:04 PM


All times are GMT -5. The time now is 03:32 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration