LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Best shell script editor? (https://www.linuxquestions.org/questions/linux-newbie-8/best-shell-script-editor-4175562361/)

damuser 12-25-2015 05:49 PM

Best shell script editor?
 
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.

Thank you in advance.

ButterflyMelissa 12-25-2015 05:56 PM

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

Emerson 12-25-2015 06:13 PM

http://usevim.com/2012/07/06/vim101-completion/

jamison20000e 12-25-2015 08:52 PM

Hi.

Kdevelop if you have the RAM, tho you will learn more with Vi*...

grail 12-26-2015 12:17 AM

vim +1

BW-userx 12-26-2015 08:01 AM

Quote:

Originally Posted by Thor_2.0 (Post 5468962)
Geany...pretty good,

Yeah Geany what is what I use -- works great 4 me

BW-userx 12-26-2015 08:02 AM

Quote:

Originally Posted by jamison20000e (Post 5468996)
Hi.

Kdevelop if you have the RAM, tho you will learn more with Vi*...

only how to use VI+ -- bash script has nothing to do with VI -- VI is an editor BASH script is a langage that tells the computer what to do.

wpeckham 12-26-2015 09:28 AM

VIM GVIM done
 
-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.

BW-userx 12-26-2015 09:36 AM

Quote:

Originally Posted by wpeckham (Post 5469155)
-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.

jamison20000e 12-26-2015 10:27 AM

Geany has some good plugins too. If you want to go all out with GUI like Kdevelop (bells, whistles and such) Eclipse is cool?

Vi is grate because you learn the code not the editor! ;)

jamison20000e 12-26-2015 10:29 AM

Quote:

man vi
...
Quote:

VIM(1) General Commands Manual VIM(1)

NAME
vim - Vi IMproved, a programmers text editor

SYNOPSIS
...

tronayne 12-26-2015 11:09 AM

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.

jamison20000e 12-26-2015 12:27 PM

Most teachers won't let you start with anything fancier than pure .txt, .sh, .html, .rb, etc..

e.g: if you only learn math with a calculator then what?

BW-userx 12-26-2015 01:10 PM

Quote:

Originally Posted by tronayne (Post 5469193)
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 ;)

damuser 12-26-2015 01:13 PM

Thank you for all the replies. I will check a couple of these out today. =0)


All times are GMT -5. The time now is 10:02 AM.