Compare commits

...

3 Commits

Author SHA1 Message Date
Rob Watson d5d5ca6fa7 fix: nvim_cmp config for copilot (wip) 2023-09-18 08:01:47 +02:00
Rob Watson c468aecea9 chore: remove obsolete plugin 2023-09-18 07:58:30 +02:00
Rob Watson 7e112c8bfb feat: add deletevimplugin script 2023-09-18 07:58:09 +02:00
2 changed files with 40 additions and 5 deletions

9
nvimrc
View File

@ -367,23 +367,23 @@ lua <<EOF
cmp.setup({
completion = {
completeopt = 'menu,menuone,noinsert',
keyword_length = 3,
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
mapping = cmp.mapping.preset.insert({
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['C-y'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
['<CR>'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
},
}),
sources = cmp.config.sources({
{ name = 'copilot', keyword_length = 0 },
{ name = 'nvim_lsp' },
{ name = 'nvim_lsp', keyword_length = 3 },
{
name = 'buffer',
option = {
@ -414,7 +414,6 @@ EOF
packadd! nvim-lspconfig " https://github.com/neovim/nvim-lspconfig.git
packadd! lsp_signature.nvim " https://github.com/ray-x/lsp_signature.nvim.git
packadd! fzf-lsp.nvim " https://github.com/gfanto/fzf-lsp.nvim.git
packadd! lsp-colors.nvim " https://github.com/folke/lsp-colors.nvim.git
lua <<EOF
local nvim_lsp = require('lspconfig')

36
script/deletevimplugin Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
#
# Delete a vim plugin.
# Use with `-o` argument to delete from opt/
set -e
if [ "$1" = "-o" ]; then
opt=1
dir="$HOME/.vim/pack/git-plugins/opt"
basename=$2
else
opt=0
dir="$HOME/.vim/pack/git-plugins/start"
basename=$1
fi
if [ -z "$basename" ]; then
echo "Usage: deletevimplugin [-o] <basename>"
exit 1
fi
path="$dir/$basename"
if [ ! -d "$path" ]; then
echo "Plugin not found: $basename"
exit 1
fi
rm -rf $path
echo "Deleted $basename"
if [ $opt = 1 ]; then
echo "Now, remove the following line to $HOME/.vimrc:"
echo "packadd! $basename \" <git url>"
fi