Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello all. Hope this is the best place for this question.
I am looking for the best shell script editor. Ultimately, it would be great if there was one that supported auto complete and would allow you to select available functions, etc.
Geany...pretty good, Bluefish...great...both GUI...completion, never tried, never needed it...code coloring, both yes...
I doubt CLI editors have completion, unless I'm (very possibly) mistaken Welcome to the forum
Keep the questions comming
Melissa
-1 BW-userx : do you not understand the question? The OP wants advice on an EDITOR to use for scripting BASH, so it DOES have to do with the answer!
I use VIM for all of my script development. Perl, Bash, Python, it all just works. Follow that link for completion, as I do not use that feature. I would use GVIM if I were restrained to use a GUI tool, but luckily I can open a terminal and do it faster and cleaner directly in the shell.
-1 BW-userx : do you not understand the question? The OP wants advice on an EDITOR to use for scripting BASH, so it DOES have to do with the answer!
I use VIM for all of my script development. Perl, Bash, Python, it all just works. Follow that link for completion, as I do not use that feature. I would use GVIM if I were restrained to use a GUI tool, but luckily I can open a terminal and do it faster and cleaner directly in the shell.
exialy it is an editor question using VI or a vareint of it does nothing to improve the BASH code, a flat file editor of any kind will work no matter what.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Shell programming is text, be it BASH, KornShell, Shell or whatever, it's text.
That means a text editor is in order. Fancy-schmancy graphics? Uh, no, just text.
The base text editor is vi; however, in many Linux systems, vi is a symbolic link to elvis, "a clone of the ex/vi text editor" that has, over time, exhibited little glitches here and there and has been (and should be) replaced with vim, "Vi IMproved, a programmers text editor."
You'll probably find vi is /usr/bin/vi.
Code:
su - { or use sudo }
<root password>
cd /usr/bin
ls -l vi
lrwxrwxrwx 1 root root 5 Nov 22 2013 vi -> elvis*
{ the symbolic link is to /usr/bin/elvis, you want to change that }
{ make sure you have vim }
ls -l vim
-rwxr-xr-x 1 root root 2235144 Oct 2 2013 vim*
{ yep, got it, make the link }
rm vi
ln -s vim vi
{ check it }
ls -l vi
lrwxrwxrwx 1 root root 3 Dec 26 12:16 vi -> vim*
Ctrl-D
vim has color syntax highlighting (which drives me nuts but you may like it). Doesn't have, have as fare as I know, completion. It works just fine.
Something you may not be aware of about vi/vim is that it has settings that are quite useful, especially for code.
Get into your home directory and do this:
Code:
cat > .exrc
set autoindent showmode showmatch
Ctrl-D
When you're typing code and hit the tab key at the beginning of a line the editor will automatically indent one level and stay there until you type another tab (to indent further) or Ctrl-D to back up one indent level. Makes your code readable.
The showmatch setting causes the cursor to jump back to a matching paren, bracket or brace when you type a closing paren, bracket or brace (), [], {}. Helps you get the right number of closings to openings; it just jumps, so you have to watch.
Hope this helps some.
Last edited by tronayne; 12-26-2015 at 11:22 AM.
Reason: Forgot stuff
Shell programming is text, be it BASH, KornShell, Shell or whatever, it's text.
That means a text editor is in order. Fancy-schmancy graphics? Uh, no, just text.
The base text editor is vi; however, in many Linux systems, vi is a symbolic link to elvis, "a clone of the ex/vi text editor" that has, over time, exhibited little glitches here and there and has been (and should be) replaced with vim, "Vi IMproved, a programmers text editor."
You'll probably find vi is /usr/bin/vi.
Code:
su - { or use sudo }
<root password>
cd /usr/bin
ls -l vi
lrwxrwxrwx 1 root root 5 Nov 22 2013 vi -> elvis*
{ the symbolic link is to /usr/bin/elvis, you want to change that }
{ make sure you have vim }
ls -l vim
-rwxr-xr-x 1 root root 2235144 Oct 2 2013 vim*
{ yep, got it, make the link }
rm vi
ln -s vim vi
{ check it }
ls -l vi
lrwxrwxrwx 1 root root 3 Dec 26 12:16 vi -> vim*
Ctrl-D
vim has color syntax highlighting (which drives me nuts but you may like it). Doesn't have, have as fare as I know, completion. It works just fine.
Something you may not be aware of about vi/vim is that it has settings that are quite useful, especially for code.
Get into your home directory and do this:
Code:
cat > .exrc
set autoindent showmode showmatch
Ctrl-D
When you're typing code and hit the tab key at the beginning of a line the editor will automatically indent one level and stay there until you type another tab (to indent further) or Ctrl-D to back up one indent level. Makes your code readable.
The showmatch setting causes the cursor to jump back to a matching paren, bracket or brace when you type a closing paren, bracket or brace (), [], {}. Helps you get the right number of closings to openings; it just jumps, so you have to watch.
Hope this helps some.
and about NANO ? thats easy to use and writes text too
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.