# All Questions

9,465 questions
Filter by
Sorted by
Tagged with
5k views

### function to call shell script with arguments

I am making my own function to call a bash script that compiles and runs my program. Here is the code I have tried. function Compile_and_run(game, major, minor) !_compile a:game a:major a:minor ...
17k views

### Vim Code Completion for Python 3

I am running Debian Jessie and use the current vim-nox (with +python -python3). I am having a hard time trying to program in Python 3, as I struggle with Python 3 code completion. YouCompleteMe doesn'...
186 views

When I install plugins, I like to keep them organised in folders. For example, I have downloaded plugins that turn vim into a programming IDE. This file contains 16 folders and files which are ...
600 views

### How do I shift the line indent to a specific value?

Many times I run across a situation where a line is not indented properly. Ether through a paste, bad / not preferred indent plugin, or most often extra spaces offsetting the indent value. I usually ...
806 views

### c:\Program is not recognized error while running vimdiff

I use windows XP for testing and running some programs. I installed Vim on the machine, but when I run vimdiff on two files, I get the following error: '""C:\Program' is not recognized as an internal ...
487 views

### How to associate gvim with extensionless files on Windows [closed]

I would like to set gvim as the default program for opening files which do not have an extension (e.g. no .txt, .php, .js, .css, .html etc... suffix as part of the file name; for instance the file ...
5k views

### E575: viminfo: Illegal starting char in line: … on startup

Recently on starting vim I've been getting an error message like this: E575: viminfo: Illegal starting char in line: wait_until(lambda _:<80><fc>^B ^[ldWA)^[:w^Mkkkdd^[:w^M<80><...
163 views

### Change formating of \im' command in c.vim

I have recently installed the c.vim plugin. The only issue is when I type \im (automatically adds the main function) this is the way how it displays it. int main ( int argc, char *argv[] ) { ...
756 views

### hi StatusLine cterm=none displays whitespace characters

I don't like the cterm=reverse used on the StatusLine. Without reverse, I also don't care for bold, so I ended up with hi StatusLine cterm=none in my .vimrc. However, this lead the spaces caused by ...
115 views

### How to map CMD+Alt alone to the command?

I am trying to map Cmd+Alt to start searching in vim (/). The only question is: how would I do this? I know to map Alt in vimscript is by typing <A> but I do not know how to do Cmd. I also want ...
466 views

### How to use sensitive data in .vimrc?

I want to have my .vimrc synced through github so it has to be public file, but at the same time i have to put some sensitive data (for example db passwords/hosts for dbext.vim) in it, without giving ...
1k views

### How to change undo granularity in Vim?

At some point my Vim would undo an entire word when I hit u. [i]typing some words[C-c][u] Would result in typing some However, the undo granularity seems to have changed to deleting one letter at ...
829 views

### Why is the c.vim plugin not working?

I have just tried to install c.vim from this URL. The only issue is I do not think it is working. This is because I cannot view the help by doing :help csupport. How would I fix this? If it helps ...
262 views

### j and k keys not working like they should [duplicate]

I'm using gVim on my Windows 8.1 computer with a standard QWERTY keyboard, and neither the j and k keys, nor the Up and Down arrow keys let me move up and down in my text field while in normal mode. h ...
4k views

### Vimwiki: can't fold list items

With vimwiki you can fold headers and lists as following: Example for headers and list folding: = My current task = * [ ] Do stuff 1 * [ ] Do substuff 1.1 * [ ] Do substuff 1.2 * [ ] ...
11k views

Right now I'm working with some blocks of text that are over 1000 lines long. Is there a simple way to move to the beginning of the next paragraph? My workaround for now is searching for two ...
923 views

### How can I get ‘n’ to go forward even if I started searching with ‘?’ or ‘#’?

Vim has (at least) two sets of commands that search in opposite directions. Typing / and then a pattern will search forward through the document for the pattern; typing ? and then a pattern will ...
2k views

### How can I lookup LaTeX symbols in Vim?

Can I integrate some form of symbol completion to Vim? Dedicated TeX editors like TeXMaker provide a list of symbols for completion (for example, \al shows a list with \alpha, \la shows \lambda and \...
36k views

### How to map Alt key?

I'm trying to map Alt key in the following way: :map <A-j> j :map <A-k> k but it doesn't work (bell is rang on Alt + j/Alt + k). What am I missing? I'm using Terminal on OSX, the same ...
1k views

### How do I automatically add a character at end of line?

I am very new to vim and would like to know if I could have a script in my vimrc file that automatically adds a ; to the end of every line. The only exceptions is if the line has the strings for(, ...
123 views

### Disable tar.vim plugin from command line? [duplicate]

The tar.vim plugin tries to give a special view of tar files. Its filetype "detection" matches against the filename. If I try to download a tar file from the web and get an HTML error page, I cannot ...
893 views

### How can I search and replace within multiple files? [duplicate]

I have the same text that I want to replace in multiple files (say, I'm updating version numbers in multiple files). Even using the command history to reuse commands, it sure is tedious to open each ...
130 views

### Is there something similar to g8 but shows the values according to the file encoding

I am looking for a g8 equivalent that prints the hex values of the character under the cursor according to the file encoding of the file loaded in a buffer rather than assuming it's utf-8. Is there ...
6k views

### How do I change the colour of the statusline of the currently focused window?

How do I change the colour of the statusline of the currently focused window? I've seen colorschemes modify this. Is this some sort of highlight group? Or something else?
2k views

### Linespace in Vim using iTerm2

I am using Vim 7.4.488 in iTerm2. Currently I've configured the 'linespace' setting in iTerm2's preferences. However, I would like to set a different linespace for Vim. I know that :set linespace=1 ...
1k views

### Quickfix with makeprg running in a different directory

How can I start a build with my makeprg running in a different directory than the working directory of vim and still catch errors in quickfix so that I can jump between them? The problem is that ...
273 views

### Is there a way to set an option to the value of another option?

For example, I'd like to set set tabstop=4 set shiftwidth=4 Is there a way to do something like set tabstop=4 set shiftwidth=tabstop so I can set both values by only changing a single number?
584 views

### Fold with markers, but disable nesting?

I want to fold sections in a document. Each new section should define a top-level fold instead of a nested fold. I want to use a single delimiter to define a fold. Consider an example document: >&...
1k views

### Indenting VHDL as other programming languages

When I write VHDL Vim uses a mix of tabs and spaces which aim to align columns beneath the last parenthesis. For example, Vim will produce something like Inst_IMem: IMem PORT MAP( ...
463 views

### How can I store a series of regular expression search and replace commands and run them later?

How can I store a series of search and replace statements so I can run them later in sequence? Possibly after I have close and re-opened vim... For instance I might run the following in sequence ...
1k views

### Is there a text object for the entire buffer?

I often find myself typing commands like gg"+yG or ggdG and would like a more efficient way to do this without having to move the cursor twice. Is there any command that I can use e.g. y[movement] to ...
1k views

### Undo multiple changes in Cygwin's vim

I have two installations of vim: 7.4 in cygwin and 7.2 in a Linux virtual machine. The vim in the virtual machine can undo multiple edits by repeatedly pressing the u key. The vim in cygwin can only ...
390 views

### Digraph for the “bullet” (8226 hex 2022) [duplicate]

I am looking for a digraph to enter the bullet symbol • (Unicode 8226, hex 2022), but it seems there is none. So, in absence of such a digraph, is there an alternative way to enter the bullet easily?
1k views

### How to work with command-line mode the vi way?

Is there a way to interact with the command-line mode while always remaining in the home position? In particular, the following two actions are cumbersome, requiring moving the fingers away to the ...
926 views

My web service log file has a line that's 34151 characters wide (lots of Soap XML). When wrapped it fills more than 1 screen. How can I scroll it smoothly in vim? Using navigation keys like $and w ... 1answer 4k views ### HTML syntax folding in VIM? I was wondering which is the best way to use syntax folding for HTML files. Specially if it can recognize javascript code within <script> tags. I typed set foldmethod=syntax but it does not ... 1answer 484 views ### How does the “d3fg” command work? I would like to know how a "d3fg" command works in vi. I have done some research on Google and found that d is delete and fg means foreground. Suppose, if we want to stop the session of vi and resume ... 1answer 2k views ### How to translate Unicode escape sequences to the Unicode character? I have a file with a lot of characters represented like this: \u05E2. (These are the actual characters in the file: backslash, lowercase u, and four hexadecimal digits.) Due to that, the file is ... 2answers 3k views ### I can't get 256 colours to work with Vim in iTerm2 on MacOS X I am having a rough time getting the colors right with my vim setup and the color scheme I want to use. Using: OSX 10.10.2 Vim 7.4 iTerm2 (Set to report terminal type as "xterm-256color") gruvbox ... 1answer 53 views ### Transfer file-related settings over to a new, derived file? [closed] Let's say we handle a file that needs various speciffic settings: We have a file type, syntax, colorscheme, highlights, tab widths and more. Also, we have multiple plugins with Now, we want to ... 3answers 6k views ### What does <Bar> mean? In answering a question just now, I mentioned using a normal mode key mapping that can be found at vim.wikia.com. In the middle of explaining the key mapping, I realized that I had no idea what <... 2answers 575 views ### Entering search pattern with syntax highlighting? A search pattern used with /, entered on the vim command line, can be very complex. But even for a normal regular expression pattern, syntax highlight of the expression syntax would be helpful. ... 7answers 25k views ### Show only matching lines? In a long file, I would like to search for a pattern that will match roughly 200 lines or so. The matched lines are in random places in the file. When a line matches, only the line itself is relevant, ... 3answers 2k views ### How to write vertically? Lets say I want to produce the following text in my document: % % Not Important % O -------------------------> % | % S | % o | % m | % e | % | % M | % s | % g | % | % ... 2answers 3k views ### What does :open do in vim? Vim's documentation has this to say about the :open command: This command is in Vi, but Vim only simulates it: *:o* *:op* *:open* :[range]o[... 1answer 180 views ### Are there any platforms whose native vi` is not vim, nvi, or original vi? [closed] Just like in the title. I know most Linux distributions ship with vim and most BSDs use nvi, but I was wondering if there are any "obscure" versions of vi on some commercial UNIX or other platform, ... 2answers 618 views ### Why are ^ and$ still magic in nomagic mode?

In 'nomagic' mode, ^ and $have a special meaning and no others do. Why were these selected, rather than making people type \^ and \$ just as they do for \. and \*? EDIT: I have been able to confirm ...
2k views

### Are Vim's regex magics compatible with well-known regex classes?

Many Unix tools' regular expression syntaxes are often the POSIX-codified Basic and Extended Regular Expressions (BRE and ERE, respectively), and, in some modern implementations, Perl-style (PCRE ...