Skip to main content
15 votes
Accepted

No syntax highlighting in tmux

Well, I solved the problem by myself. as @Carpetsmoker♦ commented, I started to suspect that my .vimrc is a problem. I read this question and started vim with this command inside tmux. vim -u NONE -...
sohnryang's user avatar
  • 495
13 votes
Accepted

Separate C-m and Enter

As far as Vim is concerned, <C-M> and <CR> are the same thing: they are represented in the same way internally. If your terminal is truly sending different keycodes (mine doesn't) for ...
Rich's user avatar
  • 32.2k
10 votes
Accepted

Sending command to different tmux pane from vim

To send to another pane you'll need to call tmux from Vim. Specifically, you'll need the send-keys command (alias: send). For example, this will cause the current line number in Vim to be printed to ...
B Layer's user avatar
  • 20k
9 votes

No syntax highlighting in tmux

From the vim manual: :h termguicolors recommends reading :h xterm-true-color, also see :h $TERM Sometimes setting 'termguicolors' is not enough and one has to set the |t_8f| and |t_8b| options ...
ixil's user avatar
  • 146
9 votes

Pasting text on Vim inside tmux breaks indentation

Manually toggling :set paste/:set nopaste as suggested by francois P is cumbersome, and resetting the TERM variable as evaristegd suggests is a very bad idea as explained in the comments (which hint ...
Dining Philosopher's user avatar
8 votes

Change cursor shape in different terminals

As of November 2017, all the terminals you are using support the same DECSCUSR escape sequences for changing the cursor shape1. So you don't need to test for the different terminals. As such, the ...
Rich's user avatar
  • 32.2k
7 votes
Accepted

Nvim can not detect focus change inside tmux sessions

I opened an issue on Neovim repo and get the right answer. We need to turn on the focus-events for tmux. Edit the tmux config file ~/.tmux.conf and add the following setting: set -g focus-events on ...
jdhao's user avatar
  • 1,143
7 votes
Accepted

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

I'm not aware of any Vim feature or even plugin that does that; in fact, up until recently it would be rather hard to display it like that, but with Vim 8.2's popup windows it wouldn't be too hard; ...
Martin Tournoij's user avatar
6 votes
Accepted

Tmux messing with Vim highlighting

Add this line to your tmux.conf file set -g default-terminal "screen-256color" Add the line below to you shells rc file in my case its my .zshrc if [[ $TERM == xterm ]]; then TERM=xterm-256color; ...
byaruhaf's user avatar
  • 786
6 votes

Running code in a different tmux pane

The run-shell example you mention looks identical to that in my 'Unix & Linux' post on this topic so you may have read that. If so, at the very end I mention use of a mapping to prevent external ...
B Layer's user avatar
  • 20k
5 votes

Vim, tmux, and xterm-bracketed-paste

I have this in my .vimrc, which works when running tmux in gnome-terminal if &term =~ '^tmux' let &t_BE="\<Esc>[?2004h" let &t_BD="\<Esc>[?2004l" let &t_PS="\<Esc&...
Mike Jonkmans's user avatar
5 votes

No syntax highlighting in tmux

I actually made it work just fine with termguicolors. This is what I did 1. in my ~/.bash_profile i put this: export TERM=xterm-256color and inside my ~/.vimrc I had this syntax enable colorscheme ...
abbood's user avatar
  • 743
5 votes
Accepted

Change Neovim cursor in insert mode under st (simple terminal) and tmux

You need to tell Tmux how to translate the control sequences sent by Nvim to the outer terminal, here st. This is done by setting the unofficial extensions to terminfo Ss and Se. From man tmux: Ss, ...
user938271's user avatar
  • 5,987
5 votes
Accepted

Pasting text on Vim inside tmux breaks indentation

So using :set paste first can resolv the issue. as you asked here is my tmuxrc but it is very short : :~$ cat ~/.tmuxrc set -g status-utf8 on :~$ So I don't think it is special
francois P's user avatar
5 votes
Accepted

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

It is even supposed to be by default in Vim 8. Only if Vim thinks the terminal is xterm-compatible, which is the case if TERM is xterm or some derivative. If TERM is gnome, Vim won't enable the ...
user938271's user avatar
  • 5,987
4 votes

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

To restore the default tmux naming scheme when quitting vim you can also do: autocmd VimLeave * call system("tmux setw automatic-rename")
raphael's user avatar
  • 41
4 votes
Accepted

Truecolor (termguicolors) causes display issues in Tmux

Turns out this was a bug in Vim itself. The problem is resolved as of Vim 7.4.1942.
djmoch's user avatar
  • 181
4 votes
Accepted

Why isn't vim applying syntax highlighting to this code?

Adding t_Co=256 to your vimrc should never be necessarily, save for some highly unusual and archaic situations. It's typically a sign that something else is set up wrong. By far the most common ...
Martin Tournoij's user avatar
4 votes
Accepted

Send file and line number to tmux

Here's an example of inserting line number in a shell command: :exe "!echo " . line(".") So your mapping would be something like this: nnoremap <silent> <leader>ef :exe "!tmux send -t 0....
B Layer's user avatar
  • 20k
4 votes

Send message to tmux properly

After messing around a bit more and looking over some stuff I was able to get this to work by wrapping the external command and its parameters in an execute command then using the bar to send the ...
Jack's user avatar
  • 181
4 votes

Sending command to different tmux pane from vim

Uploaded my personal config tvp-repl Copy from one pane with Ctrl+c and paste to another (requires xclip) vim with +clipboard, .vimrc: set clipboard=unnamedplus vnoremap <C-c> "+y tmux ...
dariohett's user avatar
4 votes
Accepted

Equivalent to tmux CTRL+B z in vim?

I use ctrl-w | if my screen is split vertically or ctrl-w _ if split horizontally to zoom in. To get back, I use ctrl-w =.
mithun_daa's user avatar
4 votes
Accepted

Cannot send `--` into tmux panes from vim

Looks more like a shell related question than a Vim related question. I would try the following (not tested, so might be wrong): silent execute "!tmux send-keys -t " . _count . " -- \"" . text . "\""...
Ralf's user avatar
  • 9,277
4 votes

Running code in a different tmux pane

If you build tmux from Git master you can send the output to an empty pane, for example: mybuildcommand|tmux splitw -dI -c/my/source/directory I don't know how to stop vim hiding the code while this ...
Nicholas Marriott's user avatar
4 votes

Vim auto save buffer on Tmux `select-pane`

I don't know whether it will work for you because I don't have termite, but you could try to add this line in your tmux.conf: set -s focus-events on And these lines in your vimrc: if !has('nvim') &...
user938271's user avatar
  • 5,987
4 votes

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

You are looking for Choosewin, sadly it's not being actively developed anymore, but for the simplest use cases it works great.
Tae's user avatar
  • 2,135
4 votes
Accepted

Perform action after invoking a <Plug> command

This almost works for me: nmap <buffer> <S-CR> <Plug>SlimeLineSendj The reason it actually doesn't work is that my terminal Vim actually doesn't recognize the <S-CR> sequence ...
filbranden's user avatar
  • 29k
3 votes
Accepted

Vim + Tmux: Resetting tmux tab name when exiting vim

'titleold' string (default "Thanks for flying Vim") global This option will be used for the window title when exiting Vim if the original title cannot be restored. Only ...
laktak's user avatar
  • 2,953
3 votes

Wrong colors inside tmux

Term creates new terminals with TERM=screen-256color Put this in your .bashrc to fix the issue export TERM=xterm-256color EDIT: As pointed out in the comments, you should probably run echo $TERM ...
DoYouEvenCodeBro's user avatar
3 votes

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

This is what I put in my vimrc thanks to the answer by @raphael I also install the tmux-plugins/vim-tmux-focus-events plugin for the FocusGained and FocusLost events. augroup tmux autocmd! if ...
f3xy's user avatar
  • 131

Only top scored, non community-wiki answers of a minimum length are eligible