diff options
Diffstat (limited to '')
| -rw-r--r-- | .config/nvim/after/plugin/lsp.lua | 51 | ||||
| -rw-r--r-- | .config/nvim/lua/bindings.lua | 4 | ||||
| -rw-r--r-- | .config/nvim/lua/plug.lua | 1 | ||||
| -rw-r--r-- | .config/nvim/plug-config/vim-lsp.vim | 39 | 
4 files changed, 53 insertions, 42 deletions
| diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 1d85a9d..9f84855 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -47,6 +47,53 @@ local cmp_mappings = lsp.defaults.cmp_mappings({  	['<C-Space>'] = cmp.mapping.complete(),  }) --- lsp.set_preferences({ + +lsp.set_preferences({  --     sign_icons = { } --- }) + +    sign_icons = { +      Text = "", +      Method = "", +      Function = "", +      Constructor = "", +      Field = "", +      Variable = "", +      Class = "", +      Interface = "", +      Module = "", +      Property = "", +      Unit = "", +      Value = "", +      Enum = "", +      Keyword = "", +      Snippet = "", +      Color = "", +      File = "", +      Reference = "", +      Folder = "", +      EnumMember = "", +      Constant = "", +      Struct = "", +      Event = "", +      Operator = "", +      TypeParameter = "", +    }, +}) + +local lspkind = require('lspkind') +cmp.setup { + +  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) + +      -- The function below will be called before any actual modifications from lspkind +      -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) +      before = function (entry, vim_item) +        return vim_item +      end +    }) +  } +} diff --git a/.config/nvim/lua/bindings.lua b/.config/nvim/lua/bindings.lua index 73e9980..3db5aa6 100644 --- a/.config/nvim/lua/bindings.lua +++ b/.config/nvim/lua/bindings.lua @@ -2,6 +2,7 @@ vim.keymap.set('n', '<M-;>', ':call nerdcommenter#Comment(0,"toggle")<CR>', { no  vim.keymap.set('n', '<M-x>', ':', { noremap = true, silent = false })  vim.keymap.set('n', '<M-k>', ':bprevious<CR>', { noremap = true, silent = true })  vim.keymap.set('n', '<C-u>', '<C-u>zz', { noremap = true, silent = false }) +vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true, silent = false })  vim.keymap.set('n', '<M-j>', ':bnext<CR>', { noremap = true, silent = true })  vim.keymap.set('n', '<C-h>', '<C-w>h', { noremap = true, silent = false })  vim.keymap.set('n', '<C-j>', '<C-w>j', { noremap = true, silent = false }) @@ -10,7 +11,6 @@ vim.keymap.set('n', '<C-l>', '<C-w>l', { noremap = true, silent = false })  vim.keymap.set('n', '<C-o>', '<C-w>o', { noremap = true, silent = false })  vim.keymap.set('n', '<C-q>', '<C-w>q', { noremap = true, silent = false })  vim.keymap.set('n', '*', '*zz', { noremap = true, silent = false }) -vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true, silent = false })  vim.keymap.set('i', '<C-j>', 'pumvisible() ? "<C-n>" : "<C-j>"', { expr = true })  vim.keymap.set('i', '<C-k>', 'pumvisible() ? "<C-p>" : "<C-k>"', { expr = true })  vim.keymap.set('i', '<cr>',  'pumvisible() ? asyncomplete#close_popup() : "\\<cr>"', { expr = true }) @@ -19,3 +19,5 @@ vim.g.floaterm_keymap_prev =   '<F11>'  vim.g.floaterm_keymap_next =   '<F12>'  vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")  vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv") +vim.keymap.set('x', '<leader>p', "\"_dP") +vim.keymap.set('n', 'Q', '<nop>') diff --git a/.config/nvim/lua/plug.lua b/.config/nvim/lua/plug.lua index 2b5bfd1..b61ac2e 100644 --- a/.config/nvim/lua/plug.lua +++ b/.config/nvim/lua/plug.lua @@ -55,5 +55,6 @@ Plug('hrsh7th/nvim-cmp')  Plug('hrsh7th/cmp-nvim-lsp')  Plug('L3MON4D3/LuaSnip')  Plug('VonHeikemen/lsp-zero.nvim', {['branch'] = 'v3.x'}) +Plug('onsails/lspkind.nvim')  vim.call('plug#end') diff --git a/.config/nvim/plug-config/vim-lsp.vim b/.config/nvim/plug-config/vim-lsp.vim deleted file mode 100644 index 5e5ca16..0000000 --- a/.config/nvim/plug-config/vim-lsp.vim +++ /dev/null @@ -1,39 +0,0 @@ -" if executable('ccls') -" 	autocmd User lsp_setup call lsp#register_server({ -" 				\ 'name': 'ccls', -" 				\ 'cmd': {server_info->['ccls']}, -" 				\ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))}, -" 				\ 'initialization_options': { -" 				\   'highlight': { 'lsRanges' : v:true }, -" 				\ }, -" 				\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], -" 				\ }) -" 	autocmd FileType c,cpp,objc,objcpp,cc setlocal omnifunc=lsp#complete -" endif -"  -" highlight LspCxxHlSymStruct ctermfg=Yellow guifg=Yellow -" highlight LspCxxHlSymClass ctermfg=Yellow guifg=Yellow -" highlight LspCxxHlSymField ctermfg=Blue guifg=Blue -" highlight LspCxxHlSymParameter ctermfg=LightYellow guifg=LightYellow -" highlight LspCxxHlSymVariableStatic ctermfg=LightRed guifg=LightRed -" highlight LspErrorHighlight cterm=undercurl gui=undercurl ctermfg=DarkRed guifg=DarkRed -" highlight LspWarningHighlight cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed -" highlight LspInformationHighlight cterm=underline gui=underline ctermfg=Green guifg=Green -" highlight LspHintHighlight term=italic cterm=italic gui=italic ctermfg=Green guifg=Green -"  -" augroup LspGo -"   au! -"   autocmd User lsp_setup call lsp#register_server({ -"       \ 'name': 'go-lang', -"       \ 'cmd': {server_info->['gopls']}, -"       \ 'whitelist': ['go'], -"       \ }) -"   autocmd FileType go setlocal omnifunc=lsp#complete -"   "autocmd FileType go nmap <buffer> gd <plug>(lsp-definition) -"   "autocmd FileType go nmap <buffer> ,n <plug>(lsp-next-error) -"   "autocmd FileType go nmap <buffer> ,p <plug>(lsp-previous-error) -" augroup END -"  -" let g:lsp_signs_priority = 10 -" let g:lsp_textprop_enabled = 1 -" let g:lsp_cxx_hl_use_text_props = 1 | 
