Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

learn more… | top users | synonyms

0
votes
2answers
35 views

How to swap the last name and first name without a comma with vim

I have a long list of name in order of Family name, First name. I'd like to change this to First name Last name with vim. What is the best way. Thank you for your help. Berclaz, Lucy Carlow, Rese ...
0
votes
0answers
211 views

Does vim's youcompleteme plugin require clang to auto complete?

From the youcompleteme's documentation, it's quite ambiguous what clang has done for it. Does it do syntax check? Semantics check? Or it's necessary to do auto completion? Actually, youcompleteme ...
7
votes
2answers
718 views

Why is vim leaving temporary file versions all over the place?

First of all I assume those files ending with "~" which are created by vim when editing a file are indeed serving the purpose of temporary backups while editing. But every time I open a file with vim ...
0
votes
1answer
49 views

Handling punctuation in text pattern with vim search/replace

In vim we have the :substitute command that searches for a text pattern and replaces it with a text string. How does one handle a text pattern with punctuation in it? Minimum working example: the ...
0
votes
1answer
66 views

where is vimfiles directory on mac OS?

I am a new user of mac OSX, I found there is no vimfiles directory under /usr/share/vim, but directory vim73 is there. this vim was shipped with OS and I didn't install it. vimfiles was used for ...
0
votes
0answers
42 views

vim and macvim are not reading my .vim directory

I have installed vim and macvim using macports, and tried copying over my .vim directory from linux. Neither seems to read anything from that directory: my customizations for folding and indenting ...
3
votes
2answers
51 views

vim command that will do :buff or :e if the file is not already in the buffer?

basically my workflow is as follows I have a bunch of windows open using splits in a terminal in regular vim. Sometimes I have a file open sometimes I don't I usually switch between :buf and :tag to ...
2
votes
2answers
61 views

How to use multiple spaces in listchars?

I'm currently using the following listchars I found on vim casts: set listchars=tab:▸\ ,eol:¬ I'd like to make tab be ▸ followed by 3 spaces, but I can't seem to get it to work. I've tried the ...
1
vote
1answer
36 views

Tmux - select entire lines

I'm using tmux with the following lines in my .tmux.def: bind p paste-buffer bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy 'y' copy-selection It works well and I can start copy mode ...
0
votes
0answers
146 views

URxvt: vim and cursorColor [invisible cursor or invisible cursor text]

Introduction I've always used a light-background terminal and a dark-background editor (vim). On this I'm not willing to compromise. In any case, I've just switched from xterm to urxvt ($TERM == ...
1
vote
1answer
22 views

Vim: Open multiple files in a specified configuration from command line

I use a set of tabs and splits in my Vim window for my workflow. My setup looks something like this: 1st tab with a vertical split showing two buffers. 2nd tab in the following split: ...
1
vote
1answer
31 views

How to move cursor to next wrapped line in Vim?

For example, if I have a long line wrapped several times, it is painful to move cursor inside this line, I have to hit w repeatedly, or use f to find what I want, even slower if there are many same ...
0
votes
1answer
52 views

VIM disabling replace mode

In VIM, I find myself reflexively hitting the insert key, before entering text. Normally because I have been doing some reading and often, but not always, I'll have switched out to do a search or ...
0
votes
1answer
103 views

Mouse scrolling down in vim inside tmux via PuTTY, but not up

I'm experiencing an issue across multiple platforms where scrolling down with the mouse wheel works fine, but not scrolling up, while using vim within a tmux session within PuTTY. Any ideas? Maybe ...
0
votes
1answer
36 views

set up my own vim attach where my counterpart can see my screen vice versa in ssh

I want my counterpart to see my screen to be about for him to view my codes while coding. For example, I have sample code for my partner to show, and I want it real time so we can collaborate ...
0
votes
2answers
41 views

Vim segfaulting for no apparent reason

Vim is occasionally segfaulting on me whilst editing, but it's not at all obvious what is causing it. I'm sure it's some third party plugin I have, but I have no idea which one. How can I track down ...
0
votes
1answer
255 views

objective-c syntax highlighting for vim

I would like to have an excellent syntax highliter for obj-c that matches or beats the one in my xcode.. I've installed base16 through yadr, and i've also installed cocoa.vim to have better syntax ...
1
vote
1answer
251 views

how to install a color scheme with yadr

someone advised me to use yadr, which is supposed to make installing dotfiles etc much easier for vim however I just couldn't figure out a way to install base16 through yadr.. before I had to ...
0
votes
3answers
48 views

Vim - Visual Mode - Improve Word Selection

Gentlemen/Ladies, I do not understand why vim is exhibiting the following behavior when I trigger the shortcut below on visual mode (.vimrc): vmap <script> <C-LEFT> :call ...
0
votes
1answer
23 views

Round within the vim expression register

Is it possible to round within vim's expression register? I want to do something like the following: <C-R>=1*round(1.0/7,2)
1
vote
1answer
44 views

How can I check if the cursor is at the end of a line?

Gentleman, Simple question about Vim! How can I check if the cursor is at the end of a line using a function in vimrc? []'s
0
votes
2answers
42 views

How to save open/closed folds in vim with mksession?

Premise I use :mksession s.vim to save my current session, and it does. Except for folds I opened or closed during it. Question What should I do to enable that? Settings I use the following ...
1
vote
1answer
60 views

Vim crashing when pressing `ctrl-s` in terminal

When I press ctrl-s in vim running in the terminal the program crashes to the point where it doesn't even terminate when I send kill -SIGKILL <vimPID>. The process isn't listed in the output of ...
1
vote
2answers
37 views

Vim changes files after using make

I bind F5 to make: map <F5> :make clean && make <cr> After I do make, it always replaces the current file by another file in the folder which I opened before. For example, I am ...
0
votes
1answer
67 views

Vim Gitgutter to the right of the line numbers

I am using vim-gitgutter in conjunction with vim's native line numbers. The problem is, I gitgutter is showing up on the left of the line numbers and I would prefer it go on the right. Is there some ...
1
vote
1answer
40 views

Vim: Vertical navigation in insert mode

I am using vim for quite some time but I think I broke my settings somehow after installing a few packages. Let me show it with examples. In normal mode I am used to navigation like this: However, ...
2
votes
1answer
130 views

How do I set vim to support mouse scrolling, but keep text selection on left click?

I would like to scroll my files opened in vim using mousewheel, but at the same time using the left mouse button to select text into clipboard. Setting :set mouse=nicr (or :set mouse=a) will only ...
0
votes
1answer
68 views

Automatic indentation with MacVim

How can I change the automatic indentation in MacVim? My problem is that when editing a TeX file, every time I type, for example, (, vim decides to indent the line for me. Here is a video of my ...
0
votes
2answers
63 views

Vim/Sublime Vim bindings move cursor forward/back by one

I'm new to Vim bindings and I want to start using them in Sublime, but ran into a few stumbling blocks. When I type various kinds of enclosed tokens, such as "string literals" or {code blocks} or ...
0
votes
1answer
64 views

How to substitute multiple space with a single space in Vim

I have the following lines. I'd like to replace multiple spaces with a single space in vim. How can I achieve this? Thanks in advance. Percent I4-15 b Percent and Fractions ...
0
votes
1answer
30 views

How to replace . with space in Vim

I copied the following to vim. Now I want to delete all . dots/periods. I tried :%s/./ /g But it does not give me the desired result. How can delete them at once? Thank you in advance. a. ...
0
votes
2answers
41 views

Go to end of `===` but not include `$`

Consider the following example lines: $some ==thing(); $some == thing(); $some ==$thing; $some == $thing; I am writing a macro to improve these lines. With the cursor on the space after $some, I ...
0
votes
1answer
15 views

Find and then ask to perform action

I have a few macros to help refactor code that I have inherited. For instance, this macro adds spaces around a = character: nnoremap <leader>bg /[^ ]=[^ ]<Return>a <Esc>la ...
-1
votes
1answer
39 views

Why the tee command output something very strange when I capture the result from VIM?

I can recognise the welcome message, like: VIM - Vi IMprovedversion 7.3by Bram Moolenaar et al.Vim is open source and freely distributableBecome a registered Vim ...
1
vote
1answer
32 views

any button on numeric key pad in vim counts as insert?

With or without Num Lock, any time I do / and then enter in a number via the numeric key pad I go into insert mode (as though I hit i). If I type in numbers with the set of numbers above the letters ...
3
votes
1answer
132 views

Links to references in mutt or vim

Is there some automatic script that changes text with http:// links to references for mutt or a vim plugin ? Say I have Text text, hey there goes a http://example.com link, hey the second one ...
1
vote
0answers
26 views

VIM + netrw: accessing a machine behind a gateway

I'd like to setup a vim session to edit some files on a machine behind an ssh gateway. Is this possible? To access the files via the command line, I have to do: mycomputer$ ssh gateway gateway$ ssh ...
0
votes
1answer
55 views

Display-only Column Formatting in Vim for Character-Separated Value Files

I would like to be able to nondestructively align columns when I am editing csv files in vim. I know of various ways to tabularize/align columned data in vim, but they all modify the file itself ...
1
vote
1answer
33 views

How do I enable a vim color scheme?

I'm trying to enable the github color scheme on vim. I've downloaded the script from http://www.vim.org/scripts/script.php?script_id=2855 and copied it to ~/.vim/colors. Then I've opened vim and ...
0
votes
1answer
36 views

Use project or file specific spellfiles in vim

I just enabled spell check in vim. I like it and I know how to use it. However, I would really like a project or even file specific spellfile as my list of accepted words. That way I can keep project ...
0
votes
1answer
195 views

NERDTree: Open file in new buffer?

I'm just getting used to NERDTree and Vim. I currently have one file open in a buffer. How do I get NERDTree to open another file in a buffer to the right? If I just navigate to the file in ...
0
votes
0answers
38 views

Running script from (Mac)Vim and getting continuous output in new window

I am trying to run a Ruby script from within MacVim, that runs for some hours and I would like to have all output redirected to a new window the moment it is actually output. I found the top answer ...
0
votes
1answer
40 views

Vim completion based on language

Right now if I hit ctrl + n it will complete words that are in the current document. I've also found a way to define a dictionary. I'm just unsure how to get vim to complete based on keywords in a ...
-3
votes
1answer
52 views

VIM - Detect Whether a Plugin is Active/Running/Open?

I would like to do some tricks with VIM and so I ask the help of you guys! It is possible to detect whether a plugin is active/running/open? You can close a plugin by its name? You can close a ...
3
votes
1answer
52 views

Vim: change label for specific tab

Say I have a bunch of tabs open in Vim, with a tabline looks something like this: 1 v/file1.py 2 t/file.py 1 t/file.py 1 o/otherfile.py See how two tabs both say "t/file.py"? Those are different ...
1
vote
2answers
48 views

Map Ctrl-Shift-V to an action in vi

I want to be able to paste from the clipboard on gVim on Windows using Ctrl-Shift-V, just like in Terminator. However, if I put this on my .vimrc imap <C-S-V> "+gP The shortcut works ...
2
votes
2answers
94 views

Delete / Yank lines from current line up to and including line containing search pattern

Suppose I have the following text (cursor is in middle of first word 'begin.' blah blah blah blah stuff stuff stuff \\\begin{tabular} { |p{0.25\textwidth} |p{0.2\textwidth} |p{0.5\textwidth} |} ...
1
vote
2answers
69 views

Keystroke to clear the current line at the prompt

How can the current line be cleared? I'm using bash. I don't like ctrl+c because it leaves crap printed on the screen. If the cursor is at the end of the line I can use ctrl+u and it does ...
1
vote
1answer
41 views

How to remap backspace when using ibus and vim?

First I do :inoremap <BS> x and then enter insert mode. Then switch to Hangul input in ibus. Now I try to type 마 and it shows up as ㅁx마 I guess that makes sense, right? ibus must have ...
1
vote
1answer
84 views

Better mouse-click behavior with gVim's virtual edit

I like using Vim's virtualedit=all feature, but I also like being able to click after the end of a line and have the cursor go directly to the end of the line (instead of going to the exact position I ...