vi

xshell -5 进入退出编辑文件

假装没事ソ 提交于 2019-12-08 20:35:21
进入编辑文件 输入命令 vim urls.py #打开urls.py 文件并编辑 进入如图界面 退出编辑文件 在上图界面中按 “|”这个键(回车键和shift附近的) 进入插入模式了 按esc键 输入“:”冒号 进入编辑模式,按 o 进行编辑 编辑结束,按ESC 键 跳到命令模式,然后输入退出命令: :w 保存文件但不退出vi 编辑 :w! 强制保存,不退出vi 编辑 :w file将修改另存到file中,不退出vi 编辑 :wq 保存文件并退出vi 编辑 :wq! 强制保存文件并退出vi 编辑 q: 不保存文件并退出vi 编辑 :q! 不保存文件并强制退出vi 编辑 :e! 放弃所有修改,从上次保存文件开始在编辑 来源: CSDN 作者: zhangyu4863 链接: https://blog.csdn.net/zhangyu4863/article/details/79903264

Is there visual flash effect for editing?

我的梦境 提交于 2019-12-08 19:10:52
问题 What we are looking for is to visually flash briefly the affected areas of vim editing in normal mode. For example, when editing if (true) { //line to be deleted } if we do dd on //line to be deleted , this affected area should be flashed before deleting, the same we can do using Vd . What we are looking is the same effect as that of Vd using dd . This should work for all editing operations like c , y etc. We tried mapping it with nnoremap dd Vd to test for a single line, no luck. Not even

Anyone know of any (free / open source) VI integration for Visual Studio?

心已入冬 提交于 2019-12-08 14:26:30
问题 vi is for cool kids. 回答1: ViEmu - Not Free but great Vim emulation. Visual_Studio.vim - Allows you to manage visual studio from Vim. Using GVim as the Visual Studio Editor 回答2: After @joe's answer, Jared Parsons created the great VsVim. It's been featured on Visual Studio Gallery. It's a ready extension package. I downloaded it, ran the file and it worked out of the box. It's free, too. 回答3: Starting with Visual Studio 2010 you can use VsVim. It's a free extension available on the extension

Vim & Mac: How to copy to clipboard without pbcopy

◇◆丶佛笑我妖孽 提交于 2019-12-08 07:44:45
问题 I have a version of vim with both clipboard and xterm_clipboard support. However, "*y or "+y don't copy to the system clipboard. I know I can use :w !pbcopy (and even create a shortcut for it), but I really want the standard way. I saw fakeclip also, but wish to find a solution that is not fake... Moreover, I wish to not need to use "* or "+ and just use y UPDATE: I just checked using the :reg command. I copied some text In another application then in vim ran the :reg command. The text is not

++ in vim commands

独自空忆成欢 提交于 2019-12-08 02:47:07
问题 What does ++ mean in vim? For example, :e ++ff=dos . I understand e and ff=dos , just not sure how ++ fits in there. 回答1: :h ++opt for detail The [++opt] argument can be used to force the value of 'fileformat', 'fileencoding' or 'binary' to a value for one command, and to specify the behavior for bad characters. The form is: > ++{optname} Or: > ++{optname}={value} Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* *++edit* ff or fileformat overrides 'fileformat' enc or encoding

render text with escape squence (like a terminal)

試著忘記壹切 提交于 2019-12-08 02:23:57
问题 Hi, I'm looking for some lib or tool to render text with escape squence chars in a text file. I dont know how to call this, but here is a example: ~$ echo -e "abc\vdef" abc def ~$ ~$ echo -e "abc\vdef" > /tmp/xxxxx ~$ vi /tmp/xxxxx I got abc^Kdef on screen. so i'm searching some tool that can do this for me: ~$ sometool /tmp/xxxxx > /tmp/yyyyy ~$ vi /tmp/yyyyy I can get abc def in vi window. \v is just a example, I need convert \v, \b, \f, etc. to harithski: but what I want is: $~/:sometool

No syntax highlighting after session restore in terminal

风流意气都作罢 提交于 2019-12-08 02:09:42
问题 I'm using Mac Lion 10.7.1, MacVim Snapshot 61, Vim version 7.3 I want to save the session on quit and restore the last session on Vim start without any arguments. So I added this code in my .vimrc file: autocmd VimEnter * call LoadSession() autocmd VimLeave * call SaveSession() function! SaveSession() execute 'mksession! $HOME/.vim/sessions/session.vim' endfunction function! LoadSession() if argc() == 0 execute 'source $HOME/.vim/sessions/session.vim' endif endfunction this works great with

vi & vim 插入 删除 修改 文本

旧城冷巷雨未停 提交于 2019-12-07 16:44:05
Abstract: 1) 插入文本; 2)修改文本; 3)删除文本; vi & vim 有编译模式与命令模式,下述光标移动操作均为命令模式下操作; 下文中以 ^ 符表示 Ctrl 键被按下,如 ^F 标示 Ctrl 与 F 键被同时按下; 下文中以 + 号表示按下某键后再按另外按键,如 z + Enter 表示先按下 z 键,再按下 Enter 键; 1, 插入文本: (命令模式下) 1.1 命令模式下按下 i 键,进入vi & vim 的插入编辑模式进行文本插入: 1.2 命令模式下按下 a 键,进入 vi & vim 的追加插入编辑模式进行文本插入: note: 插入与追加插入命令都会使 vi & vim 进入文本插入编辑模式, 唯一区别就是插入命令会保持光标位置不变,追加命令会使光标移到原光标位置的下一个字母的位置进行文本插入。 2, 修改文本: 2.1 修改文本字母: 2.1.1 命令 r + 字母 ,修改光标所在位置的字母为指定的字母,r 命令只修改一个字母,操作完成后依旧停留在命令模式,不需要按 Esc 键返回命令模式。 2.1.2 命令 s + 字母,替换光标所在位置的字母为任意输入文本, 此命令会删除光标所在的字母,使 vi & vim 进入插入编辑模式,此时可以输入任意你想输入的文本,直到你按下 Esc 键退出插入编辑模式。 2.1.3 命令 数字 + s +

VIM查看中文编码文件显示为乱码的解决办法

梦想的初衷 提交于 2019-12-07 16:23:04
修改你的.vimrc文件,让其支持 gb2312就行,会自动识别的。 可以参考我的设置 代码: "设定文件编码类型,彻底解决中文编码问题 let &termencoding=&encoding set fileencodings=utf-8,gbk,ucs-bom,cp936 -------------------------------------------------------------------------------- oldniu 按照karron的方法解决了终端中vi看中文字问题。谢谢 略微查了一下.vimrc中添加内容的含意,这篇文章有相关解释。 http://blog.dawnh.net/comment.php?type=trackback&entry_id=59 内容如下: vim中编辑不同编码的文件时需要注意的一些地方 此文讲解的是vim编辑多字节编码文档(中文)所要了解的一些基础知识,注意其没有涉及gvim,纯指字符终端下的vim。 [vim编码方面的基础知识] 1,存在3个变量: encoding----该选项使用于缓冲的文本(你正在编辑的文件),寄存器,Vim 脚本文件等等。你可以把 'encoding' 选项当作是对 Vim 内部运行机制的设定。 fileencoding----该选项是vim写入文件时采用的编码类型。 termencoding-

What is the best way to add a custom key mapping in vim/vi? (Does there exist a unbound keyspace for customization?)

余生长醉 提交于 2019-12-07 13:00:38
问题 I know you can add custom keymappings to vim with imap in the .vimrc file. My question is, if one is to create additional custom operators, motions, commands and map them to keys, what is the best way to add them in so they don't conflict with existing bindings? An analogy, in emacs, a lot of custom key commands are added via the C-c sequence. To be more technical, are there unbound keys in vim that allow for user customization? In other words, is there a free keyspace available to users? 回答1