10 ms·
The language of Vim
- pmelendez 14y agoWell, Vim is 21 years old already and it still has a strong base of fan users. Good example on how good software live long
- dmix 14y ago+Well maintained and supported, good software.
- johnchristopher 14y agoI wish vim was a little bit more "international" because some commands that involves {,^,[ combined with ctrl are tricky to trigger on non-us keymaps and don't feel as natural as `yy`. Some obvious keys that only need 1 keystroke for an US user requires a combination of alt-gr or something for french users. Soon I'll be remapping my keyboard for coding but I also need those é,à,ç,è :)
- antris 14y agoYou can always switch to a US keyboard layout when coding, that's what I do and it makes me faster.
- larrybolt 14y agoThis, and learning to touch type helped a lot. And on top of that all kind of shortcuts different programs use become more logic, such as the [-key for changing the brush size in Photoshop, cmd+[ for indenting in textmate...
- h2s 14y agoFor a time, I was working on gathering some good data on keyboard layouts. I wanted to work out which keys were commonly available, which weren't, and so on. I wanted to work out which characters were the most "i18n-friendly" for developers worldwide. One day, I happened to take a programming class in Brazil. I noticed that a lot of students were simply switching their keyboard layout to US English in order to write code. I ditched that project.
- McP 14y agoThat's a shame. I think your project still has a lot of value, even if the results are used more for software that's end-user focussed.
- mbehrendt 14y agoStill a bit weird if you type on keys that actually mean something else. Especially german keyboards are not designed to code with (for instance \ required three key strokes on a Mac keyboard, [ and ] are also pretty hard to reach...)
- crucialfelix 14y agoAfter a year of coding on a German kezboard (sic) set to US eng I finally bought little stickers and relabeled the []{}<>#_| keys. So much better not to have the cognitive friction anymore.
- buf 14y agoBesides mapping these keys to other keys you rarely use, such as the capslock, you can also change your keyboard layout on the fly. I use Cmd+Space to switch layouts.
- pekk 14y agoIt is totally legitimate to remap keys so that they are comfortable for you, that is why everything is customizable, don't let anyone tell you that there is only one way you have to use vim
- tiedemann 14y agoAs as swedish keyboard-user I can say that this often resolves to remapping a large quantity of bindings which then are not supported by all plugins. It's doable sure, it still takes time and energy though.
- johnchristopher 14y agoI already re-binded many things but I think changing the keymap might be easier in the long-term because I don't have to support my modifications and keep them up-to-date when I add more functions or when I discover more vim bindings.
- reirob 14y agoI have switched to US-International with AltGr dead keys. Took me 3 weeks to adapt to the new layout - but man what an investment! I had learned before this German and French layouts - it was a loss of time if I look back now. On Linux you have this layout almost on all distributions, on Windows you have to install it separately. Concerning the accents: with the US-International you have all the French accents + a lot of more - I can now write French, German and Turkish with a single keyboard, without changing the layout! And it is possible even to write capital letters with accents: ÇÉÈÂ. If you need to sometimes work with the keyboards from other people - at least the US layout is ALWAYS installed (in Windows most of the time you can switch to it with Alt+LeftShift). The downside is that there are not many Laptop vendors that allow you to chose the US-International layout, this is one more argument for me to stick with ThinkPads. From the accents that you posted it looks like you use AZERTY layout. Do the switch to US-International and you will not regret. The AZERTY is awful for developers (and even for normal writers).
- johnchristopher 14y agoI am thinking of buying these stickers: https://catalogue-ca.beaujoie.com/produits/21-Changer_la_langue_d_un_clavier_d_ordinateur/37-Autocollants_pour_PC/77-Partie_centrale___Claviers_complets_Windows/25-Anglais__US_/ https://catalogue-ca.beaujoie.com/produits/21-Changer_la_lan... to ease the transition. What do you think of BEPO ?
- lunchladydoris 14y agoWho needs bookmarks when the worthwhile posts keep turning up again and again! I'm not complaining though. Learning Vim beyond the surface level is fun and the more you know the more fun working with Vim becomes.
- andyl 14y agoI love Vim. I understand the 'Vim is a language' concept, and use it every day. But I have to wonder: is this the best that Vim can do? Vim as a language is a great concept. But IMHO, the execution sort of sucks. Twenty years have gone by, and 'Vim as a language' is still a big mystery that takes a long long time to understand... Someone should take that concept and run with it. Surely 'editor as a language' can be done better.
- super_mario 14y agoAny language takes some time to understand and even more to use effectively. Understanding Vim's nOm command pattern is pretty easy (repeat n times operator O to text motion command m moves over). But using it effectively takes some practice. Committing it to muscle memory takes about 6 months (same amount of time it takes to master touch typing). You cannot do this faster. Becoming an expert (which means not only effectively choosing and using commands to transform some text, but knowing a decent subset of entire functionality and also knowing how to extend the functionality) takes even more time. And if your language were that primitive that mastering it can be done in a day or two, would it really be that complete and high level enough?
- stcredzero 14y agoLispers and Smalltalkers would tell you: Maybe, if you're lucky.
- dsrguru 14y agoThat wasn't true for me. Working through vimtutor for vim and the `C-h t' tutorial for emacs, followed by some spaced repetition over the next few weeks, got the basic motion commands of both editors fully ingrained in my muscle memory. It took longer for my fingers to internalize using operators on text objects in vim, but you can definitely master the basics in a few days. Even though I use vim as my daily editor and haven't really used emacs (at least with emacs-style keybindings) since working through the interactive tutorial years ago, it only takes me a few seconds to get comfortable navigating an emacs buffer without having to think. Granted, emacs keybindings deliberately don't constitute a language (the whole point of emacs is to remap them for different functionality in different contexts), but I don't think it took me much longer to "become an expert" at vim's language of editing.
- dustinupdyke 14y agoIt's odd how often a SO link comes up here where the question is locked for being off-topic, not constructive, etc. I still think to some degree SE shoots themselves in the foot with the strict enforcement of their rules every time this occurs.
- mhaymo 14y agoTwo sites with two different intentions. Hacker News is for reading interesting things and learning, StackOverflow is for getting answers to problems. I don't think SO would benefit from leaving popular non-constructive questions unlocked.
- dustinupdyke 14y agoI read the thread on SO and I learned. If their end is to help users understand and learn via a question format, then isn't this question fitting? I get what you are saying, but what if my problem is I'm having a hard time understanding vim fundamentals? Perhaps "the problem" is subjective to begin with because it is relative to each of us.
- GhotiFish 14y agoI grok your thinking. Some problems have subjective answers. They're still real problems. They still have real questions, and more than one answer can exist.
- icebraining 14y agoSO is for programming questions, though, and this isn't. There are better venues for it, like other SE sites.
- mh- 14y agowhere your question will also be locked... oh- and in the interim, it will receive attention from but 1% of the qualified posters SO has.
- curiousdannii 14y agoI've never understood the appeal of vi(m). Programming is a thoughtful, creative, deliberate process. I'm never in a situation where I've got so much to type that my productivity would drop if my fingers stopped touching the keys. Rather the opposite in fact.
- deleted 14y ago[deleted]
- saosebastiao 14y agoFor me, it isn't typing speed that makes vim better. It is the speed at which I can make very direct and precise edits to something that I have already typed. Especially repetitive edits, where the pattern can be recorded. When trying to hold a problem in my brain's working memory, a bad editor turns a simple change into a swap-to-disk event.
- jff 14y agoAnd you don't have to swap-to-disk to start writing a command in Vim-speek?
- saosebastiao 14y agoNo. EDIT: This isn't to say that vim is the only solution to this problem.
- pekk 14y agoOf course not, do you have to swap-to-disk to start moving files around in your shell or file management app?
- sophacles 14y agoRight, it becomes automatic thought->fingers edits. So yesterday, when I was dealing with some javascript on a webpage, i had a realization that if I did some restructuring of my closures, the code would be smaller and simpler to understand. As soon as I was thinking my fingers were already setting a couple of marks, and putting various lines at various indent levels[1]. Then I thought, these need to be grouped together by indent level, and the reordering was happening, again almost background. I never once thought get rid of this line here and put it here. I thought, ok move this line down a few, move this chunk to the outer scope. Put these lines in a separate function. Yes I could do this slower/more methodically with other editors, but I tend to think visually, so I visualize the text transforming as I think about the code. The power of vim for me is that I have a language of text transformation that can be simply translated to commands at a speed near to me thinking it. Much like when typing documents, words in head -> text on screen doesn't involve a lot of "and now i press 'a', now i press 'b'". [1] at one point this would have been a conscious decision, but since I try to maintain consistent indenting to help define scopes, and since vim has a lot of good indent/unindent commands, I had a realization that this could help refactoring. After some practice it became automatic since its a simple << or >> in normal mode to change indent level. Now it has become a wired pathway in my head, so I just think, "oh this goes up a scope" and the actual steps of "so dedent which means press <<" never registers.
- larrybolt 14y agoI always kept switching from Vim to Sublime text until I found this: http://vim.spf13.com/ http://vim.spf13.com/ The Ultimate Vim Distribution It's a collection of plugins and common shortcuts such as :W becomes :w, :w!! for saving as root, etc... In the beginning it was mostly the file-drawler that make me want to leave Vim but that was easy solved by using this version: https://github.com/alloy/macvim https://github.com/alloy/macvim In combination with iTerm on mac it's my preferred way to develop, the only thing I miss is an easy way to reload, visit pages etc in the chrome-window on my second screen without having to lift my hands from my keyboard, but cmd+tab and Vimium help me with that.
- dbbolton 14y agoIt seems as though the asker doesn't know about mapping, which wasn't really addressed and would answer the implied "I don't like how this feature works and it's slowing me down" question. It only takes a few lines to work around vim's "horrible" copying and pasting: let mapleader = "," let g:mapleader = "," noremap <leader>a ggVG noremap <leader>c "+y noremap <leader>v "+gP noremap <leader>x "+x
- darkchasma 14y agoLearning to code with vim is much easier than learning to code without vim once you've learned vim.