vi

Software Requirements for Code Creation / Editor with RSI Type Symptoms (unusable fingers)

Deadly 提交于 2019-11-29 08:10:53
I do know and have read the appropriate topics section for this site. I have seen various topics about RSI, posture etc closed as being off topic and referred to another site/section. I think however that my question will be worded such that it comes under the "Software Requirements" section as I am looking for input on specific types as well as configuration of software for some very specific medical issues I have. This is not a topic about prevention of RSI, it is just the closest I can put in a title that people will understand off the bat. I may have already answered my question just by

VIM

淺唱寂寞╮ 提交于 2019-11-29 07:53:59
一、vim介绍 vim是vi的升级版 vim是带有颜色显示的,vi没有 yum install -y vim enhanced 安装这个包 分别有三种模式:一般模式,编辑模式,命令模式 vi vim vim一般模式下移动光标 空格键也是向右移动快捷键 h:向左移动光标 l:向右移动光标 k:向上移动光标 j:向下移动光标 crtl+f(pgup)):屏幕向前移动一页 ctrl+b(pgdn):屏幕向后移动一页 数字0或者shift6:移动到本行行首 shift 4:移动到本行行末 gg:移动到首行 G:移动到末行 nG(n是任意数字):移动到第n行 vim一般模式下复制粘贴 x:表示向后删除一个字符 X:表示向前删除一个字符 nx:表示向后删除N个字符 dd:删除/剪切光标所在的那一行 ndd:(n表示number缩写)删除/剪切所在行之后的第n行 yy:复制光标所在行 p(小写):从光标所在行开始,向下粘贴已经复制或者粘贴的内容 P(大写):从光标所在行开始,向上粘贴已经复制或者粘贴的内容 nyy:从光标所在行开始,向下复制n行 u:还原上一步操作,最多可以恢复50次操作 ctrl r反恢复 v:按v移动光标会选中指定字符。然后可以实现复制、粘贴等操作 进入编辑模式 i:光标不会移动,在你当前光标的位置插入 I:直接在光标行首位置编辑插入 o:在当前光标行所在的下一行插入新的一行

Linux运维第六天课程

荒凉一梦 提交于 2019-11-29 07:01:25
1.操作系统基础管理命令 2.操作系统快捷方式使用 3.操作系统编辑命令vi 4.如何查看系统命令帮助手册 5.系统的目录结构 和文件目录都有关系的一些命令 系统数据信息进行备份 copy ==> cp 复制命令 语法格式: cp 参数 源文件(需要备份文件) 目标文件(备份之后的文件) 备份文件信息 [root@zhanglei /oldboy]# cp /oldboy/abc /oldboy/abc.txt 补充:覆盖文件问题 正常复制文件会有覆盖提示: [root@zhanglei /oldboy]# cp /oldboy/abc /oldboy/abc.txt cp: overwrite ‘/oldboy/abc.txt’? y [root@zhanglei /oldboy]# cat /oldboy/abc.txt lei 如何进行强制覆盖: 方法一: \cp oldboy01.txt /opt/ --- 忽略覆盖提示信息 方法二: /usr/bin/cp oldboy01.txt /opt/ --- 忽略覆盖提示信息 备份目录信息 cp -r oldboy 2.系统数据信息移动操作(剪切 move)==> mv 语法格式: mv 参数 源文件(需要移动文件) 移动文件信息: 移动目录信息: [root@zhanglei ~]# mv /oldboy/ /tmp/

Indenting entire file in Vim without leaving current cursor location

房东的猫 提交于 2019-11-29 04:28:30
I already know that gg=G can indent the entire file on Vim. But this will make me go to the beginning of the file after indent. How can I indent the entire file and maintain the cursor at the same position? See :h '' This will get you back to the first char on the line you start on: gg=G'' and this will get you back to the starting line and the starting column: gg=G`` I assume the second version, with the backtick, is the one you want. In practice I usually just use the double apostrophe version, since the backtick is hard to access on my keyboard. Add this to your .vimrc function! Preserve

VIM: Finding and replacing first N occurrences of a word

我怕爱的太早我们不能终老 提交于 2019-11-29 03:01:07
问题 I am editing a file and i want to change only a specific word with another word, but only for first N occurrences. I tried multiple commands N :s/word/newword/ :%s/word/newword/count And other commands that i could find on google. But none of them works. EDIT:: Vim commands is preferred. But Vim script can also be used. I don't have any prior experience in vim scripting. 回答1: Using a disposable recording allows you to control exactly how many changes you do: qq " start recording in register q

Mapping <Shift>-Arrows to selecting characters/lines

。_饼干妹妹 提交于 2019-11-29 02:02:52
问题 I started to use vim recently, but I miss the character/line selection methods from other text editors. By default vim maps <S-Up> , <S-Down> to jumping one page up/down and I want to remap these to text selection. Is there a way to do that? 回答1: Vim doesn't bend to that easily in my opinion. The terminal one doesn't even recognize Shift-Up in my case! I thought the v (character-wise selection) or V (line-wise selection) was among the easier concepts to learn about vi/vim. If this works (can

How to find the callers and callee of a function in C code in vi/vim?

与世无争的帅哥 提交于 2019-11-29 01:36:24
问题 I want to know how can I easily click (or maybe use some easy shortcuts) on a function name and find all its callee or open where it has been defined. Most of the web manuals in web are really hard to follow or don't happen to work out. Say I want to click on allocuvm and see where it has been defined? uint newstk=allocuvm(pgdir, USERTOP-PGSIZE, USERTOP); 回答1: For that, Vim integrates with the cscope tool; see :help cscope for more information. 回答2: cscope minimal example Ingo mentioned it,

How can I open vim with a particular line number at the top?

浪子不回头ぞ 提交于 2019-11-29 00:18:40
问题 I know it is possible to have vim open a file at particular line number using this syntax: vim +500 filename However, I would like it to open with the specified line at the top of the editor window, not in the middle. 回答1: You could issue zt after opening the file, so something like: vim +500 filename -c 'normal zt' . 回答2: As an alternative (because I ended up here searching for it), if you want to have the syntax vim <filename>:<linenumber> , eg vim test.rb:45 , you can use vim-fetch with

Getting vim to recognize XML

主宰稳场 提交于 2019-11-28 23:09:13
I would like vim to help me indent my xml files like my C code. However, when I use gg=G It just sets everything to the left. Do I need to designate a syntax? Is XML recognized as a language? Idan Arye Put filetype plugin indent on in your .vimrc to have Vim automatically identify .xml files as xml. You might need to put set nocompatible before that. If the file extension is not .xml, you can make Vim threat it like xml by using :set filetype=xml After you do that, Vim's autoindention (and syntax highlighting, and omnicomplete (that in xml just closes tags, but that's still something)) will

vi命令的使用

▼魔方 西西 提交于 2019-11-28 21:45:30
1)、 查找字符串 命令模式下输入“/字符串”,例如“/USER”,输入的时候无两边的引号,按n查找下一个 命令模式下输入“?字符串”,按n查找上一个 2)、 跳转到第一行 方法一::0或:1 方法二:连续两次g 3)、 跳转到最后一行 方法一:shift + g或G 方法二::$ 4)、 跳转当前行第一个字符 0 5)、 跳转当前行最后一个字符 shift + 4或 $ 6)、 跳转到第10行 10gg 或 :10 7)、 删除当前行 dd 8)、显示编号 :set nu 9)、 退出vi :w (保存当前文件) :w filename (将文件以指定的文件名“filename”保存) :wq (保存并退出vi) :wq filename(将正在编辑的文件保存为“filename”文件退出vi) :q (退出vi) :q! (不存盘强制退出vi) :x (相当于 :wq 的功能) 来源: https://www.cnblogs.com/yangxuyang/p/11427751.html