Questions tagged [vim-windows]

A Vim window is a view of a buffer. A tab page comprises one or more windows. For questions about interaction with the Microsoft operating system, use [microsoft-windows]. For questions about interaction with the desktop windowing system, use [window-management].

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

How may I setup a consistent shortcut to switch to the right pane, even the pane is in another Terminal?

I have 2 screens of difference sizes, and I am a Neovim user (with Tmux, iTerm2). I would like to hack a way so that I can have a consistent way to "switch to the pane on the right of this pane&...
0
votes
1answer
37 views

Useful script to manage buffer and window?

Given the scenario: I want to create a vertical split from current buffer for reference another file/the same file. After I've done with this split I don't want to see this buffer-for-reference in ...
0
votes
1answer
27 views

Focus on window of target buffer

Let's say I have a way of identifying (through name or number) a buffer which is already open in a window somewhere. How can I focus on the window that hosts said buffer? Can this be generalizable so ...
0
votes
3answers
56 views

How to automatically re-apply max window height + width upon terminal resize?

I often use the <C-w>_ and <C-w>| commands in Vim to maximize the current pane to fill the entire window (I have it keymapped to <C-w>0). And I've recently started using a tiling ...
0
votes
1answer
40 views

Change default window layout of Vimspector

When debugging with Vimspector, I would love to customize the default window layout. I mainly want to have a wider view of the vimspector.Watches window on the left. I can do this after firing up a ...
1
vote
2answers
69 views

I need two windows on the same file but screen too small for split

I'd like to modify a file at two different places but without having to go from one location to another in the same file. So I learned about windows but it seems they only work by splitting. My screen ...
2
votes
1answer
25 views

Buffers that are neither active nor hidden

Both :ls and :buffers display a list with buffer information, giving indicators for each buffer. For example, # means the alternate buffer, and % means the current buffer. The meaning of each ...
3
votes
1answer
59 views

How to determine which window cursor will move to after closing preview window?

I am trying to fix a bug that goes like this: [cursor in ordinary window] open preview window and move to it [cursor in preview window] close preview window expected: cursor moves to where it was in ...
1
vote
1answer
28 views

Forcing integrated terminal to scroll down after relayed command

I have a plugin which integrates a terminal that I can send commands through using a custom command I made. The only issue I'm having is that sometimes after the terminal gets clogged, it tends not to ...
1
vote
3answers
315 views

Don't show grey boundaries between windows

I am using vim as a book reader. For this purpose I have three windows open as shown ________________________________________ |~ ||The book I'm||~ | |~ ||reading ...
1
vote
1answer
32 views

Is it possible to have zero width window separator?

I want to remove the split separators without any leftover empty space. Is such functionality exposed?
0
votes
2answers
33 views

Automatically resize window based on filetype

I have a nifty autocommand in my vimrc that automatically maximizes any :help window: augroup LargeHelpWindow autocmd! autocmd BufWinEnter * if &l:buftype ==# 'help' | wincmd _ | endif ...
1
vote
1answer
56 views

Vim autoload doesn`t work

I've created a ~/.vimrc file that uses plug.vim. call plug#begin('~/.vim/plugged') Plug 'something' call plug#end() I also downloaded plug.vim and put in the folder ~/.vim/autoload. But when I open ...
3
votes
1answer
31 views

Get the position of a split window inside of vim

Is there any way to get the position of the top left corner of a split window relative to the entire vim window? For example, if there was only one window, and the tabline was inactive, the position ...
0
votes
1answer
48 views

Substitution replaces only current line?

I have a block of of text which contains variables whose name I want to change, but not all. I want to be able to choose which variables get replaced by the substitution and which do not. I tried ...
0
votes
3answers
71 views

Efficient copy->paste onto mark

I typically write all my software in the same way (omitting the TDD parts): Iterate pseudo code until it is granular enough that each part can be written in, hopefully, under 20 minutes. Implement ...
1
vote
0answers
32 views

How can I overlap windows, use non-rectangular windows, or dock a window in the corner?

I'm working on a text file (my notes/todo document), and I want to have the to-do list part of the document open in one Vim window (to check things off), with another to look at the rest of the ...
0
votes
1answer
38 views

How can one open a file from a directory window into an existing window?

In a directory window (:Explore or :Vexplore) every 'o' or 'v' creates a new window, I just want 1 directory view window on the left and 1 file view window on the right like a classic IDE. When ...
2
votes
1answer
58 views

Move cursor back to previous window after splitting

After running a command that opens a new split (e.g. :botright 10new), how can I have the cursor move back to its previous position? A use case would be to show a message in a scratch buffer without ...
1
vote
1answer
77 views

c-w suddenly not working to switch panes

sorry, I don’t know if this is a problem at the VIM level, terminal emulator or with KDE. I'm running vim-gtk3 in Debian Netrunner 20.01 which is KDE, and normally using Konsole, but also Terminator ...
0
votes
3answers
71 views

Does a plugin exist which allows moving (across) the windows and split them without having to press Ctrl+w before each action?

I'm kind of fine with moving across windows using Ctrl+w followed by (sometimes a counter and) h, j, k, l, p, t, b, and I'm also fine with the similar key combinations to split the windows or to move ...
-1
votes
1answer
402 views

Colorscheme displayed wrongly with Neovim

Hello I am new to vim and only used it via plugin in my IDE and now I wanted to change to the consol. I use the build : NVIM v0.5.0-727-gc10c2fab5\ OS: Windows 10 Terminal: Windows Terminal with ...
0
votes
1answer
36 views

Adapt side panels to different screen resolution (aspect ratio)

How can I adopt side panel plugins (TagBar, TagList, NerdTree, etc) width to current screen aspect ratio? Using Vim with many different computers makes me a bit trouble to write one portable config ...
0
votes
0answers
41 views

Why session in Vim did not save buffer from other folder rather than ~?

I use gVim on windows and save my current working files to session. However, when openning old session, it did not load files from other folder except home folder ~ (where I store my _vimrc file). My ...
2
votes
1answer
122 views

Why it enters 'replace mode' automatically even with '--clean' flag in WSL?

To demonstrate the whole reproducing process, I make a video: https://youtu.be/UD38-wnwGnw As you can see, I enter my vim with '--clean' flag. No vimrc, no plugins, but it still enter the 'replace ...
1
vote
2answers
324 views

Check if a specific window is open

I have a window in vim opened (current file) and another one in split called [Scratch]. I want to check if the [Scratch] is open or not. Any example is appreciated.
2
votes
0answers
25 views

Can I define window position/contents via command line arguments ? Maybe a sort of parameterised session file? [duplicate]

I would like to open, say, 4 files and then have windows arranged in a grid so that the first file was in top left, second bottom left, third top right and fourth bottom right. So a command like this (...
1
vote
1answer
26 views

How can I alter the window to which ctrl+w, ctrl+p will jump to?

What I'm looking for is a programmatic way of changing which window Ctrl+w, Ctrl+p will jump to. The reason why I want to do this is that I have an autocmd like the following autocmd BufEnter ...
0
votes
0answers
268 views

A problem regarding the fragility of multiple windows viewing the same buffer

Problem Statement (concise, but inexact, version) Windows viewing the same buffer are fragile in the following sense. Consider a complex arrangement of tens or hundreds of windows, distributed amongst ...
0
votes
0answers
134 views

Change cursor shape in Vim PowerShell

I have looked through the web but I have found no answer to this. https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes The above website mentions ways to do it in terminals but not when ...
3
votes
1answer
63 views

How to make gf behave like :drop

When I'm in a python file and I go to the imports, put the cursor on one of them, and type gf, it opens the corresponding file in a new buffer in the same window, even if the file is already open in ...
3
votes
4answers
643 views

How to scroll in another window without switching to it?

There is a keybinding in Emacs that lets you scroll in another window that you're not currently working on (C-M-v to scroll-other-window-down and C-M-V to scroll-other-window-up). For example, in a ...
0
votes
0answers
16 views

saving a .v file triggers it to be opened in another window and gets E:325 in neovim

After trying to save a .v file, it triggers a new window to be opened with e:325 error with swap file already exists. This only happens to .v files. This only happens when neovim is opened from that ...
0
votes
0answers
42 views

NERDTree causes Vim exiting when open two buffers on same window

Here is what is happening: I open one file, either with o in NERDTree or with :edit file_a. I open another file, again with o in NERDTree or with :edit file_b, and the file opens at the same window ...
0
votes
2answers
22 views

Vim misses a few files when opening multiple files

I use vim -o a* to open 25 files (filenames starting with 'a') together and search & replace (:windo %s/old/new/gcI) some common word in these files. Later I found that not all of them have been ...
1
vote
1answer
225 views

How to populate the preview window?

I need to show a 'prompt' in the preview window when the user makes a selection of an item in a popup window, which is similar to the way the tern-for-vim completion plugin does in Javascript files, ...
0
votes
1answer
21 views

Window sizes do not stay the same if a new window is spawned

I use Vim to do some C coding and for this I installed the YouCompleteMe extension. This extension, among other things, provides source code autocompletion and when I select an item within the menu, a ...
1
vote
1answer
155 views

How do I set a final size to a split in vim

I fond out how to resize a split on the fly in Vim but I would like to have a fixed size to some split (like the NERDTree split it always has the same size). So basically I am using Vim Plug as a ...
3
votes
0answers
73 views

How to preview Markdown in a Vim buffer?

I'm aware of some of the Markdown plugins for Vim, but I want the functionality VS Code and Atom provide, namely being able to split the editor screen and render a live Markdown preview in an adjacent ...
1
vote
0answers
54 views

How do I make the contents shift less when vertically resizing a vim window?

If I open a long file in vim or neovim, and my cursor is not on the first line, and I make the window shorter by either resizing the terminal, or adding another split with <C-W>s or :sp<cr>...
2
votes
2answers
76 views

Move to window if specified buffer is opened

I am currently trying to write myself a function the will let me show or hide (toggle) the :terminal window. The only way to hide it, as far as I currently know, is to just navigate to that window and ...
1
vote
3answers
181 views

How to open multiple file with single split command?

I can open and split multiple file like this :split file1 :split file2 :split file3 But is there any way to open multiple files in a single command? Something like this :split file1 file2 file3
0
votes
0answers
34 views

Is it possible to make some animation in vim

This issue may be a kind of nonsense but I still want to know if it is possible to make some dynamic stuff in vim 7 or vim 8. For example, load a file and make if move from left to right (just like ...
0
votes
0answers
15 views

Any way to raise a dialog similar to `z=`?

z= on misspelled words shows a dialog (set spelling before). Can I get the dialog by a function?
2
votes
1answer
551 views

How to open a terminal horizontally on the right side of vim

I'm using vim 8 and I set a shortcut to open a terminal in my vim. nnoremap <F5> :wa<CR> \| :term ++kill=term<CR> It works except that it opens a terminal vertically as below: ----...
0
votes
1answer
26 views

How to display MiniBufExpl window on the top

instead of the default display of the MiniBufExpl window on the bottom, I would like to have it on the top, is this possible?
1
vote
1answer
39 views

How to open a new window and edit it in an automated fashion?

Consider the following function function! Exp() call feedkeys(":new ~/.vimrc\<CR>") call search('F') endfunction My expectation from Exp() was that if I call Exp() then 1) I see my ...
1
vote
2answers
260 views

How to manage windows properly

I've used two plugins with vim: Nerdtree and Taglist. However, if I quit the opened file and open another file in the Nerdtree, it will become: Which means that the new opened file is displayed at ...
1
vote
0answers
19 views

Get/set window line, column without navigating to window

I'm looking for three functions (line, col, cursor) in nvim that takes an extra parameter window number so that I don't need to first navigate to the window and then navigate away. The reason is if I ...
4
votes
4answers
387 views

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

Does Vim have functionality similar to tmux's display-panes command for selecting (goto) a specific window by number? Sometimes when I've many windows open, it can be a pain to navigate them by C-w ...

1
2 3 4 5