Skip to content

Commit

Permalink
feat(nvim): capabilities + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nagy135 committed Jan 28, 2022
1 parent f1df32d commit 809f071
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
6 changes: 5 additions & 1 deletion nvim/.config/nvim/lua/lsp/tsserver.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- sudo npm i typescript-language-server -g

require'lspconfig'.tsserver.setup{}
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())

require'lspconfig'.tsserver.setup{
capabilities = capabilities
}
16 changes: 0 additions & 16 deletions nvim/.config/nvim/lua/my_nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@ local cmp = require'cmp'
local lspkind = require "lspkind"
lspkind.init()

local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end

local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end

cmp.setup({
snippet = {
expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
end,
},
mapping = {
Expand All @@ -34,7 +22,6 @@ cmp.setup({
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
-- { name = 'vsnip' }, -- For vsnip users.
{ name = "path" },
{ name = "luasnip" },
{ name = "buffer", keyword_length = 4 },
Expand All @@ -53,10 +40,7 @@ cmp.setup({
},

experimental = {
-- I like the new menu better! Nice work hrsh7th
native_menu = false,

-- Let's play with this for a day or two
ghost_text = true,
},
})

0 comments on commit 809f071

Please sign in to comment.