Changed nvim completion autoselection
This commit is contained in:
@@ -1,22 +1,31 @@
|
||||
local plugins = {
|
||||
'rebelot/kanagawa.nvim',
|
||||
|
||||
'nvim-lualine/lualine.nvim',
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
{'neoclide/coc.nvim',
|
||||
branch = 'release'},
|
||||
'navarasu/onedark.nvim',
|
||||
'tpope/vim-surround',
|
||||
'godlygeek/tabular',
|
||||
'OmniSharp/omnisharp-vim',
|
||||
'dense-analysis/ale',
|
||||
|
||||
'kylechui/nvim-surround',
|
||||
|
||||
{
|
||||
'ibhagwan/fzf-lua',
|
||||
config = function()
|
||||
require('fzf-lua').setup({'skim'})
|
||||
end
|
||||
},
|
||||
|
||||
'neovim/nvim-lspconfig',
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-path',
|
||||
|
||||
'rust-lang/rust.vim',
|
||||
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
opts={},
|
||||
},
|
||||
'preservim/nerdtree',
|
||||
'junegunn/fzf.vim',
|
||||
'junegunn/fzf',
|
||||
'rust-lang/rust.vim'
|
||||
|
||||
}
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
37
laptop/nvim/lua/config/plugins/lspconfig.lua
Normal file
37
laptop/nvim/lua/config/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
local servers = {'ccls', 'rust_analyzer'}
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
|
||||
local cmp = require 'cmp'
|
||||
|
||||
cmp.setup {
|
||||
preselect = cmp.PreselectMode.None,
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' }
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user