Code-oriented editor : Must-have features? - text

I hope this question doesn't fall into the "subjective question" case, but here's what :
I've been coding for almost 18 years, and having migrated to Macs for the last year or so, it was inevitable to start thinking about writing a code editor from scratch - probably, just to try this thing out, or to make something that perfectly suits my needs. And I was wondering :
What are the absolute MUST-HAVEs of a good code editor*? (by order of priority, if possible)
If we're talking about a not-so-conventional feature, could you give me an example of actual implementation of that particular feature? ("xxxxx" like in Notepad++ on Windows).
Looking forward to see your answers...
*Well, there is sometimes a thin line between what could be considered as an "Editor" and an "IDE", but let's just not exclude more... IDE-oriented ones...

Syntax highlighting with error checking.
"Go to Definition"/"Go to Declaration". Other types of quick "Go To"s.
As many kinds of autocompletion as you can possibly imagine.
Vim mode or being a Vim clone (command/edit mode dichotomy).
There's a lot of other nice-to-have features like automatic refactoring but the above I believe are definitive traits of a source code editor.

Related

Vim context highlighting

I think standard highlighting is useful -- to some extent. When programming with callbacks and nested structures, this does not help. Keywords and strings, they appear everywhere, and it helps when they are shown in a distinct color, but these colors gives no clue about in which scope I am, where I am in a lexical standpoint.
I have heard of context highlighting, in a talk of Douglas Crockford, which I can't remember a url to. The idea is, to highlight lexical levels of scope. Toplevel definitions are colored in color0, inner level block statements are colored in color1, and this repeats recursively every time a new level of scope is introduced. Below is an example for this, using some imaginary node libraries. (Now added a (ish (or scheme lisp)) example)
This is not necessarily for node or javascript. I wonder if there is an editor/vim plugin implementing this kind of feature. I don't know if context highlighting is the word for this, but I can't just find one. Googling for context highlighting brings up results for generic token based highlighting and ConTeXt (which I don't have a clue about).
Does this exists? Is there an editor implements this? And more importantly, can I have this in vim?
Another question which is identical to mine, with no real answer: Is Crockford style Context Coloring implemented in any code editor?
I also couldn't find anything similar, so I wrote one:
rainbow_levels.vim: A different approach to code highlighting.
Of course it is a very simplistic implementation, only considering indentation levels instead of real context, but it gets the job done ;D
Not exactly what you are requesting, but code folding is a powerful feature to let you focus on specific levels of your code. Vim supports folding http://vim.wikia.com/wiki/Folding
Indention guides are very handy also, for focusing in on specific parts of code. The sublime text editor has this (http://sublimetext.userecho.com/topic/98136-indent-guide-highlighting-changed/)
I saw this plugin for vim (https://github.com/nathanaelkane/vim-indent-guides) that appears to do the same thing.
You could possibly create a syntax highlighter that uses the indentation logic of this plugin to change the color scheme. What you describe is more involved where it needs to work not just off the indention, but like a language parser.
There is now a plugin for this in VIM called vim-js-context-coloring. I've only just played with it a little and am not super impressed yet, but it looks promising!
Note: you need to install npm and then run npm install in the directory where the plugin is installed. I regretfully, forgot to read the instructions when I installed it.

notepad++ alternative on centos to code directly on vps that is like nano

This question has been asked few times here and there, but you see all of them seem to have a linux desktop, i don't want a notepad++ alternative for a linux desktop, I want a notepad++ alternative for centos server, and I want it to be like nano not like vi, I don't know vi, so i'm looking for an editor that let me open a file on vps, choose a programming language, and it should correct my coding mistakes, this way I would not waste my time uploading files from windows to the vps, it should be easy to use and small, I don't want to waste my vps resources on an editor
Does such an editor exist?
Edit
#romainl
my vps is from 2host.com, I have centos 5 64 bit VPS E-CLASS, go to there for more info, that's all the info I know.
It's my production vps true, but i asked because i have another vps from chvps.com, the cheapest plan, i have mysite.com and mysite.net, I bought mysite.net, so no one can steal it, so i redirect users from mysite.net to mysite.com, I'm creating a new script for my site so chvps host mysite.net where i do some testing for the new version, like a staging server.
moreover i play with django on alwaysdata.com so I would like to get an editor.
I have seen many people saying that they love vim/vi, i will learn to use vim if you can tell me why vim is more powerful? aren't they all just editors?
To answer your question directly, here are a few CLI editors:
ne
joe
midnight commander's editor
As far as I know they won't show syntax errors as you type or even on save, you won't get any (semi)auto-completion either. All in all these are more powerful than nano but less powerful than NP++ (which I'm not familiar with) and a fortiori vim or emacs.
Anyway, a stock vim, even built with "huge" feature-set won't check the syntax of your PHP files as you type or on save, you'll need a bunch of plugins for that.
I don't know about emacs, but vim can be used in "easy" mode like this: vim -y yourfile.php.
Vim is one of the two best editors out there, learning its basics is not that hard. You probably don't have much time to spend on it right now but, once you do, try it. It rocks.
Can you tell us a bit more about your workflow (server layout, use of a VCS…)? At a glance it looks like you are editing files directly on a production server which is not really recommended.
<EDIT>
About Vim and all the others being just editors.
Yes they all have the same set of basic features: ability to input text, cut, paste, move the cursor… but even these basic features can be implemented in many manners. You say that you want NP++ features in a CLI editor, we can assume that you have tried other editors and ultimately decided to go with it because it worked better for you than the others.
All the CLI editors are different, like their GUI counterparts they shine in one place and lack in another. Because you are a programmer you "need" some advanced features and any editor not having a full fledged search/replace system supporting regex, some sort of auto-completion, macros, ability to build and show errors and so on.
Vim and Emacs both offer these fatures and sooo much more either natively or via plugins. As far as I know they are the only CLI editors really suited for programming so, to be able to work directly on your VPS, and be productive, you don't really have much choice: it's either one or the other.
The first problems you may be facing is the abruptness of the learning path and the weirdness of their "models" but most vim/emacs users will tell you that once its internalized it's hard to come back.
Why Vim (or emacs)?
I don't have a specific selling pitch to serve you. I was an advanced TextMate user, for me it was the best editor and it fitted all my needs but I was a little bored.
Then I stumbled on a Python screencast where everything looked magical to me and I found other screencasts by Dereck Wyatt and others and I was hooked: the way they moved through their code, the way they search/replaced, the omni-completion, the crazy plugins (surround rocks), the freaking motions and text-objects…
I took advantage of a slow week to learn the basics and make/revert a lot of mistakes and now I look at TextMate the same way you'd look at Notepad (not ++).
Here are a bunch of additional vim links for you:
One of the greatest answers here on SO
Coming home to Vim
Vi for smarties
The Physics of VIM
Vim Introduction and Tutorial
Ask HN: Suggestions for mastering vim?
Use Vim Like A Pro
Power Vim Usage
Why, oh WHY, do those #?#! nutheads use vi?
How I boosted my Vim
Ho, I just remembered another CLI editor: diakonos.
</EDIT>
If you asked allready a few times maybe the application you're looking for doesn't exists yet. I have to do the same things like you (edit files on the server, config and scripts) and I do it with jEdit with the langauge specific plugins plus FTP plugin. At least you could give it a try.

What Resharper features should be highlighted?

On next week I will be talking in front of my colleagues about Resharper as a tool which improves developers' performance. Because time for this talk is limited the question is - what resharper features are worth to be spoken about more then the others?
At the moment I can think of:
code analisys/highlight
unittest runner
refactoring features (rename, extract methods, ...?)
Other than the ones already stated, I would like to add this ones:
Code verification and highlight the code that does not compile on the fly;
Ctrl + Click goes to definition;
Code suggestion/improvements (null reference exception, convert to, etc.);
Find references is way more powerful (with go to definition and go to implementation).
I agree that a demo is probably the best, and configure the infos/errors/warnings beforehand, some of them are overkill/unused.
Demo (live on the beamer) what it can do: analysis, refactoring, unit test... Don't go into details as it pretty much explains itself.
Then focus on important things that they might not discover themselves: How to configure the warnings, code formatting, keyboard shortcuts. (I really love the context sensitive Ctrl-Shift-R / Alt-Enter)
The most important thing: R# lets you write clean, concise and mostly error-free code (at least when it comes to syntactical errors) and greatly lifts up a developer's productivity.
Things that seem most attractive to me:
The many context sensitive Refactoring options (rename, move to another namespace, extract etc...)..
The environment and context sensitive Live templates.
All these options are accessible via shortcuts (which are well worth to learn...)!
If you are doing Test-driven development, you might also find the Unit test integration noteworthy...
Thomas
File Structur window.
Without that defining regions would not be so useful.
Search patterns that can be shown as errors or warnings are also pretty cool.
Navigation (Ctrl + T, F12, Alt + Home, Alt + End,...)
This is one of the coolest features in R# 5.
Go to type (Ctrl+T).
I use it in combination with "Locate in Solution Explorer" (Shift+Alt+L).
(Ctrl + Shift + T) to find/search or open file
This may sound sarcastic, but it's not: The ability to disable resharper, from Tools -> Options -> Resharper ->General -> Suspend. While resharper is awesome, it is sometimes soooooo slow. We have many different solutions, some of which are huge, and it can literally add 5 to 10 minutes to the time it takes to open and/or build our larger solutions. I love that I can suspend resharper when I don't need it and when working on the larger solutions, and then just re-enable it again on the days that I do need it and when I'm working in smaller solutions.
The actual features that I use most are:
Ctrl+Shift+T to find files (works better than the VS native Ctrl+,).
Alt+Enter for code improvements.
The code suggestions given with blue/red squiggles.
The little glyph it puts beside unit tests, so you can easily run a single test.
Go To Implementation is great when working with projects using IoC.

Code Classic ASP in Linux

What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them.
What i'm looking for is:
Syntax highlighting
Code Browser (Ctags)
Preferably som sort of code insight
Something like Ultra Edit or E-texteditor.
I'm not sure what you're asking here, but if you are simply looking for a text-editor, my recommendations would be:
Console-based:
jed (simple, with a DOS Edit-like menubar, supports syntax-highlighing)
nano / pico (even simpler)
X-based:
Kate (KDE, syntax-highlighing)
Mousepad (like notepad)
SciTE (syntax-highlighing)
There are of course likely to be a gazillion other text-editors better than the ones listed above, but these are the ones I tend to use.
I played with BlueFish for a while when I was contemplating switching over completely and I liked it better than Kate. But, you will have to add the code to enable ASP highlighting. Its floating around numerous places - I found it in short order with a quick trip to the trusty ole Google. ;)
But that is just my personal preference. Your mileage may vary.

Text Editor For Linux (Besides Vi)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby.
Doing a google search yielded outdated answers.
Edit: Since there has been some concern about the 'merit' of this question. I am about to start a new Ruby Programming Project in Linux and before I got started I wanted to make sure I had the right tools to do the job.
Edit #2: I use VIM on a daily basis -- all . the . time. I enjoy using it. I was just looking for some alternatives.
http://xkcd.com/378/
Emacs is a wonderful text editor. It has huge power once you become a power user. You can access a shell, have as many files open as you want in as many sub-windows and an extremely powerful scripting support that lets you add all kinds of neat features.
I have been using a ruby-mode which adds syntax highlighting and whatnot to ruby, and the same exists for every major language.
If you keep at it, you can use exclusively the keyboard and never touch the mouse, which increases your editing speed by a significant margin.
If you want to start with something a lot more basic though, gedit is nice... it has built in syntax highlighting as well for most languages based on the filename extension. It comes with the OS as well (though emacs you can easily install with apt-get or some similar package finder utility).
UPDATE: I think gedit is exclusively GUI based though, so it would be useful to learn emacs in case you are stuck with just a shell (it is fully featured in both shell and graphical mode).
FURTHER UPDATE: Just FYI, I am not trying to push Emacs over Vim, it's just what I use, and it's a great editor (as I'm sure Vim is too). It is daunting at first (as I'm sure Vim is too), but the question was about text editors on Linux besides vi... Emacs seems the logical choice to me, but gedit is a great simple text editor with some nice features if that's all you are looking for.
Kate, the KDE Advanced Text Editor is quite good. It has syntax highlighting, block selection mode, terminal/console, sessions, window splitting both horizontal and vertical etc.
I use sublime Text on linux.
Try Scribes . It tries to be a TextMate replacement for Linux
2020 edit: forgotten in the mists of history
I use SciTE
very small and simple text editor.
I like the versatility of jEdit (http://www.jedit.org), its got a lot of plugins, crossplatform and has also stuff like block selection which I use all the time.
The downside is, because it is written in java, it is not the fastest one.
I find Geany (http://geany.uvena.de/) quite good.
I use pico or nano as my "casual" text editor in Linux/Solaris/etc. It's easy to come to grips with, and whilst you lose a couple of rows of text to the menu, at least it's easy to see how to exit, etc.
You can even extend nano, I think, and add syntax highlighting.
Alternative text editors? Try Diakonos, "a Linux editor for the masses". The default keyboard mapping is as expected for cut, copy, paste, undo, open, save, etc.
When I searched for TextMate alternative for Linux, I ended up using Geany. It's not as powerfull, but still nice to work with. Great replacement for Kate.
On Mac OS X, I have used BBEdit since the early 1990's, so I use that as my reference for all other editors. I sometimes use BBEdit to edit files on a Linux box using ftp mode, and that works very well if you have a fast network connection to the Linux box.
I learned emacs two years ago because the rest of the programming team I joined uses it. I find emacs powerful but annoyingly old-fashioned in many ways, but once you have learned emacs, you can use it on any platform (Linux, OS X, Windows). This is the editor I use almost exclusively at work now. It is going to take me years to master all its features, though.
I have also used gedit on Linux and found it very usable, but I haven't tried to use it as my primary editor for any project.
I have a colleague at work who uses Komodo Edit 4.4 (free from activestate.com), running it on a Windows computer but using it in ftp mode so she can edit files on our Linux server. Komodo Edit has many nice features, but it takes a looonnnggg time to launch the first time.
Don't forget NEdit! Small and light, but with syntax highlighting and macro record/replay.
Best one besides Vi? Vim.
SciTE
http://www.scintilla.org/SciTE.html
The best I've found is gedit unfortunately. Spend a few hours with it and you'll discover it's not so bad, with plugins and themes. You can use the command line to open documents in it.
+1 for pico/nano -- lightweight, gets the job done, good help
Friend of mine swears by jed, http://www.jedsoft.org/jed/
First I don't want to start a war..
I haven't used TextMate but I have used its Windows equivalent, e-TextEditor and I could understand why people love it.
I've also tried many text editors and IDEs in my quest in finding the perfect text editor on Linux. I've tried jEdit, vim, emacs (although I used to love when I was at uni) and various others.
On Linux I've settled with gEdit. Although I do use Komodo Edit from time to time. When I'm in a hurry I use gEdit purely because it is quicker than Komodo Edit.
gEdit has plenty of plugins and comes with some nice colour schemes. I reckon once gEdit has a proper code-tidy facility it'll be cool.
I think the only reason I use Komodo Edit is the project file facility.
I have a friend who donated his 'Vi Improved' book in the hope that he can convert me to Vim. The book is over an inch thick and completely put me off in investing time in learning Vim..
Everytime I find an editor - I always find myself going back to gEdit. It is a frills-in-the-right-places editor. Give gEdit a go, it is the default text editor in Ubuntu and Linux Mint.
Here is a link to an excellent guide on how to get gEdit to look and behave (somewhat) like TextMate:
http://grigio.org/pimp_my_gedit_was_textmate_linux
Hope that helps.
I agree with Mike, though I'm a Vim die-hard. I've been using GEdit quite frequently lately when I'm doing lightweight Ruby scripting. The standard editor (plus Ruby code snippets) is extremely usable and polished, and can provide a nice reprieve from full-strength, always-on programming editors.
I've just started using OSX. Free editors of note that I've discovered:
Komodo by ActiveState. No debugger or regex editor (although one comes with Python, i.e. redemo.py) in free version but perfectly usable.
ERIC, written in PyQT.
Eclipse with PyDev is my preferred option for editing Python on all platforms. Nice clean GUI, decent debugger. Good syntax parsing etc.
I've used Emacs for 20 years. It's great and it works everywhere. I also have TextMate, which I use for some things on the Mac (HTML mode is great). If you want to do Ruby development, Netbeans supports Ruby and it also runs on all platforms.
http://www.netbeans.org/features/ruby/index.html
I've seen some blogs, etc claiming that it's the best Ruby environment available.
I use joe for simple (and not so simple) editing when I'm away from Eclipse.
It uses the classic Wordstar keybindings- although I've never used Wordstar, it's a selling point for many people.
It's easy, well-supported, light-weight and it has binaries available for everything.
I love Kate because it has several interesting features (already cited) usually found in (heavier) IDEs. My favorite feature, however, is its terminal window that is very practical for quickly performing the save-compile-execute combo.
Nedit is another valid option, packed with lots of features (and it hasn't lots of dependencies: that's a huge plus IMHO).
For editing in a shell, when I cannot use VIM, I look immediately for pico or nano (but I would not recommend them for continuous development: for rapid editing they are perfect).
If it's just you? Use what you want to use today; switch in mid-stream if you want.
Is it a team? Try to be editor-agnostic. Set standards for white-space (are tabs allowed? How many spaces does a tab represent?), but otherwise allow anyone to use whichever editor they want.
Is it a team doing pair-programming? That's where you may need a team-standard editor, just so that programmers can easily pass the keyboard.
To help implement a standard white-space policy in a shop where one or more coders is using Emacs: You can tell Emacs about your white-space policy with some comments stuck at the bottom of every file source file. For example,
# Local Variables:
# tab-width: 2
# ruby-indent-level: 2
# indent-tabs-mode: nil
# End:
Anyone using emacs (or xemacs) on that file will automatically get the group standard indentation.
Sublime Text 2 is my favorite.
Intuitively understandable and quite powerful.
You can try Emacs with ruby-mode, Rinari (for Rails) and yasnippet which provides automatic snippets like Textmate.
TextMate is a great editor, and there is a way to replicate some of the functionality in GEdit. Check the article out here: http://rubymm.blogspot.com/2007/08/make-gedit-behave-roughly-like-textmate.html to modify GEdit to behave like TextMate.
Vim is a nice upgrade for Vi, offering decent features and a more usable set of keybindings and default behaviour. However, graphical versions like GVim, KVim and even Cream are extremely lacking in my opinion. I've been using Geany a lot lately, but it also has its shortcomings.
I just can't find something in the league of Programmers Notepad, Smultron or TextMate on Linux. A shame, since I want to live in an all open source cyberworld, I'm stuck hopping from one almost-right editor to another.
I personally use MacVim which is basically a GVim for Mac OSx. However I have been reading alot about Redcar, which is a text editor for Linux, which shares a lot of the Textmate functionality. Checkout the links below.
Redcar
LURG Lecture on Redcar

Resources