vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

15
votes
5answers
2k views

Automatically create matching braces in vim

How do I automatically create matching braces in vim? It should work as follows: If I input an open brace the closing one should appear automatically and the cursor should be placed in between. To ...
0
votes
1answer
68 views

Auto code completion in GEdit and VIM, for C++

Being a Visual Studio fan, I am just wondering if I can have same feature in GEdit and VIM. PS : I’m new to VIM and currently using CentOS and Ubuntu.
1
vote
1answer
24 views

Vim command to turn hard wrapped lines into visually wrapped lines with preserved formatting

Given the following strings each on a separate line (which I indicate by prefixing line numbers) with syntax specific indendation: 1 Standard string with only text or code from some programming ...
2
votes
2answers
522 views

How to fix weird vim polluting the terminal behaviour on arrow keys and on delete in insert mode?

My terminal gets polluted by B, C,A,D when I try to navigate within vim using arrow keys and on delete using backspace it only scrolls back without deleting the characters on screen while the ...
0
votes
2answers
71 views

Adding color scheme to Vim

I would like to add this color scheme to Vim any suggestions on how I could accomplish that ?
2
votes
3answers
43 views

The vim navigation sweet spot, medium-distance jumps

In vim I often find myself j-stepping by line to go, say, 8 or 10 lines down. For example, if I have a directory open in netrw and the directory I want is 8 lines down I will just jjjjjjjj+ENTERENTER. ...
2
votes
2answers
96 views

Anyway to navigate percentage-wise in vim?

I often open large files, looking through logs for finding info. As all lines have timestamp in my case and I am sure of in which part of the whole file the info is present which I am interested in. ...
7
votes
2answers
351 views

Bash inside Vim not working properly

In MacVim I'm using Conque to run bash commands inside Vim. I have a problem with the text navigation while using Conque. If I'm at the end of a line of text and press down Alt← I skip a word to the ...
2
votes
1answer
109 views

What does the underscore motion do in vim?

I don't understand the underscore motion in vim, at least in the context of yank (y). My cheat sheet reads "soft" bol down which I do not comprehend. If I use the motion alone it seems to be the ...
0
votes
1answer
18 views

Move to other end of paragraph in vim (not a visual block)

If I have a paragraph selected in visual mode (eg, vap), I can swap the cursor between the ends by using Shift-O. Is there a way to do this in normal mode?
4
votes
2answers
2k views

Copy-paste for vim is not working when mouse (:set mouse=a) is on?

I was trying to copy paste something from vim to another application and also, from that application to vim using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also ...
1
vote
1answer
47 views

In VIM how do you run a command silently in the background?

I'm using ubuntu and currently have the following line in my vimrc file: nnoremap < leader >dc :execute 'silent !drush cc all' | redraw! The command works but it doesnt hit me back to the ...
0
votes
1answer
10 views

:bnext not cycling through all buffers in vim

For some reason :bnext is not cycling though all the buffers shown by :buffers I have 5 buffers open but only 3 buffers are visited when I used :bnext repeatedly. How can I cycle through all the ...
0
votes
2answers
81 views

Open list of files in vim to specific lines

I know about vins command line operator but I need a version that works on multiple files . For instance I have a stack trace file and would like it to open all of the files to the line in a ...
0
votes
2answers
83 views

Select an item in vim autocomplete list without inserting line break

A rather annoying feature of vim is that if you are in insert mode and do an autocomplete (Ctrl-N), arrow key down to the desired item, and press the Enter key, then it inserts the item but also ...
0
votes
1answer
101 views

How do I use vim on the command line to add text to the middle of a file?

I am trying to write a command along the lines of the following: vim -c "XXXXXX" myFile Instead of the "XXXXX" I want to supply some commands to vim to add some text to an arbitrary point in the ...
10
votes
5answers
2k views

How can I paste (overwriting) with vim?

In vim I use yy and p all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use yy p dd p because the dd deletes the line to the clipboard ...
0
votes
1answer
40 views

The form of the cursor in vim in konsole in kde with tmux

I use KDE and for vim in Konsole, I have such commands in my .vimrc: " Konsole " solid underscore let &t_SI = "\033]50;CursorShape=2\007" " solid block let &t_EI = "\033]50;CursorShape=0\007" ...
1
vote
2answers
88 views

Graphical issues in vim

Not sure if this is the best place to ask this but does anyone know why I'm seeing those purple-ish bars in my vim? My vimrc http://dpaste.com/698999/ Also, I'm using Lion OSX
6
votes
2answers
284 views

How can I create my own spelling file for vim?

At the moment I'm writing a document where I need to use a lot of acronyms, technical language, and non German words. Now I was wondering if I could create a spelling file (tech_speak) which checks ...
20
votes
3answers
10k views

Ctrl-s hang terminal emulator?

I came across a sentence in vimdoc: Note: CTRL-S does not work on all terminals and might block further input, use CTRL-Q to get going again. and this key indeed hangs my vim. I was ...
2
votes
1answer
121 views

/usr/bin/vim vs. /bin/vim

I get that binaries can be in different places. What I don't understand is why when I run whereis, which and type it says vim is at /usr/bin/vim, but when I try to run it using sudo it says I can't ...
1
vote
0answers
32 views

Gbrowse not working correctly on MAC

I'm using vim and have installed Pathogen and vim-fugative, but when editing a file under source control on github.com I use the command :Gbrowse and nothing happens. I've tried most of the advice I ...
4
votes
2answers
710 views

Can vim display ASCII characters only, and treat other bytes as binary data?

I already know vim -b, however, depending on the locale used, it displays multi-byte characters (like UTF-8) as single letters. How can I ask vim to only display ASCII printable characters, and ...
3
votes
2answers
197 views

place the aliased version of an existing command in /usr/bin/

I use Vim a lot, and I know how I can start vim in insert mode. So I have an alias named vii in my .bash_aliases file. On other hand I use Git a lot too, and I have this line in my .gitconfig: ...
3
votes
1answer
27 views

Position-based tag filtering in vim

When jumping to a tag with CTRL-] and having multiple tag matches, one has to choose which tag to use. Is it possible to filter the multiple match menu based on things like position or active syntax ...
3
votes
3answers
217 views

Method for storing/remembering one liner commands

Often when configuring and adjusting unix-based systems I use a lot of one-line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you ...
2
votes
1answer
30 views

Why can I not do visual mode when using visudo?

I thought perhaps vim was in some compatibility mode of some sort. To make sure it was using vim instead of vi, I set the VISUAL environment variable but was still unable to get into visual mode ...
0
votes
1answer
38 views

How do you track down why a Vim plugin does not work?

I have installed the plugin vim startify which worked fine in my remote server where I use it. Something happened (I think an upgrade) and the plugin no longer seems to work!
But I don't get any error ...
4
votes
4answers
86 views

Replace using vim - Replace a pattern […] by a string

I have a file containing lines in below e.g. format - [foo@host.com, bar@host.com], Payment processed - 23499, params = {'invoice':3243} I only want the account numbers i.e. 23499. It's a number. ...
1
vote
1answer
72 views

Neither `less` or `less -X` clear screen on exit

Neither less or less -X clear screen on exit. At the same time, vim does.... Env iTerm2, protocol mosh, server Centos + tmux + zsh iTerm2: report term as xterm-256color tmux: set -g ...
0
votes
2answers
32 views

“abbreviation” for dd$ if current line is empty

Example: I type "abc" then [newline]. Now I want to effectively just remove the [newline] to remove the current line (dd) and then jump to the end of "abc" ($). It might seem odd to ask for ...
0
votes
0answers
26 views

View .deb package files in vim

vim is capable of reading compressed files (for common methods, at least). However, it sees Debian package files as binary gibberish. The Archive Manager tool can, however, open package files and show ...
2
votes
1answer
56 views

How to toggle mouse support in vim?

I have been working on my laptop a lot lately, and I am accidentally clicking while typing. I know I could remove set mouse=a in my .vimrc, but sometimes I like using the mouse. What can I do to ...
5
votes
9answers
794 views

Replace several strings with other string in several files

I have several text files. All these text files need to undergo a set to editing which can be done in vim. I want to automate this. vim has several commands for replacement. Suppose the text files ...
3
votes
3answers
57 views

Keymaping for re-indent source code in Vim

I have key mapping in my ~/.vimrc file that re-indents edited source code on the fly. It looks like as follows: " press F4 to fix indentation in whole file; overwrites marker 'q' position noremap ...
1
vote
1answer
116 views

vim replace search text by manipulated search text

This is a very simplified version of my problem. Suppose I have a text file containing several places the code 20091a or 20092a or 20093a. I'm wishing to surround all this code by the text ...
4
votes
3answers
440 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
0
votes
0answers
57 views

Folding in vimrc does not work as expected

I added these to my vimrc: set foldenable set foldmethod=syntax set foldlevelstart=1 let javaScript_fold=1 " JavaScript let perl_fold=1 " Perl let php_folding=1 ...
3
votes
2answers
85 views

Vim settings within ncftp edit

I'm using the ncftp utility. It has an edit command which handles the get, edit, put sequence for me as in GUI ftp clients. It's great except for one thing, I get vanilla vim, with none of my ...
5
votes
3answers
1k views

Vim unnamed register + or *

Im using Vim 7.3 in Ubuntu and I'm having a little problem copying to the system clipboard with the following command "+y but I'm getting the following error: E354: Invalid register name: '+' In my ...
2
votes
1answer
26 views

Reverse global and local marks in vi/vim

How can I reverse the capitalization convention of marks in vi/vim? Normally a lower-case mark like "a" means it is local to the current file, but upper case marks like "A" are global to the session. ...
8
votes
2answers
149 views

Vim spell punctuation for ⸮

I am finding myself using the point d'irony (⸮) more and more. However, vim spelling does not recognise it as a valid punctuation character. How can I add it to vim so that the spelling works?
4
votes
1answer
308 views

Vim Copy to System Clipboard without overwriting the default register(")

When I use "+y to copy to the system clipboard, the selected content is copied to the + register as well as the default(") register. How can I ensure that the content is copied only to the + register ...
1
vote
2answers
73 views

Vim - statusline and links

Given this situation: cd ~/temp ln -s /var/lib/alsa alsa cd alsa pwd -> /home/<username>/temp/alsa But if I open some file in the directory output of pwd, the vim statusline gives me: ...
5
votes
3answers
1k views

vim - how can i do a 'change word' using the current paste buffer

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar' and I want to replace it with my paste buffer. To replace the text ...
0
votes
1answer
49 views

Can I get my iTerm key-combos working in tmux?

I have some shortcut keys defined in iTerm, and I use them for key-mappings in Vim. For example, I map Ctrl-Enter to send a ^[O2P escape code, which I then use to define a Ctrl-Enter key-mapping in ...
0
votes
1answer
44 views

Cursor keys do not jump over tabs in Vim

When I step over a tab with the cursor keys (h and l), the cursor does not jump over the tab, it just goes one space at a time. This is annoying because I am not sure if there is a tab there or ...
6
votes
1answer
61 views

Change inside comments with Vim

Is there a way to change inside of a comment with Vim? I know you can change inside brackets and quotes with i] and i". For example, If you are on a quote you can press, ci"my new textESC And ...
-2
votes
1answer
70 views

Why are there several keys unbound in vim?

There are several keys that are unbound in vi/vim, such as g, q, v and #. Is there a particular reason why these keys are unbound? Can I just use them however I want or will I be breaking certain ...