Changed nvim completion autoselection
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
require('config/keymaps')
|
||||
require('config/settings')
|
||||
require('config/plugins')
|
||||
require('config/plugins/coc')
|
||||
require('config/plugins/lualine')
|
||||
require('config/plugins/ale')
|
||||
require('config/plugins/nerdtree')
|
||||
require('config/plugins/lspconfig')
|
||||
|
||||
local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/"
|
||||
|
||||
|
||||
@@ -4,3 +4,7 @@ vim.keymap.set('n', '<C-h>', '<C-w>h')
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j')
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k')
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l')
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', ':FzfLua files<CR>')
|
||||
vim.keymap.set('n', '<leader>fb', ':FzfLua buffers<CR>')
|
||||
vim.keymap.set('n', '<leader>rg', ':FzfLua grep<CR>')
|
||||
|
||||
@@ -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' }
|
||||
},
|
||||
}
|
||||
@@ -31,6 +31,7 @@ vim.opt.wrapscan=true
|
||||
vim.opt.report=0
|
||||
|
||||
vim.opt.list=true
|
||||
vim.opt.completeopt=menuone,noselect,noinsert
|
||||
|
||||
|
||||
vim.g['loaded_perl_provider']=0
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
colorscheme onedark
|
||||
colorscheme kanagawa
|
||||
|
||||
if has('multi_byte') && &encoding ==# 'utf-8'
|
||||
let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±'
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user