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. 创建 ...
随机推荐
- Python的第三方web开发框架Django
1.Django Django是一个基于Python的第三方Web应用开发框架,可以简化Web开发. 官网:https://www.djangoproject.com/ 主要特点: ①采用MVC模型变 ...
- MVC4.0接口学习
/// <summary> /// 正则验证身份证号是否合法 /// </summary> /// <param name="sIdCard"> ...
- getcomputedstyle和style的区别
1.只读与可写getComputedStyle方法是只读的,只能获取样式,不能设置:而element.style能读能写,能屈能伸.2.获取的对象范围getComputedStyle方法获取的是最终应 ...
- BUUCTF WEB
BUUCTF 几道WEB题WP 今天做了几道Web题,记录一下,Web萌新写的不好,望大佬们见谅○| ̄|_ [RoarCTF 2019]Easy Calc 知识点:PHP的字符串解析特性 参考了一下网 ...
- leetcode976之三角形最大周长
题目描述: 给定由一些正数(代表长度)组成的数组 A,返回由其中三个长度组成的.面积不为零的三角形的最大周长. 如果不能形成任何面积不为零的三角形,返回 0. def largePara(A): A. ...
- 记录B端和C端产品的理解
C 为:Consumer.Client,我们每天都在接触C端产品,为消费者.个人用户或终端用户,比如:微信.头条.抖音.美团等等. B 为:Business,作为职场人士也会经常接触B端产品,通常为企 ...
- ClickHouse源码笔记1:聚合函数的实现
由于工作的需求,后续笔者工作需要和开源的OLAP数据库ClickHouse打交道.ClickHouse是Yandex在2016年6月15日开源了一个分析型数据库,以强悍的单机处理能力被称道. 笔者在实 ...
- Beta冲刺——测试随笔
这个作业属于哪个课程 软件工程 这个作业要求在哪里 团队作业第五次--Beta冲刺 这个作业的目标 Beta冲刺 作业正文 正文 github链接 项目地址 其他参考文献 无 一.测试工作安排 项目 ...
- DOM对HTML元素的增删改操作和事件概念和事件监听
DOM创建节点的方法: document.createElement(Tag),Tag必须是合法的HTML元素 DOM复制节点的方法: 节点cloneNode(boolean deep),当deep为 ...
- Jmeter(七) - 从入门到精通 - 建立数据库测试计划实战<MySQL数据库>(详解教程)
1.简介 在实际工作中,我们经常会听到数据库的性能和稳定性等等,这些有时候也需要测试工程师去评估和测试,上一篇文章宏哥主要介绍了jmeter连接和创建数据库测试计划的过程,宏哥在文中通过示例和代码非常 ...