Live data from Hacker News

A Good Vimrc

dougblack.io

161–170 of 178 posts

Re: A Good Vimrc

#161
post #68

Earlier quoted context omitted.

Realistically, what justification is there any more for working on somebody else's machine, being force to use their config? Ok, if your machine explodes and you need their's for a bit fine. But in the long run, the amount of times where you need to actually edit some code by typing on another person's machine should be vanishingly small. I'm all for standards when it comes to collaborating on code. But when it comes…

How do people who like to customize their environment do pair programming? I belong to that group, and I like the idea of pair programming, but I've never had the chance to try it in practice...

tmux/screen sharing work just fine.

Re: A Good Vimrc

#162
I've played around with vimscript and my .vimrc many many times, and always found it very unwieldy. I've started using a new and very different approach, which involves using the amoffat/snake library to write my new .vimrc functions in python. This is definitely not for everyone, but I've been able to do some pretty cool stuff with it, like creating a function for writing trace like debug statements, or sending the currently selected vim lines to a shell via the window manager/os level, rather than a terminal multiplexer like screen. If anyone else is interested, an example can be found at gist.github.com/sac2171/ce7b086421e8387193fd

Re: A Good Vimrc

#163

    syntax enable           " enable syntax processing

    The comment should be enough to describe this one.
Sorry, no it's not. The syntax processing of what? The syntax of the current file loaded? Some sort of commands?

Re: A Good Vimrc

#164

One thing I've added fairly recently is: try source ./.vimlocal catch /^Vim\%((\a\+)\)\=:E484/ endtry which lets me tweak my settings (project specific key bindings, &c) by dropping a .vimlocal file in the directory I'm editing from. The try-catch ignores the error raised when the file is absent.

Why not check for file existance, instead of try-catch:

  if filereadable(expand("~/.vimlocal"))
      source ~/.vimlocal
  endif

Re: A Good Vimrc

#165

One thing I've added fairly recently is: try source ./.vimlocal catch /^Vim\%((\a\+)\)\=:E484/ endtry which lets me tweak my settings (project specific key bindings, &c) by dropping a .vimlocal file in the directory I'm editing from. The try-catch ignores the error raised when the file is absent.

Why not check for file existance, instead of try-catch: if filereadable(expand("~/.vimlocal")) source ~/.vimlocal endif

I've no strong objection to that - it's racy but not in any way that probably matters. Otherwise, it's mostly just a question of forgiveness vs permission...

Re: A Good Vimrc

#166
post #72
post #56

Earlier quoted context omitted.

Holy ish! Neovim has progressed so much. Exciting.

I'm actually using it currently and I really enjoy the built-in terminal. It makes my workflow much better. Be aware that some plugins might have some bugs. I also got segfaults when using multiple terminals (although that's quite rare).

Interesting. I tried out the built-in terminal and found that I couldn't navigate around panes as quickly as if I just used tmux instead. Are you using the default mappings, or have you made them easier to use somehow?

Re: A Good Vimrc

#167
post #83

Earlier quoted context omitted.

> Am I some kind of princess because I decided to use a different keyboard layout than the default? Maybe you just bought into some myth: https://www.utdallas.edu/~liebowit/keys1.html

I made my own layout because Azerty is unusable for programming; hitting three keys to produce an @ sign or a {} is inexcusable. And, since I play a lot of games, I wanted the default qwerty wasd keys. But sure, I bought into some typing speed myth, whatever floats your boat. XKCD774. https://github.com/jleclanche/dotfiles/blob/master/X11/xkb/s...

Probably missed the whole "Maybe" thing I wrote.

In your case those are valid reasons and apply to several "national" layouts -- but there are many people who go for the cargo cult version too.

Re: A Good Vimrc

#168
post #130

Earlier quoted context omitted.

Note that in Norwegian (and, I think, Swedish and Danish) words are joined without a hypen. So anythime a word ending with "j" like "marsj" ("march/marching") is joined with a word beginning with "f" like "fart" ("speed") you'll see "jf": "marsjfart" ("marching speed"/"cruis(e|ing) speed"). Also jfr isn't a particularly rare abbreviations - so ymmv. At any rate, with how words can be combined in Norwegian, there's ge…

Ah, hadn't thought of that. I had a feeling there had to be more words, but couldn't come up with any off the top of my head. Apparently I write very little Norwegian in vim (I use jk for Esc).

FWIW (again, not sure about rules for joining words in Swedish):

    for abb in jk jf;
    do
      echo "Occurances of ${abb}:"
      grep ${abb} -c \
      /usr/share/dict/{bokmål,nynorsk,british*,svenska}
    done

    Occurances of jk:
    /usr/share/dict/bokmål:90
    /usr/share/dict/nynorsk:39
    /usr/share/dict/british-english-insane:20
    /usr/share/dict/svenska:70
    Occurances of jf:
    /usr/share/dict/bokmål:31
    /usr/share/dict/nynorsk:32
    /usr/share/dict/british-english-insane:0
    /usr/share/dict/svenska:0
So jf seems pretty safe for English, at least. Apart from when adding "jk" to your vimrc …

Re: A Good Vimrc

#169
post #22

I've been testing your recommendation of using ag in ctrlP (let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'), but the performance seems to be pretty much the same. Do you notice that much of a difference? Disclaimer: I'm using a SSD.

Shouldn't even large code bases fit into your RAM's disk cache these days?

Re: A Good Vimrc

#170

Earlier quoted context omitted.

I once told my wife an amusing story I'd read in Australian Personal Computer where a computer technician was told by a secretary that she was great with computers, said technician was very happy and joked that he was glad as the last person he had to help thought that the way to input capital letters was to press the caps lock key, the capital letter and then press the caps lock key again... To which the secretary a…

To be fair, some of the fastest typists use caps lock instead of shift, since it makes the shift action modal, instead of requiring coordination of multiple fingers at once. http://forum.colemak.com/viewtopic.php?id=1309

Oh! My wife will be pleased :-)
Post reply on HN