9
zlice
220d

i have grown to HATE short variable names

nevermind all the generic names like thing/item/object/component

int i;

cute, good enough...oh wait it's referenced here 50 times in a sea of some loop? well fuk...how do... nope highlighting wont work - int, idkwtftonamethisvar, it's a common vowel. can't sed/regex a stand alone 'i' just...gg. gl finding or recognizing a single letter

about to start using iii or i_cnt

Comments
  • 3
    /\bi\b/ tho?
  • 0
    @melezorus34 does perl work in vim???

    edit :'\<i\>' does =0

    edit 2: ':%s/\<i\>/c/g'

    lol -- for a solution, someone frequents stack overflow
  • 10
    If there is a sea of loops having 50 references to some variable, the actual problem is not the name of that variable...
  • 3
    Have you considered using a real IDE? Literally all of them have a feature to rename symbols which respects shadowing and all other rules because it's backed by a language server.
  • 0
    Apparently there's a Vim plugin to connect language servers, so this isn't a dig at Vim even though I originally intended it as one. But really. Don't use DIY software if Y can't be assed to DI properly.
  • 0
    can't sed/regex standalone "i"

    lol of course you can.
    anything else than letter, "i", anything else than letter.

    look up regex syntax for "anything else than letter".

    you're welcome.
  • 1
    int i4I;
  • 4
    Find: i

    ☑️ Match whole word
    ☑️ Match case
  • 1
    @zlice Go with the mouse over a word, like i, and press *
  • 0
    @happygimp0

    somebody give this man a medal, sandwhich, something. 10x easier
  • 1
    Sorry, i meant cursor, not mouse.
  • 1
    Ah I love short var names...

    void plot(uint32_t *s, int x1, int y1, int x2, int y2, uint32_t c){

    ....int x, y, o;

    ....for(y = y1; y <= y2; ++y){

    ........o = y * s->p;

    ........for(x = x1; x <= x2; ++x){

    ............s->m[o + x] = c;

    ........}

    ....}

    }

    :-)
  • 0
    @FreeBasic s is not a struct tho, how are you pointer accessing a variable like m or p
  • 1
    @melezorus34 good one... I failed (*_* ). luckily this was just a fun example!
Add Comment