News for hackers. Stuff that matters.
Re:Vimcasts by tfh on Tuesday March 30, 2010 @10:28AM (#1229209)
What i like about vim's UI is that it's very reduced to a minimum. New users have no idea how powerful it is.
Re:Vimcasts by nfnaaron on Tuesday March 30, 2010 @10:35AM (#1229228)
Come to the Dark Side. We have buffers.
Re:Vimcasts by sophacles on Tuesday March 30, 2010 @11:29AM (#1229360)
Wait, which dark side? (or possibly, what is the light side?) Both vim and emacs have buffers, including special ones...
Re:Vimcasts by 10ren on Tuesday March 30, 2010 @01:20PM (#1229655)
I use the arg list. I looked into buffers a while back, but they seemed overcomplex for what I need (same with windows). Checking the vim help just now, buffers and arglist seem (mostly) equivalent.

I'm curious: do you find there's specific advantages of buffers over the arglist? And, do you use buffers as well as, or instead of, the arglist?

The only problem I find is that if I start two vims in different xterms, sometimes I'll want to paste between them - so I need to use the system clipboard, instead of vim.

Re:Vimcasts by nfnaaron on Tuesday March 30, 2010 @01:46PM (#1229709)
Ah, my mistake. I meant registers, not buffers.

:help registers

As to your "I'm curious" question, I use both. Mostly arglist, and I resort to buffers when the arglist has gone squirrely (editing an additional file after starting with a number of files, e.g.).

For example, edit a small number of files (vi *).

:files will show you the list of files.

Repeating :n will take you through each file.

:e newfile to create a new file

:files will show you the list, with newfile at the end.

:rew to rewind the list

:n will get you to the last file on the original list, but not to newfile.

:bn will then get you to newfile.

Re:Vimcasts by 10ren on Thursday April 01, 2010 @12:15PM (#1234921)
I've had that problem, here's what I do:

:arge

will do the same as :e, but also add it to the arglist. You can prefix with a number to insert it at a particular position, especially :0arge and :99arge for first and last respectively. It only adds one at a time; several can be added with :arga (including recursive wildcards such as /*.java)

:argd %

will delete the current file (which % expands to) from the arglist.

BTW: I dislike pressing : and <CR> so instead of :n, my .vimrc has:

:map <C-n> <Esc>:n<CR> " next file, with control-n :map <C-p> <Esc>:N<CR> " prev file, with control-p

Re:Vimcasts by 10ren on Thursday April 01, 2010 @11:31PM (#1235951)
The recursive wildcard didn't come out right. It should be:

    **/*.java
And the mapping is:

    :map <C-n> <Esc>:n<CR>    " next file, with control-n
    :map <C-p> <Esc>:N<CR>    " prev file, with control-p
Re:Vimcasts by weaksauce on Wednesday March 31, 2010 @12:19AM (#1230913)
I just watched the video entitled "Working with Buffers" so I don't quite get your reference
Re:Vimcasts by nfnaaron on Friday April 02, 2010 @10:33AM (#1236514)
In the parent to my comment was this sentence: "New users have no idea how powerful it is."

That reminded me of this quote from Star Wars Episode VI: "You don't know the power of the Dark Side."

Which reminded me of the bumper sticker or T shirt: "Come to the Dark Side. We have cookies."

Which led to my comment: "Come to the Dark Side. We have buffers."

Buffers isn't important, except as something Vim has that can substitute for cookies.