## Editors

Please compose all posts in Emacs.

Moderators: phlip, Prelates, Moderators General

### Re: Editors

That's more like it.

enk wrote:I stopped reading at "^xjxjxjxjxjxjxjxjxjxjxjxjxj". If they use vi like they use notepad, of course there will be better alternatives. For example, vi used properly. And "^x" deletes the first NON-WHITESPACE char. And I used to think Plan9 was cool.
First of all I think the "^x" was a little mistake in the text, and it should just have been "x". Secondly, what you call "vi used properly" is perhaps using a macro and repeating it a certain number of times? Something like qrxjq15@r? It seems faster but it really isn't, because in the time you cooked up that macro you could also just have "used vi like notepad", probably twice -- proving the point of the text! Vim macros are nice if you have to do something for a hundred lines but not for 15. Thirdly, Plan 9 IS cool.

enk wrote:"When the mouse is properly accelerated, many of us find that it's faster and easier to highlight the lines in question and then type and execute Edit s/^<tab>//g in acme or just type s/^<tab>//g in sam's command window."

You can do that in vim as well. Or you could just highlight the lines using the mouse and press ONE SINGLE KEY, <, to dedent. That's when I stopped reading.
gvim, I suppose? How is this supposed to support terminal editors?
For proper frame of reference, other GUI editors like Notepad++ and Textwrangler can do the same but with shift-tab, which is more intuitive. Oh, and have I mentioned that the latter editors allow you to collapse a block of code with a nice little clickable triangle in the margin, out of the box?

enk wrote:
Jplus wrote:<move there by jk>0dd<move to the other line by jk>p ... <move there by jk>0yy<move to the other line by jk>p

What's with the zeroes?
Yeah, I realise they don't really need to be there. I forgot to take them out when I changed from moving a line without the line break (which would be done with 0d\$) to moving a line including the line break (dd). See how much thinking is involved in typing Vim commands?
enk wrote:Not that it hurts but if you don't take the time to learn basic vim, yes, there will be better alternatives.
Better alternatives to move a single line in Vim? Like what?

enk wrote:What exactly does grep offer that vim regex doesn't?

Oh, I don't remember and I don't find it important enough to figure it out. In any case, I've come to use TextWrangler searches for everything I used macros for in Vim, as well as everything I used pattern searches for in Vim, and both use cases have become more convenient.
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

### Re: Editors

Jplus wrote:Folks, this is not a Battle of the Editors. This is not even like a pillow fight. All I see "I like vim/emacs/ed/nano/textmate/whatever", with some modest arguments. What happened with flaming?

Let me add a new perspective. Using a terminal editor is silly. You are more efficient if you take advantage of the mouse.

This is only because you're some spoiled amature Luser who only works in an environment where access to a GUI is universal. As a consultant, I often work remotely on machines where the bandwidth to run an X server/citrix or other remote UI access is inadequate, leading to an agonizing lack of productivity...and I'm generally being hired at two to four times the price of the company's own employees (such as yourself), to save their asses on a project, in part because I'm more productive than they are.

So you can stick your pampered, whiny "why don't we all just use our purty graphic interface" ignorance where the sun don't shine.

And spin.

Spoiler:
He said he wanted flaming

kazvorpal

Posts: 45
Joined: Tue Oct 11, 2011 4:43 pm UTC
Location: St Louis, MO

### Re: Editors

I'll say "Yay!"
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

### Re: Editors

Jplus wrote:what you call "vi used properly" is perhaps using a macro and repeating it a certain number of times? Something like qrxjq15@r? It seems faster but it really isn't, because in the time you cooked up that macro you could also just have "used vi like notepad", probably twice -- proving the point of the text!

Well, you're the one raving about macros.

Autoindent inner block (between the two enclosing curly braces): =i{
Autoindent whole buffer: gg=G (and return cursor to where it was: <c-o><c-o> (that's control-o twice). Jump history.. how many editors have that?)
Dedent inner block: <i{
Dedent 10 lines: 10<<
If it's not a full block (for whatever reason) or not block based (Python for example) and you don't know exactly how many lines:
Line visual: Vj< where you hold down "j" as you see fit.
Block visual: <c-v>jx

Jplus wrote:gvim, I suppose? How is this supposed to support terminal editors?

Who says terminal apps can't use the mouse? :set mouse=a

Jplus wrote:For proper frame of reference, other GUI editors like Notepad++ and Textwrangler can do the same but with shift-tab, which is more intuitive.

Shift-tab is intuitive because many apps use it. "<" for move left and ">" for move right is certainly also intuitive.

Jplus wrote:Oh, and have I mentioned that the latter editors allow you to collapse a block of code with a nice little clickable triangle in the margin

So does vim. Yes, also in the terminal. :set foldmethod=syntax foldcolumn=3

Jplus wrote:See how much thinking is involved in typing Vim commands?

There's a lot of thinking involved in driving a car as well until you learn it.

Jplus wrote:
enk wrote:Not that it hurts but if you don't take the time to learn basic vim, yes, there will be better alternatives.
Better alternatives to move a single line in Vim? Like what?

No, better alternatives to vim.

Nano, for example. It has your options printed for you at all times

Jplus wrote:I've come to use TextWrangler searches for everything I used macros for in Vim

Just because you don't use the full power of a program doesn't mean it's inferior.
phlip wrote:Ha HA! Recycled emacs jokes.

enk

Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

### Re: Editors

Jplus wrote:gvim, I suppose? How is this supposed to support terminal editors?

Most terminal emulators are able to pass the position of the mouse to software that understands it. Very little software understands it.
Sexothermic
I have only ever made one prayer to God, a very short one: "O Lord, make my enemies ridiculous." And God granted it. -Voltaire
They said we would never have a black president until Swine Flu. -Gears

netcrusher88

Posts: 2171
Joined: Mon Mar 26, 2007 4:35 pm UTC
Location: Seattle

### Re: Editors

enk wrote:Autoindent inner block (between the two enclosing curly braces): =i{
Autoindent whole buffer: gg=G (and return cursor to where it was: <c-o><c-o> (that's control-o twice). Jump history.. how many editors have that?)
Dedent inner block: <i{
Dedent 10 lines: 10<<
If it's not a full block (for whatever reason) or not block based (Python for example) and you don't know exactly how many lines:
Line visual: Vj< where you hold down "j" as you see fit.
Block visual: <c-v>jx

Nice tricks, really. But does it also work if I want to remove an asterisk from a series of lines? For example when converting a bullet list into a normal paragraph? Or if I want to keep the indentation but strip one space?
Btw, using visual to select a chuck of text is obviously a solution that was invented because of the lack of a mouse. Selecting directly with your mouse is undeniably more efficient and comfortable.

enk wrote:
Jplus wrote:gvim, I suppose? How is this supposed to support terminal editors?

Who says terminal apps can't use the mouse? :set mouse=a

I'm not saying that terminals can't use the mouse, but if you need the mouse to make your app more efficient, that sort of proves my point.

enk wrote:
Jplus wrote:Oh, and have I mentioned that the latter editors allow you to collapse a block of code with a nice little clickable triangle in the margin

So does vim. Yes, also in the terminal.:set foldmethod=syntax foldcolumn=3

Mouse again?

enk wrote:
Jplus wrote:See how much thinking is involved in typing Vim commands?

There's a lot of thinking involved in driving a car as well until you learn it.

After that there's still thinking involved in driving a car (or using Vim), but you don't really notice anymore. If driving a car/typing Vim commands wouldn't involve thinking you'd be utterly bored while doing it. It's different from grasping your cup of tea, which is something you just do (and which can be really annoying if it takes you more than half a second). Using a mouse is more like the latter.

enk wrote:
Jplus wrote:I've come to use TextWrangler searches for everything I used macros for in Vim

Just because you don't use the full power of a program doesn't mean it's inferior.

The fact that I need more learning and have to spend more time thinking in order to do the same things does make it inferior. Especially when it doesn't offer any advantage in return.
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

### Re: Editors

Jplus wrote:Secondly, what you call "vi used properly" is perhaps using a macro and repeating it a certain number of times? Something like qrxjq15@r? It seems faster but it really isn't, because in the time you cooked up that macro you could also just have "used vi like notepad", probably twice -- proving the point of the text! Vim macros are nice if you have to do something for a hundred lines but not for 15.

I can't speak to how Vi macros work, but I use Emacs macros all the freaking time, and they do usually save time, even on just 5-10 lines. Why? Because "cooking up the macro" as you put it takes basically the same amount of time as doing one edit. C-x (, then you do the edit, then C-x ) to end, then C-x e to repeat. Occasionally things go wrong and your macro doesn't work and you have to fix it up, but that's reasonably rare. The only other reasons it would take longer is because you sometimes have to think a small amount to make it general, and sometimes have to do things a little differently (e.g. search for a delimiter instead of just use character navigation). But for my uses, setting up the macro is almost always less than twice the time of doing the edit: so I win out with very very few lines. (A lot of the edits I do with Emacs macros could be done with regex search/replace as well, but for a variety of reasons I strongly prefer macros most of the time. A lot of that is familiarity, not that I'm a regex newbie by any means.)

I have two features that I want out of a text editor: quick macros like that and incremental search. And being able to use it without knowing too much about it, even if it's sort of inefficient. (That actually excludes some old Vis for me.)
EvanED

Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC

### Re: Editors

Jplus wrote:Nice tricks, really. But does it also work if I want to remove an asterisk from a series of lines? For example when converting a bullet list into a normal paragraph? Or if I want to keep the indentation but strip one space?

yeah: 10s/^*// for 10 lines. Visual mode to select the span if you can't count.

Btw, using visual to select a chuck of text is obviously a solution that was invented because of the lack of a mouse. Selecting directly with your mouse is undeniably more efficient and comfortable.

Not when keyboard movement is more efficient than mouse movement - and, when looking at code, it often is. How quickly can you select an exact block of code from delimiter to matching delimiter? In vim, v% (or V% if you want line-wise, but you probably don't). Or that inner block command I hadn't seen before. Or just append the movement to the command, if you're only doing one manipulation selecting is a waste of time.

Mouse again?

Nope. That command gives a nice sidebar, but the mouse is never necessary.

After that there's still thinking involved in driving a car (or using Vim), but you don't really notice anymore. If driving a car/typing Vim commands wouldn't involve thinking you'd be utterly bored while doing it. It's different from grasping your cup of tea, which is something you just do (and which can be really annoying if it takes you more than half a second). Using a mouse is more like the latter.

I get pretty bored driving a car, to be honest. Vim commands (or emacs if you're filthy like that) become muscle memory, and since you never take your hands off the keyboard you can issue commands and input text inline with movement without moving your hand away to the mouse.

The fact that I need more learning and have to spend more time thinking in order to do the same things does make it inferior. Especially when it doesn't offer any advantage in return.

If you work with code the advantages in return are substantial - not just from having a programmer's text editor that's been developed for exactly that purpose over decades, but from not having to dick around with the mouse, menus, and dialogs to do simple tasks like fixing indentation or folding. Searching the file. Search-and-replace. Jump to line (do that efficiently with a mouse). Ctags, which while supported by most modern editors are a vi invention (and have, as I recall, a single-keystroke lookup function in vi).

I mean, if you're writing a children's book, sure, knock yourself out. But an editor lacking meaningful, thorough keyboard commands is a sorry excuse for a programmer's text editor.
Sexothermic
I have only ever made one prayer to God, a very short one: "O Lord, make my enemies ridiculous." And God granted it. -Voltaire
They said we would never have a black president until Swine Flu. -Gears

netcrusher88

Posts: 2171
Joined: Mon Mar 26, 2007 4:35 pm UTC
Location: Seattle

### Re: Editors

Jplus wrote:Nice tricks, really. But does it also work if I want to remove an asterisk from a series of lines? For example when converting a bullet list into a normal paragraph? Or if I want to keep the indentation but strip one space?

Indentation commands are for.. yeah.. indentation. But block mode is useful for those examples, and I use it a lot for things like that. Plus what netcrusher88 said. And also visually select lines, then simply :s/what/ever/ which means you don't have to count and you can do things more advanced than in block mode.

Jplus wrote:Btw, using visual to select a chuck of text is obviously a solution that was invented because of the lack of a mouse. Selecting directly with your mouse is undeniably more efficient

Only if my hand was already on the mouse. Which it wasn't.

Jplus wrote:and comfortable.

Big no. Mice destroyed my hand. After spending a smaller fortune on a trackpad it started getting better. But that's just for web browsing anyway. The keyboard is for editing.

Jplus wrote:I'm not saying that terminals can't use the mouse, but if you need the mouse to make your app more efficient, that sort of proves my point.

You said your point was that terminal editors suck. Maybe what you meant was that mouse-less editors suck?

Maybe all that mouse usage has slowed your mind?

I rarely use the mouse in vim, though. And when I do, it's not for selecting text.

Jplus wrote:
enk wrote:
Jplus wrote:Oh, and have I mentioned that the latter editors allow you to collapse a block of code with a nice little clickable triangle in the margin

So does vim. Yes, also in the terminal.:set foldmethod=syntax foldcolumn=3

Mouse again?

Actually the mouse is inferior for handling folds and I don't use it for that. It can only open or close.

There are over 20 keyboard commands for folding. The ones I use are:

zM fold most (close all folds recursively)
zr reduce folding (open all folds one more level)
zR reduce folding most (open all folds recursively)
za toggle current fold
zA toggle current fold recursively
zi toggle foldenable (keep state but show nothing as folded)
phlip wrote:Ha HA! Recycled emacs jokes.

enk

Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

### Re: Editors

netcrusher88 wrote:line-wise, but you probably don't). Or that inner block command I hadn't seen before.

:h text-objects

They rock

netcrusher88 wrote:Or just append the movement to the command, if you're only doing one manipulation selecting is a waste of time.

I do a lot of coding while others are watching and I use visual mode quite a lot so they can se what I'm doing. Also, a lot of <c-e> and <c-y> instead of big jumps

netcrusher88 wrote:Ctags, which while supported by most modern editors are a vi invention (and have, as I recall, a single-keystroke lookup function in vi).

ctags is nice. Go to tag is <c-]>. Or g followed by a click on a tag if you're into that sort of perversion
phlip wrote:Ha HA! Recycled emacs jokes.

enk

Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

### Re: Editors

See, I like that. Simplicity.

But while the GUI menace sleeps: you'll note that with the vi family you can do that with just one or a few keystrokes. As opposed to Ctrl-x Meta-x (manual-chords (symphony (beethoven (5th)))). Reverse polish text editing. Ugh.
Sexothermic
I have only ever made one prayer to God, a very short one: "O Lord, make my enemies ridiculous." And God granted it. -Voltaire
They said we would never have a black president until Swine Flu. -Gears

netcrusher88

Posts: 2171
Joined: Mon Mar 26, 2007 4:35 pm UTC
Location: Seattle

### Re: Editors

EvanED wrote:I have two features that I want out of a text editor: quick macros like that and incremental search. And being able to use it without knowing too much about it, even if it's sort of inefficient. (That actually excludes some old Vis for me.)

How can you maintain this for any advanced terminal editor in general, and especially for emacs?

@netcrusher88, enk: I give up on Vim specialities, you guys clearly know the program a lot better than I do. But everything you mentioned I can do with TextWrangler, since TextWrangler (and Notepad++) was also designed for programming. Moreover, I know how to do all these things even though I've only used it for a year, since GUI editors don't require you to get your editor PhD first.

Oh and for line jumping, I find TextWrangler excellent. It puts all my program entities in a nice little pulldown menu so I can access all of them in just two clicks.
Jumping to specific positions in the text is nearly always faster with the mouse for a very simple reason: while you're narrowing down the position by eyesight, you're already moving in the right direction with your mouse pointer.

Picking up the mouse takes less time than thinking up what control sequence you're going to type. It's ridiculous to think that editor commands could be in your muscle memory. You're just not aware of the fact that you're thinking about it.

Oh, and I can select blocks with my mouse very quickly: just double-click inside the braces (but even if I were to do it with a traditional click-and-drag I could do it fast).

enk, I'm sorry for your hand falling prey to mouse injury, but I think you were in bad luck. It seems that such injury (or RSI at least) can be prevented by reducing stress and assuming a healthy posture with lots of little breaks. Besides, carpal tunnel syndrome seems more associated with typing than with mousing.
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

### Re: Editors

Ugh, pulldown menus are the worst UI element known to man, or were until the Ribbon which is so bad Microsoft is trying to ditch it after just two releases. They're better than most alternatives for what they do but a huge waste of time.

I mean, I'm sure it's nice if you're working in a single source file with less than a dozen source code objects. ctags provide a nice way to jump around an entire project though.
Sexothermic
I have only ever made one prayer to God, a very short one: "O Lord, make my enemies ridiculous." And God granted it. -Voltaire
They said we would never have a black president until Swine Flu. -Gears

netcrusher88

Posts: 2171
Joined: Mon Mar 26, 2007 4:35 pm UTC
Location: Seattle

### Re: Editors

netcrusher88 wrote:until the Ribbon which is so bad Microsoft is trying to ditch it after just two releases.

I'm just curious, but what is your evidence for this? I personally haven't seen anything to suggest that they're getting rid of the ribbon.
Derek

Posts: 1543
Joined: Wed Aug 18, 2010 4:15 am UTC

### Re: Editors

Jplus wrote:
EvanED wrote:I have two features that I want out of a text editor: quick macros like that and incremental search. And being able to use it without knowing too much about it, even if it's sort of inefficient. (That actually excludes some old Vis for me.)

How can you maintain this for any advanced terminal editor in general, and especially for emacs?

Emacs still gives you a GUI which makes a number of things gradually discoverable. Even if you don't know C-x C-s saves, there's still a menu and such you can use. Contrast with old vis where the arrow keys don't even work so you really need Vi-"specific" knowledge about what keybindings move the cursor around and such. Without that knowledge, you can't even work inefficiently. Modern Vis (just Vim? Not sure) are much better about this (still need to know how to save and quit), and Gvim nearly completely satisfies my criterion. (You just need to know about insert/command mode.)

netcrusher88 wrote:until the Ribbon which is so bad Microsoft is trying to ditch it after just two releases.

Without commenting too much about the merits and demerits of the ribbon, have you read anything about Windows 8? They're adding it to more things, not trying to ditch it. It's still in Office 2012, and I don't see anything in a brief search about trying to drop it.
EvanED

Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC

### Re: Editors

Jplus wrote:Let me add a new perspective. Using a terminal editor is silly. You are more efficient if you take advantage of the mouse. I first realized this when I was confronted with Acme from Plan 9 from Bell Labs. The folks at Bell Labs also took the effort to explain why mousing is faster than typing commands.

thankfully, such things became obsolete years ago. have you even tried using a graphical editor with a laptop touchpad? or a touchscreen? it's just awful.
Code: Select all
uint8_t f(uint8_t n){ if (!(n&1)) return 2;  if (n==169) return 13; if (n==121||n==143) return 11;  if (n==77||n==91) return 7; if (n==3||n==5) return 0;  n=(n>>4)+(n&0xF); n+=n>>4; n&=0xF;  return (n==3||n==6||n==9||n==12||n==15)?3:(n==5||n==10)?5:0; }

hotaru

Posts: 949
Joined: Fri Apr 13, 2007 6:54 pm UTC

### Re: Editors

hotaru wrote:
Jplus wrote:Let me add a new perspective. Using a terminal editor is silly. You are more efficient if you take advantage of the mouse. I first realized this when I was confronted with Acme from Plan 9 from Bell Labs. The folks at Bell Labs also took the effort to explain why mousing is faster than typing commands.

thankfully, such things became obsolete years ago. have you even tried using a graphical editor with a laptop touchpad? or a touchscreen? it's just awful.

That's the problem of touchpads and touchscrenes, not GUI editors

I had a train of thought, in response to some of the comments here, that went something like this:
GUI editors can still have keyboard shortcuts, of course, and in fact, it's often very useful for the most used commands (copy, paste, undo, etc.). In fact, it is the combination of both mouse and keyboard that make GUI editors so powerful. You can be doing one thing on the keyboard, and something else on the mouse at the same time, this is also why m/kb is so good for FPS and RTS games). But when I think about it, a lot of keyboard shortcuts are kind of awkward to do with one hand. They should try to place the most used shortcuts on the left hand side of the keyboard.

Conclusion: Text editors need grid keys!

So yeah, that's the epiphany that I had a few days ago.
Derek

Posts: 1543
Joined: Wed Aug 18, 2010 4:15 am UTC

### Re: Editors

hotaru wrote:
Jplus wrote:Let me add a new perspective. Using a terminal editor is silly. You are more efficient if you take advantage of the mouse. I first realized this when I was confronted with Acme from Plan 9 from Bell Labs. The folks at Bell Labs also took the effort to explain why mousing is faster than typing commands.

thankfully, such things became obsolete years ago. have you even tried using a graphical editor with a laptop touchpad? or a touchscreen? it's just awful.

Agreed. Thankfully, touchpads and touchscreens became obselete years ago with the invention of the mouse.

(Of course my statement is pretty ridiculous, but I'd argue it's far less so than yours.)

Derek wrote:In fact, it is the combination of both mouse and keyboard that make GUI editors so powerful. You can be doing one thing on the keyboard, and something else on the mouse at the same time, this is also why m/kb is so good for FPS and RTS games).

I often use the mouse when doing text editing, and I actually disagree with this. For almost all tasks, your "I'm doing some commands now" spurts are very very short... maybe select some text, cut it, move the cursor somewhere else, and paste. Most of the time you're probably actually going to be typing. And unless you like typing with one hand on the mouse, that means you have to move your mouse hand back. Granted, that motion doesn't take you very long -- but nor does having your hand on the mouse buy you very much either.

RTS and FPS players don't play for a bit with their mouse hand on the mouse, then move it over to the keyboard and stay there for a while, then move it back -- it stays on the mouse for the entire game.

(Also, that's not why keywoard+mouse is good for FPS... that's true because the mouse is way better at aiming accurately quickly than a controller. But whatever.)
EvanED

Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC

### Re: Editors

...Eclipse?

toastking

Posts: 6
Joined: Fri Oct 14, 2011 2:35 am UTC

### Re: Editors

I like Eclipse as an LDAP editor with that one plugin from Apache.
Sexothermic
I have only ever made one prayer to God, a very short one: "O Lord, make my enemies ridiculous." And God granted it. -Voltaire
They said we would never have a black president until Swine Flu. -Gears

netcrusher88

Posts: 2171
Joined: Mon Mar 26, 2007 4:35 pm UTC
Location: Seattle

### Re: Editors

toastking wrote:...Eclipse?

No, the OS thread is over this way.

Ha HA! Recycled emacs jokes.
While no one overhear you quickly tell me not cow cow.
but how about watch phone?

phlip
Restorer of Worlds

Posts: 7172
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

### Re: Editors

I hear Emacs people often remap their Ctrl to Caps Lock, but why not to Alt? It seems to me that that alt is reachable by the thumb without even moving a finger. And then Alt/Meta, the second-most used button, could be at Caps Lock, where it only takes a pinkie to reach.

I speak without any real prior experience of this key config, of course. Does overuse of Alt secretly cause carpel tunnel or something?

Similarly, do Vim people remap their Esc key to somewhere nearer the home row?
lalop

Posts: 204
Joined: Mon May 23, 2011 5:29 pm UTC

### Re: Editors

lalop wrote:I hear Emacs people often remap their Ctrl to Caps Lock, but why not to Alt? It seems to me that that alt is reachable by the thumb without even moving a finger.

Even on my split keyboard, where Alt is closer to the center than usual, and at least for me, using thumb on alt is uncomfortable without either shifting your hand over or turning it clockwise. On my non-split keyboard, it's really uncomfortable. E.g. I think I do M-y in emacs with my left thumb on alt, index finger on y, and with about a 30 degree turn in my arm. (Note: I use Dvorak, and 'y' is on the QWERTY 't' key.)

The pinkie on caps is way more comfortable in both cases, at least for me. (I'm assuming use of the left alt, though it seems about the same on the right.)

Similarly, do Vim people remap their Esc key to somewhere nearer the home row?

I have heard of heavy Vi users mapping caps to esc.
EvanED

Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC

### Re: Editors

lalop wrote:I hear Emacs people often remap their Ctrl to Caps Lock, but why not to Alt? It seems to me that that alt is reachable by the thumb without even moving a finger. And then Alt/Meta, the second-most used button, could be at Caps Lock, where it only takes a pinkie to reach.

I speak without any real prior experience of this key config, of course. Does overuse of Alt secretly cause carpel tunnel or something?

Similarly, do Vim people remap their Esc key to somewhere nearer the home row?

I find that Alt is incredibly uncomfortable to reach from a typing position with with either the pinkie or thumb. Both require either a large twist or shifting my entire hand several keys one way or the other. Ctrl is only slightly uncomfortable and I'm find using it for typing.
Derek

Posts: 1543
Joined: Wed Aug 18, 2010 4:15 am UTC

### Re: Editors

I see. Maybe it's that I'm using a laptop keyboard.

It's not good how vim and emacs seem to encourage different keys being mapped to Caps Lock. This prevents crossover from the people who would otherwise want to use both.
lalop

Posts: 204
Joined: Mon May 23, 2011 5:29 pm UTC

### Re: Editors

Heh, there's a battle for a useful use of the caps lock key. Mapping such a useful key to esc seems wasteful to me. I use vim for like everything and I use ctrl-c instead of esc.

I also use the Colemak keyboard layout where caps lock is used for backspace which is a really good idea, except that control is better. So I use caps lock as control. But I still don't have to overwork my pinky to reach for backspace since it's on my thumb with my Kinesis Advantage keyboard
phlip wrote:Ha HA! Recycled emacs jokes.

enk

Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

### Re: Editors

After some serious trial time I've decided my left thumb was indeed hurting too much, and so moved Ctrl from Alt to Caps Lock. It's a shame, I think, because if I had a slightly bigger lalt and smaller space-bar, I'd be able to press it without any issues.

enk wrote:Heh, there's a battle for a useful use of the caps lock key. Mapping such a useful key to esc seems wasteful to me. I use vim for like everything and I use ctrl-c instead of esc.

Weirdly enough, I've also mapped esc -> lctrl. It's been backfiring on me sometimes, though, and may not actually be worth it for my personal frequency of using esc.
lalop

Posts: 204
Joined: Mon May 23, 2011 5:29 pm UTC

### Re: Editors

I use both vi(or vim or nvi or elvis or ex visual mode or ...) and ed thought I like vi bit more and usually use ed only on my MacMINIX box(installed because I can). I have tried nano(stopped using after much irritation from line wrapping "feature") and Esc-Meta-Alt-Control-Shift(on sdf public access TWENEX(interesting OS by the way) because vi or ed wasn't installed.) Never going to use it again. I couldn't do ANYTHING without emacs cheat sheet. Even forward and backward moving was ridiculously complicated.
JuEeHa

Posts: 2
Joined: Sun Sep 11, 2011 7:56 am UTC

### Re: Editors

I use emacs as an ide and vim as a text editor.
<caps lock> is a second control key, and I have discovered that C-[ == <escape> which lets me have my cake and eat it too.
blueeyedlion

Posts: 2
Joined: Fri May 18, 2012 2:49 am UTC

### Re: Editors

lalop wrote:After some serious trial time I've decided my left thumb was indeed hurting too much, and so moved Ctrl from Alt to Caps Lock. It's a shame, I think, because if I had a slightly bigger lalt and smaller space-bar, I'd be able to press it without any issues.

enk wrote:Heh, there's a battle for a useful use of the caps lock key. Mapping such a useful key to esc seems wasteful to me. I use vim for like everything and I use ctrl-c instead of esc.

Weirdly enough, I've also mapped esc -> lctrl. It's been backfiring on me sometimes, though, and may not actually be worth it for my personal frequency of using esc.

I like using jj for Esc in vim. Not that I'm all that experienced with vim, but it works. Think about it: how often would you type jj when working on a text document naturally? Not often at all. Unless you had some *very* strange variable names in your code...
joek

Posts: 94
Joined: Tue Apr 21, 2009 4:33 pm UTC

### Re: Editors

joek wrote:
lalop wrote:After some serious trial time I've decided my left thumb was indeed hurting too much, and so moved Ctrl from Alt to Caps Lock. It's a shame, I think, because if I had a slightly bigger lalt and smaller space-bar, I'd be able to press it without any issues.

enk wrote:Heh, there's a battle for a useful use of the caps lock key. Mapping such a useful key to esc seems wasteful to me. I use vim for like everything and I use ctrl-c instead of esc.

Weirdly enough, I've also mapped esc -> lctrl. It's been backfiring on me sometimes, though, and may not actually be worth it for my personal frequency of using esc.

I like using jj for Esc in vim. Not that I'm all that experienced with vim, but it works. Think about it: how often would you type jj when working on a text document naturally? Not often at all. Unless you had some *very* strange variable names in your code...

Wait, that's not bound by default, though...is it?? I've never noticed it (although Vim isn't my primary editor). I've heard of people doing it, but I assumed they rebound the keys. Personally, I map CapsLock->LCtrl->Esc->CapsLock which is almost as easy as jj, and when I use a keyboard without a remapped Ctrl->Esc (but with remapped CapsLock->Ctrl, which is the minimum I need for my sanity), I use C-[, which is just as good.

I've been thinking about using a straight CapsLock<->LCtrl for ages, but I keep holding off. C-[ works on anything with vi-bindings, but I like having a convenient Esc for other things, too (killing dialog boxes, etc). I guess I could always map C-[ to Esc generally with xbindkeys (or AutoHotkey for Windows), but then I'd be back to having more bindings to maintain (and one that requires non-default software).
troyp

Posts: 529
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

### Re: Editors

troyp wrote:
joek wrote:
lalop wrote:After some serious trial time I've decided my left thumb was indeed hurting too much, and so moved Ctrl from Alt to Caps Lock. It's a shame, I think, because if I had a slightly bigger lalt and smaller space-bar, I'd be able to press it without any issues.

enk wrote:Heh, there's a battle for a useful use of the caps lock key. Mapping such a useful key to esc seems wasteful to me. I use vim for like everything and I use ctrl-c instead of esc.

Weirdly enough, I've also mapped esc -> lctrl. It's been backfiring on me sometimes, though, and may not actually be worth it for my personal frequency of using esc.

I like using jj for Esc in vim. Not that I'm all that experienced with vim, but it works. Think about it: how often would you type jj when working on a text document naturally? Not often at all. Unless you had some *very* strange variable names in your code...

Wait, that's not bound by default, though...is it?? I've never noticed it (although Vim isn't my primary editor). I've heard of people doing it, but I assumed they rebound the keys. Personally, I map CapsLock->LCtrl->Esc->CapsLock which is almost as easy as jj, and when I use a keyboard without a remapped Ctrl->Esc (but with remapped CapsLock->Ctrl, which is the minimum I need for my sanity), I use C-[, which is just as good.

I've been thinking about using a straight CapsLock<->LCtrl for ages, but I keep holding off. C-[ works on anything with vi-bindings, but I like having a convenient Esc for other things, too (killing dialog boxes, etc). I guess I could always map C-[ to Esc generally with xbindkeys (or AutoHotkey for Windows), but then I'd be back to having more bindings to maintain (and one that requires non-default software).

No, that's not bound by default. It's rebound because of the inconvenience of the Esc key...
joek

Posts: 94
Joined: Tue Apr 21, 2009 4:33 pm UTC

### Re: Editors

emacs for \mathrm{L^{\!\!A}\TeX}, Eclipse for Java (which I haven't used lately), Visual C# 2010 (same), Notepad++/gedit for everything else depending on which OS I'm currently on.
ycc1988

Posts: 28
Joined: Fri Jun 22, 2012 5:13 am UTC

### Re: Editors

I find myself pressing C-n everywhere and opening a whole load of tabs.
Razzle Storm wrote:Used to be Christian, then I read the Bible.
dalcde

Posts: 133
Joined: Fri Apr 06, 2012 5:49 am UTC

### Re: Editors

I started with vi, when I started programming when I was 13. The tutorials I learnt from insisted that vi was the way to go if you wanted to be taken seriously.

Now? I use nano. I never got the hang of emacs, and vi is just too buggy. I always somehow feel mistakes aren't an option when using vi. The syntax highlighting is a nice bonus to nano (I think of nanos syntax highlighting as like a puppy, it'll piss on your kitchen floor, but you can't help love it), but what really made me pay attention to it is that it works, without muscle memory or a cheatsheet piled halfway to the ceiling.

And anyone who says that nano is overkill is wrong. When developing, your probably working on a machine with at least 128MiB of ram, which is more than enough to run nano.

Of course, none of this works when working with java. Then you need an IDE, 4 TB of ram, the latest NVidia graphics card oe. and jesus (other deities are available) installed in your machine.

In conclusion:
-Vi is buggy
-emacs never inspired me
-nano is not overkill
-any xwindow/gui editor IS overkill
4thdwarflord

Posts: 0
Joined: Wed Jun 18, 2014 12:43 am UTC

### Re: Editors

What bugs were you experiencing with vi? I've used vim for some time, and never hit any major bugs. Plenty of user error, of course... as is to be expected with a UI as incomprehensible and power-user-focused as vim... but nothing that couldn't be solved with judicious use of the U key.

I mean, "use vi or you won't be taken seriously" as a viewpoint can go die, and if you're able to make nano work for you then more power to you, I'm just curious about the "buggy" comment...
While no one overhear you quickly tell me not cow cow.
but how about watch phone?

phlip
Restorer of Worlds

Posts: 7172
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

### Re: Editors

iMy biggest complaint with vim is how it affects my use of other tools.jk:wq

Xenomortis
Not actually a special flower.

Posts: 961
Joined: Thu Oct 11, 2012 8:47 am UTC

### Re: Editors

Yes. I still have that, several years after switching to TextWrangler.
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

### Re: Editors

Jplus wrote:Yes. I still have that, several years after switching to TextWrangler.

How horrifying!

Why does it show EVERY POSSIBLE INDENTATION EVERYWHERE? Can't it have normal indentation guides? You know, like this and this and this?

Actually, can it? Would be helpful since I'm stuck on a Mac at my 9-5 these days.
*** FREE SHIPPING ENABLED ***

Riddles are abound tonight

eviloatmeal

Posts: 403
Joined: Thu Dec 11, 2008 9:39 am UTC
Location: Upside down in space!

### Re: Editors

Not that I know of. It's helpful to think of them as tabstops rather than indentation markers, though. You can hide the tabstops, but as far as I know TextWrangler doesn't do indentation markers.

I like the tabstops, I find it makes it easier for me to visually navigate through my files.
Feel free to call me Julian. J+ is just an abbreviation.
coding and xkcd combined

Jplus

Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

PreviousNext