5
votes
2answers
316 views

How to a open a file in vim using pipe

I get to use the locate command extremely often. So if I run the following command. locate updatedb | head -1 Then it gives me the O/p /usr/updatedb.conf I wonder if there is any such command ...
0
votes
0answers
50 views

Can’t set color of vim

I've asked same question to stackoverflow but It evaluated offtopic at stackoverflow. http://stackoverflow.com/questions/23667728/cant-set-color-of-vim?noredirect=1#comment36357524_23667728 If it ...
1
vote
2answers
72 views

Keystroke to clear the current line at the prompt

How can the current line be cleared? I'm using bash. I don't like ctrl+c because it leaves crap printed on the screen. If the cursor is at the end of the line I can use ctrl+u and it does ...
0
votes
1answer
62 views

linux bash settings for vim

When I close vim in linux shell bash, part of it viewing is still seen, usually root, but in some other users, usually other than root, vim closed means no viewing document is seen. Where/how can I ...
1
vote
3answers
400 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
37 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, ...
0
votes
1answer
88 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 ...
1
vote
2answers
119 views

VIM/Screen background color is inverted for non-text characters

I'm trying to use a vim while inside a screen session. For some reason, the background color for the parts of the screen without text are displaying as dark while the parts with text are displaying as ...
1
vote
1answer
98 views

*live* vim syntax highlighting on stdout?

I want to have some program's output colorized as it apperas on terminal. I know that utility named highlight does the this. But: it has a limited set of built-in language support, and I want ...
2
votes
0answers
107 views

How can I tell what command is running on the remote end of an ssh connection?

Tl;dr - how do I find the name of the command (eg $BASH_COMMAND) running on the remote end of an ssh connection? ... My example setup is two tmux vertical panes, LH pane runs a local vim session ...
2
votes
1answer
47 views

Shell commands executed from Vim behave differently

I have mapped a key in Vim to run curl-based tests on my API with :map ,t :w\|:!quizzical tests.sh <CR>. The tests run as expected when I press the key; however, the tests which take longer to ...
1
vote
1answer
91 views

Vim command line argument not being executed

I've been looking for a command line calendar program for Linux for quite some time now. I realized I should just use vim. I want to be able to easily view a week of todo lists. Currently using this ...
1
vote
2answers
180 views

Vim is not using Bash's aliases

I am trying to set up Vim so that I can compile C code directly from the editor itself: .vimrc: let $BASH_ENV = "$HOME/.bashrc" autocmd FileType c map <F6> :!gcc -o "%:p:r.out" "%:." ...
4
votes
1answer
239 views

Vim process stops after executing an external command

I've been using vim recently to program in C. I have created shortcuts for compiling and running the programs from within vim itself, but recently vim's process has been stopping after executing the ...
0
votes
0answers
159 views

Edit Zip files recursively using VI editor

I have a use case in which I want to edit a file using vi editor which is bundled inside a war package and the war package is bundled inside an ear package. I am on a linux machine Oracle Enterprise ...
2
votes
1answer
554 views

`vi` command doesn't open newly installed Vim 7.4 on OS X

I just installed Vim 7.4 on my MacBook using Homebrew. When I enter vim on the command line, it successfully enters Vim 7.4, but when I use vi I still get the old 7.3. To install Vim 7.4 I used this ...
1
vote
1answer
38 views

Use VIM to pass options to PDF reader

I have a BASH script that recompiles a latex document and reopens it up using my PDF reader when the buffer is written back. The command in my '.vimrc' looks like this: autocmd BufWritePost *.tex ...
2
votes
1answer
874 views

PuTTY not sending Esc

I SSH with PuTTY from my Win7 x64 laptop to a Unix environment for my office. The problem I'm facing is very similar to this post where I cannot send an Esc character to the terminal. I first noticed ...
2
votes
0answers
151 views

How to disable alternate buffer in GNU screen itself but not for vim, less inside it?

What I would like to accomplish is mouse wheel scrolling behavior that I'm used to in a regular ssh session. In bash prompt mouse wheel should scroll my terminal output, and inside less/vim - the ...
1
vote
1answer
176 views

Select vimenter autocmd's to run based on args

I'm trying to reduce the number of things I need to do when I open VIM. I have the three following scenarios that I'd like to account for: 1. Open vim with a directory specified vim . For this ...
1
vote
2answers
62 views

How do I run Windows vim from a function within my .bashrc?

I have installed windows vim and added the following function to my .bashrc: function winvim() { local win_vim_path='/cygdrive/c/Program\ Files\ \(x86\)/Vim/vim73/vim.exe' #local ...
1
vote
2answers
479 views

Increase the space between lines in vim

I think the title says it all. I've done my homework and the only command that I found was: :set linespace=3 but it doesn't seem to work, neither on the Mac nor in Linux. Edit: In Mac OSX you can ...
0
votes
1answer
163 views

vim set default to save buffer when TERM signal received

I use multiple instances of vim. Currently I use a bash function kv(){ a=($(pgrep vim)); kill ${a[@]}; } to terminate all running instances of vim. This has the drawback of leaving unsettled ...
0
votes
0answers
45 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
159 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 ...
0
votes
1answer
199 views

Cannot get Vim to remap CTRL+S to `:w`

I've been trying to get Vim to remap CTRL+S (or ^S) to :w by editing my .vimrc file, however it doesn't work. This is my current ~/.vimrc configuration: nmap <c-s> :w<CR> imap ...
2
votes
1answer
103 views

Suppress (or quiet) the output of bash: “Hit any key to close this window…”

Typically when I invoke an GUI application in vim, I get a command prompt that awaits for my response: shell returned 1 Hit any key to close this window... How can I not make this prompt to show ...
1
vote
1answer
100 views

ESC and Caps Lock get swapped to original mapping after loading bashrc twice

I followed xmodmap way of swapping ESC and Caps lock in this link. It works well when I load .bashrc with . ~/.bashrc for the first time. However, if I edit different part of my .bashrc and reload it ...
3
votes
5answers
451 views

Vim execute bash commands/make in the same window

When i try to run some commands like :make or :!ls , it shows the output in an altogether different screen/view and the file i am editing is not visible during this process. Is there anyway i can ...
4
votes
2answers
757 views

Vim execute process in background

I would like to run a process in the background in Vim on Mac OS X (or Unix in general). I would hope and expect the following, or some variant, to accomplish this: execute "!my_command &" or ...
0
votes
1answer
754 views

Executing scripts with bash from vim

I'm trying to get vim to execute the script I'm editing with a key mapping, say ctrl + x, so I used this in vimrc :map <C-x> :!exec_file %<CR> To pass the file name to a script I wrote ...
3
votes
3answers
162 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 ...
1
vote
1answer
187 views

Vim text messed up on remote server

I often work on remote servers. There is one server that seems to get "confused" about the number of available columns (my best guess), but only when working in Vim (not bash). Specifically, when I ...
3
votes
2answers
803 views

CL VIM: How to get 256 color support in Fedora 17 terminal?

How do I enable 256 color support for VIM in the Fedora 17 terminal? My .bashrc: 1 # .bashrc 2 3 # Makes terminal default 256 Colors Include these lines in .bashrc 4 5 export TERM=xterm-256color 6 ...
2
votes
1answer
78 views

Vim shortcut in Terminal

In vim I have jj bound to go to normal mode: inoremap jj <ESC> I changed Terminal to vi mode in ~/.bash_profile, but how can I set up the same binding? This doesn't work unfortunately: bind ...
0
votes
1answer
146 views

VIM buffer for MySQL CLI interpreter?

I just learned that CtrlxCtrle in the Bash CLI will open the current command in a VIM buffer for editing. That is nice, but where I really need this feature is the MySQL CLI interpreter, and that ...
7
votes
3answers
259 views

vim can not execute unix command with :! due to shell changing

Our company uses red hat linux system and allocate everyone an account in /home. Unfortunately, our system is using tsch, which is not favorable for me. Moreover, as I do not have the super user ...
1
vote
1answer
433 views

Vim clobbering scrollback buffer outside of screen

If I'm not in a screen session, then when exiting Vim I get a bash prompt below the remnants of the VIM window. A side effect of this is that my scrollback buffer is clobbered, especially if I have ...
2
votes
2answers
298 views

Vim-like history in bash?

In bash, it's possible to scroll through the command history using the up and down keys. In vim, this is also possible (after pressing :). But with vim, if you type the first few letters of a previous ...
1
vote
1answer
747 views

How to bind up arrow in ~/.inputrc (readline) for vim insert mode?

When in Readline apps with vim mode enabled in ~/.inputrc (set editing-mode vi) is there a way to bind the <Up> arrow key in vi-insert mode? To display previous history item, for example. It ...
1
vote
0answers
387 views

bash vi key bindings: Can I map keys? Display mode (insert vs command)?

I am a long time vi(m) user and recently made the switch to using vi key binding in bash. I can already tell that this will be an improvement, but I would like to customize a few things to really ...
13
votes
3answers
633 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. ...
1
vote
3answers
215 views

What steps put my bash prompt commands into vim and then back again to bash to execute?

I've enabled VIM style editing of bash commands at the bash prompt as default bash setting. On a few occasions I've accidentally opened a blank vim file with some complex bash command I was writing. ...
3
votes
2answers
160 views

Open vim then save and close automatically

Using bash is it possible to open a file in vim and then automatically save and close e.g. "ZZ" | vim my.file.txt obviously the above isn't going to work, but how would I do the equivalent? - I ...
5
votes
3answers
515 views

Why does bash tab-expand a tilde when I am completing a vim file name?

If I type cat ~/.bashr<TAB> then it completes to cat ~/.bashrc. If I type vim ~/.bashr<TAB> then it completes to vim /home/neil/.bashrc... (It does the same with vi, which is aliased to ...
0
votes
1answer
720 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. ...
6
votes
2answers
2k views

How to close other windows in tmux?

I write some functions in .bashrc to make tmux easy to use: #!/bin/bash # .bashrc # vim tmux #----- -------------------- tabc() { tmux kill-window; } tabe() { tmux new-window; } tabf() ...
0
votes
1answer
181 views

Program/script to 'walk' through svn revision history

Looking for a program, or script, I can use to easily 'walk' through an SVN revision history for a specific file. Anyone know if this exists? Can I achieve this with the command line client for svn? ...
3
votes
4answers
432 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
1answer
463 views

Display characters on a square grid?

How can I display characters as if they are square in vim? The characters themselves don't need to be square, but if you were to draw a grid through all centre points of the characters it should make ...