Questions tagged [terminal]

A terminal emulator (or terminal, for short) displays characters, colours, and the cursor on the screen. Vi & Vim are run inside of a terminal, gVim is not.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 views

How to run a command in neovim's terminal mode without leaving this mode

Suppose ALT+h to mapped to <C-\><C-N><C-w>j as following Nvim documentation: nvim_terminal_emulator. We have two horizontally split windows with terminal buffers and the right window ...
0
votes
0answers
25 views

How to scroll the screen in terminal mode in neovim

In insert mode, we can use PageDown/Up or <Shift-PageDown/Up> to scroll the screen. But this fails for terminal mode. How can we achieve this in terminal mode? I'm using zsh on the Arch Linux ...
4
votes
2answers
3k views

Neovim Gray Background

Problem Anytime I switch to a colorscheme the background turns this ugly gray that gives everything a washed out look. Why does this happen, and how can I prevent it? Example screenshot— More ...
1
vote
1answer
29 views

How to put cursor in the right position after switching from normal mode to insert mode in terminal

After launching a terminal inside vim via :terminal, vim doesn't put curosr in the right position after pressing i in normal mode. As seen in the following picture, the cursor is put at the end of the ...
0
votes
1answer
13 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&...
0
votes
1answer
20 views

How can I execute commands or move to other tabs without first closing the terminal executed by `:term`?

I've created a new terminal by executing :tabnew +term. How can I execute other Vim commands or move to another tab without first closing the terminal (:term)? Currently, all input is directed to ...
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
117 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 ...
1
vote
1answer
43 views

How do I get the name of the current terminal in Vim?

I'm currently running Vim in Windows 10. I want to specify in my config file certain settings for when I'm running Vim in Cmder, different settings when I'm running Vim in Alacritty, etc. When in ...
2
votes
1answer
20 views

$TERM specific NeoVim configuration

I spend half the time in a TTY (Linux console as in Ctrl+Alt+F2) and the other half in a X session. Unfortunately the color scheme I use for NeoVim in the graphical environment on xterm does not look ...
0
votes
1answer
57 views

Ctrl keybindings not working in wsltty

I have the following mappings: nnoremap <C-,> :tabe ~/.config/nvim/init.vim<cr> nnoremap <C-/> gcc Neither of these mappings is working - they both do nothing. I have a plugin ...
2
votes
2answers
85 views

How to activate bracketed paste mode in GNOME Terminal for Vim inside tmux

Edit this issue happens inside a tmux session. The original value of $TERM before starting vim is: echo $TERM screen The issue appears for example when pasting this kind of indented code: def ...
7
votes
3answers
221 views

how to change local directory of terminal buffer whenever its shell change directory

After :term ++curwin zsh, I use that buffer as an alternative of tmux window. But there is one caveat, if I cd in zsh, vim will not know. Which cause problem in below case In terminal normal mode, ...
0
votes
1answer
16 views

How do you open text files exclusively for writing so that other applications cant access it at that time?

How can I restrict my other terminals from accessing one of my already opened file (within vim)? Sometimes I forget which one of my terminals has that particular file already opened and again open it ...
1
vote
1answer
26 views

How can I use the `:term` command without closing the current window on exit?

I often use the :term command in my projects to create new directories or perform other work. However, if I have multiple windows open, then executing :term from one of them will also close that ...
0
votes
1answer
38 views

Vim takes a long time to close over SSH?

While ssh'd into my server, vim hangs for a variable amount of time (about 2 seconds, but can be longer or shorter) when opening and closing. It's worth noting that (to my eyes) the delay is the ...
0
votes
1answer
20 views

How to I use terminal-function-details?

recently started working in the terminal Vim provides with :terminal. Reading through the man pages of this I reached the section on Terminal functions, which seem quite interesting. However, I'm not ...
2
votes
1answer
54 views

Neovim does not restore terminal cursor on exit

The cursor of my gnome-terminal is an underline _. I am using Neovim and I want the cursor in Command Mode to be: block | set guicursor=n:block-Cursor When I exit from Neovim I want the cursor back ...
1
vote
1answer
25 views

Cannot run basic Windows commands using :terminal

I have the GVim 8.1 compiled with +terminal flag. After I enter Vim via vim -u NONE, I try to execute simple command, like :terminal cd or :terminal dir just to check the output. Instead of the ...
2
votes
2answers
133 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:...
4
votes
1answer
68 views

Why does custom map of <c-w><space> cause mapping delay in terminal mode?

I'm using <c-w><space> to open current terminal buffer in a new tab: tnoremap <c-w><space> <c-w>:tab split<cr> This map cause <c-w><c-w> trigger ...
1
vote
1answer
26 views

Cannot read output of ./a.out

My current keybinding for compiling cpp files is: autocmd filetype cpp nnoremap <F2> :!g++ -g %<CR>:!./a.out<CR> When I press F2, vim escapes to the shell and a.out executes well ...
7
votes
1answer
116 views

Difference between `:!{cmd}` and `:w !{cmd}` regarding alternate screen

On a Linux platform I see this difference of behavior between running a shell command with :!{cmd} (which just runs the command directly) and with :w !{cmd} (which passes the buffer as standard input ...
4
votes
4answers
137 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
vote
1answer
23 views

Shortcut for binding same command to multiple key

Is there any way to map same command to multiple key without repeating mapping. Like mapping this one inoremap ) <right> inoremap " <right> inoremap ] <right> into something like ...
0
votes
1answer
12 views

'include=^\s*\(from\|import\)' error in vim

When I type :set inc it doesn't work and below status bar shows include=^\s*\(from\|import\). Even when I turn on GVim it shows include=^\s*#\s*include error. Here is my .vimrc file set nocp ...
43
votes
5answers
33k views

How to map Alt key?

I'm trying to map Alt key in the following way: :map <A-j> j :map <A-k> k but it doesn't work (bell is rang on Alt + j/Alt + k). What am I missing? I'm using Terminal on OSX, the same ...
0
votes
0answers
20 views

Vim not rendering text when moving up

I can move down until the last line of a file with no issues. However, when move up the text that was out of screen bounds does not render (as shown by the figure) until i press Ctrl + L to force ...
0
votes
1answer
278 views

Hide terminal buffer from buffer list

How do I keep the terminal buffer from showing up in my airline list of buffers? I assume airline just pulls buffers from what normally shows up in :ls. But I actually don't want the terminal to show ...
1
vote
1answer
33 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
58 views

Whats the benefit of using :term inside Vim compared to a separate terminal emulator app?

I am using iTerm2, which is working well for me. I've been using VIM for almost 2 years now, with MacVim. Then suddenly I became curious whether my coding experience will improve when I use terminal ...
1
vote
1answer
31 views

Job still running in buffer while :qa

I'm using vim 8 with some plugins and shortcuts. I set a shortcut for :term to open a terminal in vim: nnoremap <F5> :wa<CR> \| :term<CR> command Q qa So when I type F5, a ...
0
votes
0answers
11 views

Running a python command with terminal-generated signals enabled

I'm trying to do a long blocking read call inside a python script supplied with the python command: python3 << EOF import ctypes libc=ctypes.CDLL("libc.so.6") ch = ctypes.create_string_buffer(1)...
3
votes
3answers
113 views

How to map CMD+Alt alone to the command?

I am trying to map Cmd+Alt to start searching in vim (/). The only question is: how would I do this? I know to map Alt in vimscript is by typing <A> but I do not know how to do Cmd. I also want ...
4
votes
2answers
62 views

Ctrl-W at :terminal (default terminal behavior expected)

I am very fond of Vim's :terminal, though whenever I use Ctrl-w (expecting to erase the last typed word at prompt), Vim captures the key press and enters pane navigation mode. So I end up having to ...
1
vote
0answers
14 views

F10 is not yet available to Vim via gnome-terminal

I'm using gnome-terminal for first time (after using xterm for many years). And the one keystroke that no longer works within gnome-terminal from my Vim application is Function Key F10. I've turned ...
1
vote
2answers
3k views

How to use WSL's bash shell as default terminal of gvim/windows 10?

gvim 8 1-26 / windows 10 I'd like to use Windows Subsystem Linux (WSL)'s bash shell as a gvim's terminal instead of cmd. So if I type in command potion of gvim: :!.\test.sh, it will echo result ...
3
votes
1answer
411 views

How to use arrow keys mappings in vim-submode plugin on linux terminal?

Following this answer I've been using vim-submode for some months on a windows gVim. Now that I'm trying to apply the same configuration on a terminal vim on linux I have some problems: With the ...
0
votes
1answer
38 views

How to move the cursor out of the terminal

I'm now using Vim 8 and its new feature: :term. Well, it's great but I don't know how to move the cursor out of the terminal without the mouse. In Vim 7, we can type <C-w><C-h>, <C-w&...
1
vote
1answer
37 views

Mapping Shift-Up & Shift-Down, mintty keycodes

I am trying to create some keybinds (in my .vimrc) for vim, used from Cygwin's mintty. I have found and extended some code for the .vimrc that translates the keycodes used by mintty (https://github....
0
votes
1answer
63 views

how to prevent resize of my split windows on every call of term_start() if I do need to use 'termwinsize' option

I have 2 files opened in a vertically split window. I call term_start() and get results in a split window below. I use something like this: :let foo=term_start("some_script", {'hidden':1, '...
1
vote
2answers
40 views

Pasting text on Vim inside tmux breaks indentation

Ubuntu: 18.04 bionic tmux: version 2.6 VIM: Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 ) Included patches: 1-1453 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-...
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! ...
5
votes
1answer
9k views

Make vim show all the colors

I have a problem with making vim show a colorscheme fully (like in gvim). I've read about how to enable 256 color mode in terminal and it vim, but somehow it just doesn't work. The state of now is: :...
3
votes
1answer
54 views

customising Termdebug commands

There are commands such as :Break and :Continue, but I would like an :Until to run to the current line without setting a breakpoint. Is it possible to add this myself, or would it need a vim feature ...
32
votes
3answers
10k views

Can Vim interpret terminal color escape codes?

Many CLI programs output nicely-highlighted text. While most of them check if the output is going to a file, some include the terminal escape codes. I like the output with the escape codes, but ...
3
votes
1answer
122 views

ctermbg and ctermfg are backwards or incorrect for certain highlighting groups

I am currently attempting to create a custom colorscheme for vim by using ctermfg and ctermbg values, and checking what the colorscheme looks like with the highlight test file provided by Vim. What I ...
0
votes
0answers
37 views

How to get internal terminal's current dir name in vim? [duplicate]

I would like to start editing some files in dir to which I've switched in internal vim terminal. But I do not like to open nested vim inside this term. If I work in same dir in which I've opened vim, ...
1
vote
0answers
62 views

How do I prevent Vim from showing my terminal when executing an external command?

I'm running a long, blocking command using execute in Vim as part of a script. Vim shows the underlying terminal while executing the command, which is pretty distracting. function! DoSomething(query) ...
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
2 3 4 5 6