配置tmux ctrl+a与鼠标点击切换

打印 上一主题 下一主题

主题 1606|帖子 1606|积分 4818

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
.tmux.conf

  1. set-option -g status-keys vi
  2. setw -g mode-keys vi
  3. setw -g monitor-activity on
  4. # setw -g c0-change-trigger 10
  5. # setw -g c0-change-interval 100
  6. # setw -g c0-change-interval 50
  7. # setw -g c0-change-trigger  75
  8. set-window-option -g automatic-rename on
  9. set-option -g set-titles on
  10. set -g history-limit 100000
  11. #set-window-option -g utf8 on
  12. # set command prefix
  13. set-option -g prefix C-a
  14. unbind-key C-b
  15. bind-key C-a send-prefix
  16. bind h select-pane -L
  17. bind j select-pane -D
  18. bind k select-pane -U
  19. bind l select-pane -R
  20. bind -n M-Left select-pane -L
  21. bind -n M-Right select-pane -R
  22. bind -n M-Up select-pane -U
  23. bind -n M-Down select-pane -D
  24. bind < resize-pane -L 7
  25. bind > resize-pane -R 7
  26. bind - resize-pane -D 7
  27. bind + resize-pane -U 7
  28. bind-key -n M-l next-window
  29. bind-key -n M-h previous-window
  30. set -g status-interval 1
  31. # status bar
  32. set -g status-bg black
  33. set -g status-fg blue
  34. #set -g status-utf8 on
  35. set -g status-justify centre
  36. set -g status-bg default
  37. set -g status-left " #[fg=green]#S@#H #[default]"
  38. set -g status-left-length 20
  39. # mouse support
  40. # for tmux 2.1
  41. # set -g mouse-utf8 on
  42. set -g mouse on
  43. #
  44. # for previous version
  45. #set -g mode-mouse on
  46. #set -g mouse-resize-pane on
  47. #set -g mouse-select-pane on
  48. #set -g mouse-select-window on
  49. #set -g status-right-length 25
  50. set -g status-right "#[fg=green]%H:%M:%S #[fg=magenta]%a %m-%d #[default]"
  51. # fix for tmux 1.9
  52. bind '"' split-window -vc "#{pane_current_path}"
  53. bind '%' split-window -hc "#{pane_current_path}"
  54. bind 'c' new-window -c "#{pane_current_path}"
  55. # run-shell "powerline-daemon -q"
  56. # vim: ft=conf
复制代码
.vimrc

  1. " An example for a vimrc file.
  2. "
  3. " To use it, copy it to
  4. "     for Unix and OS/2:  ~/.vimrc
  5. "             for Amiga:  s:.vimrc
  6. "  for MS-DOS and Win32:  $VIM\_vimrc
  7. "           for OpenVMS:  sys$login:.vimrc
  8. " When started as "evim", evim.vim will already have done these settings.
  9. if v:progname =~? "evim"
  10.   finish
  11. endif
  12. " Use Vim settings, rather then Vi settings (much better!).
  13. " This must be first, because it changes other options as a side effect.
  14. set nocompatible
  15. " allow backspacing over everything in insert mode
  16. set backspace=indent,eol,start
  17. if has("vms")
  18.   set nobackup          " do not keep a backup file, use versions instead
  19. else
  20.   set backup            " keep a backup file
  21. endif
  22. set history=50          " keep 50 lines of command line history
  23. set ruler               " show the cursor position all the time
  24. set showcmd             " display incomplete commands
  25. set incsearch           " do incremental searching
  26. "==========================================================================
  27. "My Setting-sunshanlu
  28. "==========================================================================
  29. vmap <leader>y :w! /tmp/vitmp<CR>
  30. nmap <leader>p :r! cat /tmp/vitmp<CR>
  31. "语法高亮
  32. syntax enable
  33. syntax on
  34. "显示行号
  35. set nu
  36. "修改默认注释颜色
  37. "hi Comment ctermfg=DarkCyan
  38. "允许退格键删除
  39. "set backspace=2
  40. "启用鼠标
  41. set mouse=a
  42. set selection=exclusive
  43. set selectmode=mouse,key
  44. "按C语言格式缩进
  45. set cindent
  46. set autoindent
  47. set smartindent
  48. set shiftwidth=4
  49. " 允许在有未保存的修改时切换缓冲区
  50. "set hidden
  51. " 设置无备份文件
  52. set writebackup
  53. set nobackup
  54. "显示括号匹配
  55. set showmatch
  56. "括号匹配显示时间为1(单位是十分之一秒)
  57. set matchtime=5
  58. "显示当前的行号列号:
  59. set ruler
  60. "在状态栏显示正在输入的命令
  61. set showcmd
  62. set foldmethod=syntax
  63. "默认情况下不折叠
  64. set foldlevel=100
  65. " 开启状态栏信息
  66. set laststatus=2
  67. " 命令行的高度,默认为1,这里设为2
  68. set cmdheight=2
  69. " 显示Tab符,使用一高亮竖线代替
  70. set list
  71. "set listchars=tab:\|\ ,
  72. set listchars=tab:>-,trail:-
  73. "侦测文件类型
  74. filetype on
  75. "载入文件类型插件
  76. filetype plugin on
  77. "为特定文件类型载入相关缩进文件
  78. filetype indent on
  79. " 启用自动补全
  80. filetype plugin indent on
  81. "设置编码自动识别, 中文引号显示
  82. filetype on "打开文件类型检测
  83. "set fileencodings=euc-cn,ucs-bom,utf-8,cp936,gb2312,gb18030,gbk,big5,euc-jp,euc-kr,latin1
  84. set fileencodings=utf-8,gb2312,gbk,gb18030
  85. "这个用能很给劲,不管encoding是什么编码,都能将文本显示汉字
  86. "set termencoding=gb2312
  87. set termencoding=utf-8
  88. "新建文件使用的编码
  89. set fileencoding=utf-8
  90. "set fileencoding=gb2312
  91. "用于显示的编码,仅仅是显示
  92. set encoding=utf-8
  93. "set encoding=utf-8
  94. "set encoding=euc-cn
  95. "set encoding=gbk
  96. "set encoding=gb2312
  97. "set ambiwidth=double
  98. set fileformat=unix
  99. "设置高亮搜索
  100. set hlsearch
  101. "在搜索时,输入的词句的逐字符高亮
  102. set incsearch
  103. " 着色模式
  104. set t_Co=256
  105. "colorscheme wombat256mod
  106. "colorscheme gardener
  107. "colorscheme elflord
  108. colorscheme desert
  109. "colorscheme evening
  110. "colorscheme darkblue
  111. "colorscheme torte
  112. "colorscheme default
  113. " 字体 && 字号
  114. set guifont=Monaco:h10
  115. "set guifont=Consolas:h10
  116. " :LoadTemplate       根据文件后缀自动加载模板
  117. "let g:template_path='/home/ruchee/.vim/template/'
  118. " :AuthorInfoDetect   自动添加作者、时间等信息,本质是NERD_commenter && authorinfo的结合
  119. ""let g:vimrc_author='sunshanlu'
  120. ""let g:vimrc_email='sunshanlu@baidu.com'
  121. ""let g:vimrc_homepage='http://www.sunshanlu.com'
  122. "
  123. "
  124. " Ctrl + E            一步加载语法模板和作者、时间信息
  125. ""map <c-e> <ESC>:AuthorInfoDetect<CR><ESC>Gi
  126. ""imap <c-e> <ESC>:AuthorInfoDetect<CR><ESC>Gi
  127. ""vmap <c-e> <ESC>:AuthorInfoDetect<CR><ESC>Gi
  128. " ======= 引号 && 括号自动匹配 ======= "
  129. "
  130. ":inoremap ( ()<ESC>i
  131. ":inoremap ) <c-r>=ClosePair(')')<CR>
  132. "
  133. ":inoremap { {}<ESC>i
  134. "
  135. ":inoremap } <c-r>=ClosePair('}')<CR>
  136. "
  137. ":inoremap [ []<ESC>i
  138. "
  139. ":inoremap ] <c-r>=ClosePair(']')<CR>
  140. "
  141. ":inoremap < <><ESC>i
  142. "
  143. ":inoremap > <c-r>=ClosePair('>')<CR>
  144. "
  145. "":inoremap " ""<ESC>i
  146. "
  147. ":inoremap ' ''<ESC>i
  148. "
  149. ":inoremap ` ``<ESC>i
  150. "
  151. ":inoremap * **<ESC>i
  152. " 每行超过80个的字符用下划线标示
  153. ""au BufRead,BufNewFile *.s,*.asm,*.h,*.c,*.cpp,*.java,*.cs,*.lisp,*.el,*.erl,*.tex,*.sh,*.lua,*.pl,*.php,*.tpl,*.py,*.rb,*.erb,*.vim,*.js,*.jade,*.coffee,*.css,*.xml,*.html,*.shtml,*.xhtml Underlined /.\%81v/
  154. "
  155. "
  156. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  157. " let &guioptions = substitute(&guioptions, "t", "", "g")
  158. " Don't use Ex mode, use Q for formatting
  159. map Q gq
  160. " This is an alternative that also works in block mode, but the deleted
  161. " text is lost and it only works for putting the current register.
  162. "vnoremap p "_dp
  163. " Switch syntax highlighting on, when the terminal has colors
  164. " Also switch on highlighting the last used search pattern.
  165. if &t_Co > 2 || has("gui_running")
  166.   syntax on
  167.   set hlsearch
  168. endif
  169. " Only do this part when compiled with support for autocommands.
  170. if has("autocmd")
  171.   " Enable file type detection.
  172.   " Use the default filetype settings, so that mail gets 'tw' set to 72,
  173.   " 'cindent' is on in C files, etc.
  174.   " Also load indent files, to automatically do language-dependent indenting.
  175.   filetype plugin indent on
  176.   " Put these in an autocmd group, so that we can delete them easily.
  177.   augroup vimrcEx
  178.   au!
  179.   " For all text files set 'textwidth' to 80 characters.
  180.   autocmd FileType text setlocal textwidth=80
  181.   " When editing a file, always jump to the last known cursor position.
  182.   " Don't do it when the position is invalid or when inside an event handler
  183.   " (happens when dropping a file on gvim).
  184.   autocmd BufReadPost *
  185.     \ if line("'"") > 0 && line("'"") <= line("$") |
  186.     \   exe "normal g`"" |
  187.     \ endif
  188.   augroup END
  189. else
  190.   set autoindent                " always set autoindenting on
  191. endif " has("autocmd")
  192. " 增加鼠标行高亮
  193. set cursorline
  194. hi CursorLine  cterm=NONE   ctermbg=darkred ctermfg=white
  195. " 设置tab是四个空格
  196. set ts=4
  197. set expandtab
  198. " 主要给Tlist使用
  199. let Tlist_Exit_OnlyWindow = 1
  200. let Tlist_Auto_Open = 1
复制代码
将这两个文件vim到你们的服务器或者虚拟机上面去就可以将tmux的快捷键改成ctrl+a而且支持鼠标点击啦~

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

涛声依旧在

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表