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
mila kunis
Jun 10, 2011
Thanks!

Adbot
ADBOT LOVES YOU

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Ag is real loving good for project search.

https://github.com/ggreer/the_silver_searcher

It's fast as all get out, has a sensible cli. Just in case you want another option for project searching.

mila kunis
Jun 10, 2011
I got most things working but rails.vim seems to be giving me trouble.

here's the .vimrc i'm using, it's a hodgepodge because I just copy pasted stuff from around here and there. could what's in here be messing it up?

code:
filetype off
execute pathogen#infect()
filetype plugin indent on
nmap <F8> :TagbarToggle<CR>
autocmd vimenter * NERDTree
set laststatus=2  
set t_Co=256  
set noshowmode
nmap <F8> :TagbarToggle<CR>
set autoindent
set shiftwidth=2
set nocompatible      
syntax on            
filetype on         
filetype indent on 
filetype plugin on

Pooper Hero
Sep 11, 2001
The costumed crapper

tekz posted:

Hey, I'm working on a rails app and thought I'd try out vim. Looking for a little help with getting it set up like an IDE. So far I've installed vim-rails, vim-ruby, Nerdtree and ctrlp. What plugins would you guys recommend for tab autocomplete, closing html tags, jumping to ends of blocks/methods/parentheses and search all files for text functionality?

https://github.com/rking/ag.vim is good and if you install silver searcher on your computer you can use it with ctrlP and speed up those searches.

mila kunis
Jun 10, 2011
Thanks everyone.

Got a ctrlp question, it seems to not not show the file you currently have open. Is there a way to configure it so that it does?

qsvui
Aug 23, 2003
some crazy thing

tekz posted:

Thanks everyone.

Got a ctrlp question, it seems to not not show the file you currently have open. Is there a way to configure it so that it does?

I think the option you want is g:ctrlp_match_current_file.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
Just learned about buffersaurus which solves a need I had recently (regex search across open buffers). Unfortunately <C-n> and <C-S-n> aren't distinguishable by vim, so I can't have the mapping for next/previous match I want..

Anyone know if there's a PR that resolves this, or if it's in neovim? It's pretty annoying that I can't do it, but I'm not willing to open the vim source to see if it's fixable. :effort:

e: <leader>n isn't too bad I guess but still

leper khan fucked around with this message at 16:31 on Aug 1, 2016

bitprophet
Jul 22, 2004
Taco Defender
:let mapleader=" " and then never feel bad about overusing <leader> maps ever again!

Unrelated: I only found out about the (admittedly newish - 7.4.338+) :set breakindent recently and it's kind of the best if you're an anal-retentive nested-bullet-list abuser like I am.

Signed, someone attempting to replace Evernote with vimwiki and surprised at how not-badly it's going so far.

EDIT: also signed, someone starting to use vim-plug finally. Heck, here's my vimrc, maybe somebody will learn something: https://github.com/bitprophet/dotfiles/blob/1542a44843e6708fbf8fcabb1c9c2d1e28b2f90d/.vimrc

bitprophet fucked around with this message at 21:40 on Aug 1, 2016

Hughmoris
Apr 21, 2007
Let's go to the abyss!
I've recently re-installed Vim to give it another go (I'm a Vim novice). How do I have Vim autoload the plugins I have installed, via Vim Plug? I'm on Windows 10 with a fresh installation of Vim 8.0, I've used Vim Plug to install vim-perl. However, each time I open gVim I have to manually call :PlugStatus, then "L"oad vim-perl.

My folder structure looks like:
c:\users\bob\vimfiles\autoload\plug.vim
c:\users\bob\.vim\plugged\vim-perl\

My c:\users\bob\.vimrc file looks like:
code:
call plug#begin('~/.vim/plugged')
Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }
call plug#end()

Hughmoris fucked around with this message at 15:19 on Oct 26, 2016

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Your do section for vim-perl maybe overriding default behaviour? I'm not familiar with Vim plug but maybe try removing that...

Civil Twilight
Apr 2, 2011

Hughmoris posted:

However, each time I open gVim I have to manually call :PlugStatus, then "L"oad vim-perl.

If your concern is that PlugStatus shows that vim-perl isn't loaded after starting vim fresh, the "'for': 'perl'" part of that Plug line means to only load vim-perl once a perl file is opened.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Maluco Marinero posted:

Your do section for vim-perl maybe overriding default behaviour? I'm not familiar with Vim plug but maybe try removing that...

I removed the "Do" section since I don't need those options right now.

Civil Twilight posted:

If your concern is that PlugStatus shows that vim-perl isn't loaded after starting vim fresh, the "'for': 'perl'" part of that Plug line means to only load vim-perl once a perl file is opened.

I tested this and you're correct. When I open a perl file, the PlugStatus shows that vim-perl loads automatically. How do I get it to behave the same for a perl6 file? If I open a .p6 file, the PlugStatus shows that vim-perl is not loaded.

This didn't seem to do anything:
code:
Plug 'vim-perl/vim-perl', { 'for': 'perl perl6'}

Civil Twilight
Apr 2, 2011

Hughmoris posted:

How do I get it to behave the same for a perl6 file?

Looks like what you want is:
code:
Plug 'vim-perl/vim-perl', { 'for': ['perl', 'perl6']}
Or you can just remove the curly-brace clauses entirely and let it load vim-perl on normal startup if that still gives you trouble.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Civil Twilight posted:

Looks like what you want is:
code:
Plug 'vim-perl/vim-perl', { 'for': ['perl', 'perl6']}
Or you can just remove the curly-brace clauses entirely and let it load vim-perl on normal startup if that still gives you trouble.

That worked, thank you.

canoshiz
Nov 6, 2005

THANK GOD FOR THE SMOKE MACHINE!
I made the jump to vim from Atom last week and I like it so far. I'm using it with tmux to have all my server logs in one place with my text editor. I've just started running into some weird issue though, anyone seen anything like this?

Steps:
1. I start vim in my root directory (`vim .`)
2. I open command-t (bound to leader-t) and start typing in a filename
3. I hit tab to switch to the list of partial matches
4. When I try to use the arrow keys to select a file from the list of partial matches, it looks like it's sending an insert command with capitals ABCD (depending on which arrow key I pressed) to the other tab
5. What do???? This does weird poo poo with whatever is in the other tab (for example, if I just start up vim it'll load NERDTree and sometimes will trigger it to recursively expand a directory which can sometimes just lock up my vim completely if I trigger it while node_modules or bower_components is under the cursor).

It didn't do this until today when the only thing I did was add (and them remove) some comments from my .vimrc. Here's my .vimrc and .tmux.conf:
https://raw.githubusercontent.com/pyi891/dotfiles/master/.vimrc
https://raw.githubusercontent.com/pyi891/dotfiles/master/.tmux.conf

edit: never mind, fixed it -- it's because I rebound ESC to close the command-t pane. Apparently pressing an arrow key is equivalent to pressing ESC-o-(ABCD)....

canoshiz fucked around with this message at 03:55 on Jan 17, 2017

Jo
Jan 24, 2005

:allears:
Soiled Meat
Is there a non-bullshit vim plugin for Java? Something with autocomplete, quickdoc, and go-to def?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Jo posted:

Is there a non-bullshit vim plugin for Java? Something with autocomplete, quickdoc, and go-to def?

http://eclim.org?

Jo
Jan 24, 2005

:allears:
Soiled Meat

I had dismissed it as poo poo. "If I wanted the bloat of Eclipse...". Maybe unfairly so? I'll give it some additional consideration.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Jo posted:

I had dismissed it as poo poo. "If I wanted the bloat of Eclipse...". Maybe unfairly so? I'll give it some additional consideration.

The eclipse runs headless and you get most of the good from it with minimal bad. It's still java though..

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Which plugin manager should I be using today in 2017?

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

Boris Galerkin posted:

Which plugin manager should I be using today in 2017?

I've used Pathogen, Vundle, and vim-plug. The latter seems the simplest, but they all pretty much work the same. It's nice not to have to deal with submodules (assuming you check your dotfiles into git), though.

xtal
Jan 9, 2011

by Fluffdaddy
Submodules are perfectly fine

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

They're manageable. I've realized that I don't actually care about locking every commit of my dotfiles to a specific commit of every vim plugin, though. As rare as it happens, I'm perfectly fine with a fresh dotfiles checkout just pulling the latest versions. So if that's important to you, don't use vim-plug.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

good jovi posted:

I've used Pathogen, Vundle, and vim-plug. The latter seems the simplest, but they all pretty much work the same. It's nice not to have to deal with submodules (assuming you check your dotfiles into git), though.

Cool thanks for that. I've been using vim forever now, but haven't ever bothered or messed around with plugins before. I dunno why, but it probably has something to do with my vimrc being a confusing mess from all the random poo poo I've taken from various other vimrc files that I don't really understand.

Anyway I just compiled neovim to give it a shot and downloaded vim-plug with it. Figured I had nothing to lose especially since neovim uses a different vimrc by default. Anyway vim-plug is pretty awesome. I can't believe I've been doing all this poo poo like managing color schemes and dropping poo poo into ~/.vim/whatever manually for so long.

I can't get youcompleteme to work though. I installed it with vim-plug just by adding the "Plug /repo/link" line to my vimrc file and installed it, it says youcompleteme is installed, but I don't get any autocompletion. I've only tried python files as that's all I have available right now but it just doesn't work. Nothing pops up with suggestions like the gif shows on their git repo. Their git repo also has an entire treatise on installing it but I thought all I had to do with add the line to my vimrc if I'm using vim-plug. It's not really clear but I must be missing something since it's not working.

e: CtrlP is great. I've been using http://vimawesome.com/ to look for plugins. Are there any actual "plugin review websites" out there? I wouldn't be surprised if there wasn't since I imagine the audience isn't that big but I figured I'd ask.

Boris Galerkin fucked around with this message at 00:30 on Mar 19, 2017

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

Boris Galerkin posted:

I can't get youcompleteme to work though. I installed it with vim-plug just by adding the "Plug /repo/link" line to my vimrc file and installed it, it says youcompleteme is installed, but I don't get any autocompletion. I've only tried python files as that's all I have available right now but it just doesn't work. Nothing pops up with suggestions like the gif shows on their git repo. Their git repo also has an entire treatise on installing it but I thought all I had to do with add the line to my vimrc if I'm using vim-plug. It's not really clear but I must be missing something since it's not working.

Did you go into the YCM checkout and compile it? That's also something you can set up as a post-pull hook for vim-plug.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

good jovi posted:

Did you go into the YCM checkout and compile it? That's also something you can set up as a post-pull hook for vim-plug.

Nope I didn't do that. I thought vim plug would do it all for me.

Apparently the vim plug website says to append a dictionary thing after the youcompleteme plugin. I did that and now it's working.

qsvui
Aug 23, 2003
some crazy thing
Is there any reason to switch over to Neovim if you're just a simple user? I can't imagine there would be some killer plugin that's Neovim only.

xtal
Jan 9, 2011

by Fluffdaddy
Not really

Pooper Hero
Sep 11, 2001
The costumed crapper

qsvui posted:

Is there any reason to switch over to Neovim if you're just a simple user? I can't imagine there would be some killer plugin that's Neovim only.

I tried it for a bit and it didn't really offer me anything more than regular vim. I use neomake(like syntastic) with vim 8 and it works all async like, so the main selling point of neovim is already in vim now. Also there are no good gui clients on the level of macvim/gvim.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

Neovim has terminal mode, which is cool, but still kind of janky.

NeoMake was the reason I switched, and Ale kind of invalidates that now.

xtal
Jan 9, 2011

by Fluffdaddy
Having a terminal in your editor is dumb

Odette
Mar 19, 2011

xtal posted:

Having a terminal in your editor is dumb

Mmmm yes. Tmux takes care of this for me. It's drat good.

Hyvok
Mar 30, 2010
Anybody using neovim and/or SpaceVim? I'm very intrigued, quickly tried setting both up on Windows but the SpaceVim configuration is not being loaded from "~\.SpaceVim.d\init.vim" which is supposedly the place to put your configuration. Also docs present this great concept of "unite" but I still don't really understand what it is after reading the docs... Also interested in general opinions/thoughts about neovim or SpaceVim on any platform :)

bollig
Apr 7, 2006

Never Forget.
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?

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/

bollig
Apr 7, 2006

Never Forget.

Lumpy posted:

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

http://learnvimscriptthehardway.stevelosh.com/

YEah this looks cool thanks

xtal
Jan 9, 2011

by Fluffdaddy
My arrow keys are Fn+HJKL so lol

Adbot
ADBOT LOVES YOU

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

xtal posted:

My arrow keys are Fn+HJKL so lol

I bought a 60% as well and it is the most terrible thing I've ever typed on.

Nothing to do with vim but it's just so awkward.

  • Locked thread