commit
This commit is contained in:
parent
4bc4118cb8
commit
6a2c2ddc61
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
lazy-lock.json
|
1
init.lua
1
init.lua
@ -1,4 +1,3 @@
|
|||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
require("config.options")
|
require("config.options")
|
||||||
require("config.keymaping")
|
require("config.keymaping")
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- neo-tree
|
||||||
map("n", "<leader>e", ":Neotree<CR>", { desc = "nvimtree focus window" })
|
map("n", "<leader>e", ":Neotree<CR>", { desc = "nvimtree focus window" })
|
||||||
|
|
||||||
-- telescope
|
-- telescope
|
||||||
map("n", "<leader>ff", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
|
map("n", "<leader>ff", ":Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||||
map("n", "<leader>gr", "<cmd>Telescope lsp_references<CR>", { desc = "telescope lsp references" })
|
map("n", "<leader>gr", ":Telescope lsp_references<cr>", { desc = "telescope lsp references" })
|
||||||
|
|
||||||
|
map("n", "<tab>", ":BufferNext<CR>", { desc = "Next tab" })
|
||||||
|
map("n", "<S-tab>", ":BufferPrevious<CR>", { desc = "Previous tab" })
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
{ out, "WarningMsg" },
|
{ out, "WarningMsg" },
|
||||||
{ "\nPress any key to exit..." },
|
{ "\nPress any key to exit..." },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
@ -23,13 +23,13 @@ vim.g.maplocalleader = "\\"
|
|||||||
|
|
||||||
-- Setup lazy.nvim
|
-- Setup lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
-- import your plugins
|
-- import your plugins
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
-- Configure any other settings here. See the documentation for more details.
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
-- colorscheme that will be used when installing plugins.
|
-- colorscheme that will be used when installing plugins.
|
||||||
install = { colorscheme = { "habamax" } },
|
install = { colorscheme = { "habamax" } },
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
})
|
})
|
||||||
|
@ -4,6 +4,8 @@ local g = vim.g
|
|||||||
|
|
||||||
g.mapleader = " "
|
g.mapleader = " "
|
||||||
|
|
||||||
|
opt.tabstop = 4
|
||||||
|
|
||||||
o.laststatus = 3
|
o.laststatus = 3
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
|
|
||||||
|
@ -12,6 +12,11 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||||
animation = true,
|
animation = true,
|
||||||
|
gitsigns = {
|
||||||
|
added = { enabled = true, icon = "+" },
|
||||||
|
changed = { enabled = true, icon = "~" },
|
||||||
|
deleted = { enabled = true, icon = "-" },
|
||||||
|
},
|
||||||
insert_at_start = true,
|
insert_at_start = true,
|
||||||
auto_hide = true,
|
auto_hide = true,
|
||||||
sidebar_filetypes = {
|
sidebar_filetypes = {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
local api = vim.api
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
--opts = {},
|
--opts = {},
|
||||||
@ -8,7 +10,7 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
require("conform").format({ bufnr = args.buf })
|
require("conform").format({ bufnr = args.buf })
|
||||||
|
@ -1,50 +1,47 @@
|
|||||||
return {
|
return {
|
||||||
-- Main LSP Configuration
|
-- Main LSP Configuration
|
||||||
'neovim/nvim-lspconfig',
|
"neovim/nvim-lspconfig",
|
||||||
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
{
|
{
|
||||||
'williamboman/mason.nvim', config = true,
|
"williamboman/mason.nvim",
|
||||||
}, -- NOTE: Must be loaded before dependants
|
config = true,
|
||||||
'williamboman/mason-lspconfig.nvim',
|
}, -- NOTE: Must be loaded before dependants
|
||||||
--'WhoIsSethDaniel/mason-tool-installer.nvim',
|
"williamboman/mason-lspconfig.nvim",
|
||||||
--{ 'j-hui/fidget.nvim', opts = {} },
|
--'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
--{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
},
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
config = function()
|
|
||||||
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
--capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
|
||||||
|
|
||||||
local servers = {
|
config = function()
|
||||||
gopls = {},
|
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
}
|
--capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||||
|
|
||||||
require('mason').setup()
|
local servers = {
|
||||||
|
gopls = {},
|
||||||
|
}
|
||||||
|
|
||||||
--local ensure_installed = vim.tbl_keys(servers or {})
|
require("mason").setup()
|
||||||
--vim.list_extend(ensure_installed, {
|
|
||||||
-- 'stylua', -- Used to format Lua code
|
|
||||||
--})
|
|
||||||
|
|
||||||
--require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
--local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
|
--vim.list_extend(ensure_installed, {
|
||||||
|
-- 'stylua', -- Used to format Lua code
|
||||||
|
--})
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
--require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
handlers = {
|
|
||||||
function(server_name)
|
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
require("mason-lspconfig").setup({
|
||||||
|
handlers = {
|
||||||
|
function(server_name)
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local server = servers[server_name] or {}
|
||||||
|
server.capabilities = capabilities
|
||||||
local server = servers[server_name] or {}
|
-- server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
server.capabilities = capabilities
|
require("lspconfig")[server_name].setup(server)
|
||||||
-- server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
end,
|
||||||
require('lspconfig')[server_name].setup(server)
|
},
|
||||||
end,
|
})
|
||||||
},
|
end,
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-lualine/lualine.nvim',
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = function()
|
config = function()
|
||||||
require('lualine').setup()
|
require("lualine").setup()
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
branch = "v3.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,71 +1,71 @@
|
|||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- {
|
-- {
|
||||||
-- snippet plugin
|
-- snippet plugin
|
||||||
-- "L3MON4D3/LuaSnip",
|
-- "L3MON4D3/LuaSnip",
|
||||||
-- dependencies = "rafamadriz/friendly-snippets",
|
-- dependencies = "rafamadriz/friendly-snippets",
|
||||||
-- opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
-- opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
-- config = function(_, opts)
|
-- config = function(_, opts)
|
||||||
-- require("luasnip").config.set_config(opts)
|
-- require("luasnip").config.set_config(opts)
|
||||||
-- require "nvchad.configs.luasnip"
|
-- require "nvchad.configs.luasnip"
|
||||||
-- end,
|
-- end,
|
||||||
--},
|
--},
|
||||||
|
|
||||||
-- autopairing of (){}[] etc
|
-- autopairing of (){}[] etc
|
||||||
--{
|
--{
|
||||||
-- "windwp/nvim-autopairs",
|
-- "windwp/nvim-autopairs",
|
||||||
-- opts = {
|
-- opts = {
|
||||||
-- fast_wrap = {},
|
-- fast_wrap = {},
|
||||||
-- disable_filetype = { "TelescopePrompt", "vim" },
|
-- disable_filetype = { "TelescopePrompt", "vim" },
|
||||||
-- },
|
-- },
|
||||||
-- config = function(_, opts)
|
-- config = function(_, opts)
|
||||||
-- require("nvim-autopairs").setup(opts)
|
-- require("nvim-autopairs").setup(opts)
|
||||||
--
|
--
|
||||||
-- setup cmp for autopairs
|
-- setup cmp for autopairs
|
||||||
-- local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
-- local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||||
-- require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
-- require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
-- end,
|
-- end,
|
||||||
-- },
|
-- },
|
||||||
|
|
||||||
-- cmp sources plugins
|
-- cmp sources plugins
|
||||||
--{
|
--{
|
||||||
-- "saadparwaiz1/cmp_luasnip",
|
-- "saadparwaiz1/cmp_luasnip",
|
||||||
--"hrsh7th/cmp-nvim-lua",
|
--"hrsh7th/cmp-nvim-lua",
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
-- "hrsh7th/cmp-nvim-lsp",
|
||||||
-- "hrsh7th/cmp-buffer",
|
-- "hrsh7th/cmp-buffer",
|
||||||
-- "hrsh7th/cmp-path",
|
-- "hrsh7th/cmp-path",
|
||||||
-- },
|
-- },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require('cmp')
|
local cmp = require("cmp")
|
||||||
-- snippet = {
|
-- snippet = {
|
||||||
-- REQUIRED - you must specify a snippet engine
|
-- REQUIRED - you must specify a snippet engine
|
||||||
-- expand = function(args)
|
-- expand = function(args)
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||||
--end,
|
--end,
|
||||||
--},
|
--},
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = "nvim_lsp" },
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
end
|
end,
|
||||||
--opts = function()
|
--opts = function()
|
||||||
-- return require "nvchad.configs.cmp"
|
-- return require "nvchad.configs.cmp"
|
||||||
--end,
|
--end,
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
"navarasu/onedark.nvim",
|
"navarasu/onedark.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require('onedark').load()
|
require("onedark").load()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
-- cmd = "Telescope",
|
-- cmd = "Telescope",
|
||||||
opts = function()
|
opts = function()
|
||||||
-- return require "nvchad.configs.telescope"
|
-- return require "nvchad.configs.telescope"
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user