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.options")
|
||||
require("config.keymaping")
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- neo-tree
|
||||
map("n", "<leader>e", ":Neotree<CR>", { desc = "nvimtree focus window" })
|
||||
|
||||
-- telescope
|
||||
map("n", "<leader>ff", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||
map("n", "<leader>gr", "<cmd>Telescope lsp_references<CR>", { desc = "telescope lsp references" })
|
||||
map("n", "<leader>ff", ":Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||
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" })
|
||||
|
@ -4,6 +4,8 @@ local g = vim.g
|
||||
|
||||
g.mapleader = " "
|
||||
|
||||
opt.tabstop = 4
|
||||
|
||||
o.laststatus = 3
|
||||
o.showmode = false
|
||||
|
||||
|
@ -12,6 +12,11 @@ return {
|
||||
opts = {
|
||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||
animation = true,
|
||||
gitsigns = {
|
||||
added = { enabled = true, icon = "+" },
|
||||
changed = { enabled = true, icon = "~" },
|
||||
deleted = { enabled = true, icon = "-" },
|
||||
},
|
||||
insert_at_start = true,
|
||||
auto_hide = true,
|
||||
sidebar_filetypes = {
|
||||
|
@ -1,3 +1,5 @@
|
||||
local api = vim.api
|
||||
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
--opts = {},
|
||||
@ -8,7 +10,7 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ bufnr = args.buf })
|
||||
|
@ -1,16 +1,17 @@
|
||||
return {
|
||||
-- Main LSP Configuration
|
||||
'neovim/nvim-lspconfig',
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||
{
|
||||
'williamboman/mason.nvim', config = true,
|
||||
"williamboman/mason.nvim",
|
||||
config = true,
|
||||
}, -- NOTE: Must be loaded before dependants
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
--'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
--{ 'j-hui/fidget.nvim', opts = {} },
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
|
||||
config = function()
|
||||
@ -21,7 +22,7 @@ return {
|
||||
gopls = {},
|
||||
}
|
||||
|
||||
require('mason').setup()
|
||||
require("mason").setup()
|
||||
|
||||
--local ensure_installed = vim.tbl_keys(servers or {})
|
||||
--vim.list_extend(ensure_installed, {
|
||||
@ -30,21 +31,17 @@ return {
|
||||
|
||||
--require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local server = servers[server_name] or {}
|
||||
server.capabilities = capabilities
|
||||
-- server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require('lualine').setup()
|
||||
end
|
||||
require("lualine").setup()
|
||||
end,
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ return {
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ return {
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require("nvim-autopairs").setup(opts)
|
||||
--
|
||||
--
|
||||
-- setup cmp for autopairs
|
||||
-- local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
-- require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
@ -39,8 +39,8 @@ return {
|
||||
-- },
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
-- snippet = {
|
||||
local cmp = require("cmp")
|
||||
-- snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
-- expand = function(args)
|
||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
@ -57,15 +57,15 @@ return {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = "nvim_lsp" },
|
||||
}),
|
||||
})
|
||||
end
|
||||
end,
|
||||
--opts = function()
|
||||
-- return require "nvchad.configs.cmp"
|
||||
--end,
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
return {
|
||||
"navarasu/onedark.nvim",
|
||||
config = function()
|
||||
require('onedark').load()
|
||||
require("onedark").load()
|
||||
end,
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ return {
|
||||
opts = function()
|
||||
-- return require "nvchad.configs.telescope"
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user