Hot answers tagged

4

set completeopt+=noinsert noinsert - do not insert any text for a match until the user selects a match from the menu. Only works in combination with "menu" or "menuone". No effect if "longest" is present. For more info: :h completeopt


3

Your best effort: source expand("$MYVIMRC:p:h") . "/vimrc/env.vim") has issues: source command doesn't work with "strings" even if it worked with strings, you have strange last unbalanced ) You can try using :execute statement with composed source: :exe "source " . fnamemodify("$MYVIMRC", ":p:h") . "/vimrc/env.vim" Note that expand("$MYVIMRC:p:h") will ...


2

A possible solution: execute printf('source %s/vimrc/env.vim', fnamemodify($MYVIMRC, ':h'))


2

You need to load it. Add colorscheme solarized to your .vimrc. You can also load it on the fly executing :colorscheme solarized on the Vim command line


2

you add another single quote to escape your single quote inside your vim macro let @r=':%s/''/"/g' from https://vim.fandom.com/wiki/Macros if your register must itself contain single quote characters, you use a second single-quote character to escape it. For example, if you want your register to contain "Vim's quote handling is a little tricky" ...


1

I don't use coc, so I will just share my vision on how you can try to fix this. I assume that by suggestion box you mean regular vim Pmenu. Try to make sure if it is actually Pmenu: run :hi Pmenu and check the colors: if it really is, then changing it would be simple, add to your vimrc """ Customize colors func! s:my_colors_setup() abort " this is ...


1

According to coc readme you can trigger completion manually with: " Use <c-space> to trigger completion. inoremap <silent><expr> <c-space> coc#refresh() NOTE that not every terminal supports <c-space>... I don't know for sure how to map cmd in vim... Probably D or something: " Use <CMD-x> to trigger completion. ...


1

If I’ve understood you correctly, you want to do something like this in your vimrc: augroup au! au FileType * setlocal noexpandtab augroup But I cannot guarantee this works (i.e., something might get triggered after this autocommand that sets expandtab). I think you could establish a buffer-local BufEnter autocommand inside the FileType autocommand, ...


1

There are several issues. First of all what happens when you make a visual selection and then go to the command line with :? You see how it's pre-populated with '<,'>. You should drop that from the first substitution in your mapping as it's redundant. (Or you can leave it in and make the first part of your mapping <C-U> as in Ctrl-U. That will ...


1

I don't have a personal vimrc. Then Vim sources $VIMRUNTIME/defaults.vim You can see this by issuing :scriptnames Why are the last 2 lines in my vimrc ignored? They are not. The last line gets effectively cancelled by the line filetype plugin indent on from defaults.vim, because it gets sourced after it. The last 2 lines are: This is a huge mistake, ...


1

I have this since 2002 it seems It also handles <end> key inoremap <silent> <Home> <c-o>@=<SID>HomeLikeVCpp()<cr> nnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr> vnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr> inoremap <silent> <End> <c-\><c-n>...


1

Yes, it is possible to create a mapping for that. For example, a mapping that will go to the indent if you're elsewhere in the line, but go to the first character if you're on the indent: noremap <expr> <Home> col('.') == match(getline('.'), '\S') + 1 ? "\<Home>" : "^" inoremap <expr> <Home> col('.') == match(getline('.'), '\...


1

FZF uses bat to add syntax highlighting to the preview if it is installed. bat comes with several themes available. You can choose a theme by setting the BAT_THEME environment variable. For example, you can add this line to your .bashrc or .zshrc to set the TwoDark theme: export BAT_THEME="TwoDark" To preview the available themes run: bat --list-themes ...


1

I made a plugin built on Blasco's suggestion: https://github.com/bagohart/vim-operator-insert-append


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