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. 创建 ...
随机推荐
- chrome "items hidden by filters"
今天更新chrome 后遇到console不能显示errors的问题,折腾一番后发现在console的Default levels中选择Default即可.
- JavaScript基础技术总结
javascript的作用 HTML网页运行在浏览器端,与用户没有交互功能,用户访问网页的时候只能看,如果网页没有程序员去更新,永远是一成不变的.JavaScript就是可以让程序运行在网页上,提高客 ...
- LibreOJ #515 贪心只能过样例
题目链接:https://loj.ac/problem/515 知识点: DP.bitset类 解题思路: DP部分不难想到:从 a 到 b 遍历,然后在已有的状态上加上遍历得到的数字的平方,难点在于 ...
- GO 使用Webhook 实现github 自动化部署
通常大家开发大部分是本地git push 提交,服务器上git pull 手动更新.git 可以使用webhook实现自动部署.webhook是仓库平台的一个钩子事件,通过hook 钩子监听代码,回调 ...
- spring的mybatis-puls 配置,增删改查操作,分页
pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.or ...
- Mysql添加更新删除数据-表
例如 此处拥有一个表名为 uuser 为表添加新数据 ,'); ,'); ,'); 假如只想添加uid和uname ,'小张'); 那么pas自动填充为NULL. 为表更新数据 这里把小王的pas改成 ...
- 监控-zabbix
1:什么是监控? 监控:安防的监控 看监控,事后追责 linux监控: 事前预警,数据分析 2:常见的linux监控命令 cpu 1 top 2 htop 3 uptime ...
- PIC单片机的i2c的程序
#include<pic.h>#define uchar unsigned char#define uint unsigned int#define add 0xaa__CONFIG(0x ...
- [注]6W运营法则教你盘活社区内容运营
社区运营人员大体分为两种:一种是内容运营,这类人才基于产品,一般对文字以及对广告文案比较敏感:另外一种则是更多基于产品推广运营,前者需要把内容最大化地曝光,后者则是把产品推送给用户,两者的是相辅相成, ...
- Weblogic 漏洞利用总结
整理的一些利用方式,后续会更新到15年至今的洞 后台爆破拿shell 后台爆破: 部署-安装-上载文件 制作war包,一直下一步,最好保存 jar -cvf shell.war ./shll/* 上传 ...