added neovim config and basic README.md
This commit is contained in:
parent
d7a014909d
commit
56bca305b2
12 changed files with 312 additions and 1 deletions
45
lua/core/plugins/autocomplete.lua
Normal file
45
lua/core/plugins/autocomplete.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
-- Basically a completion plugin for neovim
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "L3MON4D3/LuaSnip",
|
||||
build = "make install_jsregexp"
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }
|
||||
}),
|
||||
formatting = {
|
||||
format = require("nvim-highlight-colors").format
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
}
|
||||
}
|
||||
11
lua/core/plugins/colorscheme.lua
Normal file
11
lua/core/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- loads colorscheme
|
||||
vim.cmd([[colorscheme kanagawa-dragon]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
lua/core/plugins/highlight.lua
Normal file
8
lua/core/plugins/highlight.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- For more information: https://github.com/brenoprata10/nvim-highlight-colors
|
||||
|
||||
return {
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
config = function ()
|
||||
require("nvim-highlight-colors").setup({})
|
||||
end
|
||||
}
|
||||
100
lua/core/plugins/lsp.lua
Normal file
100
lua/core/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
return {
|
||||
-- Java
|
||||
-- For checksums: https://github.com/mfussenegger/nvim-jdtls/discussions/249#discussioncomment-3159367
|
||||
-- It's here first because it needs to have load before lspconfig apparently
|
||||
{
|
||||
"nvim-java/nvim-java",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
config = function()
|
||||
require("java").setup()
|
||||
require("lspconfig").jdtls.setup({})
|
||||
end
|
||||
},
|
||||
--
|
||||
|
||||
-- https://github.com/williamboman/mason.nvim?tab=readme-ov-file#configuration for more information
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim?tab=readme-ov-file#setup for more info
|
||||
{ "williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig", -- https://github.com/neovim/nvim-lspconfig for more information
|
||||
},
|
||||
opts = function()
|
||||
require("mason").setup({
|
||||
registries = {
|
||||
"github:nvim-java/mason-registry",
|
||||
"github:mason-org/mason-registry"
|
||||
}
|
||||
})
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"pylsp",
|
||||
"clangd",
|
||||
"bashls",
|
||||
"ts_ls",
|
||||
"eslint",
|
||||
"cssls",
|
||||
"html",
|
||||
}
|
||||
})
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- LSP Servers
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- FOR bashls
|
||||
-- Make sure to install 'shellcheck', :MasonInstall shellcheck
|
||||
-- Make sure to install 'shfmt', :MasonInstall shfmt
|
||||
|
||||
lspconfig.bashls.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
lspconfig.pylsp.setup {}
|
||||
|
||||
lspconfig.clangd.setup{
|
||||
cmd = { "clangd", "--background-index", "--clang-tidy", "--log=verbose", "--query-driver=/usr/bin/c++", "--suggest-missing-includes", "--all-scopes-completion", "--completion-style=detailed" },
|
||||
init_options = {
|
||||
fallback_flags = { "-std=c++17" },
|
||||
},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.eslint.setup {
|
||||
capabilities = capabilities
|
||||
|
||||
}
|
||||
|
||||
lspconfig.html.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
|
||||
lspconfig.cssls.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
-- Javascript and/or Typescript
|
||||
{
|
||||
"typescript-language-server/typescript-language-server"
|
||||
}
|
||||
}
|
||||
12
lua/core/plugins/nvim-tree.lua
Normal file
12
lua/core/plugins/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- https://github.com/nvim-tree/nvim-tree.lua?tab=readme-ov-file -- For more information
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup {}
|
||||
end,
|
||||
}
|
||||
14
lua/core/plugins/telescope.lua
Normal file
14
lua/core/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- For more information on the arguements, visit: https://www.lazyvim.org/extras/editor/telescope#telescopenvim OR for more information on telescope, visit: https://github.com/nvim-telescope/telescope.nvim
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
cmd = "Telescope",
|
||||
keys = {
|
||||
{ "<leader>//", "<cmd>Telescope<cr>", desc = "Start" },
|
||||
|
||||
{ "<leader>pp", "<cmd>Telescope find_files<cr>", desc = "File Picker" },
|
||||
{ "<leader>;;", "<cmd>Telescope buffers<cr>", desc = "Buffer Picker" },
|
||||
{ "<leader>..", "<cmd>Telescope treesitter<cr>", desc = "Treesitter" },
|
||||
{ "<leader>[[", "<cmd>Telescop live_grep<cr>", desc = "Grep" }
|
||||
}
|
||||
}
|
||||
27
lua/core/plugins/tree-sitter.lua
Normal file
27
lua/core/plugins/tree-sitter.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
-- https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#language-parsers for language parsers
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup({
|
||||
ensure_installed = { "lua", "cpp", "java", "javascript", "bash", "python", "typescript", "css", "html", "jsdoc" },
|
||||
sync_install = true,
|
||||
auto_intsall = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
},
|
||||
ident = { enable = true },
|
||||
autopairs = {
|
||||
enable = true
|
||||
}
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>mm", "<cmd>NvimTreeToggle<cr>", desc = "Toggle Tree"}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue