Trying one last change

This commit is contained in:
Bryan Ramos 2023-05-28 20:39:31 -04:00
parent bcfbcce59c
commit 4fff72b08d
2 changed files with 62 additions and 20 deletions

View file

@ -10,20 +10,62 @@ end)
-- When you don't have mason.nvim installed -- When you don't have mason.nvim installed
-- You'll need to list the servers installed in your system -- You'll need to list the servers installed in your system
lsp.setup_servers({ lsp.setup_servers({
'tsserver', 'tsserver',
'eslint', 'eslint',
'hls', 'hls',
'pyright', 'pyright',
'nil_ls', 'nil_ls',
'volar', 'volar',
'cssls', 'cssls',
'html', 'html',
'jsonls', 'jsonls',
'diagnosticls', 'diagnosticls',
'lua_ls' 'lua_ls',
'marksman'
}) })
-- (Optional) Configure lua language server for neovim -- (Optional) Configure lua language server for neovim
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
lsp.setup() lsp.setup()
local cmp = require'cmp'
cmp.setup {
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
-- other sources...
},
-- other configurations...
}
local luasnip = require'luasnip'
cmp.setup {
-- other configurations...
mapping = {
['<Tab>'] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n')
elseif luasnip.expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '')
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n')
elseif luasnip.jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-jump-prev', true, true, true), '')
else
fallback()
end
end, { 'i', 's' }),
},
}

View file

@ -66,10 +66,8 @@
nodejs nodejs
gcc gcc
# Haskell
ghc ghc
cabal-install cabal-install
haskell-language-server
haskellPackages.hoogle haskellPackages.hoogle
cabal2nix cabal2nix
@ -77,15 +75,17 @@
python311Packages.pip python311Packages.pip
# LSPs # LSPs
nodePackages.vscode-langservers-extracted nodePackages.vscode-langservers-extracted
nodePackages.prettier nodePackages.prettier
nodePackages.typescript-language-server nodePackages.typescript-language-server
nodePackages.diagnostic-languageserver nodePackages.diagnostic-languageserver
nodePackages.volar nodePackages.volar
nodePackages.pyright nodePackages.pyright
haskell-language-server haskell-language-server
nil nil
sumneko-lua-language-server marksman
sumneko-lua-language-server
]; ];
# PROGRAM CONFIGS # PROGRAM CONFIGS