Hacker News new | past | comments | ask | show | jobs | submit login

As a longtime vim user, I don't see how vim makes going to the Nth logical column (for several values of N in different rows) in a large "CSV-like" file much easier.

Navigating in general is easier, sure, but... do you have a trick to share perhaps?




    58G 63f,
1. Go down to line 58

2. Jump to the 63rd comma

3. Edit


Fascinating, thanks!

I had never seen/used `f` to navigate within a line like this -- I'm usually just typing /<string> and hitting enter to scan forward.


This could lead you to the wrong place if, for example, some quoted values on this row contains commas, no?


In those cases it gets a bit trickier but still relatively straightforward thanks to regex-based search. If needed frequently you can also just create a keybinding that does the regex typing for you.

Though I'm usually in the position where I create this kind of file myself and so I just go with semicolons as column separators. Those are much less likely to cause such collisions.


100%. It's not infallible. There are CSV plugins for Vim that bring increased confidence.


EasyMotion makes it effortless.

https://github.com/easymotion/vim-easymotion


Something like this works as long as there are no commas within a cell.

  58G63f,
Takes you to cell at 58:63 (might have off-by-1 errors, don't know)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: