The cursor appears before the line number after pressing down arrow in vim Insert mode with tmux

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












enter image description here



I use tmux2.1, vim8.1 in ubuntu16.04.4. And xshell-5 to connect to my server.



This only happened when I use .vimrc and inside tmux.
And real position of cursor is correct , only show error. After sometime, about dozens of seconds, the cursor show in the right position.



here is my .tmux.conf



# 0 is too far from ` ;)
set -g base-index 1

# Send prefix
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix

# Set easier window split keys
bind-key split-window -h
bind-key - split-window -v

# Easy config reload
bind-key r source-file ~/.tmux.conf ; display-message "tmux.conf reloaded"

# New window
bind-key = new-window


here is my .vimrc



" 定义快捷键的前缀,即<Leader>
let mapleader=";"
" 开启文件类型侦测
"filetype on
" 根据侦测到的不同类型加载对应的插件
"filetype plugin on
"设置编码方式
set encoding=utf-8
" 定义快捷键到行首和行尾
nmap LB 0
nmap LE $
" 设置快捷键将选中文本块复制至系统剪贴板
vnoremap <Leader>y "+y
" 设置快捷键将系统剪贴板内容粘贴至 vim
nmap <Leader>p "+p
" 定义快捷键关闭当前分割窗口
nmap <Leader>q :q<CR>
" 定义快捷键保存当前窗口内容
nmap <Leader>w :w<CR>
" 定义快捷键保存所有窗口内容并退出 vim
nmap <Leader>WQ :wa<CR>:q<CR>
" 不做任何保存,直接退出 vim
nmap <Leader>Q :qa!<CR>
" 依次遍历子窗口
nnoremap nw <C-W><C-W>
" 跳转至右方的窗口
nnoremap <Leader>lw <C-W>l
" 跳转至左方的窗口
nnoremap <Leader>hw <C-W>h
" 跳转至上方的子窗口
nnoremap <Leader>kw <C-W>k
" 跳转至下方的子窗口
nnoremap <Leader>jw <C-W>j
" 定义快捷键在结对符之间跳转
nmap <Leader>M %
" 让配置变更立即生效
autocmd BufWritePost $MYVIMRC source $MYVIMRC
" 开启实时搜索功能
set incsearch
" 搜索时大小写不敏感
set ignorecase
" 关闭兼容模式
set nocompatible
" vim 自身命令行模式智能补全
"set wildmenu
" 解决backspace无效的问题
set backspace=indent,eol,start

" vundle 环境设置
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
" " vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" 缩进可视化
Plugin 'nathanaelkane/vim-indent-guides'
" 自动注释
Plugin 'scrooloose/nerdcommenter'
" 自动补全
"Plugin 'Valloric/YouCompleteMe'
" 目录下的文件内搜索
Plugin 'mileszs/ack.vim'
" 自动输入括号另一半
Plugin 'Raimondi/delimitMate'

" 插件列表结束
call vundle#end()
filetype plugin indent on

" 配色方案
"set background=light
"set background=dark
"colorscheme solarized
"colorscheme molokai
colorscheme default

" 总是显示状态栏
set laststatus=2
" 显示光标当前位置
"set ruler
" 开启行号显示
set number
" 高亮显示当前行/列
"set cursorline
"set cursorcolumn
" 高亮显示搜索结果
set hlsearch
" 设置 gvim 显示字体
"set guifont=YaHei Consolas Hybrid 11.5
" 禁止折行
"set nowrap
" 设置状态栏主题风格
let g:Powerline_colorscheme='solarized256'
" 开启语法高亮功能
syntax enable
" 允许用指定语法高亮配色方案替换默认方案
syntax on
" 自适应不同语言的智能缩进
filetype indent on
" 将制表符扩展为空格
set expandtab
" 设置编辑时制表符占用空格数
set tabstop=4
" 设置格式化时制表符占用空格数
set shiftwidth=4
" 让 vim 把连续数量的空格视为一个制表符
set softtabstop=4

" vim-indent-guides设置
" 随 vim 自启动
let g:indent_guides_enable_on_vim_startup=0
" 从第二层开始可视化显示缩进
let g:indent_guides_start_level=2
" 色块宽度
let g:indent_guides_guide_size=1
" 快捷键 i 开/关缩进可视化
:nmap <silent> <Leader>i <Plug>IndentGuidesToggle

" 基于缩进或语法进行代码折叠
set foldmethod=indent
"set foldmethod=syntax
" 启动 vim 时关闭折叠代码
set nofoldenable
"在状态栏显示正在输入的命令
set showcmd
" 粘贴模式快捷键
set pastetoggle=<F9>
" my行号快捷键
nmap <silent> nu :set nu<CR>
nmap <silent> no :set nonu<CR>






share|improve this question























    up vote
    0
    down vote

    favorite












    enter image description here



    I use tmux2.1, vim8.1 in ubuntu16.04.4. And xshell-5 to connect to my server.



    This only happened when I use .vimrc and inside tmux.
    And real position of cursor is correct , only show error. After sometime, about dozens of seconds, the cursor show in the right position.



    here is my .tmux.conf



    # 0 is too far from ` ;)
    set -g base-index 1

    # Send prefix
    set-option -g prefix C-a
    unbind-key C-a
    bind-key C-a send-prefix

    # Set easier window split keys
    bind-key split-window -h
    bind-key - split-window -v

    # Easy config reload
    bind-key r source-file ~/.tmux.conf ; display-message "tmux.conf reloaded"

    # New window
    bind-key = new-window


    here is my .vimrc



    " 定义快捷键的前缀,即<Leader>
    let mapleader=";"
    " 开启文件类型侦测
    "filetype on
    " 根据侦测到的不同类型加载对应的插件
    "filetype plugin on
    "设置编码方式
    set encoding=utf-8
    " 定义快捷键到行首和行尾
    nmap LB 0
    nmap LE $
    " 设置快捷键将选中文本块复制至系统剪贴板
    vnoremap <Leader>y "+y
    " 设置快捷键将系统剪贴板内容粘贴至 vim
    nmap <Leader>p "+p
    " 定义快捷键关闭当前分割窗口
    nmap <Leader>q :q<CR>
    " 定义快捷键保存当前窗口内容
    nmap <Leader>w :w<CR>
    " 定义快捷键保存所有窗口内容并退出 vim
    nmap <Leader>WQ :wa<CR>:q<CR>
    " 不做任何保存,直接退出 vim
    nmap <Leader>Q :qa!<CR>
    " 依次遍历子窗口
    nnoremap nw <C-W><C-W>
    " 跳转至右方的窗口
    nnoremap <Leader>lw <C-W>l
    " 跳转至左方的窗口
    nnoremap <Leader>hw <C-W>h
    " 跳转至上方的子窗口
    nnoremap <Leader>kw <C-W>k
    " 跳转至下方的子窗口
    nnoremap <Leader>jw <C-W>j
    " 定义快捷键在结对符之间跳转
    nmap <Leader>M %
    " 让配置变更立即生效
    autocmd BufWritePost $MYVIMRC source $MYVIMRC
    " 开启实时搜索功能
    set incsearch
    " 搜索时大小写不敏感
    set ignorecase
    " 关闭兼容模式
    set nocompatible
    " vim 自身命令行模式智能补全
    "set wildmenu
    " 解决backspace无效的问题
    set backspace=indent,eol,start

    " vundle 环境设置
    filetype off
    set rtp+=~/.vim/bundle/Vundle.vim
    " " vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间
    call vundle#begin()

    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here')

    " let Vundle manage Vundle, required
    Plugin 'VundleVim/Vundle.vim'
    " 缩进可视化
    Plugin 'nathanaelkane/vim-indent-guides'
    " 自动注释
    Plugin 'scrooloose/nerdcommenter'
    " 自动补全
    "Plugin 'Valloric/YouCompleteMe'
    " 目录下的文件内搜索
    Plugin 'mileszs/ack.vim'
    " 自动输入括号另一半
    Plugin 'Raimondi/delimitMate'

    " 插件列表结束
    call vundle#end()
    filetype plugin indent on

    " 配色方案
    "set background=light
    "set background=dark
    "colorscheme solarized
    "colorscheme molokai
    colorscheme default

    " 总是显示状态栏
    set laststatus=2
    " 显示光标当前位置
    "set ruler
    " 开启行号显示
    set number
    " 高亮显示当前行/列
    "set cursorline
    "set cursorcolumn
    " 高亮显示搜索结果
    set hlsearch
    " 设置 gvim 显示字体
    "set guifont=YaHei Consolas Hybrid 11.5
    " 禁止折行
    "set nowrap
    " 设置状态栏主题风格
    let g:Powerline_colorscheme='solarized256'
    " 开启语法高亮功能
    syntax enable
    " 允许用指定语法高亮配色方案替换默认方案
    syntax on
    " 自适应不同语言的智能缩进
    filetype indent on
    " 将制表符扩展为空格
    set expandtab
    " 设置编辑时制表符占用空格数
    set tabstop=4
    " 设置格式化时制表符占用空格数
    set shiftwidth=4
    " 让 vim 把连续数量的空格视为一个制表符
    set softtabstop=4

    " vim-indent-guides设置
    " 随 vim 自启动
    let g:indent_guides_enable_on_vim_startup=0
    " 从第二层开始可视化显示缩进
    let g:indent_guides_start_level=2
    " 色块宽度
    let g:indent_guides_guide_size=1
    " 快捷键 i 开/关缩进可视化
    :nmap <silent> <Leader>i <Plug>IndentGuidesToggle

    " 基于缩进或语法进行代码折叠
    set foldmethod=indent
    "set foldmethod=syntax
    " 启动 vim 时关闭折叠代码
    set nofoldenable
    "在状态栏显示正在输入的命令
    set showcmd
    " 粘贴模式快捷键
    set pastetoggle=<F9>
    " my行号快捷键
    nmap <silent> nu :set nu<CR>
    nmap <silent> no :set nonu<CR>






    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      enter image description here



      I use tmux2.1, vim8.1 in ubuntu16.04.4. And xshell-5 to connect to my server.



      This only happened when I use .vimrc and inside tmux.
      And real position of cursor is correct , only show error. After sometime, about dozens of seconds, the cursor show in the right position.



      here is my .tmux.conf



      # 0 is too far from ` ;)
      set -g base-index 1

      # Send prefix
      set-option -g prefix C-a
      unbind-key C-a
      bind-key C-a send-prefix

      # Set easier window split keys
      bind-key split-window -h
      bind-key - split-window -v

      # Easy config reload
      bind-key r source-file ~/.tmux.conf ; display-message "tmux.conf reloaded"

      # New window
      bind-key = new-window


      here is my .vimrc



      " 定义快捷键的前缀,即<Leader>
      let mapleader=";"
      " 开启文件类型侦测
      "filetype on
      " 根据侦测到的不同类型加载对应的插件
      "filetype plugin on
      "设置编码方式
      set encoding=utf-8
      " 定义快捷键到行首和行尾
      nmap LB 0
      nmap LE $
      " 设置快捷键将选中文本块复制至系统剪贴板
      vnoremap <Leader>y "+y
      " 设置快捷键将系统剪贴板内容粘贴至 vim
      nmap <Leader>p "+p
      " 定义快捷键关闭当前分割窗口
      nmap <Leader>q :q<CR>
      " 定义快捷键保存当前窗口内容
      nmap <Leader>w :w<CR>
      " 定义快捷键保存所有窗口内容并退出 vim
      nmap <Leader>WQ :wa<CR>:q<CR>
      " 不做任何保存,直接退出 vim
      nmap <Leader>Q :qa!<CR>
      " 依次遍历子窗口
      nnoremap nw <C-W><C-W>
      " 跳转至右方的窗口
      nnoremap <Leader>lw <C-W>l
      " 跳转至左方的窗口
      nnoremap <Leader>hw <C-W>h
      " 跳转至上方的子窗口
      nnoremap <Leader>kw <C-W>k
      " 跳转至下方的子窗口
      nnoremap <Leader>jw <C-W>j
      " 定义快捷键在结对符之间跳转
      nmap <Leader>M %
      " 让配置变更立即生效
      autocmd BufWritePost $MYVIMRC source $MYVIMRC
      " 开启实时搜索功能
      set incsearch
      " 搜索时大小写不敏感
      set ignorecase
      " 关闭兼容模式
      set nocompatible
      " vim 自身命令行模式智能补全
      "set wildmenu
      " 解决backspace无效的问题
      set backspace=indent,eol,start

      " vundle 环境设置
      filetype off
      set rtp+=~/.vim/bundle/Vundle.vim
      " " vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间
      call vundle#begin()

      " alternatively, pass a path where Vundle should install plugins
      "call vundle#begin('~/some/path/here')

      " let Vundle manage Vundle, required
      Plugin 'VundleVim/Vundle.vim'
      " 缩进可视化
      Plugin 'nathanaelkane/vim-indent-guides'
      " 自动注释
      Plugin 'scrooloose/nerdcommenter'
      " 自动补全
      "Plugin 'Valloric/YouCompleteMe'
      " 目录下的文件内搜索
      Plugin 'mileszs/ack.vim'
      " 自动输入括号另一半
      Plugin 'Raimondi/delimitMate'

      " 插件列表结束
      call vundle#end()
      filetype plugin indent on

      " 配色方案
      "set background=light
      "set background=dark
      "colorscheme solarized
      "colorscheme molokai
      colorscheme default

      " 总是显示状态栏
      set laststatus=2
      " 显示光标当前位置
      "set ruler
      " 开启行号显示
      set number
      " 高亮显示当前行/列
      "set cursorline
      "set cursorcolumn
      " 高亮显示搜索结果
      set hlsearch
      " 设置 gvim 显示字体
      "set guifont=YaHei Consolas Hybrid 11.5
      " 禁止折行
      "set nowrap
      " 设置状态栏主题风格
      let g:Powerline_colorscheme='solarized256'
      " 开启语法高亮功能
      syntax enable
      " 允许用指定语法高亮配色方案替换默认方案
      syntax on
      " 自适应不同语言的智能缩进
      filetype indent on
      " 将制表符扩展为空格
      set expandtab
      " 设置编辑时制表符占用空格数
      set tabstop=4
      " 设置格式化时制表符占用空格数
      set shiftwidth=4
      " 让 vim 把连续数量的空格视为一个制表符
      set softtabstop=4

      " vim-indent-guides设置
      " 随 vim 自启动
      let g:indent_guides_enable_on_vim_startup=0
      " 从第二层开始可视化显示缩进
      let g:indent_guides_start_level=2
      " 色块宽度
      let g:indent_guides_guide_size=1
      " 快捷键 i 开/关缩进可视化
      :nmap <silent> <Leader>i <Plug>IndentGuidesToggle

      " 基于缩进或语法进行代码折叠
      set foldmethod=indent
      "set foldmethod=syntax
      " 启动 vim 时关闭折叠代码
      set nofoldenable
      "在状态栏显示正在输入的命令
      set showcmd
      " 粘贴模式快捷键
      set pastetoggle=<F9>
      " my行号快捷键
      nmap <silent> nu :set nu<CR>
      nmap <silent> no :set nonu<CR>






      share|improve this question











      enter image description here



      I use tmux2.1, vim8.1 in ubuntu16.04.4. And xshell-5 to connect to my server.



      This only happened when I use .vimrc and inside tmux.
      And real position of cursor is correct , only show error. After sometime, about dozens of seconds, the cursor show in the right position.



      here is my .tmux.conf



      # 0 is too far from ` ;)
      set -g base-index 1

      # Send prefix
      set-option -g prefix C-a
      unbind-key C-a
      bind-key C-a send-prefix

      # Set easier window split keys
      bind-key split-window -h
      bind-key - split-window -v

      # Easy config reload
      bind-key r source-file ~/.tmux.conf ; display-message "tmux.conf reloaded"

      # New window
      bind-key = new-window


      here is my .vimrc



      " 定义快捷键的前缀,即<Leader>
      let mapleader=";"
      " 开启文件类型侦测
      "filetype on
      " 根据侦测到的不同类型加载对应的插件
      "filetype plugin on
      "设置编码方式
      set encoding=utf-8
      " 定义快捷键到行首和行尾
      nmap LB 0
      nmap LE $
      " 设置快捷键将选中文本块复制至系统剪贴板
      vnoremap <Leader>y "+y
      " 设置快捷键将系统剪贴板内容粘贴至 vim
      nmap <Leader>p "+p
      " 定义快捷键关闭当前分割窗口
      nmap <Leader>q :q<CR>
      " 定义快捷键保存当前窗口内容
      nmap <Leader>w :w<CR>
      " 定义快捷键保存所有窗口内容并退出 vim
      nmap <Leader>WQ :wa<CR>:q<CR>
      " 不做任何保存,直接退出 vim
      nmap <Leader>Q :qa!<CR>
      " 依次遍历子窗口
      nnoremap nw <C-W><C-W>
      " 跳转至右方的窗口
      nnoremap <Leader>lw <C-W>l
      " 跳转至左方的窗口
      nnoremap <Leader>hw <C-W>h
      " 跳转至上方的子窗口
      nnoremap <Leader>kw <C-W>k
      " 跳转至下方的子窗口
      nnoremap <Leader>jw <C-W>j
      " 定义快捷键在结对符之间跳转
      nmap <Leader>M %
      " 让配置变更立即生效
      autocmd BufWritePost $MYVIMRC source $MYVIMRC
      " 开启实时搜索功能
      set incsearch
      " 搜索时大小写不敏感
      set ignorecase
      " 关闭兼容模式
      set nocompatible
      " vim 自身命令行模式智能补全
      "set wildmenu
      " 解决backspace无效的问题
      set backspace=indent,eol,start

      " vundle 环境设置
      filetype off
      set rtp+=~/.vim/bundle/Vundle.vim
      " " vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间
      call vundle#begin()

      " alternatively, pass a path where Vundle should install plugins
      "call vundle#begin('~/some/path/here')

      " let Vundle manage Vundle, required
      Plugin 'VundleVim/Vundle.vim'
      " 缩进可视化
      Plugin 'nathanaelkane/vim-indent-guides'
      " 自动注释
      Plugin 'scrooloose/nerdcommenter'
      " 自动补全
      "Plugin 'Valloric/YouCompleteMe'
      " 目录下的文件内搜索
      Plugin 'mileszs/ack.vim'
      " 自动输入括号另一半
      Plugin 'Raimondi/delimitMate'

      " 插件列表结束
      call vundle#end()
      filetype plugin indent on

      " 配色方案
      "set background=light
      "set background=dark
      "colorscheme solarized
      "colorscheme molokai
      colorscheme default

      " 总是显示状态栏
      set laststatus=2
      " 显示光标当前位置
      "set ruler
      " 开启行号显示
      set number
      " 高亮显示当前行/列
      "set cursorline
      "set cursorcolumn
      " 高亮显示搜索结果
      set hlsearch
      " 设置 gvim 显示字体
      "set guifont=YaHei Consolas Hybrid 11.5
      " 禁止折行
      "set nowrap
      " 设置状态栏主题风格
      let g:Powerline_colorscheme='solarized256'
      " 开启语法高亮功能
      syntax enable
      " 允许用指定语法高亮配色方案替换默认方案
      syntax on
      " 自适应不同语言的智能缩进
      filetype indent on
      " 将制表符扩展为空格
      set expandtab
      " 设置编辑时制表符占用空格数
      set tabstop=4
      " 设置格式化时制表符占用空格数
      set shiftwidth=4
      " 让 vim 把连续数量的空格视为一个制表符
      set softtabstop=4

      " vim-indent-guides设置
      " 随 vim 自启动
      let g:indent_guides_enable_on_vim_startup=0
      " 从第二层开始可视化显示缩进
      let g:indent_guides_start_level=2
      " 色块宽度
      let g:indent_guides_guide_size=1
      " 快捷键 i 开/关缩进可视化
      :nmap <silent> <Leader>i <Plug>IndentGuidesToggle

      " 基于缩进或语法进行代码折叠
      set foldmethod=indent
      "set foldmethod=syntax
      " 启动 vim 时关闭折叠代码
      set nofoldenable
      "在状态栏显示正在输入的命令
      set showcmd
      " 粘贴模式快捷键
      set pastetoggle=<F9>
      " my行号快捷键
      nmap <silent> nu :set nu<CR>
      nmap <silent> no :set nonu<CR>








      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 11 at 3:35









      杨锦修

      112




      112

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045460%2fthe-cursor-appears-before-the-line-number-after-pressing-down-arrow-in-vim-inser%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045460%2fthe-cursor-appears-before-the-line-number-after-pressing-down-arrow-in-vim-inser%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491