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
2
votes
1answer
59 views

Parsing winlayout() For Toggling Multiple Windows At Once

When working in vim, I like to have a toggle-able terminal window that I can bring with me from tab to tab. This works by tracking tracking a buffer, and opening it in a new bot split if it isn't ...
4
votes
0answers
27 views

gvim: Make the mouse follow CTRL-W_j and CTRL-W_k

I run a Linux/GNOME laptop where the focus follows the mouse, and I have vim's mousefocus feature turned on, so the selected viewport follows the mouse, too. But when I try to switch viewports using ...
4
votes
1answer
80 views

How to force which border shifts when resizing windows?

Is there some way to resize windows without using the mouse, such that I can control which border moves? It seems like it's ordinarily the bottom border or right border that moves, relative to the ...
1
vote
1answer
53 views

Split window vertically and edit visually selected file

I like what the shortcut Ctrl+Wf does, but I want to have a vertical split instead of horizontal. I managed to achieve this by defining the following mapping: nnoremap <c-w>f :vertical wincmd ...
2
votes
0answers
58 views

What is a pop_up windows? [closed]

Vim 8.2 has been released a couple of days ago and as I was reading I see that you can display somehow functions prototype, I am pretty exciting about this I hope documentations come pretty soon, ...
1
vote
1answer
54 views

How to work with multiple project folders in Vim?

I am often working with multiple projects at the same time. For example one main project and 5 related librairies. I have some issue to properly search in one project or multiple. I would like to: Be ...
1
vote
1answer
30 views

Why does :! open -a terminal or :! start cmd create totally new “applications”?

Edit: on Windows, looks like it's opening in sysWOW64 instead of system32. Any ideas why? Title. Basically, both of these commands are supposed to open a new console, the former on my mac and the ...
1
vote
1answer
27 views

How to close file/buffer/tab after cerain time of inactivity?

Is there a way to close file after certain amount of time of user inactivity? Lets say I have a encrypted file and I want to close it after 10 min. Is it possible in Vim?
0
votes
3answers
72 views

How to completely hide the seperator between windows?

I managed to hide the background of the seperator between open windows by using: hi VertSplit term=NONE cterm=NONE gui=NONE guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE However the fillchars ...
2
votes
0answers
38 views

Adjust terminal size using a system call from within Vim

All, I have a little function I'm trying to fix. I'd like to change my terminal Vim window size using the ASCII escape sequence \e[8;40;130t so that my writing window size stays the same when I use a ...
1
vote
1answer
36 views

Is it possible to have the cursor follow a newly-created window?

When I split my window (C-w v), is it possible to have the cursor automatically go to the new split right away? (I looked up switchbuf but I think that's something else; having to do with buffers ...
1
vote
1answer
44 views

Open quickfix/help in existing window [duplicate]

my usual setup is two vertically split windows. Lets say my cursor is in left window. When I vimgrep something, I would like for quickfix window to reuse already opened right window and automatically ...
1
vote
2answers
46 views

How to create a window for specific lines of a buffer?

Suppose we have a file: 1. un 2. deux 3. trois 4. quatre 5. cinq 6. six 7. sept 8. huit 9. neuf 10. dix I want to create a window that shows only lines 5--10 and nothing else. Modifying them should ...
1
vote
1answer
26 views

Closing the “list of files in a directory” when having Vim to open the directory

In the following screenshot, I demonstrate the following operations that shall yield a "buffer" that cannot be closed. My guess is that the list of files/directories is actually not a buffer. My ...
1
vote
1answer
30 views

Execute Vim command in terminal window and return to Terminal-Job mode

For a while, I'd been using :nnoremap <C-H> <C-W>h and :tnoremap <C-H> <C-W>h, et. al. to switch windows. This was working great, so when I started using tabs, I decided to ...
0
votes
1answer
56 views

Neovim: run cmd on write [closed]

I've got a file open in Neovim like so: neovim test.rb And a split open like so: :split ruby test.rb How can I rerun the split command each time I write a save in the original window? Update I'...
0
votes
1answer
25 views

Is it possible to have something that displays the filenames of all my unfocused windows?

Both the statusline and the tabline only show the file I'm currently working (on on my current tab). Is there any built-in setting that can show the names of the files that occupy the windows I'm not ...
1
vote
0answers
30 views

Vim unknown colored block

My vim on WSL has some unknown colored blocks. The weird thing is it happens randomly and some colored blocks would disappear when I pass them using cursor. The following is my .vimrc settings: ...
0
votes
1answer
26 views

Allow text to reflow in terminal mode after resizing

I opened up a terminal with :terminal. Then I ran a server process that prints logs whenever someone hits the API. Next, I resized gnome-terminal, but I noticed vim didn't update the view of the ...
1
vote
1answer
43 views

Open split window at far left

I use :vs to open a window. If I want this window to be the leftmost window, no matter what the currently active window is, how can I do it?
2
votes
2answers
115 views

How to get line numbers of a different window

I would like to get these line numbers of a different window without moving to that window. line('w0') line('w$') line('.') line('$') As for the first two, we can use getwininfo([{winid}]) which ...
1
vote
1answer
77 views

Is there a quicker way to go from the cmd window to normal mode?

Is it possible to map <esc> to close the cmd window and go to normal mode? Currently pressing <C-c> closes the cmd window but takes you into Cmdline mode. So you have to press either <C-...
0
votes
1answer
92 views

Can I specify '-o' as the default for vi in my vimrc?

When I pass the names of multiple files to vim on the command line (e.g. vim foo.txt bar.txt), I almost always want to add the -o option, because I would like them to be visible side-by-side in ...
1
vote
1answer
128 views

Lexplore and split windows

Like many, I like to browse using :Lexplore. However, as indicated by the manual, By default, :Lexplore will change an uninitialized |g:netrw_chgwin| ...
1
vote
1answer
27 views

How do I make the current tab's windows equal width but leave their heights?

I know <C-w> = equalises window sizes but I often want to keep the heights as they are. I have set noequalalways in my .vimrc as leaving it on ruins layouts when temporary windows open (like ...
1
vote
0answers
32 views

How to pin a file to a window(/viewport)

When I have multiple files open in multiple splits, when I open a new file via quickfix ( or Ctrl-P ), it sometimes ends up placing the new file in a window that I don't want to be changed. Is there ...
0
votes
1answer
35 views

how to close a single window by mentioning filename opened in that window

I want to close a window by mentioning window name in command line. For example, let's assume I have opened 1.c, 2.c and 3.c in different windows in vim. Now i'm in 2.c and i want to close 3.c. Is ...
0
votes
1answer
31 views

marks between windows

If I make a mark ma in one split pane and then from another I try to jump to it 'a I can't. I guess marks are stored per-buffer. Can I store marks per-tab?
0
votes
1answer
50 views

Equivalent of emacs `winner-undo` and `winner-redo`

Vim's C-w o is equivalent to Emacs's ESC ESC ESC, which closes all the Vim's windows (Emacs's buffers), except the current open one. In Emacs, with the command winner-undo and winner-redo one can ...
1
vote
1answer
97 views

<Alt> to enter normal mode on Windows

I'm new to vim, and I find using <Esc> to enter normal mode to be slow. I'm on Windows. I seldom use the <Alt> keys (left and right) when I'm editing text. It should be convenient to use &...
1
vote
0answers
321 views

YCM is not working with .ycm_extra_conf nor compile_comands.json on Windows

I have problems using YCM plugged for C-family languages. Here are what I have done: project layout -- build -- src -- source file dir0 -- include main.cpp -- source file dir1 ...
2
votes
1answer
31 views

How to close several windows with one mapping?

I use CTRL-W c to close current window. I expected that 5 CTRL-W c close 5 windows in row, but it's not. Now I just type CTRL-W c 5 times. What is correct way to do it and why it don't work as I ...
0
votes
1answer
129 views

vim command Termdebug doesn't show source code

If I open gdb in vim with Termdebug filename command it doesn't show source code in bottom window. cgdb works proper way with same filename.
0
votes
0answers
23 views

Displaying specific text only in the airline of a given window

Suppose that using bufwinnr() I find the windows number where a given buffer is being displayed to be 2. With that information, is there a way to display a specific string only in the airline status ...
2
votes
2answers
702 views

Always open terminal window at the bottom

My ideal editing layout would look like this (in Gvim): ---------------------------------------------------------- | | | | | N | ...
0
votes
1answer
142 views

Prevent a window from resizing [duplicate]

I nearly always have a terminal window open when I'm doing extensive editing in Vim. I've used tnoremap to set mappings for the three heights I want the terminal window to be able to take. ...
0
votes
1answer
59 views

vimL, how to get alternate window's current buffer number

Say, with 2 windows open in vim, cursor is window 2, how can I get the current buffer of the alternate window (window 1 in this case)?
0
votes
2answers
80 views

How to count the number of tilde lines in a window?

When the number of text lines is less than a window height, tilde (~) lines are displayed until the bottom of the window. I want to decrease the window height just enough to display all the lines and ...
1
vote
1answer
84 views

Binding horizontal scroll in a function with feedkeys

I'm trying to create a function to make editing TSV files easier. The function changes spacing settings, turns off wrapping, and creates a 1 row tall split at the top so that the column headers are ...
1
vote
0answers
49 views

stop updating screen until function finishes or manually call redraw

Does vim/neovim have the ability to manually disable screen updating? I run a function that jumps between a few tabs, update the content, and then go back to the original tab. The screen then flash ...
2
votes
2answers
500 views

Conditional window split

I have line to split window at start: au VimEnter * vsplit But sometimes it's annoying because I'm opening vim in small terminal, in this case I'd like to not split my window. I've tried this ...
2
votes
1answer
480 views

opening powershell from inside vim

I want to run powershell from vim and I have achieved it using the following mapping: map <leader>cd :cd %:p:h<cr>:silent !powershell<cr> The problem is that I can't do anything ...
0
votes
1answer
32 views

How come the splitted window failed to update its shapes along with the whole window

By the normal mode command :vs, I split the current buffer into two equally sized buffers. Then I resize the whole terminal window and only find the left portion of the screen remains the same as ...
0
votes
2answers
682 views

vim split horizontal resize shortcut

I can resize horizontal split windows by ctrl-w-shift-< and ctrl-w-shift->. I would like to have a shortcut for that. Close to the topic, recently I learned about the following maps: nnoremap &...
1
vote
1answer
142 views

How can I automatically preform operations when a vim *window* is resized?

I'm setting up NeoFormat/ALEfix-style code reformatting, and I'd really like to have it automatically and fluidly reformat the code as the window is resized. This is possible for whole-viewport vim-...
1
vote
0answers
55 views

How to auto save on *.coffee files when lose focus (in insert mode) then also back to normal mode

I'd like to lose focus when I'm in insert mode, to trigger auto-save on *.coffee buffers and also I need it to change mode from insert to normal mode to trigger Live compile feature of vim-coffee-...
1
vote
0answers
55 views

How do I open a tag with <C-]> but open it in an existing split?

I usually always have only two vertical splits open. One I use for actual coding and the other for reference. I would like to be able to search for tag in Window1 and have the result appear in ...
9
votes
1answer
397 views

Why does :bd # delete the current buffer when no alternate buffer exists?

Here is how I reproduce the behavior I am observing. First, I enter this command: echo aaaaa > a vim a In Vim, I enter these commands: :ls :e # :echo bufname('#') Here is the output of the ...
0
votes
1answer
72 views

Is it possible to not have the same buffer open in multiple windows?

When we have a buffer open, and we open a new one with :split or :vsplit, if in any opened window we execute :bprev or :bnext, we could have the same buffer open at the same time in both windows. Is ...
1
vote
1answer
73 views

How can I determine if *any* window in the current tabpage is in diff-mode?

So, I found this useful answer about iterating buffers; but due to the tabpage-specific duality of windows in Vim, I failed at adapting it to my needs. Thus: how can I construct a boolean expression, ...