vim

Linux下VIM编译器的使用以及shell编程基础

左心房为你撑大大i 提交于 2020-01-15 14:32:09
VIM编译器的安装与使用 vim编辑器安装 在CentOS中,执行:yum -y install vim 普通模式 h: 左移一个字符 j: 下移一行 k: 上移一行 l: 右移一个字符 PageDown(或Ctrl+F):下翻一屏 PageUp(或Ctrl+B):上翻一屏 G:移到缓冲区的最后一行 num G:移动到缓冲区中的第num行 gg:移到缓冲区的第一行 命令行模式 普通模式下按下冒号键 保存、退出命令: q:如果未修改缓冲区数据,退出 q!:取消所有对缓冲区数据的修改并退出 w filename:将文件保存到另一个文件中 wq:将缓冲区数据保存到文件中并退出 删除数据: x: 删除当前光标所在位置的字符 dd: 删除当前光标所在行 dw: 删除当前光标所在位置的单词 d$: 删除当前光标所在位置至行尾的内容 编辑数据: J: 删除当前光标所在行行尾的换行符(拼接行) u: 撤销前一编辑命令 a: 在当前光标后追加数据 A: 在当前光标所在行行尾追加数据 编辑数据: r char: 用char替换当前光标所在位置的单个字符 R text: 用text覆盖当前光标所在位置的数据,直到按下ESC键 o: 在当前光标的下一行追加数据 O: 在当前光标上一行追加数据 编辑数据: i: 在当前光标前插入 I:在当前光标所在行开头插入 复制和粘贴: yw:复制一个单词 y$

Automate rails.vim

ⅰ亾dé卋堺 提交于 2020-01-15 09:16:08
问题 I use vim(in console) 7.1 for rails developments on OSX or Ubuntu. Here's what I repeatedly do when I edit files of rails. cd RAILS_ROOT vim :Rproject .project Is there a way that the last part is automatically done? For example, I just type 'vim -some_arg' and it automatically triggers ":Rproject .project"? If that's not possible, can I alias "Rproject .project" to "Rp"? I am familiar with vim editing but not vim script. Help me please. Sam 回答1: there is probably a better way to do this, but

How to efficiently escape meta-characters in vim search

妖精的绣舞 提交于 2020-01-15 08:18:41
问题 Perl provides quotemeta function, as well as the possibility to surround strings using the \Qlots-of-meta-characters\E construct, to make sure that all the characters between \Q and \E are interpreted as literals. Very often I search strings full of meta characters in Vim. It's counterproductive to escape every special character individually. Is there anything like /\Qstring-to-search\E in Vim, which would make life easier? 回答1: You can use /\Vstring-to-search . There are two caveats: \ is

Vim automatic scroll buffer

China☆狼群 提交于 2020-01-15 08:09:31
问题 I'm trying to do something very simple: I have two buffers in Vim, one with source code (B1), another one with a text file a.txt (B2). The source code in B1 is run with a custom shortcut in Vim, filling a.txt with text. I want Vim to automatically scroll B2 every time it updates, even if my cursor is in B1. So, I just want that the buffer B2 to behave the way tail -f does. Doing this with ConqueTerm is not an option, since buffer B2 can be a preview buffer from other plugin. 回答1: In general,

Centos部署Flask项目

荒凉一梦 提交于 2020-01-15 07:16:42
1.安装git: sudo yum install git 2.安装mysql客户端(如果数据库在本机需要安装mysql服务端) wget https://dev.mysql.com/get/mysql-community-client-5.7.25-1.el7.x86_64.rpm rpm -Uvh mysql-community-client-5.7.25-1.el7.x86_64.rpm 如果此处报错则在后面加上--force --nodeps(由于yum安装了旧版本的GPG keys造成的) 3.安装python3 sudo mkdir /usr/local/python3 # 创建安装目录 wget --no-check-certificate https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz #下载Python源文件 # 注意:wget获取https的时候要加上:--no-check-certifica tar -xzvf Python-3.6.4.tgz # 解压缩包 cd Python-3.6.4 # 进入解压目录 sudo ./configure --prefix=/usr/local/python3 # 指定创建的目录 sudo make sudo make install # 编译安装

Default GNU Linker Script name so VIM does Syntax Highlighting

旧巷老猫 提交于 2020-01-15 06:10:29
问题 What is the usual suffix for a linker script so that VIM will use syntax-highlighting on it? 回答1: It seems to be .ld , only from what I see Vim doesn't come (at least mine doesn't, 7.3.) with the syntax files for it. Try the ones offered for download here. 来源: https://stackoverflow.com/questions/9612818/default-gnu-linker-script-name-so-vim-does-syntax-highlighting

Default GNU Linker Script name so VIM does Syntax Highlighting

爱⌒轻易说出口 提交于 2020-01-15 06:10:08
问题 What is the usual suffix for a linker script so that VIM will use syntax-highlighting on it? 回答1: It seems to be .ld , only from what I see Vim doesn't come (at least mine doesn't, 7.3.) with the syntax files for it. Try the ones offered for download here. 来源: https://stackoverflow.com/questions/9612818/default-gnu-linker-script-name-so-vim-does-syntax-highlighting

Mac软件

左心房为你撑大大i 提交于 2020-01-15 06:04:57
MacVim Mac开发利器之程序员编辑器MacVim学习总结 http://www.bwscitech.com/a/jishuzixun/javayuyan/2014/0531/28849.html 官网下载 http://www.macupdate.com/app/mac/25988/macvim 把 MacVim.app放到你的 应用程序也就是 /Applications目录下(必须放到应用程序目录下,否则终端调用: mvim 会找不到MacVim的可执行文件) 把 mvim拷贝到 /usr/bin/这个目录下 ($sudo cp -f mvim /usr/bin/)(终端就可以通过 mvim 文件名 来启动MacVim编辑文件了) reader.txt(看完删除) 截图软件snip ( 支持滚动截屏 ) http://jingyan.baidu.com/article/fec4bce2458d03f2618d8b8e.html Photoshop CS6 for Mac 简体中文正式 完美破解版 支持Retina屏 http://www.nowmac.com/soft/design/graphic/Photoshop-CS6.html 保存PS动作: 来源: https://www.cnblogs.com/znios/p/4618146.html

Set tab as 2 spaces in vimrc, but still set to 4 spaces when editing python files

◇◆丶佛笑我妖孽 提交于 2020-01-15 06:01:27
问题 I've set tab to equal 2 spaces in my vimrc. This works when I edit java files, but for some reason when I edit python files, tab is set to 4 spaces instead. My vimrc: filetype plugin indent on syntax on set backspace=indent,eol,start set expandtab set tabstop=2 set shiftwidth=2 set softtabstop=2 set showtabline=2 set number set showcmd set cursorline set wildmenu set lazyredraw set showmatch call plug#begin('~/.vim/plugged') Plug 'scrooloose/nerdtree' Plug 'drewtempelmeyer/palenight.vim' Plug

Vim grep causes characters to temporarily disappear

最后都变了- 提交于 2020-01-15 04:54:25
问题 I am working through Learn Vimscript the Hard Way" by Steve Losh. In chapter 32 we build a grep command that puts results in the quickfix window. It looks like this: :nnoremap <leader>g :silent :exe "grep! -R " . shellescape(expand("<cWORD>")) . " ."<cr>:copen<cr> It basically works, but when I run it, it will cause characters to become (temporarily) invisible. If I close and re-open the file, the characters come back. Also, if I search for the invisible characters, they appear. For example,