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
ephphatha
Dec 18, 2009




Civil Twilight posted:

Is there a reason to do that when you have expandtab set?

vi doesn't have an expandtab option.

Adbot
ADBOT LOVES YOU

Civil Twilight
Apr 2, 2011

Fair enough. I don't use non-vim vi for anything other than editing config files on old bsd servers.

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.

astr0man
Feb 21, 2007

hollyeo deuroga
So vundle is pretty nifty.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

astr0man posted:

So vundle is pretty nifty.

Yeah, I tried it out for a bit, but ended up going back to pathogen. Everyone should probably use one of them, just pick whichever feels right.

Civil Twilight
Apr 2, 2011

astr0man posted:

So vundle is pretty nifty.

I've been very happy with it; using vundle to manage my stuff is more pleasant than pathogen since I have all my vim config in a git repo, and submodules for pathogen are a pain.

404notfound
Mar 5, 2006

stop staring at me

PYF color schemes. I use this updated version of wombat: http://www.vim.org/scripts/script.php?script_id=2465

MononcQc
May 29, 2007

I'm using the light version of solarized: http://ethanschoonover.com/solarized

I've adapted a copy of it for iterm2 and have a custom vi-mode prompt in zsh that respects it, along with the same mode for irssi.

Light backgrounds work better if you work outside from time to time :shobon:

astr0man
Feb 21, 2007

hollyeo deuroga
I use the built-in torte scheme because I'm too lazy to find a better one :v:. Also dark background terminals forever :colbert:

This isn't a vim question, but should I start using zsh? I've always just used bash because it's available everywhere in addition to being the default in OSX.

Civil Twilight
Apr 2, 2011

I use the Tomorrow Night color scheme just about everywhere I can.

FamDav
Mar 29, 2008
I use molokai in mvim.

If you want a bunch of colorschemes to explore, I would suggest add flazz/vim-colorschemes with whatever package manager you use.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Does anyone actually use elflord, or is it just there as like a self-parody or something?

Doctor w-rw-rw-
Jun 24, 2008

astr0man posted:

I use the built-in torte scheme because I'm too lazy to find a better one :v:. Also dark background terminals forever :colbert:

This isn't a vim question, but should I start using zsh? I've always just used bash because it's available everywhere in addition to being the default in OSX.

That doesn't sound like a question for this thread, so maybe you should ask in the Linux thread. But if you'd like a quick answer, zsh does have much better autocompletion. Less compatibility with all the funky virtual environment manipulators (i.e. virtualenv, rbenv, etc.), though.

Deus Rex
Mar 5, 2005

Doctor w-rw-rw- posted:

That doesn't sound like a question for this thread, so maybe you should ask in the Linux thread. But if you'd like a quick answer, zsh does have much better autocompletion. Less compatibility with all the funky virtual environment manipulators (i.e. virtualenv, rbenv, etc.), though.

I can't speak for virtualenv but rbenv works perfectly fine with zsh. They even supply a completions file for it.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Civil Twilight posted:

I use the Tomorrow Night color scheme just about everywhere I can.

Hmm that looks nice. I'm pretty used to earendel now though, but I gotta check yours out.

No Safe Word
Feb 26, 2005

Mentioned in my teeny vimrc post but wombat has served me well as a colorscheme for a while now. Some of these other ones look pretty nice and maybe worth a shot too.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

I use the railscasts theme. There's a screenshot here, but that looks kind of desaturated or something. I've made a couple changes over the years, stealing a couple things from ir_black, and filling in some gaps.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Deus Rex posted:

I can't speak for virtualenv but rbenv works perfectly fine with zsh. They even supply a completions file for it.
virtualenv also works fine, although I had some issues with virtualenvwrapper that may be related to zsh.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
I haven't used non-zsh shells other than to install/switch to zsh in years. zsh on its own isn't that cool, but it allows amazing stuff like oh my ZSH to work, and that is priceless.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
What kind of text wrapping should I enable for markdown documents? I have the 80 characters cap for code, but it seems like it might be not ideal for a document like an essay. I'm all over the place with nowrap, textwrap, wrapmargin etc..

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
A line per sentence diffs fairly well, and for many audiences you'll want to reword and split up most sentences that don't fit into a non-awkward width line anyway. Probably doesn't work too well for an academic paper or something, though.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
When I was doing project writeups and stuff in latex I just used wrap and linebreak and wrote it one line per paragraph. A lot of how you want to format things depends on what you're doing with the text and how you plan on distributing it to other people.

MononcQc
May 29, 2007

vap:s/\. /.^M/g

vap selects to the end of the paragraph.
:s starts a regex search.
The regex can be entered as is except for ^M: that one is a literal line break that you can enter by doing Ctrl+v <Enter>.

You can then map this to some command to automate it per paragraph. Yay, instant sentence-based paragraph formatting.


You could also do it based on text width, but this tends to cascade in diffs. :set tabwidth=78 and then do gqap to format accordingly. It might make for better looking markdown, though.

leedo
Nov 28, 2000

I guess I'll pimp the gitgutter plugin since I've been enjoying it.

edit: oh, and here is my crufty vim config: https://github.com/leedo/dot-vim

leedo fucked around with this message at 05:49 on Jun 7, 2013

facepalmolive
Jan 29, 2009

DreadCthulhu posted:

  • ctrlp - I can't live without this any longer. Fuzzy searching is amazing and completely removes the need for any kind of folder navigation if your work is contained to one folder.

The one thing I miss most about IDEs is finding all references to a variable. ctags is great and all, but it only lets you find the declaration given a tag, and not the other way around -- i.e., I have a function named foo, now tell me all places where I call foo().

Is that what ctrlp does?

I think a friend had suggested cscope to me in the past, but I never looked into it after I realized it was a separate app. I just found out about cscope_maps.vim, though. Has anyone else used either? Is cscope + cscope_maps the holy grail I've been seeking all along?

Synthesizer Patel
Feb 16, 2004

But, despite this, Synthesizer and others must stay constantly vigilant as synthesizer theft is rife.
After not wanting to commit the time to write it myself 5-6 years ago, occasionally I'd look around to see if anyone else had written a Python wrapper that
can speak the netbeans protocol that vim speaks. This guy did it, and did a pretty good job of it as well: https://code.google.com/p/vimoir/.

You can ignore the main jist of his project, it provides audio-feedback based on vim events - if you know python and you know vim, his netbeans class
really is super duper for interfacing directly with vim. The netbeans interface gives you a way to get notifications for events, as well as trigger events
and run commands programatically (much more powerful than the embedded python/perl interface - you can do most of what vim is capable of doing
without having to actually type stuff in - the origins of the netbeans protocol was an addon or something to the netbeans java IDE so you could use vim
inside the editor as a 'native' editor. I dunno.

If I remember correctly, you can hook key events to trigger the netbeans event-loop, and there's a 'user has gone idle' event - since vim isn't and won't
ever be threaded - thems the breaks. But, better than nothing.

In other travels, vim-qt, the project that takes real-vim and embeds it into a qt-window seems to be working. It's kind of interesting because you can
write Qt plugins pretty easily so something like a file manager wouldn't be out of the question.. Not that one exists. This guy -> https://github.com/alloy,
made a file manager sidebar for MacVim, but it looked janky on my monitor.

And finally, a little pro tip on how to hex edit with vim:

You can convert your file to hex with:

:%!xxd

Make your edits..

And then reverse the process with

:%!xxd -r

Give it a try, becaue gdb is for pussies.

Dicky B
Mar 23, 2004

facepalmolive posted:

The one thing I miss most about IDEs is finding all references to a variable. ctags is great and all, but it only lets you find the declaration given a tag, and not the other way around -- i.e., I have a function named foo, now tell me all places where I call foo().

Is that what ctrlp does?
No, ctrlp is for locating files, but what you describe can be achieved through other means. I use ack.vim for exactly that purpose.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
I guess colorschemes are extremely personal. I tried all the ones you guys shared here and I still can't find as good of a match as earendel. I like the mix of not-too-Christmasey colors, not too dark so I can actually see the text, and an overall warm feel to it thanks to the turquoise, the cinnamon browns, the pinks and grass greens for comments.

Some of the themes are ridiculous, comments so dark grey that I have to spend 2-3 seconds adjusting my eyes so I can read them. What the christ..

b0red
Apr 3, 2013

I've always been a huge fan of the Molokai color scheme. It's easy on the eyes.

God of Mischief
Oct 22, 2010
When I use eclipse and feel like vim's editing functionality is better than eclipse's, I like to use vrapper. It doesn't embed a gvim window like eclim does, so it tends to be more stable. It is a vim-like keybinding with some specific eclipse commands to better integrate with it.

Cat Plus Plus
Apr 8, 2011

:frogc00l:

astr0man posted:

IDE integration
QtCreator has FakeVim thing built-in. I don't know how much it differs from vim.

astr0man posted:

Recommended Plugins
  • vim-indent-guides — useful when you deal with layout-based languages
  • vim-unimpaired — some useful mappings like inserting new lines above/below or moving text blocks up/down
  • Tabular — aligning text (e.g. :Tab /^[^=]*\zs=/l1l1 to align assignments)
  • vim-powerline — the best statusline :colbert:

I have a complete vimrc too.

MononcQc posted:

Do you ever get to edit a file, delete everything, then start writing new stuff, only to find out, 2 hours later, that you needed something that was in the old version and that you lost it all?
Enabling persistent undo (:help 'undofile', :help 'undodir') in addition to installing GUndo might be a good idea, too.

LaTex Fetish
Oct 11, 2010

DreadCthulhu posted:

Some of the themes are ridiculous, comments so dark grey that I have to spend 2-3 seconds adjusting my eyes so I can read them. What the christ..

Have you not tried Zenburn yet?

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!
Am I the only one here who's a fan of the built-in desert scheme?

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
Railscasts is just about the only color scheme I use when the option is available these days.

Also, coffee is my favorite flavor of ice cream.

Cat Plus Plus
Apr 8, 2011

:frogc00l:
https://code.google.com/p/vimcolorschemetest is pretty helpful when picking a colour scheme.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Cat Plus Plus posted:

https://code.google.com/p/vimcolorschemetest is pretty helpful when picking a colour scheme.

drat, that's a great resource. Thanks.

ExcessBLarg!
Sep 1, 2001

astr0man posted:

In TYOOL 2013 why don't you just use an IDE
So I missed out on the flamewar in the horrors thread, but I did have some comments in regard to this:

Perhaps an obvious, but otherwise understated point, is that Vim very much adheres to the Unix philosophy of serving as a tool (among many in the toolbox) to do one thing ridiclously well: editing text.

I've been using Vim, nearly exclusively, for all my editing tasks, including code, document preparation, whatever, both professionally and as a hobbyist, for well over a decade now. And there's something really awesome about having a tool that's both very good at editing code/text/whatever, but also being able to do so in nearly every context. In my experience (and perhaps it's somewhat dated), but IDEs are largely "one-trick ponies" with regard to language support. Whereas Vim is pretty awesome at C-family languages, Java, Perl/Python/Ruby, Bourne Shell, Makefiles, R, (La)TeX, various assembly and macro languages, hex editing (with xxd), and one-off DSLs. I can, and do, deal with all of those on a frequent basis, and being able to use the same tool with a familiar and consistent environment in all those contexts contributes to massive productivity. I don't think I'd be nearly as proficient if I had to use 5+ different IDEs as I wouldn't use any one long enough to become sufficiently familiar with it. Then there's also the part where I write nearly all my code in remote screen sessions from multiple machines, but mostly from my underpowered laptop which is perfect for ssh+screen+vim and little else.

Recently I've started using Google Docs a bit more for its collaborative features, and while I appreciate the realtime collaborative aspects of it (which, "screen -x" + Vim can do in a pinch too), it can be frustrating. Plus, have you ever tried using a "mouse" on a laptop? It's awful.

Anyways, preaching to the choir here ....

evensevenone
May 12, 2001
Glass is a solid.
http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

This is a really nice guide that shows off the cursor movement semantics really well.

LaTex Fetish
Oct 11, 2010

In case you guys didn't realize, or forgot, 7.3 has relative line numbering.

It's really useful for moving around with the movement keys and in visual mode. You don't have to count lines anymore, or move to the closest curly bracket to jump down.

Also, using 82gg or 98G to fix errors at a line still works. The relative line numbers are purely visual. Here's a snippet from my .vimrc about relative line numbers.

code:
set relativenumber

" Always show line numbers, but only in current window.
:au WinEnter * :setlocal relativenumber
:au WinLeave * :setlocal norelativenumber

" Absolute Line Numbers in Insert Mode
:au InsertEnter * :set number
:au InsertLeave * :set relativenumber

Adbot
ADBOT LOVES YOU

Cat Plus Plus
Apr 8, 2011

:frogc00l:
I always use relative numbering. Absolute line numbers are not that useful (other than for jumping to, which doesn't need them displayed).

  • Locked thread