当前位置:网站首页>tmux 和 vim 的快捷键修改
tmux 和 vim 的快捷键修改
2022-06-12 07:15:00 【Java咩】
写在前面
笔记来自于 acwing 的 Linux 课
Linux 视频地址:
https://www.acwing.com/activity/content/introduction/57/
0.知识点前要:
# 跳到用户文件夹
cd
# 创建 .tmux.conf 文件 并编辑
vim .tmux.conf
# 粘贴操作
i(<Shift>+<Insert>)<Esc>:wq
1.tmux配置
在用户目录下创建 .tmux.conf 文件
set-option -g status-keys vi
setw -g mode-keys vi
setw -g monitor-activity on
# setw -g c0-change-trigger 10
# setw -g c0-change-interval 100
# setw -g c0-change-interval 50
# setw -g c0-change-trigger 75
set-window-option -g automatic-rename on
set-option -g set-titles on
set -g history-limit 100000
#set-window-option -g utf8 on
# set command prefix
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind < resize-pane -L 7
bind > resize-pane -R 7
bind - resize-pane -D 7
bind + resize-pane -U 7
bind-key -n M-l next-window
bind-key -n M-h previous-window
set -g status-interval 1
# status bar
set -g status-bg black
set -g status-fg blue
#set -g status-utf8 on
set -g status-justify centre
set -g status-bg default
set -g status-left " #[fg=green]#[email protected]#H #[default]"
set -g status-left-length 20
# mouse support
# for tmux 2.1
# set -g mouse-utf8 on
set -g mouse on
#
# for previous version
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g status-right-length 25
set -g status-right "#[fg=green]%H:%M:%S #[fg=magenta]%a %m-%d #[default]"
# fix for tmux 1.9
bind '"' split-window -vc "#{pane_current_path}"
bind '%' split-window -hc "#{pane_current_path}"
bind 'c' new-window -c "#{pane_current_path}"
# run-shell "powerline-daemon -q"
# vim: ft=conf
2.vim配置
在用户目录下创建 .vimrc 文件
" An example for a vimrc file. "
" To use it, copy it to " for Unix and OS/2: ~/.vimrc
">-- for Amiga: s:.vimrc " for MS-DOS and Win32: $VIM\_vimrc
">-- for OpenVMS: sys$login:.vimrc " When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode set backspace=indent,eol,start if has("vms") set nobackup>->---" do not keep a backup file, use versions instead
else
set backup>--->---" keep a backup file endif set history=50>->---" keep 50 lines of command line history
set ruler>-->---" show the cursor position all the time set showcmd>>---" display incomplete commands
set incsearch>-->---" do incremental searching "==========================================================================
"My Setting-sunshanlu "==========================================================================
vmap <leader>y :w! /tmp/vitmp<CR>
nmap <leader>p :r! cat /tmp/vitmp<CR>
"语法高亮 syntax enable syntax on "显示行号
set nu
"修改默认注释颜色 "hi Comment ctermfg=DarkCyan
"允许退格键删除 "set backspace=2
"启用鼠标 set mouse=a set selection=exclusive set selectmode=mouse,key "按C语言格式缩进
set cindent
set autoindent
set smartindent
set shiftwidth=4
" 允许在有未保存的修改时切换缓冲区 "set hidden
" 设置无备份文件 set writebackup set nobackup "显示括号匹配
set showmatch
"括号匹配显示时间为1(单位是十分之一秒) set matchtime=5 "显示当前的行号列号:
set ruler
"在状态栏显示正在输入的命令 set showcmd set foldmethod=syntax "默认情况下不折叠
set foldlevel=100
" 开启状态栏信息 set laststatus=2 " 命令行的高度,默认为1,这里设为2
set cmdheight=2
" 显示Tab符,使用一高亮竖线代替 set list "set listchars=tab:\|\ ,
set listchars=tab:>-,trail:-
"侦测文件类型 filetype on "载入文件类型插件
filetype plugin on
"为特定文件类型载入相关缩进文件 filetype indent on " 启用自动补全
filetype plugin indent on-
"设置编码自动识别, 中文引号显示 filetype on "打开文件类型检测
"set fileencodings=euc-cn,ucs-bom,utf-8,cp936,gb2312,gb18030,gbk,big5,euc-jp,euc-kr,latin1 set fileencodings=utf-8,gb2312,gbk,gb18030 "这个用能很给劲,不管encoding是什么编码,都能将文本显示汉字
"set termencoding=gb2312 set termencoding=utf-8 "新建文件使用的编码
set fileencoding=utf-8
"set fileencoding=gb2312 "用于显示的编码,仅仅是显示
set encoding=utf-8
"set encoding=utf-8 "set encoding=euc-cn
"set encoding=gbk "set encoding=gb2312
"set ambiwidth=double
set fileformat=unix
3.写在后面
欢迎关注,近期会经常发一些工作或学习中遇到的问题和笔记。
欢迎随时留言讨论,知无不答!
边栏推荐
- Decoupling in D
- Recommend 17 "wheels" to improve development efficiency
- [image detection] SAR image change detection based on depth difference and pcanet with matlab code
- 9 Sequence container
- CL210OpenStack操作的故障排除--章節實驗
- 网络丢包问题排查
- Expansion of D @nogc
- Problems encountered in learning go
- How to update kubernetes certificates
- Map to sort
猜你喜欢

sql——课程实验考查

Explain ADC in stm32

2022年G3锅炉水处理复训题库及答案

【图像检测】基于深度差分和PCANet实现SAR图像变化检测附matlab代码

Jackson XML is directly converted to JSON without writing entity classes manually

5 ROS simulation modeling (4-navigation navigation simulation)

企业微信官方 加解密库 PHP7版本报错 mcrypt_module_open 未定义方法 并且被PHP抛弃 解决方法使用 openssl解决

Static coordinate transformation in ROS (analysis + example)

Detailed explanation of coordinate tracking of TF2 operation in ROS (example + code)

私有协议的解密游戏:从秘文到明文
随机推荐
Design an open source continuous deployment pipeline based on requirements
Detailed explanation of 14 registers in 8086CPU
【WAX链游】发布一个免费开源的Alien Worlds【外星世界】脚本TLM
D cannot use a non CTFE pointer
2022R2移动式压力容器充装试题模拟考试平台操作
3 strings, containers, and arrays
新知识:Monkey 改进版之 App Crawler
d中的解耦
4 expression
循环链表和双向链表—课上课后练
Use case design of software testing interview questions
2022年危险化学品经营单位安全管理人员特种作业证考试题库及答案
Esp8266 firmware upgrade method (esp8266-01s module)
Scons compiling imgui
Day 6 of pyhon
leetcode.39 --- 组合总和
Detailed explanation of memory addressing in 8086 real address mode
openwrt uci c api
sql——课程实验考查
When SQL server2019 is installed, the next step cannot be performed. How to solve this problem?