Modernize vim completion.
This commit is contained in:
parent
a6ecff72f0
commit
1962564419
3
bashrc
3
bashrc
@ -37,3 +37,6 @@ for fn in /usr/share/fzf/shell/key-bindings.bash /usr/share/fzf/key-bindings.bas
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# add Pulumi to the PATH
|
||||
export PATH=$PATH:/home/gebner/.pulumi/bin
|
||||
|
63
vimrc
63
vimrc
@ -112,7 +112,12 @@ Plug 'nvim-lua/plenary.nvim'
|
||||
" Plug 'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
" Plug 'nvim-treesitter/playground'
|
||||
|
||||
Plug 'hrsh7th/nvim-compe'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/cmp-path'
|
||||
Plug 'hrsh7th/cmp-cmdline'
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
|
||||
if isdirectory(expand('~/lean.nvim'))
|
||||
Plug '~/lean.nvim'
|
||||
else
|
||||
@ -177,7 +182,7 @@ let g:jellybeans_overrides = {
|
||||
" colors jellybeans
|
||||
" endif
|
||||
" colors monokai-nightasty
|
||||
colors default
|
||||
colors vim
|
||||
|
||||
au syntax java setl ts=4 sts=4 sw=4
|
||||
|
||||
@ -265,27 +270,37 @@ lua <<EOF
|
||||
-- },
|
||||
-- }
|
||||
|
||||
require'compe'.setup {
|
||||
local cmp = require'cmp'
|
||||
cmp.setup {
|
||||
enabled = true;
|
||||
autocomplete = false;
|
||||
debug = false;
|
||||
min_length = 1;
|
||||
preselect = 'enable';
|
||||
throttle_time = 80;
|
||||
source_timeout = 200;
|
||||
incomplete_delay = 400;
|
||||
max_abbr_width = 100;
|
||||
max_kind_width = 100;
|
||||
max_menu_width = 100;
|
||||
documentation = true;
|
||||
-- autocomplete = false;
|
||||
-- debug = false;
|
||||
-- min_length = 1;
|
||||
-- preselect = 'enable';
|
||||
-- throttle_time = 80;
|
||||
-- source_timeout = 200;
|
||||
-- incomplete_delay = 400;
|
||||
-- max_abbr_width = 100;
|
||||
-- max_kind_width = 100;
|
||||
-- max_menu_width = 100;
|
||||
-- documentation = true;
|
||||
|
||||
source = {
|
||||
path = true;
|
||||
buffer = true;
|
||||
calc = true;
|
||||
nvim_lsp = true;
|
||||
-- emoji = true;
|
||||
};
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
});
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
-- { name = 'vsnip' }, -- For vsnip users.
|
||||
-- { name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
});
|
||||
}
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
@ -365,12 +380,6 @@ hi Pmenu ctermfg=White ctermbg=Black guifg=#ffffff guibg=#000000
|
||||
|
||||
au syntax leaninfo setl scl=no
|
||||
|
||||
inoremap <silent><expr> <C-Space> compe#complete()
|
||||
inoremap <silent><expr> <CR> compe#confirm('<CR>')
|
||||
inoremap <silent><expr> <C-e> compe#close('<C-e>')
|
||||
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
|
||||
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
|
||||
|
||||
nnoremap gD <Cmd>lua vim.lsp.buf.declaration()<CR>
|
||||
nnoremap gd <Cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap K <Cmd>lua vim.lsp.buf.hover()<CR>
|
||||
|
Loading…
Reference in New Issue
Block a user