Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I made this thing a while back and someday I will actually finish it and add all the features I want to add just as soon as I have some free time oh god why am I so busy...

http://www.vimtax.com/

It helps make colorschemes.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
This is a wonderful read and helped me really understand writing stuff in my vimrc: http://learnvimscriptthehardway.stevelosh.com/

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
A nifty trick I stole from Learn vim script the hard way was to remap the arrow keys and Esc to insert "use the home row you dummy!" instead of moving the cursor / leaving Insert mode. A few times of having to un-do that and I broke my bad habits rather quickly.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dicky B posted:

I often use g, to jump back to the last edit point, but this doesn't work across buffers. Does anyone know if there is a way to make it work across buffers?

I always use `. to jump back to last edit point, and that seems to work in every buffer I have open.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dicky B posted:

That does exactly the same as g, for me, and is still buffer-local :/

This seems to be the case with a completely bare .vimrc. Do you have anything in your config which changes this behaviour?

Maybe I don't understand what you want to have happen then. Do you mean "jump to where I last edited in a buffer that I switched to" ( which is what I thought you meant) or "I edited buffer X, I switched over to buffers A,B, and C to look at stuff, and now I want a command to jump back to whatever buffer I last changed, at the point I changed it".

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dicky B posted:

For my purposes this works fine. Thanks! :)

There is also BufSurf: http://github.com/ton/vim-bufsurf which allows you to go back through edit history.

There are also lots of other ways to cycle through buffers, many of which I did not know until you asked your question and I read this page: http://vim.wikia.com/wiki/Easier_buffer_switching

vim wiki posted:

Often the buffer that you want to edit is the buffer that you have just left. Vim provides a couple of convenient commands to switch back to the previous buffer. These are <C-^> (or <C-6>) and :b#.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dicky B posted:

What is the quickest way to tranform this:
C++ code:
void butt(int fart, int *goon, const int *autism)
into this:
C++ code:
void butt(
	int fart,
	int *goon,
	const int *autism)


code:
:s/,/,\r/
Should do it. On my phone so I can't run it to be 100% sure. You use an r instead of an n for line breaks in search and replace stuff.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

fuf posted:

Any tips or good plugins for writing HTML with vim?

Two things that I'd find really helpful:

A command to jump from a tag to the corresponding close tag (like jump from <div> to </div>)

A command to replace the contents of the open and close tag at the same time (like if I replace <h1> with <h2> it will simultaneously replace </h1> with </h2>)

The HTML ones I could not live without are:

Snipmate: https://github.com/garbas/vim-snipmate
Define your own snippets to poop out blocks of HTML you use frequently quickly

Sparkup: https://github.com/tristen/vim-sparkup
Write HTML super fast!

Non-plugin command that is wonderful for HTML (which you probalby already know): cit Will, from anywhere in the contents of a tag (say, the text inside an H1) remove it and put you in edit mode.

Those thing you find helpful would be very, very cool. I don't know if they exist, but it makes me want to learn to write vim plugins.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Hughmoris posted:

Thanks. I fired Vim up for the first time at work today, it's going to take some getting used to but I'm liking it so far.

The good news is that after a couple weeks, you'll be super productive with it, and all the suffering through the learning curve will be worth it. That or you'll have Stockholm Syndrome and you'll keep telling yourself that you're much more productive.... :ohdear:

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

bollig posted:

A while back I read an article that had like a number of steps to Vim mastery or something like that. The first step was to disable the arrow keys. I remember thinking at the time that it all seemed like really sound advice, however I can't seem to dig the article up. Can someone help me out?

Dunno if this is the one, but this book suggests doing that, and it's a good read to boot!

http://learnvimscriptthehardway.stevelosh.com/

  • Locked thread