Browse Source

Clean up more code

pull/14/head
Ptrzl 3 years ago
parent
commit
bbf67fbfdc
  1. 49
      lua/configs/autocomplete.lua
  2. 6
      lua/configs/filetree.lua

49
lua/configs/autocomplete.lua

@ -14,44 +14,31 @@ function M.config()
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
mapping = {
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
mapping = { -- TODO: do these mappings
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
--[''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
--[''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
--[''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
--[''] = cmp.mapping({
-- i = cmp.mapping.abort(),
-- c = cmp.mapping.close(),
--}),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
{ name = 'luasnip' },
-- { name = 'nvim_lsp' },
-- { name = 'ultisnips' },
-- { name = 'snippy' },
}, {{ name = 'buffer' }})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
-- completion for status line commands (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
@ -61,8 +48,6 @@ function M.config()
})
-- nvim-lspconfig config
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'ccls' }
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
@ -73,12 +58,6 @@ function M.config()
}
}
end
-- C-CPP-Modern config
vim.g.cpp_function_highlight = 1
vim.g.cpp_attributes_highlight = 1
vim.g.cpp_member_highlight = 1
vim.g.cpp_simple_highlight = 1
end
return M

6
lua/configs/filetree.lua

@ -25,8 +25,8 @@ function M.config()
}
},
update_focused_file = {
enable = false,
update_cwd = false,
enable = true,
update_cwd = true,
ignore_list = {}
},
system_open = {
@ -47,7 +47,7 @@ function M.config()
height = 30,
hide_root_folder = false,
side = 'left',
auto_resize = false,
auto_resize = true,
mappings = {
custom_only = false,
list = {}

Loading…
Cancel
Save