All Questions

Filter by
Sorted by
Tagged with
1
vote
2answers
693 views

How to make 'spellfile' work for multiple languages?

I want to keep my Vim spelling synchronised across machines. For that reason I put my spelling file into Dropbox by adding set spellfile=$HOME/Dropbox/vim/spell/en.utf-8.add to my .vimrc. It worked ...
58
votes
2answers
34k views

Close and unload a buffer without exiting Vim

Often, I'll load some information into a temporary buffer, and then close it with :clo!. But this hides the buffer rather than unloading it entirely, even though I have nohidden set. I find this ...
13
votes
2answers
6k views

Suppress output from a vim autocomand

I have an autocommand defined in my vimrc: au BufWritePost * !./make.sh The script make.sh compiles a .tex file 3 times and I don't want the output to be displayed. Is there a way to suppress the ...
0
votes
1answer
735 views

Override highlight group settings with default values

I am writing a plugin that highlights buffer settings violations. I use matchadd() function. In addition I need to add patterns that are force ignored. In order to achieve that I use priorities in ...
20
votes
2answers
576 views

How can I use a line number to copy a line to where my cursor is?

A lot of times I'm in a situation similar to this: 1. <Line 1> 2. <Line 2> 3. <Line 3> 4. <Cursor is here> 5. <I want to copy line 1 here> An easy solution is mm:1<...
7
votes
3answers
132 views

How to jump only in currently open file?

Quite often, when using CTRL-O to jump back to an older position, vim takes me to other files I've been editing previously. Is there a command, to go back within the jumplist just in the current file?
-4
votes
3answers
555 views

What is an exhaustive list of “all the things” in vim? [closed]

I'm looking for a list of the basics, for instance, not a list of all the plugins, but plugin would be on my list; here is what I have so far help me out if I've missed anything or if I've mis-named ...
2
votes
1answer
73 views

Is there any way to prevent a line from wrapping around while in visual mode?

If I am using visual block mode to append to a block of text and number of characters exceeds 80, then the line snaps and text is not appended to rest of the block. I want to find a way such that line ...
22
votes
2answers
3k views

Is lookaround possible in vim's regex system?

I have encountered many situations in vim where it would be useful to have lookaround statements. I have tried using the standard lookaround syntax ((?=), (?!) etc ..), but it appears vim does not ...
4
votes
1answer
100 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 ...
1
vote
2answers
638 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 ...
5
votes
1answer
703 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 <<...
3
votes
2answers
419 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....
15
votes
1answer
576 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 \begin{equation} & \end{equation} commands. Is there any ...
4
votes
1answer
484 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 ...
2
votes
1answer
95 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 | <- ...
4
votes
2answers
693 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-...
8
votes
2answers
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> ...
3
votes
1answer
364 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 ...
11
votes
1answer
7k 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: ...
3
votes
1answer
201 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,...
7
votes
2answers
421 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 ...
6
votes
1answer
2k 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 ...
15
votes
5answers
15k 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 ...
9
votes
1answer
673 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" : "...
1
vote
1answer
54 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, ...
2
votes
2answers
86 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 ...
6
votes
3answers
733 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?
2
votes
2answers
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 ...
1
vote
2answers
418 views

How to set both files to the encoding in vim diff from command line?

I've opened the files I want to diff using the following command: C:\temp\robocopyTasks>vim -c "edit ++enc=ucs-2le" -d C:\temp\robocopyTasks\acl\tasks_temp.txt C:\temp\robocopyTasks\acl\tasks_win....
26
votes
1answer
7k views

Setting a vim option from the command line?

How does one set a vim option when launching from bash or another shell?
2
votes
1answer
128 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 ...
26
votes
2answers
2k 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 ...
7
votes
4answers
8k 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 ...
2
votes
1answer
112 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 ...
6
votes
1answer
4k 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 ...
2
votes
2answers
110 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 ...
4
votes
1answer
596 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 ...
7
votes
1answer
1k 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 ...
17
votes
1answer
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 ...
2
votes
1answer
159 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 -...
7
votes
3answers
2k 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 ~/....
2
votes
1answer
306 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 ...
5
votes
3answers
5k 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 ...
21
votes
3answers
9k 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 you there is no visual split between them at all if the content ...
9
votes
3answers
434 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....
4
votes
1answer
186 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 ...
1
vote
1answer
2k 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 ...
1
vote
2answers
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. :...
15
votes
2answers
492 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 ...

15 30 50 per page