当前位置:网站首页>Shortcut key modification of TMUX and VIM

Shortcut key modification of TMUX and VIM

2022-06-12 07:22:00 Java baa

Write it at the front

The notes come from acwing Of Linux course

Linux Video address :
https://www.acwing.com/activity/content/introduction/57/

0. Before knowledge points :

#  Jump to the user folder 
cd
#  establish  .tmux.conf  file   And edit 
vim .tmux.conf
#  Paste operation 
i(<Shift>+<Insert>)<Esc>:wq

1.tmux To configure

Create in user directory .tmux.conf file

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 To configure

Create in user directory .vimrc file

" 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 highlighting  syntax enable syntax on " According to the line Numbers 
set nu

" Change the default annotation color  "hi Comment ctermfg=DarkCyan
" Allow backspace key to delete  "set backspace=2
" Enable mouse  set mouse=a set selection=exclusive set selectmode=mouse,key " Press C Language format indent 
set cindent
set autoindent
set smartindent
set shiftwidth=4

"  Allows buffer switching when there are unsaved changes  "set hidden
                                                                                                                              
"  Set no backup files  set writebackup set nobackup " Show bracket matching 
set showmatch
" The bracket matching time is 1( The unit is one tenth of a second ) set matchtime=5 " Displays the current row number and column number :
set ruler
" The command being entered is displayed in the status bar  set showcmd set foldmethod=syntax " Do not collapse by default 
set foldlevel=100
"  Open the status bar information  set laststatus=2 "  Command line height , The default is 1, Set here as 2
set cmdheight=2


"  Show Tab operator , Use a highlighted vertical bar instead of  set list "set listchars=tab:\|\ ,
set listchars=tab:>-,trail:-
                                                                                                                                        

" Detect file types  filetype on " Load file type plug-in 
filetype plugin on
" Load related indented files for a specific file type  filetype indent on "  Enable auto completion 
filetype plugin indent on-


" Set up automatic recognition of coding ,  Chinese quotation marks show  filetype on " Open file type detection 
"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 " This can be very powerful , No matter encoding What's the code , Can display text in Chinese characters 
"set termencoding=gb2312 set termencoding=utf-8 " The encoding used for the new file 
set fileencoding=utf-8
"set fileencoding=gb2312 " Code for display , Just to show 
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. Written in the back

Welcome to your attention , Recently, I will often send some problems and notes encountered in work or study .

Please feel free to leave a message to discuss , Know all but answer !

原网站

版权声明
本文为[Java baa]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120715492254.html