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
1
vote
1answer
18 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
36 views

Neovim: run cmd on write

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
23 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
28 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
16 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 ...
2
votes
1answer
28 views

Reduce size of undo file

I had a very large (14 digit) decimal number in my (Windows) clipboard. I had vim open in normal mode on the command line at the time. Accidentally, I pressed some key/mouse combination that caused ...
1
vote
1answer
35 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
85 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
72 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
90 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
78 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
24 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
29 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
26 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
39 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
71 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
179 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
105 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
22 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 ...
1
vote
2answers
420 views

Always open terminal window at the bottom

My ideal editing layout would look like this (in Gvim): ---------------------------------------------------------- | | | | | N | ...
0
votes
1answer
82 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
37 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
69 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
74 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
42 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
488 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
396 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
30 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
552 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
116 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
53 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
48 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
306 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
71 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
64 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, ...
1
vote
2answers
234 views

How to start gvim from command line with predefine pasting from clipboard

I know gvim -c [command] samaple.txt might run command predefined in command body. How to paste text from windows clipboard at the end of sample.txt file?
5
votes
2answers
495 views

Detect if window has neighbour in given direction

Is there a robust way to detect whether a window has a neighbour in a given direction? So far, the only solution I found uses wincmd, let winnum = winnr() noautocmd wincmd h if winnum != winnr(...
1
vote
0answers
50 views

How to pass C-r to Vim terminal window? [closed]

In the Vim terminal I want to be able to search history in bash and ipython but C-r is already bound to basic Vim functionality. Is there any general way to pass this and other characters to the ...
0
votes
0answers
43 views

Highlight block of injected code [duplicate]

windows 10/ gvim 1-1802. I use Javascript and there are sometimes blocks of HTML code that need to be inside a particular region that can be indicated by """, for example . I have a similar ...
1
vote
2answers
2k views

Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'

I am new to vim. As much as I love it, there seem to be a lot of bugs or errors every time I try doing something. I am unable to run the plugin "browserlink.vim" (https://github.com/jaxbot/...
1
vote
1answer
72 views

How to have a buffer takes 1/4 of a window and another takes all the rest?

I have two buffers, and would like one takes 1/4 of a window and other takes rest of the window. Normal behavior would be for example sp or vsp would split buffer to take 50/50 percent each, there ...
0
votes
2answers
2k views

How to switch between buffer and terminal (cmd windows)

I have a vim's buffer and a terminal in the same vim's window but each time switch to terminal I can only exit it to go back to vim's buffer, Is there a way to keep terminal session but be able to ...
1
vote
1answer
417 views

Unable to Open NERDTree

I'm new to Vim, and for the paste couple of weeks, I've been using NERDTree with no problems. However, I recently added a few key mappings and am now unable to open NERDTree with the <C-n> ...
1
vote
1answer
116 views

Quit a window by its win_getid() identifier?

I use something like zoomwintab to zoom in/out of a single window view, using tabs to simulate the effect. It exposes a toggle function to zoom in on a single window, and to zoom back out to the ...
0
votes
1answer
133 views

Contextual key bindings when a specific context menu is open

I recently installed fzf CLI fuzzy search utility, and the accompanying fzf.vim file with it. They both work great, and I have been enjoying my experience with them thus far. However, I'd like to ...
1
vote
0answers
56 views

Disable regex searching in specific windows

I usually have about 4 or 5 windows open in Vim. Currently - one of my files is very large(in size) - a CPU cache trace. Every time I search with "/", vim searches all windows before returning the ...
1
vote
0answers
17 views

Resize windows “visually” [duplicate]

When I use tmux, I can hold Ctrl-c and continue pressing any of the 4 arrow directions I want to resize a pane: I then see the pane of interest resizing while pressing and I stop when I get visually ...
4
votes
1answer
532 views

How to lock a window height / width?

I jot notes in a tiny split window (buffer) regularly: <C-W>s :enew :res 5 ... jot jot... When I create a new horizontal split in the same tab, that little window resizes, as if doing <C-W&...