Browse Source

neovim lsp works now

master
Juni Kim 1 week ago
parent
commit
9d06f129a0
  1. 4
      .config/hypr/hyprpaper.conf
  2. 5
      .config/nvim/lazy-lock.json
  3. 42
      .config/nvim/lua/junikim/plugins/lsp.lua
  4. 2
      .config/nvim/lua/junikim/plugins/treesitter.lua

4
.config/hypr/hyprpaper.conf

@ -1,2 +1,2 @@
preload = /home/junikim/wallpaper/trees.png
wallpaper = eDP-1, /home/junikim/wallpaper/trees.png
preload = /home/junikim/wallpaper/valley.png
wallpaper = eDP-1, /home/junikim/wallpaper/valley.png

5
.config/nvim/lazy-lock.json

@ -1,6 +1,11 @@
{ {
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"emmet-vim": { "branch": "master", "commit": "6c511a8d7d2863066f32e25543e2bb99d505172c" }, "emmet-vim": { "branch": "master", "commit": "6c511a8d7d2863066f32e25543e2bb99d505172c" },
"everforest-nvim": { "branch": "main", "commit": "3598755ade98f87e66415cb0e15d3f99b895bdf8" }, "everforest-nvim": { "branch": "main", "commit": "3598755ade98f87e66415cb0e15d3f99b895bdf8" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },

42
.config/nvim/lua/junikim/plugins/lsp.lua

@ -9,24 +9,57 @@ return {
{ {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
event = 'InsertEnter', event = 'InsertEnter',
dependencies = {
{ "L3MON4D3/LuaSnip" },
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
{ 'hrsh7th/cmp-buffer' }, -- Optional
{ 'hrsh7th/cmp-path' }, -- Optional
{ 'saadparwaiz1/cmp_luasnip' }, -- Optional
{ 'hrsh7th/cmp-nvim-lua' }, -- Optional
},
config = function() config = function()
local cmp = require('cmp') local cmp = require('cmp')
local luasnip = require("luasnip")
local cmp_select = { behavior = cmp.SelectBehavior.Select }
cmp.setup({ cmp.setup({
sources = {
sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer' },
{ name = 'nvim_lua' },
}, {
{ name = 'buffer' },
}),
completion = {
completeopt = 'menu,menuone,noinsert'
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select), ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-s>'] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<Tab>'] = nil,
['<Tab>'] = cmp.mapping.select_next_item(cmp_select),
['<S-Tab>'] = nil, ['<S-Tab>'] = nil,
["<CR>"] = cmp.mapping({
i = function(fallback)
-- and cmp.get_selected_entry()
if cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
}), }),
experimental = {
ghost_text = true
},
snippet = { snippet = {
expand = function(args) expand = function(args)
vim.snippet.expand(args.body)
luasnip.lsp_expand(args.body)
end, end,
}, },
}) })
@ -42,6 +75,7 @@ return {
{ 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/cmp-nvim-lsp' },
{ 'williamboman/mason.nvim' }, { 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' }, { 'williamboman/mason-lspconfig.nvim' },
{ "L3MON4D3/LuaSnip" }
}, },
init = function() init = function()
-- Reserve a space in the gutter -- Reserve a space in the gutter

2
.config/nvim/lua/junikim/plugins/treesitter.lua

@ -13,7 +13,7 @@ return { -- Highlight, edit, and navigate code
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to -- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent. -- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
disable = { "latex", "perl", "htmldjango" },
}, },
indent = { enable = true, disable = { 'ruby' } }, indent = { enable = true, disable = { 'ruby' } },
}, },

Loading…
Cancel
Save