Live data from Hacker News

Why Kakoune – The quest for a better code editor

kakoune.org

141–150 of 329 posts

Re: Why Kakoune – The quest for a better code editor

#141
post #10

This looks awesome (although I think the name could use a little work). It also brings up a question I have for HN: Every few years, I make an attempt to learn to use one of the classic editors like vim or emacs, and inevitably give up after the enormous productivity drop I suffer when writing code. I just can't seem to pick up the muscle memory required to become fast with these tools, and the overwhelming array of…

It's totally worth it. For me, I learned vim & touch typing at the same time. Generally I learned while doing side projects, supplemented with general vim sessions (such as the built-in tutor, and http://vim-adventures.com/ ). Many find it easier to start off with GUI vim as your favourite keyboard shortcuts are still there, but I found that too much of a crutch. Once you commit a few standard sets of motions to musc…

Can you add code completion or basic static analysis to vim? I've found it fine for editing but it lacks the information of the IDEs that I generally use

Re: Why Kakoune – The quest for a better code editor

#142
post #10

This looks awesome (although I think the name could use a little work). It also brings up a question I have for HN: Every few years, I make an attempt to learn to use one of the classic editors like vim or emacs, and inevitably give up after the enormous productivity drop I suffer when writing code. I just can't seem to pick up the muscle memory required to become fast with these tools, and the overwhelming array of…

No, in my opinion. The problem is the people who reply will be the people for whom vim and Emacs "clicked". I'm like you, and when I looked at my vim using friends, they really aren't any more efficient. Also, while your editor will "work forever", expect interesting plugins (like C++ integration via clang) to be less stable than say atom or visual studio, and to have to nice plugins every few years. Also, they don't…

I agree with saying no. Vim and Emacs will "click" for you when you want to learn them. Wanting to learn them is different than wanting to have learned them. It's the difference between wanting to write a novel and wanting to have written a novel.

Personally I would nominate emacs using spacemacs[0], but I knew both already going in. I have a hard time understanding what people find hard about Vim, but I've used it for 7 years now (well, spacemacs now), so I probably just don't remember what was hard.

I think it wasn't so bad for me because I didn't try to learn much about it. I learned how to move, (just the hjkl part), and basic selection. Anything else was learned "just in time."

For example, even after having used vim for 7 years, I never knew about the "ib" selector. Never needed it, and doing that sort of selection has never been painful enough to me that I went searching for a "better way."

While things like vim-tutor or vim-golf or whatever they have now might work for some people, that would have killed it for me. Learning for the sake of learning will get you part of the way there, but learning out of a personal need is what leads toward "mastery." And I define mastery in a restricted sense of being able to do what you want, fluently.

[0] http://spacemacs.org/

Re: Why Kakoune – The quest for a better code editor

#143

Earlier quoted context omitted.

I find that console apps are far less intuitive when it comes to visual thinkers. I also am not too keen on modal editing, it doesn't match how I do most things in life. I don't have to switch out my teeth when eating vs drinking. It just doesn't seem natural to me. I've always found I'm more productive with a GUI. Command line is great for simple tasks and executing commands, but editing files has always seemed less…

> I don't have to switch out my teeth when eating vs drinking. But you do switch how your mouth is working when switching between eating and drinking. In one, you masticate and move food around your mouth before swallowing once (maybe twice), whereas the other involves directing fluids back to your throat which acts in a near-continuous swallowing action. > You have to remember so many key combinations and commands T…

He doesn't control his mouth when switching between eating and breathing, I'm pretty sure that it's part of the autonomic system. You kind of made his point since there's no way Vim actions actually become fully reflex actions, especially the powerful stuff that separates Vim from a good IDE, since the vast majority of those really complex actions will be done at best dozens of times per day (and I'm being generous here).

Re: Why Kakoune – The quest for a better code editor

#144
> Kakoune’s grammar is object followed by verb

This is so important. It's the reason I've stuck by Quicksilver all these years, and avoided Spotlight and whatever Google's search bar thingy is called.

I've never been interested in vi because the effort to reward ratio doesn't seem favourable, but I think I'll give Kakoune a try.

Re: Why Kakoune – The quest for a better code editor

#145
post #76
post #73

One functionality I find missing in all modern code editors is - repeat action. This was present and extremely useful in, now extinct, Convergent Technology OS (CTOS) resident editor. In brief, it allowed users to repeat all the actions they performed on one-line of code, on another line of code. It's amazing how productive you can be when you have that feature. This goes beyond find & replace; It also helps format c…

I don't know what you are talking about. Every major editor I know has that functionality.

It does? I wouldn't mind finding out how Sublime, Atom and VSCode do it.

Re: Why Kakoune – The quest for a better code editor

#146
post #10

This looks awesome (although I think the name could use a little work). It also brings up a question I have for HN: Every few years, I make an attempt to learn to use one of the classic editors like vim or emacs, and inevitably give up after the enormous productivity drop I suffer when writing code. I just can't seem to pick up the muscle memory required to become fast with these tools, and the overwhelming array of…

Long time vim user here, but I think that the best setup is to use a regular text editor, which has vim bindings. All major editors seem to have them, including Sublime and IntelliJ.

I think the biggest gains in using vim are the small navigation, copying, and editing keystrokes, and that there are little to no productivity gains of using other vim features like tabs and buffers, over say tabs in IntelliJ / Sublime. I am a little biased but I really think that being quick with the vim bindings really makes me a lot more productive at editing code than my non-vimming co-workers. When we're pair programming, it's usually me who does the driving because in one or two keystrokes I can do something that would take them 5+ seconds with a mouse.

So just install the vim bindings on your favourite editor and start picking it up bit by bit. You can start simple with the h,j,k,l keys for navigation, and i for insert, and use the mouse for the rest until you get up to speed.

Re: Why Kakoune – The quest for a better code editor

#147
post #101

Earlier quoted context omitted.

I think Vim is far easier to learn than Visual Studio. The menus are completely unintuitive, bureaucratic and painful to use. I always use cl.exe from the command line with Makefiles.

Why not stop using the menus then? ;) Visual Studio can be operated pretty much entirely from the keyboard. The default shortcuts are fairly sensible, and you can always add more from the options. There is one major omission: changing build configuration or build target. (You can give the configuration manager a keyboard shortcut, and do it that way, but it's a bit unwieldy.) So I keep the relevant widget in the tool…

Your comment is the last one that has a reply link, so I'm using it, though none of the following applies to it at all.

Over the years I've observed that VS criticism is downvoted quite rigorously here. This is in stark contrast to the overall sentiment on the Internet, so I suspect corporate downvoting here.

The moderators should take a look at it.

Re: Why Kakoune – The quest for a better code editor

#148
I will give this a try.

I had been a long time vim/emacs rejector. I used ide and sublime text for most of the time.

But few weeks ago, I needed to program a server for deep learning. Because of the graphics driver on that server, there is really no option to run a gui application. So I had to learn vim.

It turned out to be not that difficult to get used to it.

The only complain I have is code navigation. The font size of the vim is fixed to the font size of the terminal. The text is relatively large, therefore the viewing window can only show few lines of code.

Sometimes, I need to reference a previously defined variable or function of the same file, It's difficult to quickly navigate to the right place.

With sublime text, it's mini map navigator is so convenient to allow me go back and forth between locations.

With vim, however, I rely more on my memory. I need to go back once and remember everything, and then go to the end of the file to edit.

Re: Why Kakoune – The quest for a better code editor

#149
One of the nice things about being an Emacs user (hang in there, I have a real point about Vim to make) is that the concepts (especially non-modal editing) and the keyboard shortcuts map well to newer IDEs.

I switch between IntelliJ and Emacs all day, and all I had to do to become comfortable is choose the Emacs keyboard preset in the IntelliJ preferences. The same is true for Eclipse and Visual Studio.

The Emacs paradigm is a lot more similar to contemporary IDEs than the Vim paradigm, and that makes it a lot easier to switch back and forth.

While a better Vim is a nice goal, I don't see how it will bridge the gap between Vim and newer editors/IDEs unless it includes some fairly fundamental changes to the Vim paradigm. But then it wouldn't be a better Vim -- it would be something different enough that Vim users probably wouldn't like it. I suspect that Vim and modern editors/IDEs are doomed to remain divergent forever.

Re: Why Kakoune – The quest for a better code editor

#150
post #10

This looks awesome (although I think the name could use a little work). It also brings up a question I have for HN: Every few years, I make an attempt to learn to use one of the classic editors like vim or emacs, and inevitably give up after the enormous productivity drop I suffer when writing code. I just can't seem to pick up the muscle memory required to become fast with these tools, and the overwhelming array of…

I will try to answer your questions as I have seen both sides of the fence.

I initially used Visual Studio (around 2012) and really loved the power it gave me. I never felt slow or inefficient until I saw a screencast about Apache config that used vim and I was amazed to see how the person could simply jump to places he wanted. So I set out to try vim. I switched it for all my hobby work but it didn't catch on. So I went back to Visual Studio and in 2014 I thought I should give it another go. This time I started by installing the VsVim extension for Visual Studio.

This is how I got good with Vim: - In the beginning (I think 2 weeks) I only focused on using the motions (word, next character, paragraph, blocks and regex motion), common commands like d, c and R. If it helps I saw a screencast (one of the Vim London meetup videos) which broke down Vim into a grammar to be thought of as "operator + count + motion". I also slowed the key repeat rate to make sure I don't hold arrow keys to move. DISABLE ARROW KEYS IN VSVIMRC.

- After around 2 weeks I got comfortable with that and switched to pure Vim whenever I could. You can set up an external program to call up on the current file in Visual Studio. I also learned to touch type in the next 2 weeks so that I could reap more benefits.

- After a week of moving to Vim, I started writing my vimrc with things like colorcolumn, autoindent and other simple stuff. I also installed relevant text object plugins [1]. I installed some language specific plugins and started reading the :help pages. :helpgrep is very handy. At this time I think I felt I was back to my old productivity level if not above it. It took around 3 weeks I think.

- I then proceeded to learn about jumplist, named registers, location list, differences between buffers, windows, splits and tabs and how they are INTENDED to be used. It took me around one week.

- At that point I simply started looking at some Vim screencasts [3], [4], [5], [6], [7], [8] and [9].

CONCLUSION:

I am more productive in Vim when writing anything other than C#, F# or Java. Visual Studio excels in that department. I debug NodeJS in VSCode. For all other things I use Vim and am noticeably faster now compared to other editors. Although yes, I really miss Visual Studio a lot when using Vim. But thankfully Visual Studio has the great VsVim plugin.

[1]: https://github.com/kana/vim-textobj-user/wiki

[2]: My .vimrc https://github.com/hashhar/dotfiles/blob/master/neovim/.conf...

[3]: https://vimeo.com/vimlondon/videos

[4]: https://www.youtube.com/watch?v=xZTkrB_tEoY

[5]: https://www.youtube.com/user/ThoughtbotVideo/search?query=vi...

[6]: http://derekwyatt.org/vim/tutorials/index.html

[7]: http://vimcasts.org/

[8]: http://tilvim.com/

[9]: https://sanctum.geek.nz/arabesque/vim-anti-patterns/

Post reply on HN