Questions tagged [terminal-buffer]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
12 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&...
1
vote
0answers
11 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 ...
0
votes
0answers
20 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 ...
1
vote
1answer
32 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 ...
2
votes
2answers
110 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 ...
4
votes
1answer
38 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 ...
1
vote
1answer
35 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 ...
0
votes
1answer
33 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(...
1
vote
1answer
37 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&...
1
vote
1answer
56 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 ...
1
vote
1answer
41 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 $...
1
vote
1answer
29 views

terminal api not working on gvim

vim 8 support terminal, and has a api to let command in terminal to communicate back to vim. For example: In vim, define function like " .vimrc let g:cnt = get(g:, 'cnt', 0) func! ...
2
votes
1answer
72 views

Remapping keys doesn't seem to work in the terminal-buffer [closed]

I'm a total beginner that sees vim as a potential simple IDE, (as well as a text editor). I had several questions, but that was confusing, so I'll stick with just one already answered. I like using ...
2
votes
0answers
28 views

Save terminal buffer's current working directory with mksession [duplicate]

I usually start vim at the root of my project. Then I open tabs with windows inside. Usually one of the windows has a :terminal. In the :terminal, I usually cd to/some/subfolder. At the end of the ...
0
votes
0answers
46 views

Positioning the terminal emulator cursor in Neovim

When in Normal mode in a Terminal buffer (as in :terminal) there's the Neovim's cursor and the shell's cursor. Going into Terminal-mode forgets your Neovim cursor and you're then using the shell's ...
0
votes
1answer
37 views

Rename neovim terminal buffer without breaking :mksession

Is there a "good" way to rename the terminal buffer in neovim? I know that renaming is possible with the :file command, and that works fine for current session. The problem with this approach is ...
1
vote
0answers
24 views

neovim: Keep :terminal active when I switch to other buffers

I use :terminal in neovim to run a dev server. But whenever I switch to other opened buffer(s), the terminal kills the process. Is there a way to keep the terminal running in neovim?
4
votes
1answer
133 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 a buffer, and opening it in a new bot split (if it isn't visible), or ...
3
votes
1answer
163 views

NeoVim - Go into insert mode when clicking in a terminal in a pane?

I'm trying to use NeoVim as a tmux replacement, and have found that no matter what I do, I can't get it to go into insert mode when I click in a pane that has a terminal in it. Here's the config I'm ...
2
votes
1answer
152 views

Making terminal buffer unlisted

I'm configuring my scripts to work with terminal in VIM and have a question regarding :h special-buffers. Among mentioned kinds there were the following: unlisted The buffer is not in the buffer ...
1
vote
1answer
66 views

How to start a terminal, so that on exit will call a function?

I recorded info of terminal buffers in a dict, and want remove bufnr of closed ones. Can you tell me how to start a terminal such that call a function on exit, eg, func! myterm#remove(bufnr): ...
1
vote
2answers
41 views

CTRL-V_CTRL-[key], instead of ^[key] gives ^[[27;5;[ASCII code of key]~ in xterm on Arch

For example, Ctrl-v_Ctrl-w gives ^[[27;5;119~ instead of usual ^W. It does behave in such way only on (u)xterm. I've tested it on st, lxterminal, xfce4-terminal and rxvt. I'm also 98% positive that ...
0
votes
0answers
39 views

Vim terminal job prevents from exiting

I'm writing a function which is supposed to create a terminal buffer once for the entire Vim session and which would not prevent it from exiting. Here is how it looks like: let s:term_buf_nr = -1 ...
1
vote
2answers
86 views

Make a buffer active by its number

I'm configuring a terminal buffer and now I have the following problem. I have only one terminal buffer and I need to make it active by its number to avoid lots of CTRL-w j/k/l clicks. Here is what ...
2
votes
2answers
131 views

Toggle terminal buffer vimscript function

I'm new to vimscript and writing a function to toggle a terminal buffer. Here is what I tried: let g:toggle_term = "<C-j>" let g:term_buf_nr = -1 function! ToggleTerminal() if g:...
1
vote
1answer
46 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 ...
3
votes
1answer
433 views

Is there a way to start vim in terminal mode?

I often find myself Opening a terminal Running vim Starting a :terminal Is there a way to say vim --start-terminal and have Vim automatically run :terminal ++curwin as soon as it starts?
1
vote
1answer
227 views

How does g:terminal_ansi_colors affect the :terminal colors?

:term usually looks ugly in most colorschemes I've tried. At least on Windows, with light themes, these colors do not work and end up in an unreadable shade of yellow against my light background. I ...
0
votes
1answer
52 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 ...
3
votes
1answer
48 views

Is it possible to use <C-H> (and J/K/L) for navigation inside a Vim 8 terminal?

I rebound control + H/J/K/L to navigate between splits without needing <C-W>: nnoremap <C-J> <C-W><C-J> nnoremap <C-K> <C-W><C-K> nnoremap <C-L> <C-...
1
vote
0answers
36 views

Autocmd commands for sharing terminal when open new tab

I was trying to create a trigger that does the following: When opening a new tab with a file, if there already exists a terminal buffer, it is opened below in this new tab. I have seen in logfiles ...
2
votes
2answers
166 views

closing :terminal / term_start() should quit vim if it's the last buffer

Situation: I've typed this: vim foo.js :terminal Now I have one split, a file editing buffer and a terminal. The good: I can quit by closing the terminal first, then the file buffer. The bad: But ...
1
vote
1answer
437 views

Vim terminal: How to split below by default?

Opening the vim terminal using :term, creates a horizontal split with the terminal placed at the top half of the window. Is there a way to open the terminal at the bottom half instead? I know I can ...
1
vote
0answers
66 views

Random characters appear in my buffer but they are not part of the current file

I really don't know what details to give except for some screenshots and my vimrc file, I think it is because of a plugin but I am really not sure. Random characters just appear. Note that they are ...
2
votes
1answer
377 views

How to copy long line from terminal buffer as it is without adding new lines?

I wanted to copy a public key from one machine to the other. I opened up vim and had two terminal buffers - one for each machine. In the terminal in which I had the first machine I went into normal ...
1
vote
2answers
456 views

How to follow the output of a command in a terminal window

I recently decided to give a try at neovim and one thing is bothering me: I use a terminal window to run my code watcher i.e. a never ending command which outputs new lines each time I write a buffer....
1
vote
0answers
80 views

send <cr> to ipython in :term

When I am developing some python script, I regularly find myself running part of the code to see if it does what I want it to do. Currently I do this by copying the code that I want to run to the ...
1
vote
3answers
170 views

Command to copy from current window and paste the text into terminal buffer

I am having trouble crafting a command that would copy the text from the current window and paste this text into a terminal buffer opened in the split below. Here are a few things I tried: normal ...
0
votes
1answer
79 views

vim 8.1 send_termkeys problem

I noticed that, if I use call term_sendkeys(buf, "make\n") and then I try to execute something else in the terminal windows (i.e. ls), vim append the last string sent from command mode to the actual ...
1
vote
0answers
52 views

use pipe symbol in vim :term command [duplicate]

recently i stumpled over vim :terminal mode. i am really exited about that. now i wanted to ask, how i can create a mapping, which sends a command, including a pipe symbol to :terminal? it should look ...
1
vote
1answer
123 views

Using a login shell only for the :term command

I'm on MacOS, so basically all terminals are login terminals for me which source my bash_profile and load everything I need. However, the :term command does not source my bash_profile, I believe ...
0
votes
1answer
69 views

Ex command to put value of variable into terminal emulator?

Using a terminal emulator (with :term), I would like to insert the value of a variable at the terminal cursor. In a normal text buffer, I could use put =g:my_variable or exec ("normal! i" . g:...
1
vote
2answers
612 views

neovim key remap specific to terminal buffer

I have been using nvim terminal mode to learn python and I want to have Ctrl-C break the python script from the terminal window even when I am not in insert mode. However, I also want Ctrl-C in my ...
0
votes
0answers
868 views

How to hide terminal buffer without closing it?

I want to make toggleable window with terminal buffer similar to every IDE terminal feature. Currently i have mapped: noremap <F4> :botright 8split term://bash<CR> tnoremap <F4> &...
1
vote
1answer
620 views

How to keep the neovim terminal buffer in the buffer list even after it being hidden

My problem is similar to, if not same as, this issues. But I can't follow what they're talking about. The following steps are necessary to reproduce my problems: :sp :term :wincmd w :wincmd o :ls ...
0
votes
0answers
17 views

How can I reproduce a Linting Plugin Behavior

I'm trying to get in to plugin writing, and currently I'm doing some builds (like Latex and LanguageTools checker), and I have in place hotkeys that call for the compilation, and It throws the output ...
1
vote
2answers
451 views

How to go up to previous command when in terminal mode in Vim 8?

I am new to Vim. I managed to use :terminal and :vertical terminal to have a terminal side by side with my code. This works great, I can move between my code and the terminals. However, how do I go ...
0
votes
1answer
105 views

Identifying the PID of Vim 8.1 internal terminal launched with :terminal ++close

When launching an internal Vim 8.1 terminal for an exclusive program like in terminal ++close ipython, is there a way to identify from vimscript which is the PID of the launched process (i.e. of the ...
0
votes
1answer
150 views

In Vim 8.1, “:term ipython” gives a different version of IPython than typing “ipython” on an already open terminal

When I open a Gnome terminal in my Ubuntu 18 and execute the command ipython, I start an Anaconda IPython terminal version 5.8.0. Within Vim 8.1, that is what I also get if I first open a Vim terminal ...
3
votes
1answer
94 views

Unmapping the global mappings on a per-buffer basis

I have the following mapping in tnoremap <Esc> <C-\><C-n> init.conf to exit insert mode while in the terminal. In certain terminal buffers I would like to not have that global ...