diff --git a/init.lua b/init.lua index eea85d2..79ff17d 100644 --- a/init.lua +++ b/init.lua @@ -5,8 +5,8 @@ vim.g.mapleader = " " local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" if not vim.uv.fs_stat(lazypath) then - local repo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } end vim.opt.rtp:prepend(lazypath) @@ -15,15 +15,15 @@ local lazy_config = require "configs.lazy" -- load plugins require("lazy").setup({ - { - "NvChad/NvChad", - lazy = false, - branch = "v2.5", - import = "nvchad.plugins", - }, + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + }, - { import = "plugins" }, - { import = "custom.plugins" }, + { import = "plugins" }, + { import = "custom.plugins" }, }, lazy_config) -- load theme @@ -34,7 +34,5 @@ require "options" require "nvchad.autocmds" vim.schedule(function() - require "mappings" + require "mappings" end) - -local saga = "lspsaga" diff --git a/lazy-lock.json b/lazy-lock.json index cad6819..c819d1b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -25,6 +25,7 @@ "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "a479e25ed5b5d331fb46ee4b9e160ff02ac64310" }, "nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" }, "nvim-lspconfig": { "branch": "master", "commit": "b0caeef0d835fbe19df6ad71dbc4345eaaea649c" }, "nvim-tree.lua": { "branch": "master", "commit": "f0e9951778802526b14c934f7bf746e1e0ae5ed0" }, diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 53a542a..f3561aa 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -6,7 +6,7 @@ local M = {} M.base46 = { - theme = "pastelDark", + theme = "radium", } return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index b466dd9..760421c 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -7,6 +7,7 @@ local options = { typescriptreact = { "prettier" }, javascript = { "prettier" }, javascriptreact = { "prettier" }, + json = { "prettier" }, }, format_on_save = { diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index f2d9fa4..8cedf20 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -2,16 +2,17 @@ require("nvchad.configs.lspconfig").defaults() local servers = { - html = {}, - cssld = {}, - clangd = {}, - ts_ls = {}, - dartls = {}, - jdtls = {}, - texlab = {}, + html = {}, + cssld = {}, + clangd = {}, + ts_ls = {}, + jdtls = {}, + texlab = {}, + jsonls = {}, + dartls = {}, } for name, opts in pairs(servers) do - vim.lsp.enable(name) - vim.lsp.config(name, opts) + vim.lsp.enable(name) + vim.lsp.config(name, opts) end diff --git a/lua/mappings.lua b/lua/mappings.lua index e2d5d23..200bb50 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -20,3 +20,13 @@ end) map("t", "", function() term.toggle() end) + +-- display full diagnostic message +map("n", "dd", "lua vim.diagnostic.open_float()") + +-- cancel snippets +map( + { "i", "s" }, + "", + 'lua require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] = nil' +) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 7fb0a7b..4e10c01 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,48 +1,75 @@ return { - -- config for formatters - { - "stevearc/conform.nvim", - event = "BufWritePre", - opts = require "configs.conform", - }, - - -- config for LSP - { - "neovim/nvim-lspconfig", - config = function() - require "configs.lspconfig" - end, - }, - - -- treesitter, to have highlighting - { - "nvim-treesitter/nvim-treesitter", - dependencies = { "OXY2DEV/markview.nvim" }, - opts = { - ensure_installed = { - "vim", - "lua", - "vimdoc", - "html", - "css", - "tsx", - "typescript", - "dart", - "latex", - }, + -- config for formatters + { + "stevearc/conform.nvim", + event = "BufWritePre", + opts = require "configs.conform", }, - }, - -- Tools for flutter - { - "akinsho/flutter-tools.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "stevearc/dressing.nvim", + -- config for LSP + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, }, - config = true, - }, - { "ingur/floatty.nvim" }, + -- treesitter, to have highlighting + { + "nvim-treesitter/nvim-treesitter", + dependencies = { "OXY2DEV/markview.nvim" }, + opts = { + ensure_installed = { + "vim", + "lua", + "vimdoc", + "html", + "css", + "tsx", + "typescript", + "dart", + "latex", + "json", + }, + }, + }, + + -- Tools for flutter + { + "akinsho/flutter-tools.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "stevearc/dressing.nvim", + }, + config = function() + require("flutter-tools").setup {} + end, + }, + + { "mfussenegger/nvim-dap" }, + + { "ingur/floatty.nvim" }, + + { + "L3MON4D3/LuaSnip", + even = "VaryLazy", + config = function() + local ls = require "luasnip" + ls.setup { + region_check_events = { "CursorHold", "InsertLeave" }, + delete_check_events = { "TextChanged", "InsertEnter" }, + history = false, + } + vim.keymap.del({ "i", "s" }, "") + + vim.keymap.set({ "i", "s" }, "", function() + ls.jump(1) + end, { silent = true }) + + vim.keymap.set({ "i", "s" }, "", function() + ls.jump(-1) + end, { silent = true }) + end, + }, }