diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..1e1765c --- /dev/null +++ b/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.globals": [ + "vim" + ] +} \ No newline at end of file diff --git a/init.lua b/init.lua index aaed9b1..188e5c3 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,10 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - + local lazyrepo = "https://github.com/folke/lazy.nvim.git" local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - + if vim.v.shell_error ~= 0 then vim.api.nvim_echo({ { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, diff --git a/lazy-lock.json b/lazy-lock.json index 7dabbb0..014abbf 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,11 +1,15 @@ { "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-treesitter": { "branch": "master", "commit": "f0c928dbe93533b7e35894a8f957f40150d1f663" }, + "nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" }, + "nvim-treesitter": { "branch": "master", "commit": "fd59f984416f696d85119fd4d15ce0965b179944" }, "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..19b1896 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,31 @@ +return { + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "ts_ls" } + }) + end + }, + { + "neovim/nvim-lspconfig", + config = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({}) + lspconfig.ts_ls.setup({}) + + vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Display symbol info" }) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { desc = "Go to declaration" }) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, { desc = "Get signature help" }) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, { desc = "Get code actions" }) + end + }, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 5549a0d..3085a09 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,7 +1,8 @@ return { "nvim-lualine/lualine.nvim", config = function() - require("lualine").setup() - options = { theme = "dracula" } + require("lualine").setup({ + options = { theme = "dracula" } + }) end } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 5563aea..b5db38b 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,13 +1,30 @@ return { - 'nvim-telescope/telescope.nvim', - tag = '0.1.8', - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function() - local builtin = require('telescope.builtin') + { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local builtin = require('telescope.builtin') - vim.keymap.set('n', '', builtin.find_files, { desc = 'Telescope find files' }) - vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) - vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) - vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) - end + vim.keymap.set('n', '', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + end + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown { + } + } + } + }) + + require("telescope").load_extension("ui-select") + end + } }