macvim

Set python virtualenv in vim

只谈情不闲聊 提交于 2019-11-27 14:48:32
问题 I use vim for coding and for python coding in particular. Often I want to execute the current buffer with python interpreter. (for example to run unittests), usually I do this with :!python % <Enter> This scenatio will work works fine with global python, but I want to run virtualenv python instead. How do I enable virtualenv within vim? Is it possible to switch virtualenv on the runtime? I'm using macvim 回答1: Here's what I use (sorry the highlighting is screwy). " Function to activate a

How to run mvim (MacVim) from Terminal?

北战南征 提交于 2019-11-27 09:56:56
I have MacVim installed and I am trying to set it up as the editor for Git (version control), but I can't run 'mvim' from the command line as it isn't recognised. How do I setup mvim so I can run it from Terminal? There should be a script named mvim in the root of the .bz2 file. Copy this somewhere into your $PATH ( /usr/local/bin would be good ) and you should be sorted. I don't think I'd to add anything to the path, did brew install macvim mvim -v should then open macvim in the terminal, you can also go ahead and alias that alias vim='mvim -v' Sean Chou If you go the brew route, the best way

MacVim Open File In Existing Window

爷,独闯天下 提交于 2019-11-27 09:46:24
问题 Is there a way to set up MacVim to open a new file in the current window in a running MacVim instance? I currently have the MacVim preference "Open new files in a new tab in the current window" set, but ideally I'd just like to open new files the way ":e new_file" works, without the tabs. My main motivation is that I currently use NERDTree and Bufexplorer for my workflow and don't need the tabs at all. I'm also using PeepOpen, which is awesome except it always opens files based on MacVim's

Highlight all occurrence of a selected word?

ε祈祈猫儿з 提交于 2019-11-27 09:04:12
问题 How can I highlight all occurrence of a selected word in GVim, like in Notepad++? 回答1: In Normal mode: :set hlsearch Then search for a pattern with the command / in Normal mode, or <Ctrl>o followed by / in Insert mode. * in Normal mode will search for the next occurrence of the word under the cursor. The hlsearch option will highlight all of them if set. # will search for the previous occurrence of the word. To remove the highlight of the previous search: :nohlsearch You might wish to map

程序员专用文本编辑器MacVim

给你一囗甜甜゛ 提交于 2019-11-27 07:41:21
MacVim for Mac版 是一个将Vim程序员编辑器带入Mac的项目。另一方面,Vim基于强大的Vi应用程序,这是一个为Unix操作系统开发的文本编辑器。除了其他功能之外,MacVim应用程序还支持使用热键,包括全屏模式,允许您使用透明背景等等。请记住,即使MacVim可以处理文本,它也不是一个WYSIWYG处理器。 MacVim for Mac软件介绍 Vim是一个高级文本编辑器,旨在提供事实上的Unix编辑器'Vi'的强大功能,具有更完整的功能集。无论您是使用vi还是使用其他编辑器,它都很有用。Vim是一个很好的旧UNIX编辑器Vi的改进版本。添加了许多新功能:多级撤消,语法突出显示,命令行历史记录,联机帮助,拼写检查,文件名完成,块操作,脚本语言等。还提供了图形用户界面(GUI)。仍然保持Vi的兼容性,那些拥有Vi“手指”的人会有宾至如归的感觉。请参阅runtime/doc/vi_diff.txt与Vi的差异。此编辑器对于编辑程序和其他纯文本文件非常有用。所有命令都使用普通的键盘字符,因此可以用十个手指键入的人可以非常快速地工作。另外,功能键可以由用户映射到命令,并且可以使用鼠标。Vim运行在MS-Windows(NT,2000,XP,Vista,7,8,10),Macintosh,VMS和几乎所有类型的UNIX下。移植到其他系统应该不是很困难。较旧版本的Vim可在MS

vim 插件 YouCompleteMe 的安装 for Mac

蹲街弑〆低调 提交于 2019-11-27 07:41:01
系统:macOS Mojave 10.14.6 vim 版本:8.1 (高于 7.4.1578 且支持 Python2 或 Python3 即可) CMake 的安装 CMake 是一个跨平台的项目管理工具。可以直接通过 brew 获取 brew install cmake Vundle 的安装与使用 Vundle 是一个自动化的 vim 插件管理器。由于版本更新,Vundle 的配置方式和网上给出的半数教程不再一致。参考 Vundle 的 官方文档 ,可以使用以下命令安装 Vundle git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 下载完成后,就可以使用 Vundle 去下载和管理其他插件了。首先在 ~/.vimrc 中指明要使用 Vundle 管理的插件 set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'scrooloose/nerdtree' Plugin 'jistr/vim-nerdtree-tabs' Plugin 'vim-scripts/taglist.vim'

How to see which plugins are making Vim slow?

。_饼干妹妹 提交于 2019-11-27 02:20:00
Is there a way to profile Vim plugins? My MacVim becomes slower and slower when I open a large .py . I know I could deselect all plugins and reselect one by one to check which plugin is the culprit, but is there a faster way? My dotvim is here: https://github.com/charlax/dotvim You can use built-in profiling support: after launching vim do :profile start profile.log :profile func * :profile file * " At this point do slow actions :profile pause :noautocmd qall! (unlike quitting noautocmd is not really required, it just makes vim quit faster). Note: you won’t get information about functions

$PATH variable not properly set in gvim/MacVim when it is opened from the finder

血红的双手。 提交于 2019-11-27 01:37:26
问题 I am using MacVim (basically gvim for the mac). If I open macvim from the command line then my $PATH variable will be properly set. If I open macvim via point and click with the finder, the $PATH variable will NOT be properly set. Can anyone give me some insight? Note: I know at least part of my path is set in ~/.bashrc , but I am not sure where the rest of it is set. Examples: If I open macvim from the terminal: % gvim basic.tex And then in MacVim I go: :!echo $PATH /opt/local/bin:/opt/local

How can I install MacVim on OS X?

不羁岁月 提交于 2019-11-26 18:43:28
问题 I am using OS X 10.9.1 (Mavericks). What are the systematic steps to install to Gvim or MacVim in Mac OS? If you write the steps using 1, 2, 3, ..., it would be easy to follow. I must confess that I failed to understand all the instructions provided on MacVim page. Other google-searched webpages do not clarify. E.g. What is $VIMRUNTIME ? What version of vim should I install for my OS? Now somehow I have installed MacVim in my system (Not systematically I believe). I can see that I have a

vim用户手册笔记常用操作整理

允我心安 提交于 2019-11-26 12:26:31
"x" 命令可以删除一个字符 "d" 命令可以后跟任何一个位移命令,它将删除从当前光标起到位移的终点处的文本内容 dw "c" ,改变命令例如 cw c2w "cc" 命令可以改变整行 "r" 命令不是一个操作符命令。它等待你键入下一个字符用以替换当前光标下的那个字符 "." 命令会执行上一次所执行的更改命令 "$" 命令是移动光标到行尾 "w" 看作是向右移一个 word 的命令 以匹配一个括号为目的的移动 % "G" 命令 2 。指定一个命令计数,这个命令就会把光标定位到由命令计数指定的行上 当你用 "G" 命令从一个地方跳转到另一个地方时, Vim 会记得你起跳的 位置。这个位置在 Vim 中是一个标记。使用下面的命令可以使你跳回到你 刚才的出发点: `` 自定义标记 ‘ ma ’定义了一个 a 标记,‘ `a ’跳转到 a 标记 :marks看关于标记的列表 ' 进行此次跳转之前的起跳点 " 上次编辑该文件时光标最后停留的位置 [ 最后一次修改的起始位置 ] 最后一次修改的结束位置 "H" 意为 Home, "M" 为 Middle, "L" 为 Last CTRL-U、CTRL-D 向上上下滚半屏 简单搜索 /include 搜索 include 单词 n 查找下一个搜索目标 N 相反 你以 "d" 或 "x" 这样的命令删除文本时,被删除的内容还是被保存了起来