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
Hughmoris
Apr 21, 2007
Let's go to the abyss!
I'm in a Windows environment at work and mainly write a lot of single-file scripts to help with day to day workflow. I've been using sublime and am interested in learning Vim, just cause. Is there any reason I should use standard Vim instead of gVim?

Adbot
ADBOT LOVES YOU

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

Clark Nova posted:

Not as far as I know - gVim's GUI is pretty minimal, and can be turned completely off if it bugs you. I don't think there's a way to get hi-color mode (i.e. nice, pretty colorschemes) to work in the standard windows console version of vim. I think you may be able to get that working in cygwin or mingw but I've never tried because :effort: Anyway, vim and gvim will both use the same config file, so you can switch back and forth effortlessly.


Marsol0 posted:

gVim is just a window wrapper around vim. The thing with vim in Windows is that there are a few default shortcuts that are different due to global Windows shortcuts (most notably ctrl+c and ctrl+v). :help explains the differences.

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.

Hughmoris fucked around with this message at 00:37 on Jun 23, 2015

Hughmoris
Apr 21, 2007
Let's go to the abyss!
I'm running Windows 7. Is there a way to have Vim launch " :! " commands in powershell, instead of the command prompt? For instance, if I executed
code:
:! perl testScript.pl
I'd like that to launch in a powershell window because it makes copy/pasting/scrolling a lot easier.

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

VikingofRock posted:

According to this site the relevant commands are
code:
set shell=powershell
set shellcmdflag=-command
I don't have access to my windows box at the moment to test that out, but hopefully it works for you!

Thanks. I tried that first but it's not working for me, but I might be doing it wrong. I placed those two lines in my _vimrc file, and when I run the command, it still loads it in the black command prompt window.
code:
:! perl testScript.pl

Hughmoris
Apr 21, 2007
Let's go to the abyss!
Is there a simple way to copy all regex matches in a file, and paste it into a new buffer? If not, maybe highlight all matches and delete anything that is not a match?

Hughmoris
Apr 21, 2007
Let's go to the abyss!
Thanks for the ideas. Yeah, I was hoping to grab just the captures and delete everything else. So, the starting text would be:
code:
adsfkjla"ORDER=PIZZA"djiasdf
nznjvzzajdf"ORDER=COKE"jaidjfa
nzxncvjzx"ORDER=CAKE"jadsmfa
and the ideal result would be the current buffer, or new buffer, containing
code:
PIZZA
COKE
CAKE

Hughmoris fucked around with this message at 19:32 on Sep 19, 2015

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

Solumin posted:

A week late and a buck short, but wouldn't
code:
%s/.*ORDER=\([^"]\+\).*/\1
work just fine? This would update the current buffer, which you said would be the ideal solution.

Thanks!

I'm really enjoying learning Vim, and discovering how much it can do. I had an extremely messy text file, with tons of duplicates and lots of noise. Used some :%s to remove the noise, and was left with lots of duplicates. I was thinking I would have to use Perl or Python to remove the duplicates, but it turns out that Vim has :sort u. That removed all the duplicates, and I had the result I wanted.

Good stuff.

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

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'}

Adbot
ADBOT LOVES YOU

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.

  • Locked thread