I wonder if this would work better as a temporary mode (like how a real clutch works). For example, you stay in insert mode until you press the pedal, which escapes you to command mode, and then restoring insert mode after you depress the pedal?
Vim clutch
131–140 of 227 posts
Re: Vim clutch
#132Earlier quoted context omitted.
If you use KeyRemap4MacBook[1] you can map caps lock to Ctrl, but also map just tapping caps lock to escape. Be warned, the only problem with this set up is that it's so good that you'll have trouble using another one; I disabled it when I got a thinkpad and starting doing about 50% of my development on my x220 instead. After that I changed to using ctrl-[ or ctrl-c in place of escape for most everything. [1] http://…
Ah, ctrl-c for esc is a good idea.
Re: Vim clutch
#133Re: Vim clutch
#134My advisor in college used to joke that lispers would get foot pedals for their boxes to use as paren keys :)
Re: Vim clutch
#135I don't know how this would work out ergonomically. My dad is a cab driver and he often complains that pressing the clutch with his foot often giving him RSI kind of pain. But however I think this is purely subjective. From an experiment perspective, this is really cool! And this generally qualifies into what could one call a 'real hack'. This has a air of freshness to it. Now the real power of vim is in getting into…
You have to learn h,j,k,l are not just navigational keys but also can be combined with multipliers like 20h(Moves 20 positions to the left). You know, I've understood this for a while, but to this day I still don't use it. I can't count characters that fast! If you're going to lean forward and count out chars, you might as well count them out with presses of 'h'.
:set relativenumber
You won't have to count anymore.Re: Vim clutch
#136Re: Vim clutch
#137I don't know how this would work out ergonomically. My dad is a cab driver and he often complains that pressing the clutch with his foot often giving him RSI kind of pain. But however I think this is purely subjective. From an experiment perspective, this is really cool! And this generally qualifies into what could one call a 'real hack'. This has a air of freshness to it. Now the real power of vim is in getting into…
You have to learn h,j,k,l are not just navigational keys but also can be combined with multipliers like 20h(Moves 20 positions to the left). You know, I've understood this for a while, but to this day I still don't use it. I can't count characters that fast! If you're going to lean forward and count out chars, you might as well count them out with presses of 'h'.
Re: Vim clutch
#138I'll be the one voicing a contrarian opinion here. vi and vim are holdbacks from the days of 300 to 9600 BAUD modems. A time when more sophisticated interfaces were prohibitive. Back in those days it wasn't too uncommon for people to actually write their own text editors. I wrote a few, mainly in Forth, as I would bring-up self-designed systems. While I use VIM today when I have to I continue to think that in today's…
Vim when you're using it with 3-5 buffers, some specialized, on screen with lots of plugins feels just like an ide or something like Sublime Text 2
Vim keybindings in Sublime Text 2 or Visual studio/outlook/word via ViEmu is pretty good in my experience.
Re: Vim clutch
#139Earlier quoted context omitted.
di" is one of my favorite commands. Delete everything inside the quotes not including the quotes. You usually want to replace what's inside the quotes, so hence use ci" cit is pretty nice for replacing a tag's inner html. And of course this works with parentheses - ci( - and brackets - ci[ - and curly braces and single quotes and angle brackets.. I love vim :)
Wow cit ...I've been wondering if this exists for a year now. I remember reading about it when I first started learning vim but it somehow eluded me afterwards. Thanks! I use ci{ all the time for functions and CSS. It's like magic. Whenever I'm using something like nano, I'll instinctively type what looks like a long string of gibberish: "jjjddo [oh crap] ..." Once you really start getting used to the language, it ma…
Then marvel at vim-surround: cs"', cs)(, or cst, or (Shift-)v select visually S , and argtextobj: cia and daa. Those are the two plugins that I really miss on a stock vim.
[0] https://github.com/tpope/vim-surround.git [1] https://github.com/vim-scripts/argtextobj.vim
Re: Vim clutch
#140Earlier quoted context omitted.
Who said anything about menus? And, yes, funny enough, it just so happens that I would find the cockpit of a military helicopter very user friendly.
With no justification of how you think a military helicopter cockpit is user friendly, I suspect you're just trolling now.
Now you resort to calling me a troll?
That's nice.
There's nothing unfriendly about a helicopter cockpit. Even if you've only played with flight simulators anyone half-way intelligent can probably figure out most of it within a few minutes. Flying one is a different deal, as mastering and understanding the complex relations between collective pitch, power, torques and aerodynamics. As a simple example, it isn't immediately obvious that flying in ground effect is different from flying above ground effect. Or the interaction between collective pitch, the tail rotor and the demand for power. This is quite different from understanding what the knobs and dials in the cockpit might do.
All of this from simply expressing a contrarian opinion on VIM.
HN does have an unfortunate trait: If you say anything contrary to "tribal" beliefs you get pounded and sometimes brutally downvoted. That does not mean that the tribal belief is right, it just means that there are enough tribe members to bully others into either not participating or simply adopting the tribal memes and falling into compliance. Well, that's not me. If I believe that someone is bullshit you are going to hear it.
Why do I believe that some of the hyper-keyboard-efficiency claims of VIM are bullshit? Because programming is not factory work.
If a programmer is spending so much time at the keyboard that counting keystrokes becomes important they are not doing a good job. I spend far less time programming than I do planning and deciding how to solve the problem. I don't just sit down and start hacking away without direction. By the time I actually fire-up a text editor or IDE to program I have state diagrams, database structures and algorithms pretty much selected and reasonably-well thought out. If I've done such a shitty job at the pre-programming work that my text editor's keystroke count actually matters, well, I'm a hack, not a programmer.
Some of the admittedly interesting things you can do with VI (http://stackoverflow.com/questions/1218390/what-is-your-most...) are, in my opinion, somewhat of a corner case. These are things that one might not do with great frequency. The fact that you can do them is interesting, but that isn't going to be a deal breaker if you only have to do them once every few weeks or months.
In some respects I can derive far greater efficiencies from using a tool such as Excel to sometimes cut hours of coding and formatting by using it intelligently to help generate code that is more maintainable.
One such example is to use it to generate state machine lookup table code that can be copied and pasted into a text editor instantly. I've done state machines with hundreds of states this way. If you do it right they are easy to maintaing and update. No text editor can improve on this level of efficiency.
Another very similar example is to use Excel to help generate JSON files from various tables and data. Easy to setup, maintain and modify. A simple copy and paste into an editor.
When justified, I have taken the time to create more complex tools that automatically generate complex code based on database inputs. One example that comes to mind was a tool to automatically generate all of the code to manage a menu system on an embedded device consisting of an LCD display and a few buttons. Every time the menu structure or content was changed it took days to update the menu processor code. The tool took a month to create. Once in place, almost anyone could generate the code for an arbitrarily complex menu system within minutes. No degree of text editor efficiency can solve these problems.
The point here is that, if I have to resort to counting keystrokes as a measure of programming efficiency then I have either reduced programming to factory work or I am so disorganized that I am spending a disproportionate amount of time typing crap that will have to be fixed many times over before it actually works.
To beat the state machine example to death. In my case it is very rare that I have any bugs when I code state machines, even complex ones. Granted, I've been doing it for a while in both hardware (FPGA's, Verilog) and software applications. Regardless of that fact, this is because I do all of the thinking and planning ahead of firing-up the editor. The resulting code, generally speaking, works on first run.
I've you've ever programmed a CNC machine manually (G-code) you understand this concept. You don't just stand there start hacking away. You take the time to plan it, do all the math, choose tools and verify the approach before you enter the code. If you don't, you'll learn the hard way. These machines are dangerous. I once made a programming error and had my Haas VF3-SS churn aluminum with a 3/4 inch roughing bit like it was butter. Amazing what something with that much power can do. I kept the fucked-up end-mill as a reminder of what not to do.
A professor of mine, who introduced me to APL, took every opportunity to drive a point home. He said that data representation is one of the most important tasks in solving a problem. If you represent the problem using a flawed model it can take ten times longer to create a solution. He pounded that into us to the point that it became instinct. That's why I will never touch a text editor unless I know where I am going. That's my context.
I also caution you and others when considering yourselves "experts" in any field. I learned a long time ago to never utter that word. One can be highly skilled in one particularly narrow area while being completely ignorant of other ideas. I certainly am. I am not just talking programming here. Having access to a larger context is sometimes very important. What makes sense in a myopic context might not make much sense when one is able to pull back to a different plane that covers other schools of thought. Be open minded.
Now, if it makes all of you really happy, down-vote away. It's always fun to watch the tribe in action.