macvim

How to run Vim commands from Terminal

断了今生、忘了曾经 提交于 2021-02-07 14:42:57
问题 My questions is one that I haven't seen answered, the usual question is how to run certain commands to a file. My question is how to run Vim commands or functions, from outside Vim (i.e. Terminal), these wouldn't affect any file, just Vim itself. Is this is even possible? If so, how? If this is not possible like this, is there a way to go into Vim, run a command automatically, and then exit when that ends? Or run another command and then exit? Thanks for your help! 回答1: Use vim --cmd 'Command

vim redirect output to quickfix

主宰稳场 提交于 2020-08-22 09:31:54
问题 Is it possible to redirect an output of a command to the quick fix window? The command I am running is :!java %:r and was hoping the output would go into the quickfix window 回答1: Please note that the quickfix window is for specific output (e.g. of compiler or syntax checker tools) which includes references (i.e. line and column numbers) to the current buffer. There's a lot of infrastructure around this: 'makeprg' , 'errorformat' , etc., usually bundled into a compiler plugin . Though you can

Vim Ultisnips - How do I move to the next placeholder or tabstop?

徘徊边缘 提交于 2020-06-24 06:03:43
问题 I just installed a brand new copy of Macvim and UltiSnips, but I can't figure out how to move to the next completions using tabstops and placeholders. When I press tab, it simply adds a tab space. My guess is that the tab key was remapped in another plugin or vimrc, so I went with fresh installs and an empty ~/.vim folder. Still nothing... How do I move to the next tabstop? Is there a key mapping I can set? 回答1: I have the following in my vimrc : " Set ultisnips triggers let g

Ubuntu18.04 vim8.2 Yomcompleteme clang 编译、安装及使用

南笙酒味 提交于 2020-03-10 12:16:47
简介 简介: 源码编译使用vim及其插件. 内容包含: vim的编译安装, llvm clang的编译安装, 插件youcompleteme的编译安装使用, 以及vim其他插件的使用. 搭建环境: Ubuntu18.04.4 server版(desktop版应该也适用) 环境还原方式: 坚果云上保存: .vim 文件的压缩包,以免以后换环境时都得下载, 使用时直接解压至 ~/.vim GitHub上保存: .vimrc , .clang-format , .ycm_extra_conf.py 等配置文件, 地址: https://github.com/whuwzp/vim_config 主要参考网址如下, 基本上都是参照官方方法, 而不是在博客网站上拾人牙慧: vim源码编译: https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source llvm clang编译: https://llvhttps://m.org/docs/GettingStarted.html#getting-started-with-llvm youcompleteme编译使用: https://github.com/ycm-core/YouCompleteMe#linux-64-bit 其他c++插件: https:/

Vim: Find in Buffers capabilities that resembles those in TextMate

我怕爱的太早我们不能终老 提交于 2020-03-03 05:32:26
问题 In TextMate you can drag one or more files onto the icon and use "Find in Project" to search those files, can this be replicated for the current open buffers in Vim? 回答1: grep lgrep vimgrep lvimgrep These commands might help you. Check here, If this is what you are looking for. http://vim.wikia.com/wiki/Find_in_files_within_Vim 回答2: I like LustyExplorer which has a very fast and easy to use "search in buffers" function. Ack.vim works in a sort-of-similar way but is file-system based. 回答3: Out

Vim: Find in Buffers capabilities that resembles those in TextMate

时间秒杀一切 提交于 2020-03-03 05:32:08
问题 In TextMate you can drag one or more files onto the icon and use "Find in Project" to search those files, can this be replicated for the current open buffers in Vim? 回答1: grep lgrep vimgrep lvimgrep These commands might help you. Check here, If this is what you are looking for. http://vim.wikia.com/wiki/Find_in_files_within_Vim 回答2: I like LustyExplorer which has a very fast and easy to use "search in buffers" function. Ack.vim works in a sort-of-similar way but is file-system based. 回答3: Out

Vim: Find in Buffers capabilities that resembles those in TextMate

允我心安 提交于 2020-03-03 05:32:08
问题 In TextMate you can drag one or more files onto the icon and use "Find in Project" to search those files, can this be replicated for the current open buffers in Vim? 回答1: grep lgrep vimgrep lvimgrep These commands might help you. Check here, If this is what you are looking for. http://vim.wikia.com/wiki/Find_in_files_within_Vim 回答2: I like LustyExplorer which has a very fast and easy to use "search in buffers" function. Ack.vim works in a sort-of-similar way but is file-system based. 回答3: Out

Sublime Text 全程指南

不羁的心 提交于 2020-03-02 09:23:57
摘要(Abstract) 本文系统全面的介绍了Sublime Text,旨在成为最优秀的Sublime Text中文教程。 前言(Prologue) Sublime Text是一款跨平台代码编辑器(Code Editor),从最初的Sublime Text 1.0,到现在的Sublime Text 3.0,Sublime Text从一个不知名的编辑器演变到现在几乎是各平台首选的GUI编辑器。而这样优秀的编辑器却没有一个靠谱的中文教程,所以我试图通过本文弥补这个缺陷。 编辑器的选择(Editor Choices) 从初学编程到现在,我用过的编辑器有EditPlus、UltraEdit、Notepad++、Vim、TextMate和Sublime Text,如果让我从中推荐,我会毫不犹豫的推荐Vim和Sublime Text,原因有下面几点: 跨平台:Vim和Sublime Text均为跨平台编辑器(在Linux、OS X和Windows下均可使用)。作为一个程序员,切换系统是常有的事情,为了减少重复学习,使用一个跨平台的编辑器是很有必要的。 可扩展:Vim和Sublime Text都是可扩展的(Extensible),并包含大量实用插件,我们可以通过安装自己领域的插件来成倍提高工作效率。 互补:Vim和Sublime Text分别是命令行环境(CLI)和图形界面环境(GUI

最全面的 Sublime Text 使用指南

半腔热情 提交于 2020-03-02 09:14:37
最全面的 Sublime Text 使用指南 摘要(Abstract) 本文系统全面的介绍了Sublime Text,旨在成为最优秀的Sublime Text中文教程。 前言(Prologue) Sublime Text是一款跨平台代码编辑器(Code Editor),从最初的Sublime Text 1.0,到现在的Sublime Text 3.0,Sublime Text从一个不知名的编辑器演变到现在几乎是各平台首选的GUI编辑器。而这样优秀的编辑器却没有一个靠谱的中文教程,所以我试图通过本文弥补这个缺陷。 编辑器的选择(Editor Choices) 从初学编程到现在,我用过的编辑器有EditPlus、UltraEdit、Notepad++、Vim、TextMate和Sublime Text,如果让我从中推荐,我会毫不犹豫的推荐Vim和Sublime Text,原因有下面几点: 跨平台:Vim和Sublime Text均为跨平台编辑器(在Linux、OS X和Windows下均可使用)。作为一个 程序员 ,切换系统是常有的事情,为了减少重复学习,使用一个跨平台的编辑器是很有必要的。 可扩展:Vim和Sublime Text都是可扩展的(Extensible),并包含大量实用插件,我们可以通过安装自己领域的插件来成倍 提高工作效率 。 互补:Vim和Sublime

如何在vim中打开的文件中将^ M换行符转换为“正常”换行符?

半腔热情 提交于 2020-02-27 02:59:35
vim显示在每行结尾^ M 我怎么做用'正常'换行符替换它? #1楼 如果文件是在Windows上创建的,请使用dos2unix实用程序,如果文件是在mac上创建的,请使用mac2unix实用程序。 :) #2楼 我在 MacVim 中看到的用BBEdit创建的文件显示了一堆 ^M 行返回而不是常规返回。 以下字符串替换解决了问题 - 希望这有助于: :%s/\r/\r/g 这很有趣,因为我用相同的字符替换换行符,但我想Vim只需要获得一个新的\\ r来正确显示。 我有兴趣知道为什么这有效的基本机制。 #3楼 我花了一个下午与\\ n ctrl-v 012挣扎(两者都为我提供了null)。 并通过这个线程努力,直到我达到metagrapher的。 \\r 对我来说很好! /),/s/),/)\r/g 变成这样的东西: blacklist-extra:i386(0.4.1,0.4.1 + nmu1),libmount1:i386(2.20.1-5.1,2.20.1 -5.2),libblkid1:i386(2.20.1-5.1,2.20.1-5.2) ,libapt-pkg4.12:i386(0.9.7.4,0.9.7.5),nmap:i386(6.00-0.1,6.00-0.2),libsane-common:i386(1.0.22-7.3, 进入这样的事情: 26 libwv-1