How to issue Vim commands in command mode (`Enter` not working) - vim

I installed neovim with pkg install neovim. I then downloaded the latest version of Nvim-R with curl -L "https://www.vim.org/scripts/download_script.php?src_id=26482" > NvimR.vmb. Finally, I opened the file with nvim NvimR.vmb.
Now I'm in the editor and I launch the command mode by pressing the : key on my keyboard. I then proceed to type packadd vimball into the command console. Finally I try to issue the packadd vimball command by hitting Enter on my keyboard and nothing happens. I look up in the editor panel and notice each time I hit Enter the cursor is just being moved around in the editor.
I don't want the cursor to move around in the editor. I want to issue my :packadd vimball command. How do I do this?

Everything I see in that gif is precisely what I would expect to see given what you typed.
You run :packadd vimballEnter—this does vim’s native packadd command (assuming nvim has that), and then returns you to the editing portion of the screen.
Subsequent Enter presses are equivalent to j—move down a line.
All of that said, I dont know of any packages named vimball, but I don’t really work with that format. Perhaps you’ve misunderstood a plugin’s usage or vimball usage? Ask about that stuff on vi.stackexchange.com: we probably have better vi/m experts there.

Related

p4 change not working with gvim

I use perforce as source code repository. p4 change command is used to create a changelist of opened files. If I set setenv EDITOR gvim and then run this command then gvim opens and I add some description and then save and quit. I get below error. Same error does not come if EDITOR is not set, I mean in that case vim opens. Any idea to fix this issue?
sachina#inn-sachina-vm[285] p4 change
Error in change specification.
Error detected at line 29.
Change description missing. You must enter one.
Hit return to continue...
Applications that invoke EDITOR assume that the command blocks until editing is done and the editor was closed. While true for vim, the GUI version gvim launches in the background; i.e. the command returns immediately.
You can avoid this via the :help -f command-line option:
setenv EDITOR 'gvim -f'

editing file through vi editor in shell script show error

script in which I open a file in vi editor , after that user will write any thing in it then save or quite by :wq!
When I try this then it give an error message as below
e138 can't write viminfo file $home/.viminfo!
and ask for,
Press Enter or command to continue
Now when I press enter then file save. But why that error message shows.
If I open same file direct with vi editor or vim editor and do changes then it does not give any error.
also if I install vim editor then it works fine and no error shows
Please tell me what may be the issue.
my best guess is that $home is not defined properly. try running: !echo $home on both editors. If it's not defined during the script run, define it before running vim.
I came here with mostly the same error, but this answer did not work for me. I had to create more space within my $HOME directory by deleting a few files, and then vim worked normally again.

vim surround extension install problems

I am trying to install the vim (7.4) surround extension on Arch Linux (downloaded and installed this week) within an Oracle VM on a Windows 7 host.
I am getting a variety of errors including E388 (Could not find definition) when on "Hello World" with my cursor inside the quotes I try:
:ds"
And E257 (cstag: tag not found) when on <div>Hello World</div> with my cursor inside the tags I try something like:
:cst<p>
I have downloaded the most recent version of vim surround from git
I have :set nocp
I have placed surround.vim in ~/.vim/plugin
I have restarted vim
I have regenerated the helptags, and :help surround does work.
I extracted the files as the user running vim, there is no permission error.
Running :scriptnames shows ~/.vim/plugin/surround in the list.
So as far as I can tell it is installed, just that it is not working. Any ideas?
Surround is almost certainly working correctly, you just don't know how to use it and/or don't understand the difference between "Ex" commands and normal mode commands.
:ds is the short form of :dsplit, see :help :dsplit.
:cst is the short form of :cstag, see :help :cstag.
They are "Ex" commands, but Surround's ds and cst are not "Ex" commands: they are normal mode commands.
Instead of doing:
:ds"
:cst<p>
do:
ds"
cst<p>
And… Read The Fantastic Manual: :help surround.

How do I use Vim with Rebar

Trying to get up and running Vim + Rebar.
Separately they work but not together. What I want to achieve is to run eunit without leaving the Vim.
I guess this is doable with following plugin https://github.com/mbbx6spp/vim-rebar . Unfortunately is very poorly documented.
How do I run my tests quickly, see the output, code and once again.
All your feedback will be appreciated.
I don't know how to integrate rebar into vim, but perhaps you could try tmux? This works for me. In one window I keep opened vim, another window i use as compilation/attach session to erlang node.
One quick way to get out of Vim is to suspend it with Ctrl+z, run your commands, and then foreground it again with fg afterwards. Works at least on bash in Os X and Ubuntu Linux.
You can also run command line commands with :! <command name> directly from Vim, e.g. :! ls.
Yet another way is to use screen, with one window running vim and another still on the command line.
The best solution I've found is to use a Makefile in my project. Since vim is capable of running shell commands, you can call make & have it use your makefile. Then map these shell commands to shortcuts of your choosing.
For example, my Makefile has the following:
test:
$(REBAR) skip_deps=true eunit
In my .vimrc:
command MakeErlangTest !make test
nmap <leader>r :MakeErlangTest<CR>

Vim netrw asking to "Press ENTER or type command to continue"

I have noticed that when I start the day and open vim, then use :Exp, I get the "Press ENTER or type command to continue" prompt. Usually this is shown when an external command is executed. I don't remember :Exp doing this in the past(?). Further, the prompt is only displayed upon the first use of netrw?!
Although trivial, I find this annoying. Does anyone have an idea why netrw is doing this? I have been removing various things in my .vimrc to see if they change anything, but I could be here a long time...
Steps to reproduce:
Open vim or gvim
:Exp (followed by enter)
Prompt appears.
The contents of v:scrollstart can be used to get a clue of why this is happening.
There are some options that may be related to the problem.
From vim-faq:
Vim will prompt you with the "hit enter to continue" prompt, if there are
some messages on the screen for you to read and the screen is about to be
redrawn. You can add the 'T' flag to the 'shortmess' option to truncate
all messages. This will help in avoiding the hit-enter prompt:
:set shortmess+=T
You can also increase the command height by setting the 'cmdheight' option:
:set cmdheight=2
For more information, read
hit-enter
avoid-hit-enter
'shortmess'
'cmdheight'
Edit:
From :h netrw-problems:
P10. I'm being pestered with "[something] is a directory" and
"Press ENTER or type command to continue" prompts...
The "[something] is a directory" prompt is issued by Vim,
not by netrw, and there appears to be no way to work around
it. Coupled with the default cmdheight of 1, this message
causes the "Press ENTER..." prompt. So: read |hit-enter|;
I also suggest that you set your |'cmdheight'| to 2 (or more) in
your <.vimrc> file.
You should also check if you are using the latest plugin version, as there is a bug fix on version 71 that is related to your problem:
v71: * bugfix -- made some "set nomodifiable"s into
:
:
* When ch=1, on the second and subsequent uses of
browsing Netrw would issue a blank line to clear
the echo'd messages. This caused an annoying
"Hit-Enter" prompt; now a blank line message
is echo'd only if &ch>1.
Adding this line to ~/.vimrc seems to resolve the issue for me:
let g:netrw_silent = 1
I usually just do :e . to browse in current directory. Also, to get rid of prompts you can do :silent Exp.

Resources