Hot answers tagged

3

There are, in fact, some predefined build scripts, and it is relatively straightforward to create your own. These are known as compiler plugins or scripts, and live in the compiler directory of runtimepath. You can switch to a compiler with the :compiler command, or by setting makeprg and errorformat (which is what most of these scripts do). You then build ...


2

enter this command in vim to use block cursor in insert mode: :set guicursor=i:block


2

As a bit of a frame-challenge, consider learning some more :help motion (the full list is long; take it slow!). Some particular useful ones: search / and ?, along with shortcuts */gd/etc. scrolling Ctrl and any of d/u/b/f moving in a line f/F/t/T various text-object motions )/}/etc. marks/tags/etc. As a bonus, these motions combine orthogonally with ...


2

It is impossible to do from within vim or gvim. That is what operating system does for all keypresses (I doubt you can separately increase it only for specific keypresses) For windows it is: For OSX or linux there should be similar settings. I would suggest to use more navigation facilities vim has: /funcname<CR>nnn search if you know specific ...


2

In Vim, if you look at the source code for buflist_new() which adds a filename to the buffer list you'll find the part where the b: dictionary is initialized // init b: variables buf->b_vars = dict_alloc(); if (buf->b_vars == NULL) { vim_free(ffname); vim_free(buf); return NULL; } init_var_dict(buf->b_vars, &buf->b_bufvar, ...


1

This was resolved by updating to the 0.5.0 nightly build. There is an issue with netrw in 0.4.4


1

Finally, I decided not to re-invent the wheel, and this problem seems to be more difficult than I think. So, I give Vem-Tabline a try and it works nicely, and the default settings of this plugin are good, so no need to put code into my .vimrc. Nice! Now my MacVim looks like this, the prefix of buffer names are now skipped by default:


1

You can pass a command when starting up with -c (or +): vim -c 'PlugUpdate' You may also want to pass qall if you are running this from a script.


1

It is likely that there are other commands that start with :Vim but not :Vimspector that are being offered in the completion, hence why it stops there. Natively, vim offers the :VimballList command. You can see with :h :VimballList that this comes from the pi_vimball standard plugin. That page will tell you that if you do not wish to use this plugin you ...


1

You can only call plug#begin() and plug#end() once, so no this will not work. You can define all your plug-ins from the same place (such as the vimrc file) and use a conditional to detect whether you're running NeoVim to load plug-ins you only want on NeoVim: call plug#begin('~/.vim/vim-plug-in') " Vim + NeoVim plug-ins if has('nvim') " NeoVim-...


1

Here's a simple version, assuming fugitive or dispatch are installed: augroup update_vimrc autocmd! " for dispatch, automatically async " use a ! or other dispatch commands for more control autocmd VimEnter Dispatch git -c ~/dotfiles pull " or for fugitive, not so async autocmd VimEnter Git -c ~/dotfiles pull augroup END If those ...


1

As far as I can tell the term for that feature is inline diagnostics. I don't see any obvious source (like neovim help) for an answer to how to disable it but I found these two possible solutions: vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false } ) ...


1

To avoid using a local vimrc or the exrc option or things like that I would use a ftplugin (:h ftplugin) with a condition on the filepath. Create the file ~/.vim/after/ftplugin/cpp.vim and in it use the following condition: if (expand('%') =~ 'foo') setlocal noexpandtab endif This way you will set the noexpandtab option only if the file path matches foo....


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