1
vote
1answer
38 views

Unable to find source of environment variable

So I did the mistake of removing an earlier version of Vim manually on Windows without going through the "Uninstall Program" dialog. The result left me with the enviroment variables of "vim" and ...
0
votes
1answer
52 views

Vim starts with beginning of a “change” command

I'm having an issue with vim startup. Whenever I run vim somefile, it starts as though I pressed c just after startup. So, if I then try to immediately jump to the end of the file with G, it instead ...
1
vote
1answer
27 views

How to send commands from a file to VIM?

This is the content of cmd.txt: :w 2.txt :q In command line, I do D:\>vim 1.txt<cmd.txt I expect cmd.txt as input stream (rather than my keyboard) and vim will save 1.txt as 2.txt and ...
0
votes
2answers
85 views

Open multiple vim tabs and windows simultaneously from command line

I've got four files a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files a and b in the first tab and c and d in the second tab. ...
-1
votes
1answer
47 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
97 views

windows env variables not resolving

I have the following env variables: VIM_HOME: %ProgramFiles(x86)%\Vim\vim74 CMD: %USERPROFILE%\cmd PATH: ...%CMD%;%VIM_HOME%;... C:\Users\me\cmd\vim.bat @echo off start vim.exe %* Prompt: > ...
1
vote
3answers
520 views

Delete last word (Ctrl-W): Make bash shell behave like vim command line

Among the many useful keyboard shortcuts available in the bash shell, there is Ctrl-W to delete the word to the left of the cursor. Let's suppose my command line looks like the following: cp ...
2
votes
1answer
44 views

vim: how run external app on a file if filename in register or variable

If I issue the Ex command :!xv file.png all is well, and xv starts and displays the file. But if file.png is in a register or variable, which is necessary as I wish to do this in a script, ...
2
votes
1answer
376 views

Running vim script exits batch file? (Windows .BAT/.CMD)

Trying to run a vim script as part of a batch file with vim -u NONE -S dothis.vim but what is puzzling is that the batch file exits after this line instead of continuing with the next statement. ...
0
votes
1answer
1k views

PuTTY - When press Up arrow to show command from history, it forces me to edit command in vi? How to change?

When I am in PuTTY, and I execute a bunch of commands, I often want to use the same command I just used. So I press the "Up" arrow. The last command now shows up, but I want to edit it a little. I ...
0
votes
1answer
68 views

Using vim for comparing files

I try to use vim to compare two files file1.txt and file2.txt via the command line (cmd) on Windows7 by calling vim -d file1.txt file2.txt I get the error: C:\Programming\R>vim -d file1.txt ...
0
votes
1answer
85 views

Vim uses wrong encoding when invoking commands in the terminal

I'm using Vim (GVim, to be precise) under Windows 8 and I want to compile with the usual :!g++ %, but the name of the directory where my file is stored has accents, and Vim seems to have problems with ...
0
votes
0answers
19 views

Vimtutor automatically closes [duplicate]

I am having this same issue as another user. How to run vimtutor on windows? I tried the answers but i am still unable to open it from the command prompt as it quickly closes. I know in the long ...
0
votes
1answer
91 views

vimscript delete whole line or word in command mode (q:)

I'm trying to figure out how to delete a whole line in command mode. I see lots of example .vimrc's with: cnoremap <C-a> <Home> cnoremap <C-b> <Left> cnoremap <C-f> ...
1
vote
4answers
683 views

How to use a text editor WITHIN the Command Prompt in a Windows OS?

Some input on this topic would be great. I would like to be able to create and edit the text of a file, all from the command line. No pop-up window (like with notepad), just create the file and start ...
0
votes
2answers
163 views

How can I use VIM to edit files from within CPrompt on Windows 8?

I was following a tutorial on how to use Git earlier. The instructor was using a Mac, and used a program called Nano to edit a file he made from the command line (or what it's called on a Mac.) I am ...
1
vote
1answer
183 views

How to “reuse” a regex find and replace in Vim

I have a plain text file with entries as firstAuthorLastName_titleFirstWord_YYYY that I change to firstAuthorLastNameYYYYtitleFirstWord with the following s// command in Vim.^[1] ...
0
votes
0answers
91 views

vim cannot open absolute directories from command line

Running vim 7.3 on CentOS 5. Cannot open directories from command line, except ".", so this does not work (vim opens, but just shows a blank buffer): $ /usr/bin/vim /tmp But this works fine, giving ...
1
vote
1answer
138 views

How to open multiple tabbed files in vim, each at a specified line?

Using vim I can open multiple tabbed files using the -p switch: $ vim -p file1 file2 file3 Using vim I can open a file at a particular line: $ vim file1 +123 How can I open multiple files in ...
0
votes
2answers
199 views

Making MacVim/gVim “block” the terminal until closed

A long time ago, before I switched to vims, I used an editor for OS X known as TextMate. (Anyone remember that? ;) Its command-line binary, mate, allowed for a mate -w flag, which would block the ...
2
votes
1answer
89 views

how to open cmd from gvim without waiting the cmd window to be closed

In gvim I can open cmd typying :!cmd, but gvim keeps waiting for the cmd window to be closed. Is there a way to tell gvim NOT to wait?
1
vote
1answer
60 views

How to make vim recover files from command line?

If it were linux, I'd do it like this: echo "w DST_FILE | q" | vim -Esu NONE -r SWP_FILE I'm trying to do the same under windows with git's bash, but with no result. It hangs and doesn't create ...
0
votes
1answer
231 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
47 views

Can FIGNORE be limited to specific applications?

I know that you can use FIGNORE to remove filename completion from suffixes. For example, to avoid a lot of garbage files produced by LaTeX, I've been using: ...
3
votes
1answer
170 views

Edit Current Command in Zsh Vi Mode

So I know that you can set vi mode in bash with set -o vi I also know that you can set vi mode in zsh with bindkey -v The vi mode in bash has a great feature that allows you to edit the command ...
2
votes
2answers
206 views

Converting epoch seconds to time inline (preferably vim, but command line would be cool)

I have a file with the format 47 2013-05-01 1367406011 2 30 15 47 2013-05-01 1367406388 1 29 14 43 2013-05-01 1367407469 1 26 12 42 2013-05-01 1367407489 1 25 11 42 2013-05-01 1367407810 1 24 11 39 ...
0
votes
1answer
56 views

write and read from command line

How I can write something to vim command line and then read some input from it to plugin? For example, I want to write choose "Choose search patter (1, 2, ... 0):". Then user presses "2", the plugin ...
1
vote
2answers
179 views

vim - open stdin and files in split windows

Is it possible to open vim with stdin in one window, and a file in another? vim - starts vim with text from stdin in the buffer vim -o file1 file2 starts vim with files in multiple split windows ...
2
votes
2answers
2k views

Telling Vim to use custom .vimrc is easy, but how to tell it to use alternative path instead of ~/.vim?

I can use vim -u filename to use filename instead of my default .vimrc. I am using this method when switching user contexts (su) to use my .vimrc even though running as superuser. How can I achieve ...
0
votes
3answers
497 views

Changing font in console Vim

I need to change the size of the font inside the terminal Vim (not GUI Vim!). I am working on Windows, what kind of command can I use (I'll map it to a key after that). I do not want to go and change ...
3
votes
5answers
396 views

How can I view a .eml file from command line in Windows Vista?

Ok, so my parent's computer crashed (horribly - corruptedRegistry) and I'm trying to access one of their e-mail files that is saved locally on the hard drive. I can't launch Windows itself so right ...
1
vote
1answer
2k views

Why does VIM say there are trailing characters on this command?

I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one. Here is my ...
1
vote
0answers
360 views

What are the missing features in Sublime Text 2 that are available in vim? [closed]

I'm a Sublime Text 2 user who tried switching to vim because everyone swears by it. In the first few hours I realized I need to install a lot of plugins what essentially end up emulating GUI in the ...
0
votes
3answers
939 views

How do I open a file with vim from cmd?

I'm using windows 7. Unix I can open a file in vi with by using: vi textFile.txt In windows I want to navigate to the folder and type what I have above. What is the best way to go about this? ...
13
votes
3answers
693 views

How to insert the date into vim

In vim you can execute comands with "!". You can combine that with "r" to insert the output into your current buffer. :r!date Fri Jul 20 09:39:26 SAST 2012 will insert the date into a file. ...
2
votes
3answers
2k views

Where are these non-default Vim settings stored if not in my .vimrc file?

So when I press :set I see a bunch of settings that are not on my ~/.vimrc file. (My guess is they're settings I've set years ago and don't remember). So I do :version and get a path $VIM/vimrc, ...
1
vote
1answer
587 views

Using overwrite in vim but I'd like different behaviour from carriage returns

So I'm putting text in a particular area in vim... I'm using REPLACE mode so that I don't mess up the 'far edge' of the 'rectangle' when I type. It would be great if when I pressed enter in this ...
2
votes
1answer
361 views

Vim: Can't open a file's directory if it contains special letters

In Vim I can open the directory of an active file using this command: :silent ! start %:p:h However, if the directory contains special characters (like Scandinavian letters), I'm getting an error. ...
3
votes
1answer
126 views

Possible to use modal editing inside Vim's command-line mode?

Vim's normal and insert modes are wonderful. A source of constant frustration for me is that whenever I enter command-line mode for entering Ex commands (by pressing :) suddenly I lose all the ...
6
votes
2answers
1k views

How can I change the scroll wheel behavior in vim, so that it scrolls instead of moving the cursor?

I would like scrolling up to be equivalent to c-y c-y c-y, and scrolling down to be equivalent to c-e c-e c-e. The documentation here seems to suggest that this should already be the case, or I can ...
1
vote
2answers
185 views

Vim editor's “restore, abort or cancel” - what shall I do?

While I am editing my httpd.conf file the vim editor get closed abruptly. now when i am trying to open that file again editor says " want to restore or Abort or cancel. After doing this one of the ...
0
votes
2answers
123 views

better way then using vim :r! command line to put text out of the command line history like a directory path into the a file

Is there a better way to do this in vim I like the command line completion that lets me quickly get a full path out. So I use the :!ls and tab to quickly get the path I am looking for. :!ls ...
5
votes
1answer
986 views

How I change the default start path for cmd.exe in Windows 7 when opening from vim?

cmd.exe starts in %userprofile% when I start it normally. When I start it from vim, it starts in %systemroot%\system32. How can I change this so it starts in a folder of my choice (from vim)?
13
votes
2answers
3k views

How to use a pipe to edit a file with vi

Lets say I have a file called file.txt. In it is a name of a file that I want to edit with vi. I want to do something like this so that I can edit the file: cat file.txt | vi However, that doesn't ...
1
vote
3answers
1k views

I use vim in a terminal emulator. Is it possible to make vim colorschemes work?

I prefer using vim directly inside my terminal emulator (gnome-terminal or konsole) rather than using gvim, because it integrates better in my workflow. Unfortunately, it also seems to make nice ...
4
votes
1answer
2k views

How to pass vim buffer contents through shell command and capture the output to a split window

I've read lots of threads about running shell commands from vim, lots of documentation on vim commands, .vimrc and all that, but I just can't seem to understand the "ex" language or vim mappings well ...
12
votes
1answer
4k views

When using grep from VIM, how to jump to results?

When using the grep plugin to VIM, I can search the current directory for all occurrences of a string within a set of files, like this: :grep Ryan *.txt This outputs something like this: ...
1
vote
1answer
1k views

in Windows Command Line Prompt, why do my python files open in vim instead of executing?

I seem to have edited some setting for windows command prompt in windows 7 and forgot. [EDIT: it was just set as the default application for .py files in windows explorer. Dennis answered it below] ...
3
votes
3answers
507 views

Launch VIM and show, or hide, row numbers

Background Control whether row numbers are displayed after vim starts (in a non-interactive mode). Problem A shell script contains the following code: echo Converting $1 to $1.html... NUMBERS="-c ...
3
votes
1answer
1k views

Unix command-line editor for big files

I sometimes run into the problem where I need to replace just a few characters in files ~10Gb. As I only have 2Gb RAM, opening such a file with Vim or nano will consume all system resources. The way ...