All Questions

Filter by
Sorted by
Tagged with
18
votes
1answer
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?
1
vote
1answer
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 ...
4
votes
2answers
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 ...
7
votes
3answers
275 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?
5
votes
1answer
596 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: >&...
4
votes
1answer
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( ...
6
votes
4answers
469 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 ...
32
votes
5answers
2k 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 ...
4
votes
1answer
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 ...
2
votes
1answer
396 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?
11
votes
2answers
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 ...
2
votes
1answer
954 views

How to scroll through a really long line? [duplicate]

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 ...
9
votes
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 ...
5
votes
1answer
485 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 ...
7
votes
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 ...
4
votes
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 ...
1
vote
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 ...
24
votes
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 the Vim Tips Wiki. In the middle of explaining the key mapping, I realized that I had no idea what &...
5
votes
2answers
584 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. ...
38
votes
7answers
26k 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, ...
22
votes
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 | % | % ...
19
votes
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[...
0
votes
1answer
183 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, ...
3
votes
2answers
636 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 ...
17
votes
1answer
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 ...
24
votes
1answer
3k views

How can I get both splits to scroll left or right at the same time?

I want to open up two different parts of a document in horizontal splits (using :sp) and scroll both of them left and right together. For vertical scrolling, you would use scrollbind. However, I'm not ...
4
votes
1answer
193 views

Duplicating line content by substitution

I'm trying to vimify a task of editing bulk file move commands. I'm using Fossil-SCM to manage a bunch of files and have some changes in directory structure. To get SCM to grasp the move, I have to ...
4
votes
2answers
1k views

Can I get vim to fold comments when using foldmethod=indent

When editing Python files at work I have to include 20+ lines of boilerplate legalese at the start of the file. "start of the file" is not that strict: I'm allowed to include the Python docstring, and ...
9
votes
2answers
521 views

How can I create a pseudo insert mode with a different keymap?

I am in the slightly unusual position of using two different keyboard layouts on a regular basis (Programmers-Dvorak and Turkish-F). These layouts are quite different from each-other and I am only ...
30
votes
5answers
9k views

What is the easiest way to insert Unicode characters into a document?

When writing documents occasionally I want to insert Unicode characters into the text. Sometimes I know the character code and sometimes I look it up on the web. Currently I go to insert mode and ...
5
votes
4answers
902 views

How do I make dictionary completion look in a different file if triggered after the @ sign?

I have been using Vim as a research database, and I use tags in the form of @tag for each note, written in the second line after the title. I might have more than one tag. How can I make dictionary ...
6
votes
2answers
518 views

How to create syntax folding for pascal

I mostly want it to automatically create folds for between a begin and an end, although if there's anything more advanced that would be welcome too. I've looked in the help for the pascal syntax and ...
0
votes
1answer
261 views

Strange behaviour of abbreviations triggered with shift+enter in gvim+vim-latex

Playing with abbreviation in insert mode i noticed the following unexpected behaviour, when using gvim with vim-latex plugin: Defining an abbreviation such as :iab m <m> or any similar "...
19
votes
3answers
1k views

How can I make Vim position the cursor at the start of a tab character instead of the end?

Open an empty buffer and insert a tab character then exit to normal mode. When you place the cursor (normal mode) on the tab it will be at the right side of the whitespace. I'm looking for a way so ...
9
votes
2answers
2k views

How do I move to the last character in a sentence?

In normal mode ( and ) move to the previous or next first character in the sentence, respectively. How do I move to the very last character. If all of my sentences end with a period I can use )T. (...
110
votes
2answers
205k views

How can I use Vim as a hex editor? [duplicate]

Is there a neat way I can view binary files as hex in Vim, and save it back to binary from the hex?
0
votes
1answer
465 views

Quickest navigation within a buffer [closed]

Okay, here's the thing: let's say you have a buffer, 1000 lines long (a source code for example). And you want a super-fast navigation, jumping to the right place. Example: You are on a line 42, on ...
16
votes
2answers
5k views

How to tell vim not to try to unzip a file

I'm trying to open an .xlsx file in Vim, but got an error saying: ***error*** (zip#Browse) unzip not available on your system I know it's a binary file, but I want to do some checksums and ...
13
votes
2answers
1k views

Auto Highlighting identical lines text

I saw a skilled vim ninja do this a while back but I have no idea were to start. A) Is there a way to set up vims background colour so that consecutive lines with identical content get highlighted. ...
12
votes
2answers
304 views

Search all versions of a file in the undo tree

Is there an easier way to find a particular change in Vim's undo tree than just looking at random old versions of the file one at a time (either using vanilla VIM commands, Gundo, or another plugin)? ...
5
votes
2answers
647 views

Vim `cpp` Syntax highlighter prematurely ends macros mid-word

NOTE: This question is a "manual migration" from here: https://superuser.com/q/875751/199803 My Vim syntax highlighter for ft=cpp is prematurely ending some macros mid-line. For example: (The ...
13
votes
1answer
1k views

What bad things can happen if I use :bwipeout?

I have just discovered the :bwipeout command, for which the :help states: Like :bdelete, but really delete the buffer. Everything related to the buffer is lost. All marks in this buffer ...
30
votes
3answers
10k views

In Vimdiff, how do I switch the left and right panes?

When I do vimdiff file2 file1, file2 naturally goes on the left and file1 on the right. Sometimes I find that I put them the wrong way round, so I'd like to be able to switch them round without ...
38
votes
7answers
8k views

What is the easiest way to insert en dash in Vim?

To insert an en dash, I use ^v u 2014 which is seven keypresses. Is there an easier way? (I was looking at digraphs and didn't find en dash there.)
4
votes
1answer
549 views

Following a tag in a VimScript

I am working on an omni-completion script where I use taglist() to search for the existence of a certain word. After obtaining that tag I now need to quickly jump to where the tag is defined and ...
6
votes
1answer
583 views

Why don't I get syntax highlighting when I open a file in an autocmd?

While trying to devise a solution to How do I make vim look in a set of directories for a file, if it doesn't exist in the current directory?, I have got so far using Python: function LookupFiles ...
9
votes
3answers
1k views

Automatically close oldest buffers?

I needed to edit a lot of files recently for a small change in each file. To get to each file, I browsed through NERDtree and opened one file after another. As I opened more and more files, I ...
5
votes
2answers
215 views

Translating Keymaps to Ex Commands

Say that I have some semi-complex keymaps like the following: nnoremap <Leader>s :%s/\s\+$//e nnoremap <Leader>u mz:r!uuidgen<CR>dW"_dd`zp" nnoremap <Leader>d g/\v"([^"]|\n)*"\...
2
votes
1answer
148 views

inspect filter output in minibuffer or a new buffer

Would like to send a line to an external programme and inspect output in the minibuffer or a new buffer. Don't want the output to replace original text. How to do this? In gnu emacs there's M-| (...
2
votes
1answer
376 views

Why doesn't `nmap <tab> v>` work?

In my vimrc file, nmap <tab> v> doesn't work. But other key binding, such as nmap <s-tab> v< vmap <tab> >gv vmap <s-tab> <gv Do work. I tried to search for <...

15 30 50 per page
1
186 187
188
189 190
195