1
vote
1answer
98 views

Switch back to VIM before shell command finishes

When executing a shell command in VIM, it waits for the command to finish. You can press Enter to switch back to VIM, but it will only switch back after the command has finished. In the event of a ...
0
votes
1answer
67 views

Vim and the Shell - How close should their bond really be? [closed]

Bridging the gap After years of daily swims in the vast sea of Vim-plugins, ranging from 2-line snippets to full-blown superstar programs, I have observed how a very significant amount of these ...
0
votes
0answers
116 views

tmux in zsh with vi mode, toggle cursor shape between normal and insert mode

(note: I wrote this question on stackoverflow, but got flagged as offtopic, so I'm re-writing it here) Here's what I want: Consistent behavior (as much as possible) between Vim, MacVim, zsh with ...
1
vote
3answers
165 views

How to columnate text with tabs (in vim or on the shell)

I have a frequent need to manually manipulate tab-delimited text for data entry and other purposes, and when i do this it helps if the text is aligned properly into columns. For example (assuming ...
1
vote
1answer
109 views

Fast way to send current line to the shell in Vim

Say that the current line in Vim contains: ls /home (or whatever shell command). Thus, what is a fast way to send this line to the (bash) shell and read the results in Vim? And without using ...
0
votes
0answers
165 views

Can not bring a background running vim to foreground?

If I have a vim running in the background, it seems that I can not bring it back to foreground. Do you have any idea, why?
0
votes
2answers
93 views

Prevent Ctrl+S in Yakuake

How do I prevent Ctrl+S from suspending output in Yakuake? I need it to give it to the opened program in the console (such as Vim, I want to remap Ctrl+S to save in Vim).
1
vote
2answers
392 views

“Export” vim syntax highlighting to output to shell?

Is there some program that can parse vim syntax highlighting scripts and colorize code for export to the shell? Basically I am looking for cat/less with shell highlighting that draws its syntax from ...
2
votes
3answers
486 views

Vim + iTerm2 color issues

I have trouble with the right Vim configuration. I'm using the latest version of Vim as well as the latest version of iTerm2. I try to get the solarized colorscheme working, but without luck so far. ...
1
vote
1answer
71 views

Testing vimscript

I'm hacking on a test framework for vimscript (an exercise in futility, I know; humor me). Some vim plugins make calls out to the shell (with the system() function or the ! command). I want the test ...
3
votes
3answers
148 views

Run command on shell and get output in vim

I know how to run shell commands within vim using :!r and :!, but is there a way I can do that from outside, i.e. from bash? Something along the lines of vim 'ls -al'. The output of ls should be in ...
2
votes
2answers
143 views

In Vim, what are the differences between using :sus and :sh to access the shell without ending the Vim session?

I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things: Use :sh (a.k.a. :shell), then log out from the shell to return to Vim Use ...
4
votes
2answers
165 views

“set -o vi” how to get the yank in the clipboard

My goal is to yank a line in the shell (for example with yy) into the system clipboard and then paste it somewhere else (for example in the internet browser). How can I accomplish that?
0
votes
1answer
52 views

How to add a shell output content to vim?

When using vim, we can use :!ls to execute shell command, but how can we import the ls output into vim for editing?
0
votes
1answer
52 views

Macos default paths prepend my defined paths in vim

I am trying to call some shell command from vim with like :!ls command. But unfortunately there are some default PATHS that prepends PATHs defined in the original shell. Here is the echo $PATH output ...
0
votes
1answer
80 views

vim leaves the ouput after quitting

everytime I use vim, it leaves the output of the last file in the terminal. This didn't use to happen before. It used to clean up all the buffer. for example, the current behavior is /Users/snihalani ...
3
votes
2answers
412 views

pass filename and current line to shell script

I would like to pass the file name and the current line number where my cursor is at, separated by colon, to an external shell script. For example, if am editing the file "foo.c" and I am currently on ...
0
votes
1answer
150 views

How do I configure gvim to open files from the current directory?

On Windows, no matter what I set as the current directory, gVim will always set its initial working directory to $home. (That is, if I launch gVim with the current directory at C:\something, or if I ...
7
votes
3answers
1k views

How to run Vim command from the shell?

This might be a dumb question, but bear with me. I'm automating some of the usual stuff I do when setting up a new work environment, and would like to automate the Vim command :BundleInstall (for ...
7
votes
3answers
639 views

How can I keep the color when I run the external command inside vim?

For example, for the command ls --color displays colorful results when being executed in the shell. However, when I call :!ls --color inside vim, all color information is gone. What should I do to ...
0
votes
2answers
213 views

vim: Change colorscheme for internal shell

I'm using the solarized colorscheme for gvim. I'm using 'light' for normal editing. I want to switch to 'dark' when I invoke vim's internal shell (:sh). Is there a way to do this?
0
votes
1answer
644 views

Set vim's internal shell path

I'm trying to configure the $PATH env variable of vim's internal shell. I have commands that update the $PATH several times during a session. I see that vim inherits my shell's first $PATH - but not ...
1
vote
1answer
63 views

VIM in shell triggers d key but GVIM work ok

I have strange problem with my vim. In shell when I edit file my VIM triggers (probably) d key (running vim test.txt). When I press j he deletes first 2 lines. Everything works ok when i run without ...
0
votes
1answer
659 views

VIM zsh, bash and colors in command line on Ubuntu

I have problem with VIM command line when calling system commands. e.g. !ls, all command output colors aren't parsed by VIM. My system is Ubuntu 12.04 LTS with VIM 7.3.429 from Ubuntu repositories. ...
2
votes
4answers
6k views

How do you run Vim in Windows?

I just installed gVim, and tried using the usual "vim myfile.java" technique that usually works for linux to open up a file and edit it. But unfortunately, this doesn't seem to work. I've also tried ...
3
votes
4answers
381 views

Command-T for shell

I'm looking for a shell extension that allows me to do filename completion similarly to Command-T. Command-T a feature in TextMate and a plugin for Vim that allows you to select filenames by typing ...
0
votes
3answers
427 views

Oneliner for multiline regex s/,\n]/]/g?

Can someone provide a simple one-liner to remove certain line breaks? In vim I use %s/,\n]/]/g This should be possible with a very simple one-liner IMHO, but how?
1
vote
1answer
268 views

Looking for a powerful, user friendly terminal emulator based on ncurses

I often work remotely on SSH shell. I would like a more user friendly interface to my shell, based on NCurses : Possiblity to open several virtual terminals with shells Organise terminals by tabs ...
3
votes
4answers
1k views

find and replace command for whole directory

Is there any command in Linux which will find a particular word in all the files in a given directory and the folders below and replace it with a new word?
11
votes
2answers
2k 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 ...
2
votes
1answer
490 views

How to specify shell for vim?

Can I specify my shell for vim? I'm running OS X and have zsh installed via Homebrew and am using MacVim. When I type shell in MacVim, the shell opens up as bash. How can I have it open as zsh?
1
vote
2answers
784 views

How do I automate a set of VIM commands that I use all the time?

I'm running some text files written in Markdown through Pandoc to get html, but it renders the tags strangely with weird line breaks and white space in tags, so I've been running a few sed commands in ...
7
votes
3answers
779 views

PDF reader for the CLI

I'm looking for a PDF reader that I can use over SSH in a terminal, and have it running in screen. Does such a thing exist? Ideally I'd like at least a less-esque pager but with some PDF formatting, ...
4
votes
4answers
611 views

How can I check if the current shell is being used from vim?

I am running OS X. On vim, if you do the :sh command, you can drop to a shell to execute commands. I constantly forget whether I am in this shell or not. Is there any way to check if I am in the ...
1
vote
3answers
1k views

Alias to open gVim (Cream version) from Cygwin shell

I'm using the Cream version of gVim, and i'd like to make an alias to open files from a Cygwin shell in Cream. Running the gVim executable from Cygwin gives the following error (in a Windows cmd ...
3
votes
2answers
272 views

Vim/Cygwin: No linebreaks in :! output

I'm using Vim via MinTTY under Cygwin. When I issue a command like :!ls -la the displayed output doesn't show newlines correctly. It rather just jumps to the virtual column of the next line, where ...
7
votes
3answers
2k views

Mouse cursor in Terminal?

I use Mac OS X Terminal.app. But the answer to this would probably apply to any typical UNIX-ish terminal emulator in a graphical environment. Question -- what do I do to: Use my mouse cursor to ...
4
votes
1answer
900 views

Mapping a Piped Shell Command in Vim

In a previous question I asked about outputting evaluated code to a new window in MacVim. I got a great solution, but it presented another question: How can I map a key command in my .vimrc that ...
2
votes
2answers
911 views

How to Detect that Current (Bash) Shell is a (Vi/Vim) Subshell?

From inside Vi/Vim, I can type: :shell to drop into a shell. Is there any way to detect that I am in a Vi-spawned subshell? The environmental variable SHLVL is 2, but that does not tell me ...
1
vote
1answer
441 views

How do I run gvim within the same shell window?

I'm running gvim on my mac from /usr/local/bin. If I invoke it from a terminal window it opens it up in a new window. I'd like to get it to just run in the same window I'm already using. How do I ...
3
votes
1answer
2k views

Vim press ENTER to continue

When using vim to run a shell command, eg. with :!ls or :sh to get into a shell, I always have the prompt Press ENTER or type command to continue This is fine for "internal" vim commands ...
11
votes
1answer
2k views

Vim Ignores Aliases

If I map a command in vim using something like map <f4> :! pdflatex %<cr> Vim will ignore my alias for pdflatex (something like alias pdflatex='pdflatex --temp-dir=something'). Is it ...