You are wrong about tmux. Like every terminal-based program — including Vim — it only draws stuff inside cells. This means that Vim and tmux both use the same method to draw vertical borders: they just use a pipe-like character.
Tmux uses │ (U+2502) by default while Vim uses | (U+007C).
If you want the same separator in Vim, you can simply use the same ...
There you go :
autocmd BufReadPost,FileReadPost,BufNewFile,BufEnter * call system("tmux rename-window 'vim | " . expand("%:t") . "'")
autocmd BufReadPost,FileReadPost,BufNewFile,BufEnter * call
On buffer read, file read or buffer new file event (see :help autocmd-events) execute the next command :
Call a system function ...
You might try to add the following to your .vimrc.
if &term =~ '256color'
" disable Background Color Erase (BCE)
The t_ut option (default = y) describes how vim handles what it wants as background colors compared to attempting to use the current background color. This snippet clears that option.
If not, then you might try to
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 -U NONE -N ~/.vimrc
After starting vim with command above, I ran this command inside vim.
These highlighted my .vimrc ...
Ah, I found the culprit by bisecting my .vimrc file. I had mapped Escape in normal mode to clear search highlighting:
" Clear highlighting on escape in normal mode
nnoremap <esc> :noh<return><esc>
However, that will confuse vim as it tries to parse the mouse's escape codes. So what I ended up doing is taking the solution from this answer, ...
It seems the problem is that tmux doesn't send your cursor-changing escape codes to the terminal emulator. You need to wrap your desired escape codes in a special sequence that tells tmux that it should pass it on to the outer terminal.
The sequence you need to wrap your escape sequence in is \<Esc>Ptmux;\<Esc> ... \<Esc>\\(Source). The ......
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 when you press Ctrl-M vs Enter, then you might be able to map them separately by using their literal values when you set up the mappings.
Replace the following in ...
From the vim manual: :h termguicolors recommends reading :h xterm-true-color
Sometimes setting 'termguicolors' is not enough and one has to set the |t_8f|
and |t_8b| options explicitly. [ ... these are] only set [to some default] when `$TERM` is `xterm`.
I use a condition similar to the below:
if &term =~# '256color' && ( &term =~# '^...
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 only thing that requires different treatment is tmux, which will only forward escape sequences on to the terminal when surrounded by a DCS sequence. You already ...
Even in my own screen-shot, tmux is not using any magic, the split is still a single character wide column. The less obtrusive visual effect is the use of a Unicode box drawing character that is less clunky than vim's ASCII default, and the lack of a highlight background color.
Very nearly the same effect is possible in vim by adding something like the ...
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 the terminal in pane 2 using echo:
:exe "!tmux send -t 2 'echo " . line(".") . "' Enter"
Applying the same form to your command:
:exe "!tmux send -t 2 'behave ...
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 commands (e.g. a 'make' command or equivalent) from interrupting the vim session in too disruptive a way. Admittedly, it's just a small update to the answer with ...
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; you just have to loop over all visible windows and create a new popup window displaying the window number.
The closest thing you can get, which may actually be ...
No, this cannot be done in Vim, and would probably be very hard to implement in GVIM.
Vim sticks to the cell-based addressing used in the terminal; within a buffer, this is crucial for consistent vertical navigation with j / k. This addressing by cell-based x and y coordinates is so ingrained in Vim's implementation, I guess it's very hard to overcome.
I have this in my .vimrc, which works when running tmux in gnome-terminal
if &term =~ '^tmux'
Terminal in tmux is set to tmux-256color; fragment from ~/.tmux.conf:
set -g default-terminal tmux-...
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 redraw command.
:execute "silent !tmux send -t 0.1 'ruby test.rb' Enter" | :redraw!
I actually made it work just fine with termguicolors. This is what I did
1. in my ~/.bash_profile i put this:
and inside my ~/.vimrc I had this
and it worked perfectly! reference
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 problem is a wrong TERM environment variable. You mentioned tmux, try using screen-256color, which should be the correct TERM for tmux. This is typically set in your ...
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; fi
Add the line below to your .vimrc
The above configuration works for me, but if this fails try to follow this link for another methor to fix ...
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.1 'mix test %:p:" . line(".") . "' Enter"<CR><C-L>
I run tmux so I was able to test that the command appeared in a tmux pane (though I can't ...
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 . "\""
Add a -- before the text. Most Unix commands stop option processing as soon as they see a -- and everything after it is handled as parameter.
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 is running however.
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 bracketed paste mode automatically; you have to configure it.
I have vim 8, how to enable bracketed paste mode for gnome terminal?
if &t_BE == ''
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, Se Set or reset the cursor style. If set, a sequence such as this
may be used to change the cursor to an underline:
$ printf '\033[4 q'
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') && !has('gui_running')
let &t_ti ..= "\e[?1004h"
let &t_te ..= "\e[?1004l"
exe "set <S-F18>=\e[O"
exe "set <S-F19>=\e[...