PDA

View Full Version : What programming editor do you recommend?



KurtEck
02-07-2016, 11:19 AM
Just wondering what editors are people using these days for projects like the HROS1 and the like.

On Windows I have been mostly using Programmers Notepad for these types of projects, likewise for when I am editing libraries for Arduino... I have used this one for awhile now and it is not bad, but there are times when it is a bit limited, and I bit frustrating when you have lots of source files... Back a long long time ago, when I was working I used to use Visual Slickedit, but have not had a copy of that for a very long time.

I have some other editors installed as well, such as ones based on Microsoft Visual studio, which I use at times... Just wished it loaded a lot faster. Also have at least one copy of Eclipse installed (for Edison)... I have also used Geany...

Currently on the Mac I have Geany, Chicken and TextWrangler installed.

So this morning when I got a bit frustrated trying to keep several sets of files open, with over 20 some files open. This included many of the files in the HROS1-Framework, both Framework and Linux specific files, as well as files from my Raspberry Pi project, it made me wonder if maybe I should use a different editor...

Suggestions?

jwatte
02-07-2016, 01:03 PM
When I use things integrated with Arduino, I just use the (terrible, terrible) Arduino editor. Going with the flow leads to less pain over time; trying to customize everything just ends up wasting time.
When I edit random files on Windows, I use Notepad++.
When I write code on Windows for real, I use Visual Studio if at all possible. (Like, I have a compatibility layer that lets me build Arduino sketches in Visual Studio with fake hardware inputs, so I can debug them!)

When I'm on Linux, I use vim and make. And, honestly, that's about as good as using Visual Studio on Windows, except the GDB user experience is terrible.

tician
02-07-2016, 01:29 PM
I've not used it much yet, but sublime text seems quite nice. r3n33 brought it up in your PuTTY thread (http://forums.trossenrobotics.com/showthread.php?7437-PuTTY-and-colors) a while back. Gives me the familiar feel of gedit with the ability to quickly open multiple files via projects. Also has some build capabilities that I've not tried out yet. Have not bought a license yet, but likely will if do completely switch from gedit.

Took a little while to get the layout like I wanted because of the minimap size not really being easily/(at all?) modifiable and it was refusing to fit a full 80 character line without a horizontal scroll bar in a single half-screen window like gedit. Changing text settings to match gedit and changing gutter margin to -15 finally fixed that.

r3n33
02-07-2016, 02:08 PM
My vote is still for Sublime Text. It is full of features that I find useful and my license works on the osx, windows, linux versions which makes it nearly seamless between machines. I can also say I've never had an issue with lots of open files or any performance quirks. I believe the free version gives you the full feature set with a concentration killing message box that reminds you they'd like some money.

Notepad++ is also one of the editors I like on Windows but since I purchased Sublime I haven't had the need for anything else.

KurtEck
02-07-2016, 02:17 PM
Thanks,

Sounds good. I downloaded it and will try it.

KevinO
02-07-2016, 03:46 PM
+1 on sublime as well.

wadecore
02-08-2016, 12:19 AM
I'm gonna throw in another +1 for Sublime. I use it on Windows and Linux. It's sexy.

jodell
02-08-2016, 10:23 AM
I do most all of my programming with vim. The neat thing about using it for hr-os1 or other small computer projects is that it's included with most all Linux distros by default. Just ssh to the device and type 'vi'. One term window for the editor and a second for the compiler. Can't get better than that.

KurtEck
02-08-2016, 11:55 AM
Thanks, I have been known to do that in a pinch, but vi is not my favorite editor, especially if I am doing things like, working through all of the files associated with talking the the Arbotix Pro across multiple directories... I have even used nano before, but...

I do have Sublime Text installed now and have done a little playing around. Luckily most of the key bindings are pretty close to most of the other editors. Have not tried to do anything fancy yet, like figure out if there is a good way to jump from a function call in the code to find where it is defined in header and implementation... I think there are some ctags like extensions...

Jwatte: I also use Arduino IDE when doing Arduino stuff. It is not great, but at least they have added a few things now, like being able to jump to a line number... Wish they also had support to edit libraries... But...

jwatte
02-08-2016, 12:05 PM
working through all of the files associated with talking the the Arbotix Pro across multiple directories

In your .vimrc:
set hid

this keeps all the other files in RAM when switching to a new file.
You might as well also add:

set ic
set autoident
set expandtab
set sw=4
set background=light
set t_Co=256
colorscheme biogoo


Separately, commands like:

:grep -r foo . --include=\*.h

This will grep for foo in all the files with a .h extension. (I'm sure this is also mapped to some shorter key in some setups)
You then move through the hits with ":cn" and ":cp" (which you can map to <F6> and <F7> for example)

Other cool commands include ":bel spl <filename>" to open a new file in a second horizontal tab, and "%s/regex/replacement/g" to global search-and-replace in the current file. Also, uppercase marks ('A to set, mA to go to) are great when working in many files!

I'm the first to admit that vim does take a willingness to work at it to get proficient in; for me it does pay off on the other side of the learning curve.

KurtEck
02-10-2016, 10:12 AM
Thanks Jwatte,

I should mention that a long long long time ago, vi was one of the first editors I learned. It sure was a step up from using IBM card punch machines :lol: I still can fumble my way through using it, but I find myself having to google things like, how to do a Search and replace. How to make the search be non case sensitive... But I do it for some quick and dirty edits over a kitty(putty) window.

Whenever I use it, it reminds me of the days where writing a document involved using a text editor, and you had to put a bunch of cryptic stuff in column 1 to designate things like header levels, or to bold text, etc... Ah... sort of like today with Markdown :D

So since there were 3 or 4 suggestions for sublime text, I went ahead and purchased a license. Appears to work OK. Still learning, but so far finding it easier to edit in the Arbotix Pro fimware, where I simply open the directory, and then see all of the source files, and it has things like, right click on something and select goto definition...