Live data from Hacker News

A Good Vimrc (2014)

dougblack.io

31–40 of 56 posts

Re: A Good Vimrc (2014)

#31
post #15
post #13

Earlier quoted context omitted.

Sorry if this is a super naive/dumb question, but why wouldn't I simply write a "build" script that copies files out of my dotfile repo to where they're supposed to go?

1) It's cumbersome, and you'll need to specially handle things like deleting files. I personally wouldn't be comfortable having a homebaked script rm stuff in my home directory. 2) By using copies instead of symlinks you'll need to run your script Everytime you make changes and be careful to edit only your clone instead of the target location.

[deleted]

Re: A Good Vimrc (2014)

#32

Earlier quoted context omitted.

If I understand it correctly you generate the program from that file by removing all the non-code text, right? This is very well documented , but not "actually" literal programming. It's a losing battle over this definition but since you said actually I'll go for it one last time :p In literal programming, the order of the explanation dictates the flow of text. Conversely, well documented source code follows the orde…

> In literal (sic) programming, the order of the explanation dictates the flow of text. Conversely, well documented source code follows the order of the program. org-mode supports noweb-like chunks, so you can do "real, Knuth-like" literate programming. It just makes little sense in the case of configuration files because they're just a collection of mostly-independent bits.

Since configuration in Emacs mostly is code, imho it makes a lot of sense.

Re: A Good Vimrc (2014)

#33
post #25

Since this article is written in kind of a "literate programming style", I'll plug and share my Emacs config that is actually written in literate programming: https://github.com/munen/emacs.d/blob/master/configuration.o... Nice documentation like this fine blog post for free^^

If I understand it correctly you generate the program from that file by removing all the non-code text, right? This is very well documented , but not "actually" literal programming. It's a losing battle over this definition but since you said actually I'll go for it one last time :p In literal programming, the order of the explanation dictates the flow of text. Conversely, well documented source code follows the orde…

Thanks for sharing your opinion, but your premise is flawed. Through org-mode litaerate programming is indeed not only possible, but a great option.

If you're interested in that area I encourage you to give it a try.

Re: A Good Vimrc (2014)

#34
post #30

I don't believe it's possible to have a good vimrc without really grasping some elementary concepts like movements, operators, registers, windows etc. I have recently watched all the Drew Neil's VimCasts[1] and after just a couple of hours I've realized I was missing a lot for at least 10 years. There is also quite a good presentation on YouTube by Max Cantor "How to Do 90% of What Plugins Do (With Just Vim)"[2]. Ins…

I would also recommend Daniel Miessler's tutorial.[1]

[1]: https://danielmiessler.com/study/vim/

Re: A Good Vimrc (2014)

#35
post #32

Earlier quoted context omitted.

> In literal (sic) programming, the order of the explanation dictates the flow of text. Conversely, well documented source code follows the order of the program. org-mode supports noweb-like chunks, so you can do "real, Knuth-like" literate programming. It just makes little sense in the case of configuration files because they're just a collection of mostly-independent bits.

Since configuration in Emacs mostly is code, imho it makes a lot of sense.

It's code, but most of it is simply (use-package ivy ...) or (setq tab-width 3.14), where's the value in chunks? The typical Emacs configuration doesn't contain data structure definitions, algorithm implementations, or error handling that can be more appropriately reorganized for a reader.

Re: A Good Vimrc (2014)

#36

I wonder why text editor preferences are so personal. I use the same editor and probably 90% of the same config as this guy and was nodding along until I saw he remapped B and E. Horrifying! Those are fundamental motions.

I was listening to a recent TalkPython podcast with Dougal Matthews titled "Effective Code Reviews". Host Kennedy asks every interviewee what is their favorite editor. Dougal's answer: (44:35-44:48) "I use Vim all the time. Yeah, I work in so many remote servers and VMs that I have some scripts to kind of set up my Vim environment on that machine, and then it's just great."

Who knew it would be that easy to switch to your own personal VIM setup?

Re: A Good Vimrc (2014)

#37
post #24

> Don't put any lines in your vimrc that you don't understand. Actually true for most human-configurable setting files.

Well when I did a vimrc there was no single line in my vimrc that I really understood. VimL reads like output from a keylogger.

Actually, VIM remaps _are_ little more than the output from a keylogger! A keylogger recording a VIM session, no less.

Re: A Good Vimrc (2014)

#38
post #24

> Don't put any lines in your vimrc that you don't understand. Actually true for most human-configurable setting files.

Well when I did a vimrc there was no single line in my vimrc that I really understood. VimL reads like output from a keylogger.

Well... Yes. It's the same command language that's used to drive vim by hand, so it should resemble a keylog of doing those actions.

Re: A Good Vimrc (2014)

#39
post #21
post #20

Earlier quoted context omitted.

Don't tell me you've never accidentally rm -rf'd something important

Don't tell me your default method for deleting files is to carelessly throw 'rm -rf' at the issue...if it's "important" and you're using -rf, a part of me thinks "you deserve whatever happens"

[deleted]
Post reply on HN