Questions tagged [shell]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
16 views

Why does :! open -a terminal or :! start cmd create totally new “applications”?

Edit: on Windows, looks like it's opening in sysWOW64 instead of system32. Any ideas why? Title. Basically, both of these commands are supposed to open a new console, the former on my mac and the ...
2
votes
1answer
27 views

Unable to set WSL as the shell on gVim

I followed the instructions given in this answer: https://vi.stackexchange.com/a/16436/25843, and I've set my shell to point to wsl.exe like this (wsl.exe path seems to be different on my machine ...
2
votes
0answers
50 views

Use external commands within venv virtual environment

Same question as Use Vim with virtualenv, except for these differences: I'm using bash, not zsh using venv, not virtualenv or virtualenvwrapper I have a keybinding to run the current buffer as a ...
1
vote
1answer
30 views

Cross-platform way to execute command with clean environment?

A plugin I use executes: silent execute '%!cmd' which fails because of a particular environment variable I have set that deliberately modifies the behaviour of cmd. I can fix it with: silent ...
3
votes
1answer
39 views

Add comment to file while opening (C)

I have output from static analyzer, that I parsed with Bash. Now I want Vim to run on specified by analyzer line and add comment containing warning id and description. I tried this, vim $file +$...
1
vote
2answers
56 views

How can I stop Vim from inserting keypresses into the document unless the document is visible?

I have a macro that's essentially equivalent to the following: in insert mode, I press the following keys: Ctrl+O, :, !, t, r, u, e, Enter. This runs the command true in a shell and shows "Press ENTER ...
2
votes
0answers
34 views

head isn't included in syntax/sh.vim

head is a common Unix/Linux executable, but it's not listed in the shell syntax highlighting configuration. In contrast, many common executables are. Specifically, its counterpart, tail, is listed. ...
0
votes
1answer
31 views

How show underlying container for vim, ie xterm etc

When I run :maps that use ! to execute linux commands, the vim display is suspended to show the command output in the underlying container (xterm in my case). When the mapping terminates, any shell ...
0
votes
1answer
49 views

Is it possible to read a shell command's output from nvi's command line?

I was trying see if I can integrate fzf with nvi, but couldn't find a way to do something like :Edit <shell command's output> which would solve my problem. I tried :source nvi.ex -- it works ...
2
votes
1answer
49 views

Why does vim call powershell surrounded by two single quotes?

I'm attempting to use powershell from gvim, and when I do...I set: :set shellcmdflag=-NoProfile\ -NoLogo\ -ExecutionPolicy\ RemoteSigned\ -windowStyle\ Normal\ -Command :set shell='C:\\windows\\...
0
votes
1answer
37 views

restrict shell command to only part of a line

In a file I'd like to replace some occurrences of triplets of 0 with F, 1 with E, ..., F with 0. Only some, so I can't just pipe the whole file through a bash tr filter; I need a text editor to ...
3
votes
3answers
163 views

Write buffer to command and append stdout back to same buffer

I've opened an empty buffer with just vim. I have a shell script in the same directory that I can pipe SQL to. That script will print the result of the execution to stdout. In my empty buffer, I ...
3
votes
1answer
312 views

get exit status from system() call

Calling the function system("<command>") or systemlist("<command>") retrieves the stdout output from a shell call to <command>. How can I retrieve the exit status of that command? ...
0
votes
1answer
64 views

what does “\033]110\007\033]111\007” mean

I found this snippet online which is apparently a way to make vim a little faster if your terminal background is the same as what vim's is meant to be (right?) " General colors if has('gui_running') |...
0
votes
1answer
236 views

How can I emulate :shell command in Neovim?

There is no :shell command in neovim. :terminal opens a shell without previous output, while :shell contains all the output of the parent shell and all previous shells. Is there any way to emulate :...
1
vote
1answer
29 views

Why does current/shell directory change depending whether drive-letter is used in filename?

Using VIM (v6.3) from a command-prompt (i.e. not gVIM) I'm getting different behaviour for the :shell command depending on whether I specify a drive-letter when editing a file or not. Without Driver ...
0
votes
1answer
79 views

Could backtick-expansion be consistently used for autocompleting filenames within directory tree?

So, I had this keymapping for helping me to edit files: nnoremap <Leader>e :e **/ But this doesn't work with hidden directories. So, I naively added: nnoremap <Leader>d :e .**/ But ...
0
votes
2answers
94 views

Why is `vim -E` always exiting with non-zero exit code when using here-doc?

see the following session in dash: $ printf "foo\nbar\n" > testfile $ cat testfile foo bar $ vim -E testfile <<-EOS > 1 > s/foo/baz/ > x > EOS $ echo $? 1 $ cat testfile baz bar $...
0
votes
1answer
214 views

Weird characters when running :shell

When I run the :sh command I see the following characters If it is relevant, my default shell is zsh and it runs oh-my-zsh also Thanks
0
votes
2answers
177 views

Shell running inside vim windows

Is there a way that a open up a window or buffer, where i can run my bash commands? I thought on something like you know it from VS Code(1). The code windows on the top and a small command prompt on ...
1
vote
1answer
26 views

Retrieving results from variations of system('top') returns errors

Directly on the Ubuntu terminal, I can extract the results from top regarding a specific PID with: top -p <pid> -n1 | awk '/<pid>/' Where <pid> should be substituted with a PID ...
0
votes
1answer
68 views

Identifying the PID of Vim 8.1 internal terminal launched with :terminal ++close

When launching an internal Vim 8.1 terminal for an exclusive program like in terminal ++close ipython, is there a way to identify from vimscript which is the PID of the launched process (i.e. of the ...
0
votes
0answers
49 views

terminal shell behaves differently from normal shell

I run this command in a common terminal: $ ps aux | grep work | grep python | awk '{print $2}' Then I have three different pids, however, in the vim-term window, the same line gave me two pids. ...
3
votes
1answer
335 views

No color in Vim while using Google Cloud Shell

I am using the Google Cloud Shell and wanted to install a theme for Vim. Adding the following to my .vimrc (using vim-plug as a plugin manager): Plug 'mhartington/oceanic-next' syntax enable if (...
1
vote
1answer
907 views

Execute Vim commands from shell

How to execute Vim commands from shell? For ex I want to see man pages of grep command in vim typing command from shell(bash,zsh) command something like: vim ':Man grep' Is it possible?
0
votes
0answers
29 views

aliased commands don't work with the shell ex command? [duplicate]

I have a number of aliased commands in my .bashrc and they work fine on the command line. However, if I use them in Vim, they do not work. For example: :!mycommand results in: /binbash: mycommand: ...
16
votes
3answers
11k views

Can I issue an interactive shell in Vim window?

I know I can :! or :r! to execute external command and optionally insert its output into text. I can even perform :!sh and I'll spawn a shell that will live until I exit it - but while the shell is ...