# All Questions

9,742 questions
Filter by
Sorted by
Tagged with
132 views

### How do I get filename completion to ignore a leading =?

Occasionally, when writing shell scripts and such, I have entries of the form: foo=/bar/baz To get filename completion (<C-x> <C-f>) to work, I have to put a space after the =, and then ...
808 views

### How to Get Netrw to exclude certain files?

I have vim save my undo history in files named something like .filename.js.un~, but I don't want this cluttering up my list of file in vim (in Netrw). Is there a way to exclude all files with a ...
771 views

### Search and replace, but ignore text in quotes

As a poor-mans refactoring, I'd like to do a search and replace, but omit strings that are in double quotes (C/C++ quoting rules). For example cout << "Some variable " << variable <<...
480 views

### How to search for a matching pattern only in the first line across multiple files?

How do I search in multiple files for 1st line of file matching a pattern? e.g. I want to search for files starting with ++ ++ Heading 1 and not + Heading 1 ++ Heading 2 Any pointers appreciated....
692 views

### Inline English grammar checker for vim-latex?

I am looking for English grammar checker for vim-latex suite that checks the grammar as I type but does not highlight what's inside  or $$&$$ commands. Is there any ...
541 views

### Vim forgets cursor column when I move over a line that ends with a brace in insert mode

Normally, when I use the up/down arrow keys to move between lines in insert mode (I'm using Vim wrong, I know), Vim remembers which column my cursor is in, so if I move to a line shorter than where my ...
107 views

### gq with left whitespace intact

When I have heredoc and I format it with gq I want it to be aligned in a way so each line starts at the same column like this: Long text goes here ... 80 chars | <- ...
772 views

### Buffers comand to show full path and filename

Using :buffers results :buffers 1 %a "my-jspage.md" line 11 Are there any options so :buffers will list full path and filename? E.g.: :buffers 1 %a "d:\projects\self-org\my-...
1k views

### Manipulate chars with their ascii code

Let say I have let l:letter = 'A' is there a function that takes l:letter ascii code and transforms it to 'B'? I mean something like let l:next_letter = l:letter + 1 I know there's <Ctrl-A> ...
402 views

### Why substitute doesn't work in silent mode?

I'm playing with ex and I've found that removing trailing spaces for multiple files in silent mode doesn't work as expected. The following examples doesn't work as expected (whatever I use argdo or ...
9k views

### Jumping to a byte offset, and displaying position as byte offset

How can I move the cursor to the nth byte in the buffer? How can I display the current cursor position in the ruler in terms of the byte offset, rather than lines and columns? (Follow-up question: ...
225 views

### How to use a UTF8 character as part of the iskeyword setting?

I would like to be able to add the ’ character to iskeyword setting. I'm currently using this: " Count ’ as a part of words like I’m and you’re¬ au FileType plaintex,context,tex,latex,mail,markdown,...
526 views

### Remove the insert delay after entering insert in a read-only file

When entering or doing any command mode modifications to a read only file for the first time you will get the warning W10: Warning: Changing a readonly file That's fine, but this also introduces a ...
3k views

### Why vim cannot expand wildcards from the external command?

The following command works as expected within vim: :args find . -type f as well as this one (with wildcard): :args find . -name \*.inc However when I run the following: :args `find . -type f -...
19k views

### List valid color schemes?

I just found out about the :colorscheme command. Is there a way that I can get a list of valid color schemes from Vim? I'd like to be able to do this from within Vim, not from a list somewhere on the ...
1k views

### Several lines instructions

Is there a way to split a one-line instruction into several lines? For example, I'd like to transform setlocal variable_name = condition1 ? "1" : condition2 ? "0" : condition3 ? "a long string" : "...
57 views

### Can I search in the list of available completions on commandline?

I have set some options to configure completion on the command line, for commands that support it. I use the completion on the commandline very often with the :help command; That will be my example, ...
97 views

### How to replace patterns after line k

The command :%s/foo/bar/gc is to replace all "foo" by "bar" in the global field with confirmation. There are many "foo"s in my file within first 50 lines not to be changed. How can make this command ...
900 views

### How can I delete a function call, leaving its inner content intact?

Let's say I have a line like this: a = x(y(z)); And I want to change it to: a = y(z); What's the most efficient way to do this?
2k views

### Run macro over a visual selection with line movements

I can find an answer to a similar problem here, however although I can get that example to function I can't get what I want to do to work. Here is the example text to be edited, a partial section of ...
453 views

8k views

### Setting a vim option from the command line?

How does one set a vim option when launching from bash or another shell?
145 views

### Vim Diffing a pair of Unicode little endian without BOM text files in a readable format?

I have a pair of "Unicode little endian without BOM" text files that I would like to diff each other via the command line. Unfortunately when I open them using the command line in vim for Windows ...
3k views

### Elastic Tabstops in Vim?

Is there a plugin or a built-in feature in Vim that allows for elastic tabstops? I've searched a bit, and I found some references saying it was not possible in Vim, but those were quite old. Is ...
10k views

### How to set up NERDTree to CD to current folder when opening it for the first time via :NERDTreeFind

Given: $cd ~/Sites/project project$ vim :NERDTreeFind I would like to see NERDTree opening with ~/Sites/project as a root folder. Instead I see ~/Sites with project folder selected. So I have to ...
134 views

### Configuring include-search for PHP

I just learned of the existence of include-search, but even after reading :help include-searchand :help includeexpr I'm not sure what I need to do to have [I find included and required files. How do ...
5k views

### Set path to location of tags file

I think this is not quite a duplicate, although it's close. I often work with multiple, slightly different, checkouts of the same multi-directory project. I'd like to be able to jump around using ...
147 views

### PDF viewer syncing

The Mac latex editor 'TeXShop' has a great feature -- I can right-click anywhere in my tex and it shows me the corresponding character of the generated PDF. Similarly I can click on PDF and jump to ...
641 views

### Can I force python-mode's (or syntastic's) error flags over the line number columns?

When syntastic or python-mode finds an error in my python file, they create a new column at the left-hand side of the window with flags at the lines where the errors are: This new column not only ...
2k views

### How can I move windows from a vertical split to a horizontal split?

I have three vertically split windows. I want the leftmost window to remain as it is, but move the two other windows from a vertical to a horizontal split. How can I achieve this? I want to get from ...
6k views

### How do I disable syntastic for python files?

I have the syntastic and python-mode plugins installed and they both include syntax checkers. I think the python-mode syntax checker is more versitle for python files so I would like to just use that ...
220 views

### Folding via foldexpr

I have the following file # # NODE / 11000001 1009.6809 -878.9679 316.3049 NODE / 11000001 1009.6809 -878.9679 316.3049 NODE / 11000001 1009.6809 -...
3k views

### Bash not recognizing aliases when run from Vim [duplicate]

In Vim, when I run this command :!bash -c "ll", I get this error message bash: ll: command not found. ll is an alias in my ~/.bashrc file. If I just enter ll from bash it works. I created a ~/....
318 views

### Keeping cscope db updated

I work on a large project with many contributors and everyday I usually have to regenerate to keep this up to date and that is very time consuming. Do any of you have any unique solutions to help ...
6k views

### Can I load different tags per project?

I'm interested in using exuberant-tags (ctags) in vim, but I use Vim for all sorts of projects so I need multiple tag files and I need vim to use the correct tag file on a per project basis. Is there ...
11k views

### Can the split separator in vim be less than a full column wide?

I use a tiling window manager (awesome) + a terminal multiplexer (tmux) + splits inside of vim. I have no window decorations at all, so there is no visual split between them at all if the content of ...
512 views

### How to output highlighted source code into a file to use outside vim

At my workplace, I want to do a presentation of a custom language I've developed for solving some problems we had. For easier development, I created my own vim syntax file for this particular language....
202 views

### What's the point of :promptfind after all

Not sure if it's an appropriate question. But I just can't help wondering, why would any Vim user find it necessary to invoke a GUI search prompt instead of search using / or ?, why would the designer ...
3k views

### How to split window directly from command line? [duplicate]

I'm using Ubuntu system. I have files: A.txt, B.txt, C.txt I can split window in the following way: vim A.txt :vs B.txt // after entering into vim :vs C.txt Is there any way to achieve the same ...
1k views

### How to execute a command in an inactive window

I was playing around with the MiniBufExplorer plugin, and I thought it would be nice if the MBE window could stick to the bottom of my ViM screen, even if I specifically open a new window with e.g. :...
512 views

### Don't touch file upon write if the file was not changed

Occasionally I absentmindedly type :w when I'm reading something. This causes the modification time of the file to change and sometimes causes my build system to unnecessarily rebuild a substantial ...
2k views

### How to programmatically visually select a text block?

Is there a way to select a text block (e.g. a first word "TODO:") programmatically (with some commands or functions from a script)? Not simply highlight, like with a search, but visually select like ...
3k views

### How to further increase cmdline history size?

I have already put the following setting in my .vimrc file: set history=1000 It's been there for a while, I work in vim on a daily basis, so there have been many commands executed by now. I know ...
7k views

### Modify vimdiff highlighting

For readability I try to modify my ~/.vimrc to get some proper highlighting. I found here to use e.g. this: highlight DiffChange cterm=none ctermfg=fg ctermbg=Red gui=none guifg=fg guibg=Red Like ...
686 views

### Why is MacVim starting differently every other invocation?

I noticed when I sat down to do some work on my MacBook today that at some point recently something had gotten screwed up with respect to my .gvimrc settings: when I launched MacVim, everything seemed ...
314 views

### Like Ctrl-A and Ctrl-X but modify only the first digit

Is there a way to increase/decrease first digit after/under cursor, not the whole number. I know it's not how vim works, but is there a plugin that does that? I was unable to find it. It is very ...
3k views

### How can I fix the auto indentation in LaTeX?

Vim has some fancy pants indentation stuff. When it works right it's a pleasure to have, but sometimes it just drives me nuts. One that I've never been able to solve has to do with LaTeX syntax. Lets ...
6k views

### How to show search results for all open buffers

One thing I often do (but rely on the command line to do) is searching/grepping in multiple files. Is there a way to display search results for all the open buffers? Ideally, I'd like to have a new ...