geekhack
geekhack Community => Off Topic => Topic started by: hashbaz on Sat, 30 July 2011, 00:49:47
-
I'm curious as to where geekhackers' loyalties lie. What do you use, for what tasks, and why?
I'm a vim man myself. I use it for as much of my text editing as possible (chiefly coding and email). I've made several attempts to get past the early stages of emacs proficiency, but I just like vim's modal editing model too much. When I get going in hack mode I feel like I'm shaping text like a carpenter shapes wood. I think vim's t and f search motions, especially when combined with d, c, v, and semi-colon/comma, are its single greatest feature.
So, vim or emacs, or something else?
-
Notepad++
-
I'm a vim man too. Took alot more learning than I thought, but I'm glad I did.
-
vim! Best feature for me is the * and # searching! And readline of / and : commands. And cindent. And, and, and, ...
-
Nvi; Emacs (viper-mode) for Lisp.
-
Vim/emacs war : )
When it's between vim or Emacs it's mostly Emacs for me but a quite customized Emacs where I move the cursor and do selection in a vi-style (because Emacs's default CTRL-F / CTRL-B etc. simply hardly makes any sense whatsoever). I also remapped ctrl-x-map to something else than CTRL-x because that one is seriously hard to do when you remap caps-lock to act as a ctrl (and anyway ctrl-x is not convenient).
Emacs is really powerful that said. Just an example: the other day I was maintaining some old and kinda crappy codebase where a lot of constants where hardcoded into some source code file and one new constant had to be introduced in the middle of two other (don't ask, not my call ; ) and we didn't have the time to rewrite everything. The code was looking like this:
SOME_SILLY_STUFF = 21;
SOME_OTHER_SILLY_STUFF = 25;
STATE_A1 = 23;
STATE_A2 = 24;
STATE_A3 = 26;
STATE_B1 = 29;
STATE_B1 = 27;
STATE_B1 = 28;
STATE_B1 = 30;
... (here comes lots of lines that I do not want to modify manually)
STATE_Z1 = 86;
And I had to insert a "STATE_A4 = 29" and hence increment all the subsequent hardcoded constants (once again, not my call).
Under Emacs, such kind of manipulation are trivial. In this case, it's a query-replace-regexp followed by simply this:
\b[0-9][0-9]\b
\,(1+ \#&)
The first line is the regexp: whatever, it's one way to match what I need to match.
The second line is the Emacs / Lisp killer: the '\' indicates I want to use Lisp to calculate my replacement string: (1+ every_match)
That's right: in less than 30 keystrokes all in all I did use some Lisp to add 1 to all the 70 values or so that needed it. 30 keystrokes and Lisp. That's how powerful Emacs is.
I know a lot of people who, faced with the same problem, would have used much, much, more than 30 keystrokes to fix the problem.
There are Emacs videos on YouTube where people much more skilled with Emacs than I am show what they can do. It makes people's jaw drop : )
The following one is always a good read (a bit provocative and very cool):
http://www.paulgraham.com/lisp.html
:)
-
I use Geany (http://www.geany.org/) a lot, even under Windows where I prefer it to Notepad++. Usually vim if I need to use something on the command line, but I generally don't.
-
On desktop (Mac): BBedit, on server Vi (I use BSD mainly), or ViM (when I have to deal with linux server). I have used ViM as a primary editor in the past, just when the project started on Amiga platform.
-
mcedit in linux, notepad2 or notepad++ in windows
-
I really like TextMate on Mac. However, even on the Mac I find myself using vi more then anything else.
-
In Windows besides Notepad++ I've found that Textpad (http://www.textpad.com/) is the best for loading & searching through humongous log files. I still don't know how it can handle those multi-gig logs so easily.
-
Textmate on Mac. Vim occasionally. Coding in Xcode just because you lose too much by using anything else. (or are toggling constantly)
-
Coding in Xcode just because you lose too much by using anything else. (or are toggling constantly)
Yeah forgot to mention that - on those rare occasions I have to do some C/C++ I'm using Xcode too. And I almost don't program in Objective-C, used to do that in a past but haven't done it for some time now. At the moment I'm full time Perl programmer and for that one BBedit rocks.
-
Textmate on Mac. Vim occasionally. Coding in Xcode just because you lose too much by using anything else. (or are toggling constantly)
I've got my both my IDE and my Emacs set to auto-synch on any file change so that when I change in on or the other changes are instantly reflected on the other (and switching from one to the other is one shortcut). There have been talks about having IDEs allowing to allow for the integration of any text editor and I'd sure love to see this happen : )
Forgot to mention in my first post: regarding remote file editing that's what Emacs's "C-x C-f /ssh:user@host:file" is for (or you can also open a full-blown terminal inside Emacs using M-x term and do any SSH'ing you want an of course run emacs inside the outter emacs' terminal if you want to).
-
Neither emacs or vi(m).
Linux: pico (or GNU nano) for most things, actually. I use gedit for code when I don't have an IDE. My preferred IDE (right now) is Eclipse, and I like its editor.
Windows: Notepad++, but I wish it had a file pane, because that would make it easier to switch to a file.
-
Emacs for me. Especially for anything Lisp related (which is most of my code these days). SLIME is great.
-
Especially for anything Lisp related (which is most of my code these days)
Lucky you. Hence the great nick and the very cool lambda avatar... I can see there are a few real coding gurus on GH ; )
Damn, I just did a search on your posts and realized YOU are the one with the very cool: "I use SUPER for all my window-manager key bindings, so they don't interfere with any standard bindings for applications." setup!
I want to replicate this! I will make a post about this Real Soon Now [TM] (I'm also using both Linux/Xorg and OS X)
-
Damn, I just did a search on your posts and realized YOU are the one with the very cool: "I use SUPER for all my window-manager key bindings, so they don't interfere with any standard bindings for applications." setup!
You know that's why in good operating systems like Amiga and OS X you use Meta key for most actions because Control key is used in all terminal related things, and also all text boxes work with UNIX Control key shortcuts (like Ctrl+A to go to beginning line Ctrl+K to delete all to the end of line etc.).
Apple's recent politics is really **** but with OS X they made quite decent consumer grade desktop UNIX in beginning of this century.
And for those who would like to have Vi like text input throughout the system: http://www.macupdate.com/app/mac/22864/vi-input-manager
-
You know that's why in good operating systems like Amiga and OS X you use Meta key for most actions because Control key is used in all terminal related things, and also all text boxes work with UNIX Control key shortcuts (like Ctrl+A to go to beginning line Ctrl+K to delete all to the end of line etc.).
Yup I know, that's great and I use CTRL+A / CTRL+K all the time in my xterm etc. It drives me mad when I'm using applications re-defining these shortcuts...
-
vim shell and gvim gui
-
vi for small edits when at the shell anyway. Emacs for the big stuff.
-
That's right: in less than 30 keystrokes all in all I did use some Lisp to add 1 to all the 70 values or so that needed it. 30 keystrokes and Lisp. That's how powerful Emacs is.
That's impressive. In vim I would record a macro utilizing the ctrl-A (increment) command, and apply it N times (86-30, or whatever). Would probably come in at under 30 keystrokes. But inline Lisp in a search-and-replace command is pretty freakin' cool, and way more general obviously.
One of the reasons I keep trying to learn emacs is because it really is the more powerful, robust environment. But I just can't get over vim's modal editing model and command set, which are totally superior in my view (and viper mode isn't nearly good enough).
-
That's impressive. In vim I would record a macro utilizing the ctrl-A (increment) command, and apply it N times (86-30, or whatever). Would probably come in at under 30 keystrokes. But inline Lisp in a search-and-replace command is pretty freakin' cool, and way more general obviously.
One of the reasons I keep trying to learn emacs is because it really is the more powerful, robust environment. But I just can't get over vim's modal editing model and command set, which are totally superior in my view (and viper mode isn't nearly good enough).
Wrong mate - in Vi you do a regex to do that and it will take you much less keystrokes - here's simple example: http://www.xinotes.org/notes/note/41/
-
Vim.
For Eclipse, I use vwrapper (almost-vim, but integrated into the Eclipse/CDT editor pane).
Can't stand the Emacs meta-this ctrl-that style. Give me modal!
-
vi(m).
vi isn't really modal; it simply has functions with arguments.
-
If vi isn't really modal, then you don't understand what modal means. When you are not in insert/replace mode then everything you type is going to vi to interpret. That's the modality of vi.
-
If vi isn't really modal, then you don't understand what modal means. When you are not in insert/replace mode then everything you type is going to vi to interpret. That's the modality of vi.
That's an unproductive way to think of it, unfortunately encouraged by the original documentation; it makes it seem like there's a bunch of different special cases like “insert mode” and “replace mode” and “change mode” and whatever-else-I've-forgotten mode. Really though vi is a very simple, consistent, language for operating on text —
[count] command [motion] [text ESC]
It's substantially the same as TECO, with the addition of motion operands.
OK, ex mode and open mode (not present in vim) really are modes, but they're not what people are normally referring to when they describe vi as modal.
-
BTW wikipedia mentioned both vi and emacs as examples of modal and/or using interface modes
vi - has one mode for inserting text, and a separate mode for entering commands. There is also an "ex" mode for issuing more complex commands (e.g. search and replace). Under normal circumstances, the editor automatically returns to the previous mode after a command has been issued; however, it is possible to permanently move into this mode using Shift-Q.
Emacs - has a special mode for issuing commands, which is entered by pressing the control key plus a letter key. This differs from vi in that the mode always ends as soon as the command is called, when the sequence of key presses that activates it is completed. Emacs also has many "major and minor" modes that change the available commands, and are automatically invoked based on file type to more easily edit files of that type. Modes are written in Emacs Lisp, and all modes may not be included with all versions.
-
I like ed; what you get is what you get :lol:
Edith: anyone using Emacs with a remote lisp image on windows (lisp+swank on server, emacs+slime on windows)? Cygwin ssh doesn't work with Windows-emacs, so I have to use Cygwin-emacs for tramp to work.. disapointing.. Assuming I'm setting this all up, will I be able to complete filenames in the slime-repl contrib when using slime-tramp?
-
SciTE for me ;)
http://www.scintilla.org/SciTE.html
-
SciTE for me ;)
http://www.scintilla.org/SciTE.html
Haven't used that in a while but I do recall liking it for perl.
-
I like ed; what you get is what you get
I used ed for 4 months once, and then ex for a couple more before they got full duplex working. It's good training for vi, since you learn to make good use of regular expressions.
[Edit] And there's a good reason ed doesn't prompt, or display substitution results by default: you don't notice when the system is not keeping up with your commands.
-
I used ed for 4 months once, and then ex for a couple more before they got full duplex working. It's good training for vi, since you learn to make good use of regular expressions.
[Edit] And there's a good reason ed doesn't prompt, or display substitution results by default: you don't notice when the system is not keeping up with your commands.
Quite right -- I used vi over a telnet session to a very slow (and far away) embedded box once. Vi was very handy because of the count commands and stuff like ct/cf etc., making it far better over a crap link and slow hardware than a so-called `normal' text editor. But even vi eventually got on my nerves, updating the screen when I least expected it. Ed seemed to fit much better. That couple of weeks using ed improved my vi chops to no end too, as you say.
-
And for those who would like to have Vi like text input throughout the system: http://www.macupdate.com/app/mac/22864/vi-input-manager
Unfortunately input managers have been deprecated.
-
Wrong mate - in Vi you do a regex to do that and it will take you much less keystrokes
Nice, I didn't know vim could do that. I wasn't stating what vim is and is not capable of, just what I would have done to accomplish the same thing.
-
vi isn't really modal; it simply has functions with arguments.
Gotta disagree. Modes are states in which identical input will result in different output. That's why dialogs that don't let you interact with the main application are called modal -- they take over input. Maybe I'm missing a subtler aspect of what you're getting at, but vim is inarguably modal. So is emacs, for that matter (as was pointed out by someone else).
The larger point is that vim's central normal/insert mode distinction makes it pretty unique among text editors. Many hate it, but I have grown to love normal mode since it frees me from having to perform a chord for every non-text-insertion command.
-
In case anyone hasn't seen this little nugget of joy yet:
[ATTACH=CONFIG]22938[/ATTACH]
-
jupp (http://www.mirbsd.org/jupp.htm).