Skip to main content

Questions tagged [buffers]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Reloading vim file after editing from another window?

Say I am editing the file CMakeLists.txt from two vim sessions. If I make an edit to the file in one session, save my changes, and then switch to my other session I get prompted with the following: ...
user51758's user avatar
0 votes
1 answer
46 views

Get an exact copy of the buffer as it appears in the window

Main Question For a plugin I'm developing, I want to show a floating window somewhere within the buffer view, but want to work out exactly which rows and columns in the window are already taken up by ...
KamielDev's user avatar
  • 101
1 vote
2 answers
40 views

Cannot go back to previous window of an opened one using bf, especially when having 2 or more windows open at the same time

I opened 3 files by: vim compile.f rtl.f tb.f -O I navigate to a window of interest, which is rtl.f, press gf to open file below cursor and bf to go back rtl.f window. After pressing gf, the window ...
Trung anh nguyễn thành's user avatar
1 vote
1 answer
45 views

How to let buffer show relative path when splitting?

It seems to be a vanilla-vim issue as the same behaviour also appears when I'm in vim -u NONE. Basically if you open a file, for example vim src/vector.h, and then split it with :bel vsp %:p:h/vector....
Andrew.Wolphoe's user avatar
1 vote
2 answers
67 views

Check if there are non-empty or named buffers open

When closing Neovim, I'd like to store the session, but only if there are any files open. If I only have the dashboard open, or an empty unsaved buffer, I want to skip this step. So, I need a way to ...
ElRudi's user avatar
  • 191
0 votes
1 answer
36 views

Why does :bd closes tabs instead of buffers?

I am using Neovide and I just don't understand. Maybe I am missing something about buffers? I just want to get rid of annoying empty buffers or old buffers that I don't use anymore. Only in the ...
samuelnihoul's user avatar
1 vote
1 answer
552 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
47 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
68 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
51 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
46 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,136
0 votes
1 answer
93 views

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
57 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
  • 77
0 votes
2 answers
271 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
  • 13
0 votes
1 answer
68 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
379 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
49 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,869
1 vote
0 answers
47 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
26 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
42 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
143 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
55 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
29 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,530
0 votes
0 answers
113 views

How to "keep" Lexplore/Rexplore/Explore "memory" when toggling it?

Is there a way to keep Explore state? for example, If I open vim at ~/project, open :Lexplore, and navigate in the explore window to ~/project/a/b/c/1.txt. next time I open :Lex i would want to see ...
gcb's user avatar
  • 121
0 votes
2 answers
42 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,244
1 vote
1 answer
84 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
50 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
293 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
2k 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
60 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,530
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
130 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
38 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
  • 415
1 vote
1 answer
48 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
162 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
788 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,530
0 votes
1 answer
559 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
  • 743
1 vote
1 answer
131 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,530
0 votes
1 answer
100 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
  • 968
0 votes
2 answers
39 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,530
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
133 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,530
1 vote
1 answer
73 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,530
0 votes
1 answer
33 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
56 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
153 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
214 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
2 3 4 5
9