All Questions

Filter by
Sorted by
Tagged with
3
votes
2answers
2k views

What's the difference between call and execute?

E.g., in this snippet if words[0] == "\"spellgood:" call remove(words, 0) for word in words execute "silent spellgood! " . word endfor endif taken from "The first ...
2
votes
1answer
72 views

A script and keybindings to look for VIM commands in a file, and then execute them on that file

This is a followup question to Auto sorting of lists of include files, which explains the motivation. EDIT I am looking for a script and/or keybindings to look for VIM commands in a file, and then ...
8
votes
3answers
2k views

Tutorial for vim programming? [duplicate]

I am a veteran user of vi. When I started using it, there was basically nothing... Now, we have vim. But, how do I program it? Where does one start? With help? Not sure this is a good start.
7
votes
1answer
634 views

Does a Vim syntax highlighting file already exist for this log file format, or how can I easily make one?

I wonder if there's already a Vim syntax highlighting in existence that I could use out-of-the-box or modify if it's close to what I want. The log file format I want to highlight stuff in looks like ...
2
votes
0answers
176 views

What is a good way to structure a long .vimrc? [duplicate]

When you tweak your .vimrc more and more, it is easy to lose the overview about all settings, functions etc. What are some good ways to structure a long .vimrc?
4
votes
3answers
3k views

How to access a custom python module inside vim?

This is a Python 2.7 question. I have a custom python 2.7, that I have compiled and have been using successfully across my system. My custom python has the YAML modules installed as well. The system ...
3
votes
0answers
84 views

How do I edit my Airline config such that modified files will have a differently colored bar?

I recently switched to base16_default dark as my color theme. I love it, but it's the first theme I've used where a modified buffer's airline bar doesn't change color. I do, however get the [+] ...
4
votes
1answer
720 views

Personal syntax highlighting

I tried to change the syntax highlighting, by copying /usr/share/vim/vim74/syntax/html.vim to ~/.vim/after/syntax/html.vim. Then I changed the syntax highlighting file, but I don't see any changes. ...
3
votes
1answer
87 views

What plugin manager allows installing plugins from tags

I am searching for a plugin manager that has the option to install specific plugins only from tags on GitHub. I don't want to need to specify the tag. I want it to automatically use the newest tag. ...
2
votes
1answer
71 views

Difference between autoformat and autoindent

What is difference between autoformat and autoindent? What are most popular solutions in text formating in vim of both of these methods?
1
vote
2answers
1k views

Quickfix Window not Opening Automatically

I have realized that the quickfix window isn't opening automatically when it's supposed to. I have tested this on both Gvim and vim 7.4 on Windows 10 Version 10.0.10586 Build 10586. I have a few ...
4
votes
1answer
143 views

errorformat for Java junit output

I am trying to get VIM to jump to the file listed in the error. So the following is the error. || 1) test01(ErrorTest0) || java.lang.NullPointerException || at Line.equals(Line.java:43) || at ...
4
votes
2answers
102 views

Make a frequent RSpec edit easy & repeatable

Writing unit tests in RSpec, I frequently change something like this, it 'eats pizza' do pizza = build(:pizza) expect(subject.eats?(pizza)).to be_true end to this, let(:pizza) { build(:pizza) } ...
3
votes
1answer
122 views

Swap choices: how can I “skip” instead of “quit” or “abort”?

Swap file ".file.swp" already exists! [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: I usually see this message when I accidentally :edit the wrong file, i.e., one which I'm already ...
3
votes
1answer
180 views

How can I drag a file onto MacVim and make it open in a split, not a new tab?

I have MacVim 7.1 (patch level 903). When I drag a file onto it from the Finder, desktop, etc., it opens in a new tab. However, I would prefer that it open in a split. According to :help drag-n-drop, ...
10
votes
2answers
5k views

Multiline Search and Replace

Would like to perform a search and replace in a file with 12000 lines. Specifically, if an occurrence of ^ SetFontSize 28 exists after a ^Hide block and before the next ^Hide or ^Show, change 28 ...
3
votes
0answers
177 views

Directory symlink browsing moves me to new location when autochdir is set

I have a symlinked directory as such: ~/nested Which points to this directory: ~/whatever/yetanother/andanother/nested When I launch gvim or command line vim (7.4, with the standard, built-in ...
3
votes
1answer
60 views

Discard command-line contents when receiving remote keys

If Vim command-line is being edited and the Vim instance receives a string due to vim --remote-send KEYS executed on a shell somewhere, result is somewhat equivalent to pressing Return in the command-...
3
votes
2answers
272 views

How to declare commands local to a plugin?

Writing a vim plugin, I can use function! s:InternalMethod() endfunction for InternalMethod to be local to the plugin environment. It will not be directly available to users nor overwrite their ...
3
votes
0answers
71 views

Can I use Ag in combination with YouCompleteMe for tag autocompletion? [closed]

I have setup vim to use Ag for grepping and for use in the CtrlP plugin. For tag autocompletion, I am using YouCompleteMe. To get autocompletion suggestions for functions throughout the whole project,...
4
votes
0answers
50 views

How can I specify the movement direction for text objects?

How can I specify a direction (for going backwards) for commands working on text objects like 2caw? E.g. I like to make 2caw replace bbb ccc in aaa bbb ccc ddd while on c.
3
votes
2answers
2k views

Search entire file for a pattern; every time it's found, delete up until a certain character appears

I'm trying to search for the string /c in the entire file, and when it's found I'd like to delete everything - including the /c itself - up until the next occurrence of / (but not the / itself). For ...
3
votes
1answer
891 views

java completion

I am always having problems, this time with java auto completion. I try to use the installation mentioned here, so that I can use vim to do my android development. However, after the installation, on ...
2
votes
0answers
46 views

Why does append(…, readfile()) add a zero when run using Ctrl-R?

While looking for ways to solve How can I create a /* comments section with /// like in XCode?, I cam across this puzzling behaviour. Say I have foo.txt containing: /*! * @author Robbie Yi JIANG, 29-...
5
votes
1answer
493 views

Vim Function to Send Highlighted Text to a Git Commit

Problem: Suppose I have the following text in my vim buffer: This is a commit msg. Suppose further I have a git repo located at ~/my_repo. Goal: Make a vim script so that I can highlight the text ...
5
votes
1answer
451 views

How can I replace array(some_data) to [some_data]?

We are switching from array() to [] in our php code. And when I start to do code refactoring I found that almost all arrays are specified with array() and not with []. How can I substitute it by vim? ...
3
votes
1answer
101 views

vimdiff marks wrong line as added when first line in change is new

When the first line(s) in a change are new/added, and subsequent lines are changed, Vim marks the first lines as changed up the number of lines occupied by the original lefthand file, and the ...
5
votes
1answer
53 views

How do I remove the special highlighting on `rnu` numbers?

I spent a lot of time getting vim to look just the way I want, but nornu and rnu number modes look different. Is there any way to disable the special highlighting when in rnu mode? nornu rnu
4
votes
2answers
8k views

How to find multiple instances of same character on single line?

I have a CSV that uses ,(comma) as the delimiter. This CSV is nearly 20K lines long and there are 10 instances where a comma was used INSIDE the data. These errant commas are breaking my processor. ...
10
votes
2answers
2k views

Gundo plugin requires python 2.4 when version 2.7 is installed

I have Python 2.7.9 installed. And now I get the message that the Gundo plugin requires 2.4. Is there a workaround? Here is my vimrc file: set nocompatible " be iMproved, required ...
2
votes
1answer
683 views

Make Vim highlight the match for the paren *before* the cursor

I've had a look at :h matchparen, and it doesn't seem to have an option for highlighting the match for the parenthesis immediately before the cursor. In short, this is what I want: Matchparen should ...
8
votes
3answers
435 views

How can I create a /* comments section with /// like in XCode?

In XCode, there is an add-on called vvdocument, which can detect three / hits, and transfer /// into: /*! * @author Robbie Yi JIANG, 29-Jan-2016 14:01:45 * * */ How can I do this in Vim.
3
votes
1answer
412 views

Clang complete, disable precompiled headers

Sometime in the past little while either the clang on the systems I use (Fedora) were updated to use precompiled headers by default, or else my re-install of the clang complete git plugin from github ...
2
votes
0answers
76 views

How do I resolve Error E108: No such variable: “b:eclim_tab_id” in textfmt plugin v3.0?

I manually installed the txtfmt plugin (Brett Stahlman's The Vim Highlighter) ver 3.0. After trying to run :MakeTestPage, I get the following error: Error detected while processing function <SNR&...
3
votes
1answer
201 views

How I can make inputdialog() behave like input() on GUI?

I use dbext.vim for any database related work so I have several connections configured on my _vimrc and when I need to switch between them I use the DBPromptForBufferParameters that this plugin ...
11
votes
1answer
2k views

Not able to type Unicode with Gvim and VIM on Windows 7

I want to type in different languages using (g)Vim. But when I switch to another language using language bar (Devanagari or Hindi characters), and type anything, (g)vim displays ??? ??. What I tried:...
7
votes
2answers
3k views

How to repeat last action with movement?

Assume the content: foo fnord bar;" >> /tmp/foo/derp gnarf foo fnord bar;" >> /tmp/foo/derp I want to jump to the " and delete to end of line and repeat that over the rest of lines. Yet ...
11
votes
1answer
318 views

Experimenting with vim/gvim in “virgin” mode

Sometimes, I would like to try a trick I find in the internet. It is often helpful to try this in vim (gvim if it is a gui trick), in virgin mode, i.e., without loading all my ~/.vimrc stuff. Do you ...
5
votes
1answer
445 views

Vim split overflow

On some files, a line (often the status line) overflows straight onto the next line, which screws up rendering until the size changes (when I close/resize a vertical split etc). This also happens ...
8
votes
2answers
658 views

How safe is it to use an unknown `_vimrc` or `vimscript` file?

I do not know if this question should be asked here or not. In almost every language, malware exists. Is the same also applicable for vimscript? Suppose vim is running with high system privileges. Is ...
7
votes
1answer
701 views

How to override the '=' command?

I cannot convince vim to apply the coding-style I'd like to (cindent and friends). However, integrating clang-format.py (which uses the .clang-format of my project) actually makes me totally happy. ...
9
votes
5answers
3k views

How to copy each line 11 times, incrementing the last “1” in each line from 2-12

I have a number of lines in a file, and I would like to copy each line 11 times (turning each line into 12 lines), and increment the last "1" in each line so that the 12 lines have "1" through "12", ...
2
votes
0answers
395 views

gvim on windows - compiled ycm plugin now crashing on start

I installed the YouCompleteMe(YCM) plugin and compiled it using the provided instructions, one after the other for all options excluding rust. Below is a reproduction of the commands I ran, the reason ...
9
votes
1answer
915 views

NeoVim hides the * chars when editing markdown

I am using tpope's vim-markdown plugin to edit markdown files. Somehow, neovim hides the _ and * chars and changes the text in between to italic or bold depending on quantity of chars. I want to see ...
8
votes
2answers
857 views

How do I make list of search results editable?

There are several times, I need to grep for some_pattern in some XHTML files (many a time, file count in a specified folder goes beyond 10K+). Previously, I have used Lugaru's Epsilon Programmer's ...
1
vote
1answer
285 views

How can I get path from vim-rooter's function and run it with QuickRun's makeprg?

How can I run vim-rooter's function FindRootDirectory() instead of /vagrant/my_project? I have tried multiple variations like: set makeprg=FindRootDirectory().'/app/Console/cake test '.expand('%:p') ...
4
votes
2answers
551 views

How to run custom console command and output results to QuickRun without pressing any key on keyboard?

Thanks to @muru I was able to run and output the data to QuickRun by the :make command and this setting in my .vimrc: set makeprg=/vagrant/my_project/app/Console/cake\ test\ app\ Console/Command/...
6
votes
1answer
886 views

How to cut/trim line in statusline?

I'm trying to cut string returned from fugitive plugin. It returns branch name of current file. By default returned string is Git(branchname) and this is why I want to get rid of odd Git(..) wrapper. ...
6
votes
1answer
2k views

Paste from clipboard into CtrlP input in GVim

Using CtrlP with GVim I often need to open a file with the name from the system clipboard (on Windows). So my workflow should be: Ctrl+P {somehow paste name from the clipboard} Select file and open ...
8
votes
1answer
72 views

Define text object that depends on the current operator

I'm curious if it is possible to make a text object aware of its operator. In particular, I am writing a text object for LaTeX environments, where I want different behaviour depending on the operator. ...

15 30 50 per page
1
155 156
157
158 159
196