edit buffer using a builtin function

13 views
Skip to first unread message

Ernie Rael

unread,
Feb 22, 2023, 1:40:36 PM2/22/23
to vim...@googlegroups.com

Is there a builtin function to edit a buffer in the current window?

I use

execute string(bnr) .. 'buffer'

Anything more script oriented?

-ernie

Maxim Kim

unread,
Feb 22, 2023, 7:53:08 PM2/22/23
to vim_dev

Is there a builtin function to edit a buffer in the current window?

 There is no function as far as I know for this.

I use

execute string(bnr) .. 'buffer'

Anything more script oriented?

 
Pretty much this, with variations using string interpolation:

:exe $"{bnr}buffer"
:exe $"b {bnr}"

Ernie Rael

unread,
Feb 22, 2023, 8:16:17 PM2/22/23
to vim...@googlegroups.com

Thanks, hadn't thought of string interpolation

Looking again I saw that ":5buffer" and ":buffer 5" are the same (as you show, and I should have known)

I've started using

    execute 'buffer' bnr

-ernie


--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/6fb57b3e-1b3c-4379-b0e9-341ba69e30f0n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages