Questions tagged [buffers]

The representation of a file loaded into memory. Edits are performed on buffers.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Bufferline in Nvim: auto-close or hide [No Name] buffer when other buffers are open?

I'm using Bufferline with Neovim to show my open buffers at the top of the nvim window. I'd rather not see the 'No Name' buffer if I don't have to. I understand that nvim must always have a buffer ...
MikeTheTall's user avatar
0 votes
2 answers
39 views

Why does the :ls command not display :help buffers?

When I use :ls in Vim, I can see the list of open buffers. But when I open a buffer for documentation, for example :h help, I cannot see an entry for it in the :ls list, even if I open it by :tab h ...
mohamadi_arch's user avatar
2 votes
3 answers
57 views

Join two buffers into a single buffer

I'm looking for a way to: combine two buffers into single buffer using columns [1, winwidth] from left buffer and columns [1, eol] from right buffer. close buffer 2 so left with same contents in ...
Matthew Webb's user avatar
1 vote
2 answers
33 views

Neovim doesn't open previously unopen file in horizontal split

In classic Vi/Vim when I opened a previously unopened file with ctrlp, NERDTree, etc. and the current file/buffer was unsaved, it would open the new file in a horizontal split. After switching to ...
webermaster's user avatar
0 votes
1 answer
35 views

Select a buffer to open in vertical split

Often I want to view two files at once. I switch between the buffers I want to view, so I want a simple key to do so. I would like to have keymaps that let me: Select a buffer from the open buffer ...
eyal karni's user avatar
  • 1,106
0 votes
1 answer
50 views

init.vim: E194: No alternate file name to substitute for '#'

I have a problem with adding a keymap to delete all my buffers. Namely, I used the following map in my init.vim file (source): nnoremap <leader>B :%bd|e#|bd#<CR> And I get the following ...
satk0's user avatar
  • 101
1 vote
1 answer
45 views

Unloaded buffers and the :ls! command

I ran :ls! (having only a vague memory of the command and not really knowing what I was going to see) and saw a short list of files (maybe 5 or 6) with 'u' in the gutter. Apart from one of the files, ...
Tom's user avatar
  • 67
0 votes
2 answers
157 views

How to exclude a specific buffer from the BufEnter autocmd group?

I want to load a plugin when I enter a buffer, so I set this event to BufEnter. But when I start neovim, the plugin loads at the dashboard buffer. I want to exclude that buffer. How can I do it? ...
Nias26's user avatar
  • 11
0 votes
1 answer
56 views

How do I create key mappings for Windows and/or nano Shortcuts?

Having used text editors (mainly Notepad/++) and some IDEs on MS Windows, I've become familiar with their Alt and Ctrl shortcuts to the point that I use them automatically. Having used nano on a GNU/...
Agi Hammerthief's user avatar
1 vote
3 answers
234 views

How to force Vim to delete all the [No Name] buffers?

I often use Vim to manipulate clipboard data. I create a new buffer :enew Paste the data in it Modify the data Yank it :%y At the end of my day, I end up with several [No Name] buffers. I want to ...
Vivian De Smedt's user avatar
2 votes
1 answer
35 views

Configure buffer display name to show directory when buffer name is short

I don't normally set autochdir, but I'm trying it out and seeing what kind of small frustrations I encounter as a way of learning more about vim. For the purposes of this question, my .vimrc is the ...
Greg Nisbet's user avatar
  • 1,839
1 vote
0 answers
40 views

Run macros in background while doing something else

I have a macro that calls APIs to fetch data based on information in a buffer. Is it possible to have the macro continue execution while I move to another window and work on other buffers?
user22476690's user avatar
0 votes
0 answers
23 views

How do I instruct plugin BufExplorer to open a buffer in an existing window?

How do I instruct Vim plugin BufExplorer to open a buffer in a specific existing window rather than open the buffer in a new horizontal (key f or F) or vertical (key v or V) window?
Derek Mahar's user avatar
0 votes
0 answers
39 views

How can I stop Vim from quitting when the last buffer is a `:help` buffer?

I think there is an option that governs this behavior, but I cannot find it.
Futarimiti's user avatar
2 votes
1 answer
136 views

E93: More than one match when <C-d> shows only one match

When jumping between buffers in Vim, most the time things work quite smoothly. I like to jump to buffers by writing :b something1*something2, checking if the match is unique by invoking C-d, and if so ...
user22476690's user avatar
0 votes
0 answers
45 views

Buffers not close automatically by Vimspector

I have been using Vimspector for debugging Python but like 8-10 months now, the Python terminal buffer that is opened by Vimspector when the debugger runs, is not automatically closed when the ...
Xxxo's user avatar
  • 187
0 votes
0 answers
17 views

Is there a way to mark all buffers as "visited"? [duplicate]

I recognize that this is a very minor problem, but I thought I'd ask anyway. I mainly use Neovim, but to keep things simple, I'm going to be referring to and testing with vanilla Vim 9.0. The "...
Display name's user avatar
0 votes
1 answer
26 views

How do I get the first column of the current buffer after scrolling horizontally?

In the normal case, the first column is 1. But after a command like z10l to scroll rightward now the first column visible is 11 instead of 1. How do I get this 11? My trying: I found that vim.fn....
NeoZoom.lua's user avatar
  • 1,462
0 votes
0 answers
90 views

How to "keep" Lexplore/Rexplore/Explore position?

When navigating large projects, in IDEs like intellij, I keep opening and closing the navigation/file tree tab and moving around files. On vim I tried to create a similar functionality, adding to my ~/...
gcb's user avatar
  • 101
0 votes
2 answers
41 views

Misunderstanding of interaction between local options, moving between windows, and WinLeave, WinEnter, BufLeave, BufEnter events

This what is logged in :messages when I'm printing the value of nu and rnu upon the 4 events WinLeave, WinEnter, BufLeave, BufEnter during the action, done twice, of opening :help and closing it. The ...
Enlico's user avatar
  • 2,194
1 vote
1 answer
74 views

How to restrict tab-completion to the file name when opening a buffer

I know that I can do: :b home<tab> and vim will autocomplete to all buffers with the word "home" in them. My problem is that this includes all buffers that have "home" ...
Bruce Johnson's user avatar
0 votes
1 answer
43 views

Making certain buffers invisible to commands involving "all" or bufdo

For my projects I generally open several tabs some of which might involve terminals or directory trees or quickfix (since ShellCheck sends its error messages there for instance). When I want to use ...
Sina's user avatar
  • 115
2 votes
3 answers
240 views

Open all files listed in current buffer

I have a file/buffer that contains multiple file names with line numbers. Example: Declaration of x fileA.h +3 Usage of x fileB.c +10 I can open a file with the cursor in the given line ...
MaxGyver's user avatar
  • 231
2 votes
1 answer
1k views

How do you use buffers/panes? Possible to move a buffer into another pane?

I recently switched from VsCode and I am quite confused about the window/pane system of neovim. It seems like these are the only options to actually use panes in neovim: https://stackoverflow.com/a/...
Chikko's user avatar
  • 23
0 votes
1 answer
55 views

What is the meaning of command `:4w`?

As title. I just read a post that people accidentally delete(wipeout) their unsaved work by trying the command :4w. A bloody lesson to him, but I also want to prevent this from happening to myself. ...
NeoZoom.lua's user avatar
  • 1,462
0 votes
0 answers
25 views

":bufdo cd ~/Some/Folder/Path" doesn't affect all files

I have about 15 files in my buffer list [1]. In my one and only tab, I have three modifiable subwindows, none of which have unsaved changes. I issue :bufdo cd ~/Some/Folder/Path, and Vim lists each ...
user2153235's user avatar
1 vote
1 answer
111 views

How does Buffer Explorer Vim Plugin (BufExplorer.vim) determine its colours?

I've customized a colour scheme over the decades. Recently (possibly within the last year), I upgraded BufExplorer and found that it lists all of the buffers in mostly orange or yellow. Orange is my ...
user2153235's user avatar
-1 votes
1 answer
45 views

:BufExplorer and its split variants sends me to another tab

If I have BufExplorer open in another tab, any of the following commands will send me to that other tab instead of opening BufExplorer in a new subwindow in the current tab: :BufExplorer :...
user2153235's user avatar
0 votes
1 answer
37 views

How to search hidden buffer during insert-mode completion?

I am trying to write a completion function which has as its source a 386k line (CSS) file. Initially I read the file into a list with readfile() and used a for loop to iterate over each line, matching ...
Andy Stewart's user avatar
  • 1,359
0 votes
2 answers
2k views

Setup Telescope to save and close all buffers, when opening a new file

I'm following a Neovim tutorial on LaraCasts from Jess Archer, setting up Neovim. I've used Vim for a while, but I'm new with Neovim. You can see Jess Archers dotfiles here: Jess Archers Dotfiles. I ...
Zeth's user avatar
  • 405
1 vote
1 answer
40 views

Move between buffers of a certain filetype

scenario: I have a bunch of programs that generate output, the programs and output are open in buffers and the programs are one filetype eg .r and the output is another filetype eg .txt I want to ...
neverdimed's user avatar
1 vote
2 answers
125 views

Navigate arglist via filename?

I like doing things like :b css to jump to the single css file I'm working on. But of course this only works if I only have 1 css file in a buffer. I'm under the impression that it is not possible to ...
Aaron Parisi's user avatar
0 votes
1 answer
608 views

How to get the total lines of a file before it's loaded into a buffer?

As title. My target is to disable a plugin before it is applied to a buffer that will be loaded with the content of a file. I can get the file name before it is loaded. The file to be opened is ...
NeoZoom.lua's user avatar
  • 1,462
0 votes
1 answer
438 views

How to grep only the contents of the current file?

I have this alias to grep under the cursor (for the entire project): " bind K to grep word under cursor nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR><ENTER>...
abbood's user avatar
  • 733
1 vote
1 answer
109 views

What happen internally when I set `bufhidden` to `delete`?

As title. Would the buffer I set the option with the value delete really get deleted immediately? If not, when will it be deleted and what is this mechanism? Sorry for maybe a bad question but I'm ...
NeoZoom.lua's user avatar
  • 1,462
0 votes
1 answer
90 views

Read viminfo when argc() > 0

Does Vim read the viminfo when called with a file argument? How can I force Vim to restore the buffer list in that case? Use case & context What I want is: When called as vi: enable read/write ...
qeatzy's user avatar
  • 960
0 votes
2 answers
35 views

Event with the same timing as BufEnter but triggers on vsplit?

As title. I have a pair of autocmds which needs each other: One on WinLeave, this one is fine since it will be triggered when I call :vsplit. One on BufEnter, this one is NOT fine for the edge case, ...
NeoZoom.lua's user avatar
  • 1,462
1 vote
1 answer
95 views

Short delay in buffer swtich with `nnoremap` binding

I have nnoremap <C-]> :bn<Enter> nnoremap <C-[> :bp<Enter> so that I can use Ctrl + [ and ] to flip between buffers. I'm experiencing an issue where these two shortcuts behave ...
Jon Deaton's user avatar
2 votes
1 answer
111 views

What's the benefit of using unlisted buffers?

As title. Which command will make some buffers unlisted and why it is designed to do so? I guess this is related to memory management but I'm not sure about this.
NeoZoom.lua's user avatar
  • 1,462
1 vote
1 answer
65 views

What's the benefit(s) of deleting buffers that are not loaded into a window?

As title. Say that I have 20 buffers and only 4 buffers are shown (Assume in my current tab, I only have 4 splits). Since 20 buffers are there and each one is attached with some LSPs, I assume that ...
NeoZoom.lua's user avatar
  • 1,462
0 votes
1 answer
32 views

The behavior of bufname is unclear to me

I use NERDTree and try to apply the recipe that ensures no one replaces its buffer. I do the following: Start vim Execute :NERDTreeFocus Open some file Execute :q for file buffer (At this point there ...
starteleport's user avatar
1 vote
2 answers
54 views

Set mappings dependent of file type

To execute and debug different kind of programs, I mapped the function keys in the .vimrc-file. E.g. " save and execute perl :noremap <F5> :w<CR>:!./%<CR> " save and ...
Andy A.'s user avatar
  • 233
-1 votes
1 answer
132 views

Edit a file in two different terminal windows

It's nice to edit the same file from two different views. I use a vsplit for this, as described here, and it works well. However, I'd like to have the two views open in different terminal windows, ...
Adam Selker's user avatar
2 votes
0 answers
186 views

CTRL-^ work in Vim but not in Neovim

I'm reading Neovim's usr_07.txt. When I start Neovim like neovim t1.txt t2.txt t3.txt, and then issue :next, the shortcut CTRL+^ is supposed to bring me to the previous file (i.e., the alternate file)....
robertspierre's user avatar
1 vote
0 answers
37 views

How to move buffer list from bottom to top of UI?

When I invoke the buffer list (via: :ls), a selection window appears at the bottom of my UI. Is there a way to move this selection window to the top of my UI? Any suggestions would be welcome.
Mercutio's user avatar
2 votes
1 answer
691 views

When I use the yank command in vim, is the text saved into a buffer that is not visible to the user?

I understand the concept of a buffer. It is the text that's saved from a file that we edit inside of vim. When I use the yy command, where exactly does vim save this information to? In any other ...
KrabbyPatty's user avatar
1 vote
1 answer
72 views

Trying to get rid of buffers with :%bd fails

I have trouble with buffers in Vim (8.0 on a rhel8 server) apparently. That said ... I was not aware of the exitance of buffers before facing this problem. So as you can see, my expertise in vim is ...
vrms's user avatar
  • 113
1 vote
1 answer
111 views

Detect line endings in current buffer, substitute all line endings depending on result

In GVIM, I'd like to save the current file with either \r\n or \n line endings. Depending on the opened file, the appropriate line endings should be chosen automatically. I had a look at https://unix....
Lvn's user avatar
  • 13
1 vote
0 answers
72 views

Is there an autocommand event after buffer is deleted?

help BufDelete BufDelete Before deleting a buffer from the buffer list. This is close to, but not what I am looking for: After deleting a buffer.
Cyker's user avatar
  • 187
0 votes
1 answer
95 views

How to create a loaded `nofile` buffer without loading a file?

This script creates a 'nofile' buffer and loads it so it can be edited: let n = bufadd('foo') setbufvar(n, '&bt', 'nofile') bufload(n) But it has a big problem: The call to bufload will read a ...
Cyker's user avatar
  • 187

1
2 3 4 5
9