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
79 votes
8 answers
80k 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 ...
kenorb's user avatar
  • 17.7k
53 votes
5 answers
21k 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 ...
beatgammit's user avatar
  • 1,213
42 votes
3 answers
14k views

Can I use a non-monospaced font in either Vim or gVim?

Is there any way to use a non-monospace font in either vim or gvim? I tried changing the font for gVim with: :set guifont=Dejavu\ Serif\ 12 But this gives me some rather ugly results: I get the ...
Martin Tournoij's user avatar
40 votes
5 answers
5k views

Terminal borked after invoking Vim with xargs

I've sometimes tried invoking Vim using xargs, like this: find . -name '*.java' | xargs vim … which kind of works: As Vim launches, I see the following warning flash briefly: Vim: Warning: Input ...
200_success's user avatar
  • 9,209
28 votes
3 answers
15k views

Can the split separator in vim be less than a full column wide?

I use a tiling window manager (awesome) + a terminal multiplexer (tmux) + splits inside of vim. I have no window decorations at all, so there is no visual split between them at all if the content of ...
Caleb's user avatar
  • 2,215
24 votes
2 answers
8k views

Prevent Vim from clearing the terminal after exit

If I do: $ less file And press q to exit less, I stil see the same text as I had on the screen when less was still running. However, if I do $ vim file And :q, my terminal is blanked... ...
Martin Tournoij's user avatar
23 votes
3 answers
14k views

Scroll the screen, not the cursor, when using scrollwheel

I'm using Vim in a terminal, so scrolling with the scroll wheel uses the \e[A and \e[B syntax (where \e symbolizes \x1b, or escape). However, Vim interprets this by moving the cursor up or down a ...
Doorknob's user avatar
  • 14.6k
17 votes
3 answers
26k views

How could I create a terminal at the bottom

I could create a terminal with vim by running :term in the vim normal mode. However, this terminal is opened at the top of the window and I would like to open it in the bottom. How could I open it at ...
coin cheung's user avatar
17 votes
1 answer
27k 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: :...
sygi's user avatar
  • 271
16 votes
2 answers
4k views

Tmux is changing part of the background in vim

This only seems to happens when using vim inside of tmux. I'm also using iTerm 2. If I create a new tmux pane or resize a tmux pane, it immediately looks like the this: And then the only way to fix ...
aharris88's user avatar
  • 1,817
15 votes
4 answers
3k views

How to label tmux tabs with the name of the file edited in vim?

Whenever I open a tmux session in terminal, all of the tabs containing vim sessions are labelled vim. My question is: How to configure it to label tmux tabs with the name of the edited file or ...
Mayukh Sarkar's user avatar
15 votes
2 answers
9k views

Why doesn't my numpad work right in my terminal?

In several terminal programs, such as PuTTY, SecureCRT, iTerm, and Mac OS Terminal, if I have NumLock on and I press the number pad (numpad) keys 0123456789 in insert mode, my vim looks like this: y ...
Jacktose's user avatar
  • 823
15 votes
1 answer
319 views

Using <C-,> causes "<80>ü^D," to flash in the showcmd area?

I've mapped <C-,> as well as some other special keys (<C-Enter>, <C-S-Space>, ...) in my vimrc like, :set <F13>=^[[44;5u :map <F13> <C-,> :map! <F13> <C-...
ivan's user avatar
  • 1,420
13 votes
9 answers
33k views

Colorscheme's background not correct in terminal

I imported the solarized colorscheme and palette. My terminal has the correct colors and background, gvim has the correct colors and background, but vim has an incorrectly colored background. The text ...
Oberdiear's user avatar
  • 191
13 votes
2 answers
2k views

Detect neovim terminal from bash in bashrc

Does neovim set any environment variables that would let me detect from bash that the terminal is neovim? I want to change the behavior of my .bashrc if neovim is the terminal.
Praxeolitic's user avatar
  • 2,388
13 votes
3 answers
1k views

Scrolling issues when the `wrap` option is set

I find myself dealing with this issue every time the wrap option is active (in my particular case whenever I'm working with markdown files). What happens is that, while scrolling up and down the ...
zool's user avatar
  • 982
12 votes
3 answers
4k views

Mapping Ctrl+s does not work

I am trying to map Ctrl+s to save my file however it does not work. My mappings: map <C-s> :w <CR> :echo "Saved" <CR> imap <C-s> <Esc> :w <CR> :echo "Saved" <...
iProgram's user avatar
  • 1,569
11 votes
3 answers
8k views

I can't move around the document while editing

I am working on a ChromeOS computer with both Vi and Vim. When I open up the editor to an existing document, I type A to begin editing. When I try to move around with my arrow keys, the following ...
Elliot A.'s user avatar
  • 113
11 votes
1 answer
436 views

What is causing my cursor to look so strange? [closed]

Whenever I hit the end or beginning of a line, I get this very odd character where my cursor was. Any idea what may be causing this? I believe I have my fonts and theme correctly installed. I'm using ...
Sauce McBoss's user avatar
10 votes
3 answers
9k views

How to run internal vim terminal at current file's dir?

I edit file /home/me/projects/myproj/src/util.c And want to start terminal at /home/me/projects/myproj/src. Vim version > 8 so I can run :terminal but it always starts at folder in which I've opened ...
ephemerr's user avatar
  • 773
10 votes
5 answers
5k views

Use case for neovim terminal emulator?

One big difference of neovim and Vim is that neovim includes a terminal emulator that works asynchronously. However, I fail to see how can I profit from this feature. For what can I use it? Can you ...
cbaumhardt's user avatar
  • 2,069
10 votes
1 answer
9k views

Number pad not working with vi and Putty?

When I am editing a file in vim via SSH, I will try to use the number pad on my keyboard to enter long numbers (like IP addresses). Vim does not seem to like that very much. I am using PuTTY for ...
Questionmark's user avatar
9 votes
2 answers
1k 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 ...
fde-capu's user avatar
  • 243
9 votes
1 answer
6k views

Up arrow key code, why '^[[A' becomes '^[OA'?

If I run cat under terminal (xterm-256color), and then press the up arrow button, I see ^[[A as output. But if I press <ctrl-v> <up> in vim insert mode, I see ^[OA as output. So i wonder ...
jayven's user avatar
  • 193
9 votes
1 answer
878 views

Change the cursor shape in operator pending mode

My cursor in Gvim: My cursor in Gvim after pressing d: Is there any way I can change the cursor in terminal Vim when in operator pending mode? It doesn't have to look exactly like the screenshots. ...
Martin Tournoij's user avatar
8 votes
4 answers
6k views

VIM: how to send entire line to a buffer of type "Terminal"?

In Vim 8, you can open a terminal inside Vim with the term command. This opens a new buffer of type terminal inside vim. Is there any way of sending lines from other buffers to this type of buffer? ...
user avatar
8 votes
1 answer
4k views

What's t_TE and t_TI added by vim 8?

First let me show a screenshot below. In the modeline, a strange sequence of characters(>4;m<ESC>[>4;m<ESC) is shown. And not only in the modeline, I have seen such similar sentence in ...
HQW.ang's user avatar
  • 83
8 votes
4 answers
13k views

How could I adjust terminal height

I like to use the vim embedded terminal, but I do not know how I could adjust its height. Sometimes, I need it to be lower so that I could concentrate on my editor how could I adjust it ?
coin cheung's user avatar
8 votes
3 answers
1k 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, ...
qeatzy's user avatar
  • 940
8 votes
2 answers
1k views

:silent makes my vim go blank

When I used :silent to run a terminal command in the background, my vim screen goes blank, until I navigate through my code, at which point each line I move to reappears. What gives?
Costa Michailidis's user avatar
8 votes
1 answer
2k views

Mapping control-H in insert mode doesn't work; it always works like backspace

I tried mapping control-H, J, K, and L respectively in insert mode to move around splits. inoremap <C-h> <ESC><C-W><C-h>i inoremap <C-l> <ESC><C-W><C-l&...
matts1's user avatar
  • 181
8 votes
2 answers
471 views

How to capture errors from make in terminal window

Vim 8.1's release note seems to indicate that you can feed output from make running in a terminal window to a quickfix list, but I couldn't find any detailed explanation. Is there a way to do this ...
Sora Minazuki's user avatar
7 votes
3 answers
1k views

How to specify the content of a new buffer from command line?

Is there a way to call Vim in such a way that it opens a buffer with some content specified on the terminal, i.e. not saved in a file? For example, I would like to run vim and have it open a buffer ...
Gonçalo Ribeiro's user avatar
7 votes
6 answers
2k 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 ...
Shuzheng's user avatar
  • 1,175
7 votes
2 answers
9k views

Opening :terminal window in new buffer

When I type :terminal to vim8.1, it splits the window and I use it split window. I want to open a new buffer and open the terminal inside it. Basically, like neovim's terminal emulator. Is there a way ...
Muhammed Alkan's user avatar
7 votes
3 answers
4k 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 ...
mike23's user avatar
  • 290
7 votes
3 answers
11k views

Neovim with split integrated terminal / REPL

Other editors and IDEs, such as VSCode and RStudio, have an integrated console/terminal/REPL with the following characteristics: They open in a split window. The file we’re working on is visible at ...
user137369's user avatar
7 votes
1 answer
705 views

Is it possible for Vim to output ANSI colors from the terminal, without a colorscheme?

Many terminal emulators allow you to define colors: Rather than trying to approximate (and duplicate!) the same theme in a Vim colorscheme, is there a way to tell terminal Vim to output ANSI escape ...
Adrian Schaedle's user avatar
7 votes
1 answer
8k views

How to run terminal command in interactive mode from NeoVim?

I have a terminal command which runs code with a breakpoint in it. When I run this command in NeoVim the code execution does not stop at the breakpoint, instead I get an error, that its not a TTY ...
niekas's user avatar
  • 1,435
7 votes
1 answer
2k views

What's the difference between the "clipboard" and "xterm_clipboard" features?

What is the difference between the clipboard and xterm_clipboard features? When do I need to enable one or the other at compilation time? As an aside, how do these features relate to the mouse ...
jalalhugo's user avatar
7 votes
2 answers
1k views

Clipboard sharing broke under MacOS X

I'm using (roughly) the same config for my mac and my ubuntu machine. I use set clipboard=unnamed,unnamedplus To conveniently share vim's clipboard with the system clipboard. However, lately the ...
DeX3's user avatar
  • 393
7 votes
1 answer
306 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 ...
filbranden's user avatar
  • 27.7k
6 votes
6 answers
6k views

How to restore bash terminal title if using 'set title' in vim?

I recently got to know that useful info can be shown in title of bash terminal when editing files using vim. Adding below displays file name, path of the file being edited. set title But on exiting ...
mtk's user avatar
  • 233
6 votes
1 answer
6k 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 ...
Flux's user avatar
  • 941
6 votes
1 answer
2k views

Is it possible to change the statusline color in Vim 8 terminal windows?

I would like to change the default green terminal statusline below to my usual colorscheme statusline color: Is this possible? There is no mention of it in :h terminal.
Jerome Dalbert's user avatar
6 votes
1 answer
5k views

Change cursor shape in different terminals

At home I use iTerm2 on MacOS X, and at work, I have a laptop with CygWin. I have another PC where I use gnome-terminal or terminator, and sometimes I use tmux. I'm looking to configure the cursor ...
Aaron Shen's user avatar
  • 2,439
6 votes
1 answer
2k views

Scrollback in Vim 8 Terminal

Been really loving the asynchronous terminal in Vim 8. Sometimes I have a large amount of output in the terminal, and when I enter normal mode in the terminal and use gg to go to the top, I see that ...
The_Anomaly's user avatar
6 votes
2 answers
3k views

Is there a way that I can identify which window is a terminal after calling the `:term` command in neovim?

Is there way I can identify a window by a number in neovim and then jump to it with a macro ? Or better yet...Is there a way that I can identify which window is a terminal after calling the :term ...
PrimRock's user avatar
  • 343
6 votes
1 answer
1k views

Pressing Shift-Backspace in insert mode types '^?' instead of backspacing

When I mess up typing an uppercase letter, I usually hold Shift while pressing the Backspace. Instead of backspacing, it types ^? (to my frustration). Google tells me that ^? is the "delete" ...
PoorProgrammer's user avatar
6 votes
1 answer
410 views

How to prevent accidentally piping text to Vim?

I use Vim to edit the output of shell commands all the time. Appending the dash in this line is second nature: $ ./some-command | vim - But every once in a while I get distracted and forget: $ ./...
Zilk's user avatar
  • 205

1
2 3 4 5
9