vim

How can I quickly delete a line in VIM starting at the cursor position?

旧街凉风 提交于 2020-07-16 11:18:05
问题 I want to be able to delete the remainder of the line I'm on starting at the cursor's position in VIM. Is there an easy command to do this? To help illustrate, this is before the command. The quick brown dog jumps over the lazy fox. ^ |----- Cursor is here. This is after the command The q ^ |----- Cursor is here. 回答1: (Edited to include commenter's good additions:) D or its equivalent d$ will delete the rest of the line and leave you in command mode. C or c$ will delete the rest of the line

Execute different version of python in .vimrc file

南楼画角 提交于 2020-07-07 14:33:49
问题 I am trying to get powerline.vim to work and the problem is that on setup it is trying to run the wrong version of python. This line is causing the problem. python from powerline.ext.vim import source_plugin; source_plugin() How can I change this so that it executes /usr/local/bin/python instead? Thanks! 回答1: You can't. Because you are not using /anything /bin/python . The vim binary is linked to the python interpreter library directly. The library is called /usr/lib/libpythonX.Y.so.Z . E.g.

How to make Brew install Vim with +clipboard?

送分小仙女□ 提交于 2020-07-05 11:47:30
问题 I'm trying to figure out how to copy-and-paste between a file edited with Vim and the macOS Clipboard. Most instructions say to start by installing Vim using Homebrew as it will be installed with the clipboard option enabled (vim --version will display "+clipboard"). However, when I installed Vim using brew, the clipboard option was still set to "-clipboard". Can I force brew to reinstall Vim and turn this option on in the process? I'm using Homebrew 1.1.2 which installed VIM 7.4. 回答1:

Vim and azerty keyboards

我的未来我决定 提交于 2020-06-26 04:10:09
问题 I recently started learning Vim and before I go deeper I have a question I need answered. Using a AZERTY keyboard, should I remap the keys for the commands and shortcuts to fit the position of the keys of a QWERTY keyboard? I am asking this because obviously quite a lot of thinking must have being put creating thoses commands, and when I see how far the '$' is on a AZERTY keyboard compared to the QWERTY one for example I can't help but think it might feel wrong at some point. Here is the

Syntax highlighting in vim

一笑奈何 提交于 2020-06-24 22:26:28
问题 I'm having trouble reading dark blue on black when I turn on syntax colours in vim. How do I change some of the default colours or the colours of schemas like: http://www.vim.org/scripts/script.php?script_id=1571 回答1: First, try :set background=dark , which will cause vim to change to a color scheme that works better for reading on a black background. If that doesn't work well enough, you can create your own color scheme by following these directions: http://vim.wikia.com/wiki/Create_a_color

How to jump to the end of pasted content after paste?

℡╲_俬逩灬. 提交于 2020-06-24 20:48:48
问题 For example, my current file conent is: Hello world! ^------------------vim cursor here Vim cursor is at character w 。And I paste a word foobar ,the content changed to Hello Hello wfoobarorld , and cursor is at character f . But I want the cursor jump to r of foobar after paste immediately. Is there some command to do that? 回答1: By default, the p and P commands should leave the cursor at the last character of the pasted text. gp and gP go one character forwards (first character after pasted

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

Pasting a huge amount of text into vim is slow?

帅比萌擦擦* 提交于 2020-06-24 03:08:32
问题 Someone showed me how to do this before but I can't figure out what it was now. I know about :set paste but this is not the problem. 回答1: Use "*p or "*P to paste from the system clipboard instantly. Vim must be compiled with +clipboard for this to work. See :help clipboard for more information. 回答2: This is a buffer flush-to-disk problem. Vim tries to keep your work safe and doesn't assume you can type several thousand characters per second. Read :help swap-file for some details on the

Vim: Utf-8 ې character breaks displayed string

扶醉桌前 提交于 2020-06-17 09:56:04
问题 I have file that has hex content: db90 3031 46, which should be displayed in vim as "ې" followed by "01F", but what I noticed is that it is never displayed correctly. Then I noticed It is the same in other places like in terminal and browser I always get ې01F? Why is that? Just paste that in google and try yourself you will never be able to put "ې" and 0 as next character. 回答1: That's an Arabic character with right-to-left indicator, so you probably need to switch back to left-to-right mode,

Creating a list or tuple out of one word-per-line in vim

限于喜欢 提交于 2020-06-17 09:34:09
问题 I come across the following pattern quite frequently, where I have to copy-paste a bunch of items (usually in excel) into something like a SQL query and often the simplest way to do this is copy-paste the data into vim and then run a macro/command on it to format it. Here is an example of input data: This involves three steps for me: Delete empty lines: :g!/\S/d Add quotes around it and a , separator: :% s/\v(\S+)/"\1", Put it onto one line and add a wrapping [...] or (...) : ggVG (select all