2022 Developer Survey is open! Take survey.

Questions tagged [terminal-buffer]

A terminal emulator within vim, eg created by :terminal or term_start()

Filter by
Sorted by
Tagged with
0 votes
2 answers
15 views

How to get nnoremap <buffer> to work in different buffers?

I have a hotkey that runs python of the first buffer when I press F8 and outputs the outputs to the bottom. However, this hotkey does not work when I switch buffers... it only works when I am on the ...
user avatar
  • 25
1 vote
0 answers
30 views

How to visually select entire broken line in NeoVim terminal

(I'm using NeoVim, vsplit term://zsh) If I have a long terminal line that gets broken, and go into visual mode in order to copy something, selecting the entire line does not work as I expect: |$ ...
user avatar
1 vote
1 answer
44 views

How can I execute a non named file on terminal with NeoVIm?

Some time ago, I've made this question where I asked how to execute a file on the terminal with NeoVim... The solution I found was the following :terminal bash % . Knowing that, I made the following ...
user avatar
  • 375
0 votes
0 answers
19 views

Avoid insert mode jumping to end of line in terminal pane

I would like my terminal panes to behave more like a normal text buffer. When I've got a modifiable terminal pane, and I want to modify a long command from normal mode, hitting i or cl doesn't work ...
user avatar
  • 103
0 votes
0 answers
19 views

How to jump to previous file (buffer) ignoring terminal buffers?

I am look for a way to jump to a previous file (but not a terminal window) in NeoVim. Lets say I have this flow: open a code.py file open test_code.py file execute tests using :term pytest commmand ...
user avatar
  • 1,073
0 votes
0 answers
42 views

How do I paste with newlines on a terminal tab?

I can open a terminal by typing :terminal, however it doesn't paste newlines, so it concantenates everything as a single string. Why does this happen? I am using neovim on windows 10, could this be an ...
user avatar
  • 101
1 vote
1 answer
115 views

How to configure options in :terminal (NeoVim)

I've read the help section for term, terminal, termopen, buftype, and I've read several stack questions, but I haven't been able to find a solution for settings options in terminal mode. I know about ...
user avatar
0 votes
0 answers
35 views

Change the cursor appearance in :terminal that uses cmd.exe?

How can I change the style of the cursor in :terminal under Win32 gvim? Using a clean config my cursor in Terminal mode (typing to shell) looks too much like my cursor in Terminal-Normal mode. gvim --...
user avatar
  • 485
0 votes
1 answer
37 views

Prevent vim from being launched in vim

When I'm using the terminal feature on nvim sometimes I run the last command again out of habit (thinking that I'll re-run the unittests for what I'm coding at the moment or something), but the latest ...
user avatar
1 vote
1 answer
52 views

How to change the directory highlight in the terminal buffer?

I have a theme which is great apart from some minor things. I could already change the LineNr highlight and some others, but can't seem to change the directory highlight in the terminal buffer, which ...
user avatar
  • 123
0 votes
0 answers
63 views

Mapping an keyboard shortcut to interrupt the terminal window

I have program running in the neovim terminal window, and I want to interrupt it. I can do so by moving to the window, <C-W>l, going into insert mode, and pressing <Ctrl-C>. Normally, at ...
user avatar
  • 101
0 votes
1 answer
42 views

Unable to resume backgrounded Neovim-terminal-emulator-process using `kill -CONT`

So, I'm trying to find an actual solution to another question on here that doesn't really have one. However, I'm running into a problem with backgrounding/foregrounding behaviour. I need to background ...
user avatar
1 vote
1 answer
43 views

Run :terminal so it starts in terminal-normal mode?

I want to run an async command and when it completes open a terminal window. Since the opening is delayed, I don't want it to steal input from me, so the new window should be in Terminal-Normal mode. ...
user avatar
  • 485
1 vote
1 answer
94 views

`termwinsize` cannot be accessed from Python 3

The option termwinsize cannot be accessed from Python 3. Input python3 << EOD import vim for window in vim.windows: if (window.buffer.options['buftype'] == b'terminal'): window....
user avatar
  • 249
1 vote
1 answer
272 views

Remap enter Terminal-normal mode Neovim to something else than Esc

I have remaped enter terminal normal-mode to <Esc> with: tnoremap <Esc> <C-\><C-n> and it does work. But I am using zsh vi-mode, which also requires the use of <Esc> to ...
user avatar
  • 11
0 votes
1 answer
96 views

How can I append to a terminal buffer in vimscript?

I am trying to implement a vimscript function which appends to a terminal buffer. It works when I write this as a single mapping which uses the normal mode 'a' command to append: nnoremap <Leader&...
user avatar
0 votes
1 answer
39 views

The remap doesn't resize terminal window

nnoremap <leader>rt :term<cr> <C-\><C-n> :resize 10<cr> i I've tested the remap manually, it works as expected. A terminal window spawns I go into terminal normal mode, ...
user avatar
  • 115
2 votes
1 answer
71 views

How do you exit a terminal buffer unless in a pager

In a terminal buffer, I want to auto-exit when I press "kk". Except for when I'm in some interactive session, like a pager (like the pager which is created when you git diff). To do that, I ...
user avatar
-1 votes
1 answer
155 views

Split Navigation in vim terminal [duplicate]

I use vim splits quite a bit. To switch faster, I use this shortcut instead of doing ctrl + w + h/j/k/l/ " Quicker window movement nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w&...
user avatar
  • 1
0 votes
1 answer
47 views

Prepend text to all commands in terminal mode

I would like to prepend clear; to all commands in terminal mode. This reduces the amount of 'clutter' in my terminal screen and makes things slightly clearer for me.
user avatar
  • 103
0 votes
1 answer
62 views

Call range argument to execute in python terminal embeded in vim

Initial window: My expectation: to copy whole or a part of python code in the right window into the left window's python terminal and execute. My .vimrc setting: function! CopyPasteBuffer() ...
user avatar
  • 820
2 votes
0 answers
48 views

How to retain terminal colors inside the Vim terminal (-NOT- in GVim)? [duplicate]

My default terminal look: will turn into this in the Vim terminal: It's not a huge deal, but the former is easier on my eyes - and this doesn't happen on my other box... Tried to compare ...
user avatar
  • 308
0 votes
0 answers
94 views

Eye torturing colors in Vim/GVim terminal

I am using GVim but this happens in terminal Vim too. I use the Gruvbox theme. Whenever I start the terminal using :term, I see too blue colors when I change the directory within the shell. The ...
user avatar
-1 votes
2 answers
74 views

<BS> and <C-w> delete entire line in (terminal mode from a command) instead of a single character

I'm creating a mapping which is supposed to navigate to a specific window (call TEST_WIN), focus in on the terminal and then delete a single character. The goal of this command is to navigate to the ...
user avatar
  • 101
1 vote
0 answers
37 views

Terminal window interprets quick initial q as macro record

I have a function that opens a terminal window running some program. The program is quit by pressing q. But when I press q in the terminal window shortly after (within 1-2 seconds) of it being opened, ...
user avatar
  • 295
-1 votes
1 answer
56 views

How I can convert into the right characters?

I'm getting something weird characters in :messages. How can I get the right results? reproduce steps define functions. let s:rails_console_id = 0 function common#utilities#open_rails_console() ...
user avatar
0 votes
2 answers
4k views

How to hide terminal when not needed?

In VScode ,we are using ctrl+j to hide the terminal. Then if we press ctrl+j again, it will open the same terminal. Is it possible in VIM/NEOVIM? I tried :Terminal ,but there is no straightforward way ...
user avatar
1 vote
1 answer
122 views

Reopen a terminal window running an active job

How do I reopen a terminal window with an active job if I hide the terminal window? This is similar to the following question: Close vim 8.1+ terminal buffer without unloading. In this case, however, ...
user avatar
0 votes
1 answer
360 views

how i set floatterm plugin in neovim , that shortcut F5 compile javascript and how i do for other languages?

i plugged float-term plugin , that open terminal window in neovim. when i compile javascript with node in float term i did like :FloatermNew node % then it compiles fine and show me the output in ...
user avatar
  • 25
-1 votes
1 answer
588 views

How to compile a program and open the output in a vertical terminal window?

How can I write a command that does the following? With one mapping, compile and/or run a program based on the filetype (*.c, *.cpp, *.js, *.py, etc.), and open a vertical terminal window with the ...
user avatar
  • 25
3 votes
1 answer
38 views

Word completion ^P / ^N is very slow because of scanning a :term buffer

I open a terminal window inside of a vim session and leave it there for weeks, use it for compilation, running and debugging my code. After couple of days the length of the terminal buffer grows over ...
user avatar
  • 133
1 vote
0 answers
31 views

How can I keep my cursor normal after exiting a terminal buffer?

Right now, whenever I open a terminal with :term, my cursor changes from a half-height/orange cursor to a full-height/gray cursor (depending on the emulator). When I navigate back to another window, ...
user avatar
  • 13
0 votes
0 answers
126 views

How to hide a buffer thru vimscript, with buffer number or buffer name

I'm trying to make a plugin that hide and show a terminal window on the bottom of the window, but i can't find a reliable way to hide a specific buffer, i tried using hide but you only can hide by ...
user avatar
2 votes
1 answer
73 views

Yank visual selection with modifications in a terminal-buffer

Upon writing a code, sometimes I open a terminal split with :term to test it by issuing some commands and checking some output. As an example, this is a fragment of what I have executed in a split ...
user avatar
  • 2,143
0 votes
1 answer
72 views

switchin back another viewport from the terminal buffer [duplicate]

I created :term, then I switch to another viewport, but latter when I switch back to the term buffer "!/bin/bash" it is full screen and I don't understand how can I access the vim command ...
user avatar
3 votes
1 answer
275 views

Close vim 8.1+ terminal buffer without unloading

I'm looking to be able to close a terminal buffer without unloading it, as I would with a normal buffer and either hidden or bufhidden=hide set. It appears, though, that said options are ignored for ...
user avatar
  • 141
2 votes
0 answers
163 views

How can I clean the program window when using Termdebug?

The window named gdb program (see :h :Termdebug) is the one where I can give input and view output of the program being debugged. How can I clean it between one run and another (or when I like, in ...
user avatar
  • 1,562
1 vote
0 answers
107 views

:term command changes cursor type in vim

I have set the cursor shape to be - I-beam in my terminal preference. When I execute :term command in vim, the cursor type is changed to block type. This change is retained even after I exit the :term ...
user avatar
  • 111
2 votes
1 answer
300 views

How to find the buffer number of a :terminal?

I can see that I've got a terminal buffer open by running :ls R which finds all buffers with a running terminal job, but I don't know how to capture just the buffer number. The closest I can get is ...
user avatar
0 votes
1 answer
98 views

Map a key on a terminal buffer whose corresponding job is already finished

The context I have mapped <c-p> in terminal mode so that it deletes the terminal buffer where the cursor is. The way I've created this mapping is presented below tnoremap <c-p> <c-w&...
user avatar
  • 225
1 vote
0 answers
21 views

why is the terminal output resized, after the command is executed, when moving it from a function

The problem I'm trying to write a function that outputs a shell command in a terminal vertical split. Vim's terminal, as any terminal, will break lines that are wider than the terminal window. As ...
user avatar
  • 2,370
0 votes
0 answers
150 views

Make vim commands be executed once a job on a terminal buffer has finished

The context I've the following mapping in ~/.vim/ftplugin/cpp/mappings.vim. What this mapping does is to compile an arbitrary C++ file and open two windows (a) and (b). (a) shows the output of the ...
user avatar
  • 225
3 votes
1 answer
417 views

How can I pass extra arguments to gdb with Termdebug?

While using Termdebug, occasionally it would be useful to pass extra arguments to gdb (for example, -x). I've tried :Termdebug -x <my_file> <command_to_debug>, but that just seems to ...
user avatar
5 votes
2 answers
2k views

How can I change the colorscheme of the vim terminal buffer?

I use GVim with the gruvbox colorscheme. When I open a terminal inside vim with :term, the colors are different, it looks like another colorscheme is applied. The other terminals I use (urxvt and ...
user avatar
  • 270
7 votes
1 answer
631 views

prevent line wrap in terminal buffer

I can easily see the output of a command in a split using vim's terminal For example, I use :vertical terminal make re a lot. This example is also stated in the help (h :terminal): Or to run build ...
user avatar
  • 2,370
2 votes
1 answer
444 views

Concatenate vim command after :terminal

Is there any way I can concatenate a command after :terminal? For example :terminal | <some_other_vim_command> will pass | <some_other_vim_command> to the terminal that just opened, but ...
user avatar
  • 21
0 votes
1 answer
318 views

Neovim, read entries from the terminal into quickfix buffer

I made my own vim wrapper around ripgrep (I know there is vim-grepper, but I wanted to try customize some things). The crux of it is I populate a quickfix window as follows: let searchString = input(...
user avatar
1 vote
1 answer
141 views

Function to toggle terminal creates extra empty buffer

I have modified a function from CKolkey's dotfiles - ToggleTerminalDrawer (line 230) so that it works for Vim8.2 (instead of neovim). Here is my modified function now in my vimrc: nnoremap <silent&...
user avatar
1 vote
1 answer
257 views

Query an environment variable in a terminal buffer

I have a vimscript which needs to query a environment variable which gets set on terminal buffers. How can I do this? I tried looking through the help to see what term / job commands could be used to ...
user avatar
1 vote
1 answer
232 views

Setting coloring in :term on urxvt

I use the URxvt terminal emulator, and echo $TERM returns rxvt-unicode-256color. In vim, if I run :echo $TERM, I get the same result. However, if I open a terminal window with :term and enter echo $...
user avatar
  • 1,562