Hot answers tagged

5

how to load vim8 optional packages in vimrc? The way to load vim8 optional packages in your vimrc is to use the :packadd! command, which will add them to your 'runtimepath', which will make the opt plugins load together with the ones in start. In your particular case: packadd! vim-javascript The examples you give hint that what you're actually trying to ...


4

You need to use :tnoremap to map keys in the :terminal window. So if you want that to work in both normal mode of a regular buffer and of terminal windows, you need to add another set of mappings for the terminal: tnoremap <C-J> <C-W><C-J> tnoremap <C-K> <C-W><C-K> tnoremap <C-L> <C-W><C-L> tnoremap <...


3

Running process in a terminal buffer is treated mostly the same way as "an unsaved file". So you can do :qa! or :set confirm etc.etc. Well, anything to allow exit from Vim with buffers unsaved. But, of course, that will modify Vim's behaviour with respect to all buffers, not only terminals. So if you only want to allow silent terminal closing, you should ...


3

You mention in the comments, that the file Python.h is located in the directory $LOCAL_INSTALL/include/python3.8. This directory is not in the search path for include files. So it has to be added manually. export CFLAGS="-I$LOCAL_INSTALL/include/python3.8" ./configure ... The configure script adds the compiler flags from the environment variable ...


3

Terminal buffer is special: When the job has finished and no changes were made to the buffer: closing the window will wipe out the buffer. Change buffer type will stop this. Manual After job finished, clear buffer type: setlocal buftype= This also works: setlocal modifiable " make any change, the 1st change will convert terminal buffer to be a normal ...


3

I did a little investigation. At first I could not reproduce, but I think I have found the problem (part of it was, you did not mention what version you were using :/) I have a local machine with an Ubuntu 18.04.03 LTS installed. In it, I could reproduce the problem when using the system vim (I usually compile my own), that is version 8.0.1453. I traced ...


3

I rarely ever run :Gpush on its own, so maybe try this: :Gstatus in the new split view, use - to toggle which changes you want to stage for the commit, then use cc to commit. After entering the commit message and save/quit, the split window shows unpushed commits; you can use - to push individual commits. The exact push line and parameters are shown in ...


2

Using 0read on BufNewFile actually works as expected, in fact the documentation for BufNewFile explicitly mentions using that event for loading a template or skeleton file. If we also rule out the other things that might have gone wrong there, then the most likely explanation is that 0read is working, but the contents of the buffer are later erased by ...


2

Based on Chris’s comments on the OP, I would make the shell do the work, using a level of indirection: terminal bash -c "cd wherever && do_something" The issue is that the bare :terminal command doesn’t ever execute a shell—it executes the name of the external program you give it (which, by default, happens to be the shell). So, terminal cd . tries ...


2

The solution was to define $HOME as a Windows environment variable. Once I did that and restarted gVim, it read my ~\_vimrc and also sourced my native Vim 8.1 packages correctly. Source: this answer at Stack Overflow.


2

Use the :vertical and :botright modifiers. nnoremap <F5> :wa \| vertical botright term ++kill=term<CR> Or: nnoremap <F5> :wa<CR>:vertical botright term ++kill=term<CR> (Also note that you need one of <CR> or \|, not both. Your original command ends up executing the Normal mode | motion, which moves the cursor to the first column, ...


1

Those symbols are displayed in what's called the signcolumn. Fortunately, there's some degree of control over it using the 'signcolumn' setting. Available values will cause the column to be shown: "auto" only when there is a sign to display "no" never "yes" always "number" display signs in the 'number' column. If the ...


1

See :h Terminal-mode: Terminal-Job and Terminal-Normal mode Terminal-mode Terminal-Job When the job is running the contents of the terminal is under control of the job. That includes the cursor position. Typed keys are sent to the job. The terminal contents can change at any time. This is called Terminal-...


1

Quote from vim-fugitive README: FAQ Why can't I enter my password when I :Gpush? It is highly recommended to use SSH keys or credentials caching to avoid entering your password on every upstream interaction. If this isn't an option, the official solution is to use the core.askPass Git option to request the password via a GUI. Fugitive will ...


1

The help for the function term_setansicolors provides some more details. The short story is these 16 colors form a conventional palette which terminal programs use when outputting text. You can set them to anything you want, but it's best to stick to the vague color descriptions below. term_setansicolors({buf}, {colors}) *term_setansicolors()* ...


1

should I base this setup upon neovim or vim 8? If you don't have any problems with Vim, there's no need to switch to Neovim. In particular, Vim's terminal support is very decent. Open new splits with terminal similar to tmux (each split is a separate terminal) Yes, it's trivial. In fact, it's hard to avoid this. Ability to go into netrw from terminal ...


1

I looked at the source and I don't see any user-facing way to disable the bell limit. You'd have to build your own version as you mentioned. Think twice about that, though... Rather than being a killjoy "feature" this apparently was implemented for the sake of Vim stability. I saw a couple comments indicating that rapid bell sequences can hang Vim. Here's ...


Only top voted, non community-wiki answers of a minimum length are eligible