Skip to content

Commit

Permalink
Added neovim to default python, npm and ruby packages
Browse files Browse the repository at this point in the history
  • Loading branch information
missingcharacter committed Feb 2, 2024
1 parent ec12264 commit 0a98f7a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions default-gems
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neovim
1 change: 1 addition & 0 deletions default-npm-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neovim
1 change: 1 addition & 0 deletions default-python-packages
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
keyring
poetry
pynvim
38 changes: 20 additions & 18 deletions nvim/lua/missingcharacter/lazy/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ return {
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
Expand Down Expand Up @@ -121,6 +122,25 @@ return {
-- Set up nvim-cmp.
local cmp_select = { behavior = cmp.SelectBehavior.Select }

--@diagnostic disable-next-line: redundant-parameter
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- For luasnip users.
}, { { name = "buffer" } }),
})
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
Expand All @@ -140,24 +160,6 @@ return {
},
}),
})
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- For luasnip users.
}, { { name = "buffer" } }),
})
vim.diagnostic.config({
update_in_insert = true,
float = {
Expand Down
2 changes: 2 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ declare -a LINKS=(
'bashrc'
'bash_profile'
'bash_aliases'
'default-gems'
'default-npm-packages'
'default-python-packages'
'envrc'
'gitconfig'
Expand Down

0 comments on commit 0a98f7a

Please sign in to comment.