add completion icons, and path completion

This commit is contained in:
Szwendacz99 2022-11-02 14:33:54 +01:00
parent c4c719241d
commit d09b527e0f
3 changed files with 164 additions and 150 deletions

View file

@ -12,10 +12,13 @@ Plug 'hrsh7th/nvim-cmp'
Plug 'williamboman/mason.nvim' Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim' Plug 'williamboman/mason-lspconfig.nvim'
Plug 'mfussenegger/nvim-lint' Plug 'mfussenegger/nvim-lint'
"Plug 'dense-analysis/ale' Plug 'onsails/lspkind.nvim'
" various plugins " various plugins
Plug 'windwp/nvim-ts-autotag'
Plug 'hrsh7th/cmp-path'
Plug 'L3MON4D3/LuaSnip', {'tag': 'v1.*'} Plug 'L3MON4D3/LuaSnip', {'tag': 'v1.*'}
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'lambdalisue/suda.vim' Plug 'lambdalisue/suda.vim'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
Plug 'akinsho/bufferline.nvim', { 'tag': 'v3.*' } Plug 'akinsho/bufferline.nvim', { 'tag': 'v3.*' }

View file

@ -34,15 +34,16 @@ codewindow.setup({
show_cursor = true, show_cursor = true,
exclude_filetypes = {}, -- Choose certain filetypes to not show minimap on exclude_filetypes = {}, -- Choose certain filetypes to not show minimap on
z_index = 1, -- The z-index the floating window will be on z_index = 1, -- The z-index the floating window will be on
}) })
codewindow.apply_default_keybinds() codewindow.apply_default_keybinds()
-- Set up nvim-cmp. -- Set up nvim-cmp.
local cmp = require'cmp' local cmp = require 'cmp'
local lspkind = require('lspkind')
cmp.setup({ cmp.setup({
snippet = { snippet = {
-- REQUIRED - you must specify a snippet engine -- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users. require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
@ -61,22 +62,30 @@ snippet = {
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users. --{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users. { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users. -- { name = 'snippy' }, -- For snippy users.
}, { }, {
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'path' },
}),
formatting = {
format = lspkind.cmp_format({
--mode = 'symbol', -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
}) })
}
}) })
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', { cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, { }, {
{ name = 'buffer' }, { name = 'buffer' },
}) })
}) })
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
@ -97,7 +106,6 @@ cmp.setup.cmdline(':', {
}) })
}) })
require("nvim-tree").setup({ require("nvim-tree").setup({
create_in_closed_folder = true, create_in_closed_folder = true,
hijack_cursor = true, hijack_cursor = true,
@ -165,7 +173,7 @@ require("nvim-tree").setup({
watcher = false, watcher = false,
}, },
}, },
}) })
--Gruvbox theme settings --Gruvbox theme settings
-- setup must be called before loading the colorscheme -- setup must be called before loading the colorscheme
@ -187,7 +195,7 @@ require("gruvbox").setup({
transparent_mode = false, transparent_mode = false,
}) })
require('bufferline').setup { require('bufferline').setup {
options = { options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead mode = "buffers", -- set to "tabs" to only show tabpages instead
numbers = "buffer_id", numbers = "buffer_id",
@ -238,8 +246,8 @@ require("gruvbox").setup({
hover = { hover = {
enabled = true, enabled = true,
delay = 200, delay = 200,
reveal = {'close'} reveal = { 'close' }
}, },
sort_by = 'tabs' sort_by = 'tabs'
} }
} }

View file

@ -7,6 +7,9 @@ require('lint').linters_by_ft = {
local pydocstyle = require('lint.linters.pydocstyle') local pydocstyle = require('lint.linters.pydocstyle')
pydocstyle.args = { pydocstyle.args = {
'--ignore=D100', -- disable missing module docstring info '--ignore=D100', -- disable missing module docstring info
'--ignore=D203', -- disable one line before class docstring required
'--ignore=D213', -- disable multiline docstring summary
-- should start at the second line
} }
local pylint = require('lint.linters.pylint') local pylint = require('lint.linters.pylint')
pylint.args = { pylint.args = {