00-03.kaliLinux-vi粘贴复制功能配置
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打开文件就具有粘贴和复制的功能,并且有高亮和颜色了。
颜色了。
00-03.kaliLinux-vi粘贴复制功能配置的更多相关文章
- vi、vim 配置上下左右方向键和删除键
vi.vim 配置上下左右方向键和删除键 " An example for a vimrc file. " " Maintainer: Bram Moolenaar &l ...
- linux vi粘贴格式易错乱
对于一些冗长的代码完全可以粘贴的时候,vi粘贴所有格式全部错乱,完全无法阅读. 解决办法:esc进入命令行模式后,输入 :set paste,然后再i进入粘贴编辑模式,即可正常复制并保留原有格式-
- Redis Exception: Exceeded timeout of 00:00:03
Redis Exception: Exceeded timeout of 00:00:03 居然是 重启了网管, 把网络禁用重启就好了. 服 最终更新: 原来是架构湿 设置为每分钟只能读取6 ...
- vi编辑器常用配置
在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号.语法高亮度显示.智能缩进等功能的.为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc. 在启动vim时,当前用户 ...
- 防止vi粘贴时自动添加缩进的方法
使用Xshell连接Linux服务器,使用vi打开文件进行粘贴时,会自动在行首添加很多空格,导致格式错乱.可以用如下方法剞劂 在拷贝前输入:set paste (这样的话,vim就不会启动自动缩进,而 ...
- vi粘贴代码后格式混乱的问题
最近在远程终端使用vi发现从其他地方复制代码的后,粘贴到vi里面出现格式变乱的问题. 主要是因为终端通常无法区分输入是来自用户输入还是来自粘贴,所以终端也不能通知 vim 输入来自何处.在 vim 里 ...
- Vim 的粘贴复制功能
Vim作为最好用的文本编辑器之一,使用vim来编文档,写代码实在是很惬意的事情.每当学会了vim的一个新功能,就会很大地提高工作效率.有人使用vim几十年,还没有完全掌握vim的功能,这也说明了vim ...
- 禁止UITextField 使用粘贴复制功能
在开发中有时候会遇到这样的需求,就是一个文本框里面的内容不允许用户复制,或者不允许用户将其它地方复制的内容粘贴进来,本文交给你怎么实现禁止 UITextField 的粘贴.复制. 在 UITextFi ...
- Hibernate框架笔记03表操作多对多配置
目录 1. 数据库表与表之间的关系 1.1 一对多关系 1.2 多对多关系 1.3 一对一关系[了解] 2. Hibernate的一对多关联映射 2.1 创建一个项目,引入相关jar包 2.2. 创建 ...
随机推荐
- Failed to start mongod.service: Unit not found
其实自己用惯的是MYSQL,然后项目最后一步完善数据读写的部分,本来打算用mysql的,然而在centOS系统上发现安装总是出问题,后来查找一下资料,发现centOS系统上一般用的是Mariadb,这 ...
- RenderBox使用说明书&原理浅析
本文基于1.12.13+hotfix.8版本源码分析. 0.目录 一.RenderBox的用法 1.RenderBox的使用基本流程 2.RenderObjectWidget 3.非容器控件的hitT ...
- redis 主从哨兵02
一.为什么要复制 1.实现数据的多副本存储,从而可以实现服务的高可用 2.提供更好的读性能,分担读请求 二.复制技术的关键点及难点 1.如何指定被复制对象 2.增量还是全量,以及如何实现增量 3.复制 ...
- MyCat基本知识
一.Mycat基本元素 1.逻辑库,mycat中存在,对应用来说相当于mysql数据库,后端可能对应了多个物理数据库,逻辑库中不保存数据 2.逻辑表,逻辑库中的表,对应用来说相当于mysql的数据表, ...
- python-基站位置查询
本文采用的接口是聚合数据提供的 python2.7环境,3.x环境试了下好像不支持,获取位置信息为空 如下为运用代码: #coding=utf-8 ''' Created on 2019年9月18日 ...
- JAVA自定义数据类型用法
一,自定义数据类型的概念: 我们就拿一部手机进行分析,它能用来做什么呢?它可以打电话,上网,聊微信等,这些就是 手机所提供的功能,也就是方法:手机也有它的特征,如颜色.尺寸大小.品牌型号等,这些 ...
- python中几个双下划线用法的含义
_ _ init() _ _(self[,...]) 我们有时在类定义写__init()__方法,但是有时又没有.__init()__方法相当于其他面向对象的编程语言中的构造方法,也就是类在实例化成对 ...
- & vue项目中的rem适配
有个朋友问我在vue项目怎么做rem适配,我工作中都是用的dva,但是我感觉道理都是一样的,换汤不换药.配完就顺手写下来吧! 需要安装两个插件库 lib-flexible和px2rem-loader ...
- JAVA WEB EL表达式注入
看猪猪侠以前的洞,顺便总结下: 一.EL表达式简介 EL 全名为Expression Language.EL主要作用: 1.获取数据 EL表达式主要用于替换JSP页面中的脚本表达式,以从各种类型的we ...
- 前端和Nodejs的关系 简单理解
前端使用JS脚本语言进行开发. JS脚本语言需要依赖一个平台运行,从而生成可视化的东西. Node.js提供这个平台,同时提供JS运行需要的一些插件.库.包.轮子.组件.功能等等. JavaScrip ...