KaliLinux在xShell的vim中默认是无法复制和粘贴的,需要做如下配置后才能使用:

方法一

进入vim命令行模式,输入:

:set mouse=c   #进入Command-line 模式

然后就可以正常粘贴复制了。

方法二

在root目录中新建一个名称为.vimrc的配置文件。

root@kali:~# vi .vimrc
-----------------------------------------------------------------------
" Vim config file. " Global Settings: {{{
syntax on " highlight syntax
filetype plugin indent on " auto detect file type set nocompatible " out of Vi compatible mode
"set number " show line number
set numberwidth= " minimal culumns for line numbers
set textwidth= " do not wrap words (insert)
set nowrap " do not wrap words (view)
set showcmd " show (partial) command in status line
set ruler " line and column number of the cursor position
set wildmenu " enhanced command completion
set wildmode=list:longest,full " command completion mode
set laststatus= " always show the status line
set mouse= " use mouse in all mode
set foldenable " fold lines
set foldmethod=marker " fold as marker
set noerrorbells " do not use error bell
set novisualbell " do not use visual bell
set t_vb= " do not use terminal bell set wildignore=.svn,.git,*.swp,*.bak,*~,*.o,*.a
set autowrite " auto save before commands like :next and :make
set cursorline
set hidden " enable multiple modified buffers
set history= " record recent used command history
set autoread " auto read file that has been changed on disk
set backspace=indent,eol,start " backspace can delete everything
set completeopt=menuone,longest " complete options (insert)
set pumheight= " complete popup height
set scrolloff= " minimal number of screen lines to keep beyond the cursor
set autoindent " automatically indent new line
set cinoptions=:,l1,g0,t0,(,(s " C kind language indent options
set clipboard+=unnamed " shared clipboard
set noexpandtab " do not use spaces instead of tabs set tabstop= " number of spaces in a tab
set softtabstop= " insert and delete space of <tab>
set shiftwidth= " number of spaces for indent
set expandtab " expand tabs into spaces
set incsearch " incremental search
set hlsearch " highlight search match
set ignorecase " do case insensitive matching
set smartcase " do not ignore if search pattern has CAPS
set nobackup " do not create backup file
"set noswapfile " do not create swap file
set backupcopy=yes " overwrite the original file set encoding=utf-
set termencoding=utf-
set fileencoding=utf-
set fileencodings=gb2312,utf-,gbk,gb18030
set fileformat=unix set background=dark
"colorscheme SolarizedDark_modified
"colorscheme wombat_modified
" gui settings
if has("gui_running")
set guioptions-=T " no toolbar
set guioptions-=r " no right-hand scrollbar
set guioptions-=R " no right-hand vertically scrollbar
set guioptions-=l " no left-hand scrollbar
set guioptions-=L " no left-hand vertically scrollbar
autocmd GUIEnter * simalt ~x " window width and height
language messages zh_CN.utf- " use chinese messages if has
endif " Restore the last quit position when open file.
autocmd BufReadPost *
\ if line("'\"") > && line("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
"}}} " Key Bindings: {{{
let mapleader = ","
let maplocalleader = "\\" " map : -> <space>
map <Space> : " move between windows
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l " Don't use Ex mode, use Q for formatting
map Q gq "make Y consistent with C and D
nnoremap Y y$ " toggle highlight trailing whitespace
nmap <silent> <leader>l :set nolist!<CR> " Ctrl-E to switch between 2 last buffers
nmap <C-E> :b#<CR> " ,e to fast finding files. just type beginning of a name and hit TAB
nmap <leader>e :e **/ " Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse> " ,n to get the next location (compilation errors, grep etc)
nmap <leader>n :cn<CR>
nmap <leader>p :cp<CR> " Ctrl-N to disable search match highlight
nmap <silent> <C-N> :silent noh<CR> " center display after searching
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#z
"}}} " mru
let MRU_Window_Height =
nmap <Leader>r :MRU<cr> " taglist
let g:Tlist_WinWidth =
let g:Tlist_Use_Right_Window =
let g:Tlist_Auto_Update =
let g:Tlist_Process_File_Always =
let g:Tlist_Exit_OnlyWindow =
let g:Tlist_Show_One_File =
let g:Tlist_Enable_Fold_Column =
let g:Tlist_Auto_Highlight_Tag =
let g:Tlist_GainFocus_On_ToggleOpen =
nmap <Leader>t :TlistToggle<cr> " nerdtree
let g:NERDTreeWinPos = "right"
let g:NERDTreeWinSize =
let g:NERDTreeShowLineNumbers =
let g:NERDTreeQuitOnOpen =
nmap <Leader>f :NERDTreeToggle<CR>
nmap <Leader>F :NERDTreeFind<CR> "paste
vmap <C-c> "+y
nmap <C-v> "+p
set pastetoggle=<F12> "C,C++ Java Compile and run by F5
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec "!g++ % -o %<"
exec "! ./%<"
elseif &filetype == 'cpp'
exec "!g++ % -o %<"
exec "! ./%<"
elseif &filetype == 'java'
exec "!javac %"
exec "!java %<"
elseif &filetype == 'sh'
:!./%
endif
endfunc "C,C++ debug
map <F8> :call Rungdb()<CR>
func! Rungdb()
exec "w"
exec "!g++ % -g -o %<"
exec "!gdb ./%<"
endfunc -----------------------------------------------------------
:wq
-----------------------------------------------------------
root@kali:~#

至此,用vim打开文件就具有粘贴和复制的功能,并且有高亮和至此,用vim打开文件就具有粘贴和复制的功能,并且有高亮和颜色了。

颜色了。

最新文章

  1. 导出Excel And 导出word
  2. vertical-align属性
  3. 【BZOJ-1406】密码箱 约数 + 乱搞 + set?
  4. oracle 编译中一个关于clntsh 库的一个 帖子 ,收藏!
  5. unity3d角色控制器01
  6. Brute-force Algorithm_矩阵快速幂&amp;&amp;欧拉公式*****
  7. HDU 4599 概率DP
  8. [shell基础]——find命令
  9. java基础(一)对象
  10. 敏捷开发(十)- Scrum每日例会
  11. JS——基础知识(二)
  12. HDU 5144 NPY and shot(物理运动学+三分查找)
  13. 对LCS算法及其变种的初步研究
  14. 史上最全面的Docker容器引擎使用教程
  15. Java多线程系列1 线程创建以及状态切换
  16. Googlenet 中1*1 卷积核分析
  17. 窗口过程 Wndproc
  18. Unity3D十款最火的的插件推荐
  19. Delphi开发的一些技巧
  20. &lt;寒假逆向学习第一天&gt; 破解基础知识之介绍常见工具和壳的特征

热门文章

  1. 【Django+Element UI】使用一个接口文件,搞定分页获取数据,模糊查询后分页获取数据
  2. 判断对象oStringObject是否为String
  3. mysql运维入门6:MySQL读写分离
  4. 高版本Jenkins关闭跨站请求伪造保护(CSRF)
  5. Gunicorn+Nginx+Flask项目部署
  6. docker安装和基本使用
  7. SD.Team颜色代码大全
  8. 01)原生php写一个小网站
  9. 生成随机字符串 php
  10. 使用ADMT和PES实现window AD账户跨域迁移-介绍篇