Initial commit
This commit is contained in:
commit
35aaf58a92
14 changed files with 314 additions and 0 deletions
3
lua/plugins/commentary.lua
Normal file
3
lua/plugins/commentary.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"tpope/vim-commentary"
|
||||
}
|
56
lua/plugins/completion.lua
Normal file
56
lua/plugins/completion.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
-- Highlights the first result always
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert"
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-o>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping(function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<S-Tab>"] = cmp.mapping(function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true })
|
||||
}),
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }
|
||||
}, {
|
||||
{ name = "buffer" }
|
||||
})
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip"
|
||||
}
|
||||
}
|
9
lua/plugins/fugitive.lua
Normal file
9
lua/plugins/fugitive.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
config = function ()
|
||||
vim.keymap.set("n", "<Leader>gs", vim.cmd.Git)
|
||||
vim.keymap.set("n", "gh", "<cmd>diffget //2<CR>")
|
||||
vim.keymap.set("n", "gl", "<cmd>diffget //3<CR>")
|
||||
end
|
||||
}
|
||||
|
47
lua/plugins/lsp-config.lua
Normal file
47
lua/plugins/lsp-config.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "tsserver", "eslint" }
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
|
||||
lspconfig.tsserver.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
|
||||
-- Runs :EslintFixAll when saving
|
||||
lspconfig.eslint.setup({
|
||||
on_attach = function(_, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "EslintFixAll",
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||
vim.keymap.set('n', '<Leader>f', vim.lsp.buf.format, {})
|
||||
vim.keymap.set('n', '<Leader>vca', vim.lsp.buf.code_action, {})
|
||||
end
|
||||
}
|
||||
}
|
12
lua/plugins/lualine.lua
Normal file
12
lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'tokyonight'
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
12
lua/plugins/neo-tree.lua
Normal file
12
lua/plugins/neo-tree.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<Leader>nn", ":Neotree<CR>", {})
|
||||
end
|
||||
}
|
3
lua/plugins/surround.lua
Normal file
3
lua/plugins/surround.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"tpope/vim-surround"
|
||||
}
|
31
lua/plugins/telescope.lua
Normal file
31
lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.5',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<Leader>pp', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<Leader>pf', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<Leader>fh', builtin.help_tags, {})
|
||||
vim.keymap.set('n', '<Leader>ps', function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||
end)
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
}
|
||||
}
|
9
lua/plugins/tokyonight.lua
Normal file
9
lua/plugins/tokyonight.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
vim.cmd.colorscheme "tokyonight"
|
||||
end
|
||||
}
|
18
lua/plugins/treesitter.lua
Normal file
18
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local config = require("nvim-treesitter.configs")
|
||||
config.setup({
|
||||
ensure_installed = { "lua", "javascript", "typescript", "tsx" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true }
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context"
|
||||
}
|
||||
}
|
7
lua/plugins/trouble.lua
Normal file
7
lua/plugins/trouble.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
vim.keymap.set("n", "<Leader>tt", ":TroubleToggle<CR>", {})
|
||||
end
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue