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
jony neuemonic
Nov 13, 2009

What are people's thoughts on spf-13? I've been using it for a while now with some minor tweaks (mostly to remove some plugins I don't use, and to add in ragtag) and it seems to work out OK. It's definitely a bit bloated, though.

Adbot
ADBOT LOVES YOU

jony neuemonic
Nov 13, 2009

Scat Cat posted:

Anyways! I'd like to learn Vim this summer. I briefly read over your OP and was wondering if you, or any other users have any tips for beginners.

Remap H to ^ (beginning of line) and L to $ (end of line). Stumbled on it in someone's .vimrc a while back and now I can't live without it. ; to : is good too, saves hitting shift every time you want to use a command.

jony neuemonic
Nov 13, 2009

I'm not an expert (hell, I've never even used vimscript for anything) so this is completely just spitballing. But this part:

ArcticZombie posted:

\='<p id="'.n.'">'/ -- I get that this is the replacement part of the s command and I can see the different parts of it but it starts with an escaped equals sign, has quotes surrounding it and the variable part and some periods around the variable too?

Looks like it's doing string concatenation to me ( <p id -", the variable n, and "> joined by the . operator). The escaped equals sign looks like it tells Vim to not literally replace <p> with '<p id="'.n.'">' (Take a look here).

edit: Removed a misunderstanding on my part.

jony neuemonic fucked around with this message at 18:06 on Aug 11, 2013

jony neuemonic
Nov 13, 2009

The Laplace Demon posted:

:help for / :for :confused:

EDIT:
For example:
:for i in range(10) | echo i | endfor

Whoops, I apparently mistook "doesn't support the exact same syntax" for "doesn't support for loops." Edited my post.

jony neuemonic
Nov 13, 2009


I'm using airline, same idea though. They're both really good.

jony neuemonic
Nov 13, 2009

I finally got motivated to sit down and rewrite my vim config. Despite getting over the "turn VIM into an IDE" bug and slimming it down by 1/3rd it's still 125 lines. :psyduck:

Sure runs a lot better, though.

jony neuemonic
Nov 13, 2009

Cat Plus Plus posted:

I recently found out that you can now set 'relativenumber' and 'number' at the same time, and vim will show an absolute line number for current line and relative line numbers for the rest.



And if you use numbers.vim you also get relative numbering in normal mode, and absolute in insert mode as a bonus. :science:

Tiger.Bomb posted:

gg/.<CR>kdgg

Intuitive.

jony neuemonic
Nov 13, 2009

Marsol0 posted:

I get something similar with:
code:
" Relative Numbering
set number
set relativenumber
autocmd InsertEnter * :set relativenumber!
autocmd InsertLeave * :set relativenumber
autocmd WinEnter * :setlocal relativenumber
autocmd WinLeave * :setlocal relativenumber!

Slick, I'll have to tinker with that. Not that numbers is an overly large plugin but hey, one less thing to install.

jony neuemonic
Nov 13, 2009

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>)

He (accidentally?) wiped the readme, but I always liked Tim Pope's Ragtag. There's a walkthrough here, it's similar to Emmett/Sparkup though admittedly with less features.

Adbot
ADBOT LOVES YOU

jony neuemonic
Nov 13, 2009

Anyone tried out trackperlvars.vim yet? It's a handy plugin for dealing with Perl variables since it understands the different variable types (so it doesn't get confused when you want to move from definitions to uses, or globally rename a variable), but it's also supposed to highlight all uses of a variable when you put the cursor over one and that part doesn't seem to be working.

e. Turns out it only defines highlights for terminal Vim. Easily fixed.

jony neuemonic fucked around with this message at 18:50 on Aug 10, 2014

  • Locked thread