This commit is contained in:
Bryan Ramos 2024-08-22 16:29:12 -04:00
parent 528964b3e7
commit af8389dab7
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
9 changed files with 153 additions and 88 deletions

View file

@ -19,3 +19,5 @@ vim.keymap.set('n', '<S-l>', ':bnext<CR>', { noremap = true, silent = true })
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
vim.keymap.set("n", "<Esc>", ':nohlsearch<Bar>let @/=""<CR>', { noremap = true, silent = true})

View file

@ -4,7 +4,7 @@ return {
config = function()
vim.cmd("colorscheme base16-onedark")
vim.cmd([[
hi Normal guibg=NONE ctermbg=NONE
hi Normal guibg=NONE ctermbg=NONE guifg=#FFFFFF
hi NonText guibg=NONE ctermbg=NONE
hi LineNr guibg=NONE ctermbg=NONE
hi CursorLine guibg=NONE ctermbg=NONE

View file

@ -7,8 +7,7 @@ return {
--indent = { char = "⎸" },
indent = { char = "" },
scope = {
show_start = false,
show_end = false
enabled = false
},
})
end,

View file

@ -3,7 +3,7 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require('nvim-treesitter.configs').setup {
require('nvim-treesitter.configs').setup ({
ensure_installed = {
"lua",
"c",
@ -27,41 +27,34 @@ return {
},
auto_install = true,
sync_install = true,
}
end
},
{
"nvim-treesitter/nvim-treesitter-context",
config = function()
require("treesitter-context").setup({
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 3, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = false,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = "=",
zindex = 20, -- The Z-index of the context window
on_attach = nil, -- (fun(buf: integer): boolean) rurn false to disable attaching
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local lsp = require('lspconfig')
lsp.lua_ls.setup{}
require("which-key").add({
{ "<leader>cl", ":LspInfo<CR>", desc = "LSP Info" },
highlight = {
enable = true,
}
})
end
},
--{
-- "nvim-treesitter/nvim-treesitter-context",
-- dependencies = { "nvim-treesitter/nvim-treesitter" },
-- config = function()
-- require("treesitter-context").setup({
-- enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
-- max_lines = 3, -- How many lines the window should span. Values <= 0 mean no limit.
-- min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
-- line_numbers = false,
-- multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
-- trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
-- mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
-- -- Separator between context and content. Should be a single character string, like '-'.
-- -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
-- separator = "=",
-- zindex = 20, -- The Z-index of the context window
-- on_attach = nil, -- (fun(buf: integer): boolean) rurn false to disable attaching
-- })
-- end,
--},
{
"williamboman/mason.nvim",
config = function()
@ -71,43 +64,95 @@ return {
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim" },
config = function()
require("mason-lspconfig").setup{}
end
},
{
"hrsh7th/nvim-cmp",
dependencies = {
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
}
"hrsh7th/nvim-cmp",
dependencies = {
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp"
},
config = function()
local cmp = require("cmp")
cmp.setup({
enabled = function()
local context = require("cmp.config.context")
if vim.api.nvim_get_mode().mode == "c" then
return true
else
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment")
end
end,
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.abort(),
["<C-y>"] = cmp.mapping.confirm(),
["<CR>"] = cmp.mapping(function(fallback)
fallback()
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' }
}),
})
end
},
config = function()
local cmp = require("cmp")
cmp.setup({
enabled = function()
local context = require("cmp.config.context")
if vim.api.nvim_get_mode().mode == "c" then
return true
else
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment")
end
end,
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.abort(),
["<C-y>"] = cmp.mapping.confirm(),
["<CR>"] = cmp.mapping(function(fallback)
fallback()
end, { "i", "s" }),
}
})
end
{
"neovim/nvim-lspconfig",
config = function()
local lsp = require('lspconfig')
local navic = require('nvim-navic')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local servers = require('mason-lspconfig').get_installed_servers()
for _, server in ipairs(servers) do
lsp[server].setup {
capabilities = capabilities,
on_attach = function(client, bufnr)
if client.server_capabilities.documentSymbolProvider then
navic.attach(client,bufnr)
end
end,
}
end
lsp.lua_ls.setup{
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
}
}
}
}
require("which-key").add({
{ "<leader>cl", ":LspInfo<CR>", desc = "LSP Info" },
})
end
},
}

View file

@ -1,14 +1,18 @@
return {
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
dependencies = {
"nvim-tree/nvim-web-devicons",
"SmiteshP/nvim-navic"
},
config = function()
local navic = require('nvim-navic')
require("lualine").setup ({
options = {
icons_enabled = true,
theme = 'material',
component_separators = { left = '>', right = '|'},
section_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
@ -25,23 +29,32 @@ return {
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_c = {
{'filename'},
{ function() return require("nvim-navic").get_location() end, cond = function()
return require("nvim-navic").is_available()
end,
},
},
lualine_x = {'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
extensions = {
'lazy',
'neo-tree',
}
})
end
}

View file

@ -8,6 +8,7 @@ return {
},
config = function()
require("neo-tree").setup({
enable_diagnostics = false,
window = {
position = "left",
width = 20,
@ -19,7 +20,6 @@ return {
local function toggle_neotree()
local api = vim.api
local win = api.nvim_get_current_win()
local bufs = api.nvim_list_bufs()
for _, buf in ipairs(bufs) do
@ -37,14 +37,14 @@ return {
{ "<leader>e", toggle_neotree, desc = "File Explorer" }
})
vim.fn.sign_define("DiagnosticSignError",
{text = "", texthl = "DiagnosticSignError"})
vim.fn.sign_define("DiagnosticSignWarn",
{text = "", texthl = "DiagnosticSignWarn"})
vim.fn.sign_define("DiagnosticSignInfo",
{text = "", texthl = "DiagnosticSignInfo"})
vim.fn.sign_define("DiagnosticSignHint",
{text = "󰌵", texthl = "DiagnosticSignHint"})
--vim.fn.sign_define("DiagnosticSignError",
-- {text = " ", texthl = "DiagnosticSignError"})
--vim.fn.sign_define("DiagnosticSignWarn",
-- {text = " ", texthl = "DiagnosticSignWarn"})
--vim.fn.sign_define("DiagnosticSignInfo",
-- {text = " ", texthl = "DiagnosticSignInfo"})
--vim.fn.sign_define("DiagnosticSignHint",
-- {text = "󰌵", texthl = "DiagnosticSignHint"})
end,
},
}

View file

@ -34,10 +34,11 @@ return {
-- Code
{ "<leader>gd", ":Telescope lsp_definitions<CR>", desc = "Go to Definition" },
{ "<leader>gr", ":Telescope lsp_references", desc = "Goto References" },
{ "<leader>gi", ":Telescope lsp_implementations<CR>", desc = "Go to Implementations" },
{ "<leader>gt", ":Telescope lsp_type_definitions<CR>", desc = "Go to Type Definition" },
{ "<leader>cv", ":Telescope treesitter<CR>", desc = "List function names & variables" },
{ "<leader>cd", ":Telescope diagnostics<CR>", desc = "Code diagnostics" },
{ "<leader>cv", ":Telescope treesitter<CR>", desc = "Function Names & Variables" },
{ "<leader>cd", ":Telescope diagnostics<CR>", desc = "Code Diagnostics" },
-- Git
{ "<leader>Gt", ":Telescope git_branches<CR>", desc = "Git Branches" },

View file

@ -19,6 +19,9 @@ return {
{ "<leader>bd", ":bd<CR>", desc = "Delete Buffer" },
{ "<leader>bD", "execute 'close'<CR> | <cmd>execute 'bd!'", desc = "Delete Window & Buffer" },
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action" },
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename Variable" },
{ "<leader>G", group = "Git"},
{ "<leader>f", group = "Files"},
{ "<leader>c", group = "Code"},