Compare commits
3 Commits
08ec842f0d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b4ca98038 | |||
| 08193ed385 | |||
| c5d19259e2 |
@ -4,8 +4,10 @@
|
|||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" },
|
"gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "80c0130c5f16b551865a69e832f1feadeedb5fbe" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "80c0130c5f16b551865a69e832f1feadeedb5fbe" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "85bbfad83f804f11688d1ab9486b459e699292d6" },
|
"nvim-cmp": { "branch": "main", "commit": "85bbfad83f804f11688d1ab9486b459e699292d6" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "92ee7d42320edfbb81f3cad851314ab197fa324a" },
|
"nvim-lspconfig": { "branch": "master", "commit": "92ee7d42320edfbb81f3cad851314ab197fa324a" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "ca8d82fff26cb12ced239713e3222f4a9dcd0da0" },
|
"nvim-tree.lua": { "branch": "master", "commit": "ca8d82fff26cb12ced239713e3222f4a9dcd0da0" },
|
||||||
|
|||||||
@ -19,6 +19,7 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
-- Initialize lazy.nvim
|
-- Initialize lazy.nvim
|
||||||
local plugins = {
|
local plugins = {
|
||||||
require("plugins.colorschemes"), -- theme
|
require("plugins.colorschemes"), -- theme
|
||||||
|
require("plugins.editing"), -- editing
|
||||||
require("plugins.lsp"), -- LSP
|
require("plugins.lsp"), -- LSP
|
||||||
require("plugins.telescope"), -- fuzzy finder
|
require("plugins.telescope"), -- fuzzy finder
|
||||||
require("plugins.treesitter"), -- syntax tree
|
require("plugins.treesitter"), -- syntax tree
|
||||||
|
|||||||
20
lua/plugins/editing.lua
Normal file
20
lua/plugins/editing.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function()
|
||||||
|
local npairs = require("nvim-autopairs")
|
||||||
|
npairs.setup({
|
||||||
|
check_ts = true, -- enable Treesitter integration
|
||||||
|
disable_filetype = { "TelescopePrompt", "vim" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- If using nvim-cmp for completion, integrate it:
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.event:on(
|
||||||
|
"confirm_done",
|
||||||
|
cmp_autopairs.on_confirm_done()
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -36,6 +36,14 @@ return {
|
|||||||
vim.lsp.config("rust_analyzer", {})
|
vim.lsp.config("rust_analyzer", {})
|
||||||
vim.lsp.enable("rust_analyzer")
|
vim.lsp.enable("rust_analyzer")
|
||||||
|
|
||||||
|
-- Auto format
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = "*.rs",
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({ async = false })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Floating diagnostic on hover
|
-- Floating diagnostic on hover
|
||||||
vim.api.nvim_create_autocmd("CursorHold", {
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
@ -33,4 +33,33 @@ return {
|
|||||||
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" })
|
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
theme = "auto", -- follow your colorscheme
|
||||||
|
icons_enabled = true,
|
||||||
|
component_separators = "|",
|
||||||
|
section_separators = "",
|
||||||
|
globalstatus = true, -- single statusline
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { "branch", "diff" },
|
||||||
|
lualine_c = {
|
||||||
|
{ "filename", path = 1 }, -- relative path
|
||||||
|
},
|
||||||
|
lualine_x = {
|
||||||
|
"diagnostics",
|
||||||
|
"encoding",
|
||||||
|
"filetype",
|
||||||
|
},
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user