Questions tagged [command-line]
Questions on ex- or colon-commands. For questions about command-line options used to launch the editor, use the [invocation] tag.
33
questions with no upvoted or accepted answers
4
votes
0
answers
103
views
:tabonly does not close all unmodified tabs if there is a modified tab in the way
Create some test files,
touch a b c d
and open each in a tab,
vim -p a b c d
Modify file b. Go to tab c and issue :tabonly.
Expected behavior: a and d tabs are closed. b is not closed because
it is ...
4
votes
0
answers
259
views
Directory symlink browsing moves me to new location when autochdir is set
I have a symlinked directory as such:
~/nested
Which points to this directory:
~/whatever/yetanother/andanother/nested
When I launch gvim or command line vim (7.4, with the standard, built-in ...
4
votes
0
answers
2k
views
How can I undo last command in command line?
In general, is there a way to UNDO the last "meta" command (I mean a command entered in command line to manage a window ), or some equivalent keystroke sequence ?
Btw, I know the u (= undo) and CTRL-...
3
votes
0
answers
767
views
Set maximum cmdheight
Is there a way to limit the command area in vim?
When typing a long command, cmdheight is "temporarily increased", but I like to limit it to one line. What I currently have is illustrated on the ...
2
votes
0
answers
195
views
Bash process substitution on vim command line?
I want to be able to show someone a particular file's undo history in vim, remotely. It's a little complicated, so let me explain one step at a time.
For starters, I can set a custom undofile and ...
2
votes
0
answers
289
views
How can I view all of the vimscript run by a command? (neovim)
I want something similar to what I get when I enter debug mode and type "step", then enter and up, enter and up, ten thousand times... But without having to do all that work, allows it to be done ...
2
votes
1
answer
44
views
Options from external commands in vim?
If I run from the vim terminal
:! zathura foo.pdf
It opens foo on top of the terminal and when I exit I go back to the vim file. If instead I try:
:! zathura --fork foo.pdf
The intended behaviour is ...
1
vote
1
answer
128
views
Vim command-line mode encoding error when using global search in autocmd
Update
Found the issue due to souce the menu this cause encoding=utf-8 and fileencoding=cp936 in _vimrc but in txt files it shows encoding=utf-8 fileencoding=utf-8
The way to fix is reset fenc=utf-8 ...
1
vote
0
answers
344
views
How to create a (lua) function to run a particular command in the shell on the currently open file, within neovim
If I'm working on a file I might want to run a particular command which uses the file within the shell.
Example - running black (python formatter) on an open file.
Ideally I'd like to be able to enter ...
1
vote
0
answers
55
views
Completion for ++flags in command-line mode
Is there any way to turn on tab completion for the various ++[flag] flags that some commands take?
For example, :e ++ff=unix whatever.txt overrides fileformat to unix for whatever.txt, but :e ++<...
1
vote
0
answers
37
views
How to to get commmand completions for selection from a keymap?
The idea is to have a keybinding, which executes a lua/vimscript function to paste yanked text into the command line and then have the command completion showing suggestions or directly get the ...
1
vote
0
answers
259
views
How do I disable messages like "written" and "2 fewer lines"?
How do I disable these messages.
In the messages I always see:
Messages maintainer: Bram Moolenaar <[email protected]>
2 fewer lines; before #526 7 seconds ago
"somefile" 190L 6771B written
1
vote
1
answer
254
views
How to pass custom arguments to the shell invoked by :terminal?
I would like to specify the startup command to run on the :terminal shell. E.g. bash -c ls. The shell can be specified with set shell=bash, but how to specify the arguments? In another use case, I ...
1
vote
0
answers
45
views
Command (e.g. `g++`) does not point to the same binary when run from the terminal or from (neo)vim
I have NVIM v0.4.3 on macOS Mojave version 10.14.6
I have different version of g++ compilers on my machine and made the following alias in my .zshrc file:
alias g++="/usr/local/bin/g++-9"
...
1
vote
0
answers
110
views
Why does Gvim treat ansi escape codes differently than Vim in python code?
The following python code uses ansi escape sequences to clear the terminal screen and change the text color to red. It then prints "Hello from Vim."
print ('\033c\033[31m Hello from Vim.')
In Vim I ...
1
vote
0
answers
225
views
How vim doesn't expand Ex commands in autocmd?
I'm trying to pass a command to 'vim-tmux-runner' on each file save with au bellow.
autocmd FileWritePost,BufWritePost *.py :VtrSendCommandToRunner python manage.py test <afile>:p:h:t
Where:
:...
1
vote
0
answers
201
views
What encoding does :! use?
I'd like low-level control over exactly what bytes I send and receive from a process spawned from some vimscript. What encoding is used for communications with commands started with :!foo? Can I ...
1
vote
0
answers
100
views
Is it possible to copy block (given by range) multiple times in a single command?
Is there a way to copy a few times a given block from command-line mode, e.g. with the :t command?
For example, how to copy the two lines (block) above the cursor -2,-1 to the current position ., 3 ...
1
vote
0
answers
495
views
How do I get vim to autocomplete correctly for :! on Windows?
On Vim 7.3 on Windows, if I use Tab to autocomplete paths with nonstandard characters in many cases, it works fine. For example:
:n 2016\ Posts\\feb\something.txt
If I press Tab after '2' and 'f' ...
1
vote
0
answers
82
views
Strange glyph when moving commandline cursor
I recently tried vim for the (still in-dev!) Bash for Ubuntu on Windows.
I noticed this odd glyph appearing on the commandline in vim - but only when moving across it. It flashes for one screen ...
0
votes
0
answers
12
views
Why recording typed characters by "qa" into reg a has different behavior for typed <M-Z> vs. <M-z>?
Case 1:
In Excmd line I give
qa to begin recording.
I type \Alt Z
(upper case Z)
error message:
E11: Invalid in command-line window:\<blank\>:q<CR> closes the window
I give q for end ...
0
votes
1
answer
69
views
Stop flushing the last command when hitting enter
Suppose I wrote this command:
command! -nargs=1 E echo ' -> <args>'
and when user feeds an argument,
:E abc
I intend to see the following effect as they hit Enter:
:E abc -> abc
Of ...
0
votes
0
answers
160
views
How to tab autocomplete in command-line and search using CoC?
How can I have autocompletion in the colon command-line and during / search just as autocomplete works in my buffers?
0
votes
0
answers
21
views
Entering command-line window from quickfix window opened by YCM results in inconsistent Vim state
I think I'm supposed to file a bug report, however I'm not sure if for Vim or for YCM, so I'm asking this question to better understand what is really happening.
YCM has the :YcmCompleter ...
0
votes
1
answer
116
views
How to delete all lines in a command script without provoking error?
I'm trying to write a Vim command script (a file containing Ex commands) that removes all existing lines in a file (and then read in some new text, and do some further editing operations). I use the ...
0
votes
0
answers
254
views
Call custom bash function from Vim
I have created a bash function, in its own .sh file, which I want to use from within Vim, and later use if from within the lightline config file. I have tried many ways, but I cannot make it work.
...
0
votes
0
answers
46
views
calling vim with mpiexec says "Warning: Output is not to a terminal / Warning: Input is not from a terminal"
My question is a bit technical.
For specific reason, I need to call vim after mpiexec.
Example :
mpiexec -n 1 vim mytext.txt
But this gives the following warning message:
Vim: Warning: Output is not ...
0
votes
0
answers
21
views
When I run :LanguageToolCheck, the output is the java -jar command in a new buffer
I've been trying to utilize Vim to do more writing so I tried to install LanuageTool and a related vim plugin: https://github.com/dpelle/vim-LanguageTool/
However, even after specifying the location ...
0
votes
0
answers
555
views
Mouse navigation not working in VIM
I started using VIM today and I found out that we could use the mouse pointer to go to a line in vim using set mouse=a
But unfortunately, it is not working
here is the config file
https://pastebin.com/...
0
votes
0
answers
37
views
JavaScript equivalent of :perldo?
Is there a JavaScript equivalent of :perldo that allows writing one-liners that perform inline replacement of the file (or file lines) based on small, ad hoc JavaScript programs?
For example, this ...
0
votes
0
answers
28
views
How to use `<count>` and `-count` to make command repeatable?
I am trying to use <count> and -count to make a command repeatable. This is the command I have right now:
command! -count=1 Hello :d <count>.
But I got this error instead when I run :...
0
votes
0
answers
302
views
Map left command key to left control key in terminal only?
I've asked this question over on AskDifferent without any luck.
I'm using neovim to edit code and am needing to create a mapping to bind to <cmd-w> to <C-w>.
How would I go about this on ...
-1
votes
0
answers
22
views
How do I align columns in a CSV file?
I'm using this csv plugin to view my csv file. I use command :67,68ArrangeColumn to align my file, but it does not align well.
The manual mentions a command like :[range]ArrangeColumn[!] [<Row>]...