various changes
This commit is contained in:
parent
5ca9db6724
commit
e7cee070f1
7 changed files with 102 additions and 64 deletions
24
init.lua
24
init.lua
|
|
@ -5,8 +5,8 @@ vim.g.mapleader = " "
|
||||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
if not vim.uv.fs_stat(lazypath) then
|
||||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
@ -15,15 +15,15 @@ local lazy_config = require "configs.lazy"
|
||||||
|
|
||||||
-- load plugins
|
-- load plugins
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{
|
{
|
||||||
"NvChad/NvChad",
|
"NvChad/NvChad",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
branch = "v2.5",
|
branch = "v2.5",
|
||||||
import = "nvchad.plugins",
|
import = "nvchad.plugins",
|
||||||
},
|
},
|
||||||
|
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
{ import = "custom.plugins" },
|
{ import = "custom.plugins" },
|
||||||
}, lazy_config)
|
}, lazy_config)
|
||||||
|
|
||||||
-- load theme
|
-- load theme
|
||||||
|
|
@ -34,7 +34,5 @@ require "options"
|
||||||
require "nvchad.autocmds"
|
require "nvchad.autocmds"
|
||||||
|
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
require "mappings"
|
require "mappings"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local saga = "lspsaga"
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
|
"nvim-dap": { "branch": "master", "commit": "a479e25ed5b5d331fb46ee4b9e160ff02ac64310" },
|
||||||
"nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" },
|
"nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "b0caeef0d835fbe19df6ad71dbc4345eaaea649c" },
|
"nvim-lspconfig": { "branch": "master", "commit": "b0caeef0d835fbe19df6ad71dbc4345eaaea649c" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "f0e9951778802526b14c934f7bf746e1e0ae5ed0" },
|
"nvim-tree.lua": { "branch": "master", "commit": "f0e9951778802526b14c934f7bf746e1e0ae5ed0" },
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.base46 = {
|
M.base46 = {
|
||||||
theme = "pastelDark",
|
theme = "radium",
|
||||||
}
|
}
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ local options = {
|
||||||
typescriptreact = { "prettier" },
|
typescriptreact = { "prettier" },
|
||||||
javascript = { "prettier" },
|
javascript = { "prettier" },
|
||||||
javascriptreact = { "prettier" },
|
javascriptreact = { "prettier" },
|
||||||
|
json = { "prettier" },
|
||||||
},
|
},
|
||||||
|
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,17 @@
|
||||||
require("nvchad.configs.lspconfig").defaults()
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
html = {},
|
html = {},
|
||||||
cssld = {},
|
cssld = {},
|
||||||
clangd = {},
|
clangd = {},
|
||||||
ts_ls = {},
|
ts_ls = {},
|
||||||
dartls = {},
|
jdtls = {},
|
||||||
jdtls = {},
|
texlab = {},
|
||||||
texlab = {},
|
jsonls = {},
|
||||||
|
dartls = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, opts in pairs(servers) do
|
for name, opts in pairs(servers) do
|
||||||
vim.lsp.enable(name)
|
vim.lsp.enable(name)
|
||||||
vim.lsp.config(name, opts)
|
vim.lsp.config(name, opts)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,3 +20,13 @@ end)
|
||||||
map("t", "<C-t>", function()
|
map("t", "<C-t>", function()
|
||||||
term.toggle()
|
term.toggle()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- display full diagnostic message
|
||||||
|
map("n", "<leader>dd", "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||||
|
|
||||||
|
-- cancel snippets
|
||||||
|
map(
|
||||||
|
{ "i", "s" },
|
||||||
|
"<ESC>",
|
||||||
|
'<cmd>lua require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] = nil<CR><ESC>'
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,48 +1,75 @@
|
||||||
return {
|
return {
|
||||||
|
|
||||||
-- config for formatters
|
-- config for formatters
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = "BufWritePre",
|
event = "BufWritePre",
|
||||||
opts = require "configs.conform",
|
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",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
|
||||||
-- Tools for flutter
|
-- config for LSP
|
||||||
{
|
{
|
||||||
"akinsho/flutter-tools.nvim",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
config = function()
|
||||||
"nvim-lua/plenary.nvim",
|
require "configs.lspconfig"
|
||||||
"stevearc/dressing.nvim",
|
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" }, "<Tab>")
|
||||||
|
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-L>", function()
|
||||||
|
ls.jump(1)
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-J>", function()
|
||||||
|
ls.jump(-1)
|
||||||
|
end, { silent = true })
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue