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

learn more… | top users | synonyms

1
vote
3answers
61 views

How to hide a content of a file? [on hold]

Is there any way to hide the content of a file? Suppose I have the file bind which contains the following line: This is a test. After saving the file, it should not display its content. Is there ...
1
vote
0answers
16 views

Creating specialised dictionary file for VIM (from Wikipedia?)

I use VIM's dictionary completion feature very frequently, yet have found it unhelpful when it comes to 'specialized' terminology, in my case German philosophical terms. I would now like to create my ...
0
votes
0answers
19 views

What are your most useful custom keymappings in Vim? [closed]

What are your most useful custom keymappings in Vim? Also! More specifically, what are your most useful mappings to the leader key?
0
votes
2answers
19 views

Is there a way to limit a vim window to show only a portion of a buffer?

Sometimes when working with big files containing many functions I would like to create some splits showing specific functions and nothing more. Is it possible in vanilla vim or with some plugin to ...
2
votes
1answer
25 views

Vim - Automatically changing the pair of a changed HTML tag

How can I configure Vim so that when I change one member of a matching pair of HTML tags, the other is automatically changed to match? For example: given <span>content</span>, I want to ...
0
votes
0answers
20 views

Set default editor for 'info coreutils' [duplicate]

I'm using Ubuntu 14.04 and have this in my .bash_profile: export EDITOR=/usr/bin/vim export VISUAL=/usr/bin/vim man respects this setting but info always opens in something else, nano or it's own ...
2
votes
1answer
44 views

tmux vim colorscheme background is not showing

I have installed tmux but now text mode vim colorschemes do not fill the background colour properly. Here is how it looks with colorscheme xoria256 in the normal Ubuntu 14.10 terminal: And here ...
1
vote
0answers
22 views

How to map emacs multi-modifier keys in vim?

I want to be able to map the multi-modifier keys of emacs in vim. I am trying this for exiting vim: imap <C-x><C-c> <ESC>ZZ However, this does not work.
1
vote
1answer
115 views

Vim search in global variables

I can display variables in vim using :let g: but I cannot search in it (keybindings seem very limited). Can vim open this content as internal buffer or pass to some other command?
1
vote
2answers
40 views

Getting vim to go to the first line and enter insert mode when writing an email with mutt

Mutt uses vim as its editor, and its temp files are in /tmp/mutt-* I want vim to auto-insert on the first line when replying to an email in mutt. here is the applicable line from my .vimrc: autocmd ...
1
vote
1answer
28 views

Vim: x-terminal key mapping

I normally use Vim on Windows and have had no problems with key-mapping, but now that I'm using a virtual machine running Ubuntu, accessed through MobaXterm, things don't quite work as they should. ...
1
vote
2answers
39 views

In Vim, why does `2ci"` delete the surrounding quotes?

ci" (and 1ci") leave "s intact; why does 2ci" (and the same formula with any higher number) delete them?
0
votes
0answers
19 views

Gvim terribly slow redraw

I am on the last Arch Linux distribution using gnome desktop. And it is nearly impossible to work with gvim. For example, using opening python files make a mess on a screen when I start opening ...
1
vote
1answer
34 views

.vimrc does not working as expected

I've been trying new color schemes and I set: colorscheme gotham256 set background=dark set t_Co=256 highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE but these thing ...
2
votes
1answer
68 views

How to use CapsLock instead of Escape in Vim?

I would like to map my CapsLock to Escape. How do I represent CapsLock in .vimrc? I know to map space to a command I would do something like this: :map <space> viw How would I map CapsLock ...
8
votes
2answers
419 views

In VIM, replace path with slashes without using escape slashes

In vim I want to substitute a long path /a/b/f/g/d/g with another /s/g/w/d/g/r in a text file. Usually I use \/ but there are too many slashes here. Is there an easier way?
0
votes
0answers
29 views

NERDTree don't create window on open when file is not saved

Is there a way to convince NERDTree to always hide editor window? Because when I open file and I have unsaved changes in previous one, NERDTree will open new window, so it is opened in split. I don't ...
0
votes
1answer
49 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.
0
votes
2answers
57 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
41 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. ...
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?
1
vote
1answer
42 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 ...
1
vote
1answer
23 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 ...
0
votes
1answer
9 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
59 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
95 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 ...
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 ...
0
votes
1answer
38 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" ...
2
votes
1answer
108 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 ...
0
votes
2answers
37 views

Why does my vim status line say “Obtaining ../”?

On the righthand side of my vim status line it says "Obtaining ../" and is highlighted yellow. Why does it say this? The results of :set are: :set --- Options --- cpoptions=BceFs history=1000 ...
3
votes
1answer
24 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 ...
2
votes
1answer
27 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 ...
4
votes
4answers
76 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. ...
0
votes
1answer
35 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 ...
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
25 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
49 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 ...
1
vote
1answer
64 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 ...
5
votes
9answers
602 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 ...
1
vote
1answer
105 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
429 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
44 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 ...
2
votes
1answer
101 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 ...
3
votes
3answers
214 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 ...
4
votes
1answer
303 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
63 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: ...
2
votes
1answer
24 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. ...
0
votes
1answer
37 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 ...
0
votes
1answer
46 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 ...
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 ...