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
21 views

How do I reverse the order of log entries in this file? (Vim for preference)

I've got a set of files that contain notes written in reverse order: ###### 27/07/2016-15:04:20 GMT+1: Really? More? ###### 27/07/2016-15:04:18 GMT+1: It happened again! ###### 27/07/2016-15:04:...
0
votes
0answers
6 views

autocmd behaviour not as expected

I'm trying to set hlsearch on by default when I enter a buffer in vim. Running :set hls manually upon entering a buffer performs the action I expect. However, when I add autocmd BufEnter * set hls to ...
18
votes
4answers
9k views

VIM: What is the EX-mode for batch processing for?

The tutorial mentions that the Ex-mode is for batch processing. Since it is a nuisance, rather than a tool, for me, I would like to see some practical examples. Who uses it? Why? What is the EX-mode ...
0
votes
0answers
22 views

How can I open a new empty tmux pane when I am working in Vim?

Let's say I am working on an .html (or any text-based) file in vim. Next, I need to open a new pane in the same window to work on the terminal. How can I achieve that? I know how to use tmux to open ...
0
votes
1answer
9 views

Can a vim mapping trigger an Autohotkey macro?

I would like to trigger an Autohotkey macro using a vim mapping, is this possible? For example, to create a normal mode vim mapping in vim to enter CTRL-J, then use that to trigger Autohotkey. In ...
3
votes
0answers
53 views
+50

Print (decrypt) a vim encrypted file

I use the -x option in vim to encrypt a file. I read this files much more times than I write to it, so I always use cat and then remember it is encrypted because of what it shows.. So then I have to ...
2
votes
0answers
16 views

Apply window commands to a subset of all windows?

Suppose I wanted to move the top two windows (A and B) to a new column, like so: +--------+ A +--------+ B +--------+ C +--------+ D +--------+ E +--------+ F +--------+ +---+---+ |A |C | ...
7
votes
2answers
15k views

Search exact word in vim command mode

I want to search a exact word in vim in command mode(using Vim command /wordtosearch , NOT the search of the current word at the cursor using * or # commands) e.g. I would like to search an exact word ...
5
votes
4answers
6k views

Vim Solarized dark theme looks weird on iTerm2

I just installed the solarized colorscheme following instructions on the project's page. This is what it looks like now: which is not like those screenshots on the official page. Any idea how to ...
2
votes
2answers
163 views

How come terminal vim take so long to open HTML files?

I've been using terminal vim with custom plugin for a long-time. I never can wrap my head around this, I've been searching the web for a few days but had no luck. I do a lot of web development, I use ...
0
votes
1answer
18 views

vimrc set tabstop overridden by pathogen

Here is my vimrc configuration: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab execute pathogen#infect() syntax on filetype plugin indent on colorscheme spacegray The pathogen plugin ...
18
votes
8answers
8k views

Delete space-expanded “tab” in Vim with one keystroke?

I edit Python code with Vim. With the tab key I get four spaces inserted for indentation. How can I delete those spaces with one "Backspace"(?) stroke - instead of four? There has to be some "set" ...
2
votes
1answer
1k views

VIM only storing first 50 lines when yanking between files

When I use Y to yank lines, I can yank any reasonable amount of lines (I've never knowingly hit a limit). However, if I close the file and then try to paste p into another file, only the first 50 ...
0
votes
1answer
309 views

Remapping all OSX shortcuts from cmd to ctrl

I am new to OSX, and since I have mapped CTRL to CapsLock, and use alt a lot, I dont need CMD, how to remap all shortcuts globally not to use CMD?
0
votes
0answers
7 views

Vim: Error message on sourcing, but not on start up

I'm pretty new to Vim/gVim and am probably doing something wrong. What I want to do is completely reload my configuration (like a restart), but while gVim is running (keep the current session). Here ...
0
votes
0answers
21 views

Make Shift+Insert work in Insert Mode with “set paste” active

I have a Windows client with gvim for Windows 7.4. I want Shift+Insert to work as "Paste", so I added the following settings to ~/_vimrc: nnoremap <S-Insert> "+gP inoremap <S-Insert> <...
24
votes
4answers
19k views

Why does the system have /etc/sudoers.d? How should I edit it?

Last time, I asked about the risk of these (in /etc/sudoers): user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf %group_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf ...
1
vote
4answers
1k views

How to point MacVim to the right perl on OSX 10.10?

When I try to use MacVim from the command line, I get dyld: Library not loaded: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/libperl.dylib Referenced from: /Applications/MacVim.app/...
0
votes
1answer
50 views

Remap any key to F5 in Vim

I am trying to remap a key (I do not matter which) to F5 key because my physical keyboard hasn't got F1 - F12 keys. How can I do it? I have tried to use nnoremap but I am doing something wrong. I ...
0
votes
1answer
68 views

Mapping from .vimrc does not apply

In my vimrc, I mapped nnoremap <tab> >> and nnoremap <s-tab> <<. The second mapping works fine, the first one however seems to be forgotten. If I map it manually when in Vim, ...
0
votes
1answer
28 views

Why does `:tab all` open most files in new tabs and some in a one tab split horizontally?

I want to open all the files from the current directory matching *.c. I do it using :args *.c :tab all However my vim opens the first nine files in new tabs and the last six in the last tab and ...
0
votes
1answer
7 views

How do I set {argslist} programmatically in vim?

I know I can set the list of files like this: :args file1.txt file2.txt file3.txt I would like to set args based on a command. I also know, if I used a fresh vim, I could do this: vim $(some-...
1
vote
1answer
22 views

Vim: How can I remap a key, but only when I combined it with a number?

I want to center the view after I move up/down multiple lines (e.g. 7j), but not when I only move once (e.g. j but I don't care about 1j). Here's what I have: :noremap j jzz How can I make this ...
3
votes
2answers
59 views

Ctrl-A not working in vim command line mode

In vim command mode, while i am typing a really long search and replace command, how do i go to the beginning of the line? Ctrl+e and Ctrl+w are working. But when i press Ctrl+a it just prints ^A. ...
1
vote
2answers
85 views

Vimserver on Cygwin

Following to this question, I discovered that I can use --servername <name> and --remote on my console vim executable under Cygwin. So I installed vim-common vim and gvim and I do not have ...
0
votes
1answer
27 views

Vim isn't recognizing my vimrc file

I'm attempting to copy over my local vimrc configuration to a new linux server I've just set up: scp -rp .vim/ nagios:~ scp .vimrc nagios:~ Then, with ls -hoal on the remote machine in my ~ ...
0
votes
0answers
33 views

Midnight Commander VS Vim

A couple of months ago I started to learn how to use Vim (specifically, it's Vim 7.3 on Linux). Needless to say, I realized it's a powerful tool, and I seem to learn something new everyday with it. ...
4
votes
3answers
2k views

To have Vim Psql's editor

I have a Fresh Ubuntu installation. I have no personal dot-files active. I run unsuccessfully \e file.sql in Psql, when I have the following in my .bashrc, since Nano opens instead of Vim export ...
0
votes
0answers
31 views

How to install gvim.exe on Windows with Python support? (Solved by the author for this post)

Problem description: For all the executable installers for Vim that are listed below, the tags +python/dyn and +python3/dyn are unanimous when installed. However, for all my local installations using ...
2
votes
4answers
3k views

Change menu/ui language of vim to english

I search on google and I read several answers but I am unable to change the menu/ui language of vim to english. Im my .vimrc I have set langmenu=en_US.UTF-8 language messages en_US.UTF-8 but it ...
1
vote
1answer
915 views

`:cw` command in Vim: how to avoid auto jumping to first error?

In Vim, :cw command shows the quickfix window if there are any errors and let the cursor jump to the first recognized error in the quickfix window (not in the buffer where there is an error). Is there ...
0
votes
1answer
28 views

Syntastic not working on Ubuntu

I hate to post an "I can't work syntastic" question, but this has me stumped. Standard dotfiles setup - same config on OSX, Debian & now Ubuntu. Syntastic is not showing any errors in a broken ...
19
votes
5answers
4k views

How can I discard file change from fugitives status window?

When in the fugitive-plugin status window, accessed using :Gstatus, it's possible to diff changes for a file using D and toggle files for commit using -. Is there any similar shortcut for discarding ...
4
votes
1answer
228 views

brew upgrade broke Vim on OS X (dyld: Library not loaded)

I've not run brew update && brew upgrade for a long time. I just did a massive upgrade which turned out to broke my Vim. This is what I got after running vim: dyld: Library not loaded: /...
0
votes
1answer
28 views

VIM syntax highlighting works in MacVim but not vi in terminal?

When I edit a file with mvim (Installed via MacVim) I see syntax highlighting in colour on a large range of files. However, when I edit with the built in vi there is never syntax highlighting. Is ...
51
votes
5answers
32k views

In vim, how can I quickly switch between tabs?

In gnome-terminal, I can just press Alt + (1, 2, 3, etc.) to switch to specific tabs. I can also use Ctrl + (PgUp / PgDn) to cycle through tabs (admittedly less convenient, but it can be remapped). ...
2
votes
1answer
615 views

backspace not working properly inside vim comEmu

When I start vim from inside conEmu, then backspace is not working properly. I know its not a conEmu issue. It's a vim problem with console. I tried all things like stty erase ^H, stty erase '^?', ...
3
votes
2answers
3k views

iTerm2 vim cannot map alt key

I'm having trouble trying to map the alt-key bindings on vim in iTerm2. I want to map shortcuts for switching between buffers like this: map <A-Right> <C-w>l map <A-Left> <C-w>...
25
votes
9answers
13k views

How to start gVim maximized?

How to make gVim automatically maximize it's window when I open it? And a cross-plataform solution, I'm trying to use the same configs in a Linux and Windows machine... I've tried the hack :set lines=...
5
votes
2answers
982 views

Is it possible to launch MacVim NOT in full screen mode?

Whenever I Launch MacVim it takes up the whole screen. I don't want this. Is there any way to prevent it from happening? I run OS X 10.8.
80
votes
7answers
39k views

The best way to make MacVim's vim (console, not mvim) the default instead of Mac OS X's vim?

I installed MacVim using homebrew. (brew install macvim). If I call mvim from cmd, it opens the GUI MacVim. I would like to make vim call the MacVim's Vim (/Users/user/Applications/MacVim.app/...
1
vote
1answer
17 views

Vim - Is there a way to 'overlap' pages? (Getting visually lost when switching pages with Ctrl+f/b)

When I press Ctrl-f or Ctrl-b, it takes a few seconds for me to read some text to figure out where I am in the file. Is there some way I can make myself not get lost so easily? For example, is it ...
5
votes
3answers
153 views

tmux — naming windows and selecting them via fuzzy matching

I want to be able to name my tmux windows and select them using fuzzy matching (similar to LustyJuggler or Ctrl-P in vim). Is this possible with tmux?
3
votes
1answer
918 views

How to “Edit with Vim” as administrator in Windows?

When you install gvim in Windows, you get a right-click Explorer context menu item: "Edit with Vim". Is there a way of either adding a "Edit with Vim as Administrator", or just changing the existing ...
0
votes
2answers
24 views

VIM: How to set default color on search based syntax highlighting

Currently my /etc/vimrc file is set to the following: ( if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif filetype plugin on if &term=="xterm" set t_Co=8 set t_Sb=^[[4%...
10
votes
5answers
9k views

What could cause strange characters in Vim?

I'm have this really strange problem in Vim using the NERD tree plugin, where, as you can see in the picture, the characters are showing up very strange. Where there is the ahat, ~V 3/4 it should be |-...
3
votes
2answers
380 views

vim “modeline” equivalent for eclipse?

In our project different developers use different editing tools. Some use vim, some use eclipse. The nature of the project requires some files with DOS line endings, some with Unix line endings. It ...
-1
votes
0answers
19 views

ctrlp does not search any more in wild mode

I updated ctrlp today, and it does not search any more. For example, I have a list like this after I press ctrl+p > a/b/c/d.js > a/b/c/e.js > a/b/c/f.js then i entered af, it gave me ...
258
votes
5answers
194k views

How to open files in vertically/horizontal split windows in Vim from the command line

There must be a way, something like this: vim -[option] <file-list> to open files from command prompt and not from within Vim. split windows vertically or/and horizontally in separate tabs
38
votes
10answers
58k views

What's the easiest way to delete Vim swapfiles I've already recovered from?

Sometimes Vim crashes and leaves me a swapfile. That's awesome. Then I open the file I was editing and Vim asks me if I want to recover. I do, thanks. When it's done, Vim tells me, You may want ...