Add new config

This commit is contained in:
2024-12-29 11:20:41 -06:00
parent f5274dee16
commit c1fb781f6e
15 changed files with 671 additions and 175 deletions

View File

@ -4,7 +4,6 @@ require("gib_nvim.set")
require("gib_nvim.colors")
require("gib_nvim.cloak")
require("gib_nvim.fugitive")
--require("gib_nvim.harpoon")
require("gib_nvim.lsp")
require("gib_nvim.lualine")
require("gib_nvim.neotree")

View File

@ -12,122 +12,194 @@ end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{
'folke/tokyonight.nvim',
priority = 1000,
},
{
'folke/trouble.nvim', dependencies =
{ 'nvim-tree/nvim-web-devicons' }
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate'
},
{
'nvim-treesitter/playground'
},
{
'nvim-treesitter/nvim-treesitter-context'
},
--{
--'theprimeagen/harpoon'
--},
{
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
}
},
{
'mbbill/undotree'
},
{
'tpope/vim-fugitive'
},
{
'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'
},
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-path'},
{'hrsh7th/cmp-buffer'},
{'hrsh7th/cmp-nvim-lua'},
{'L3MON4D3/LuaSnip'},
{'saadparwaiz1/cmp_luasnip'},
{'rafamadriz/friendly-snippets'},
{
--'github/copilot.vim'
'supermaven-inc/supermaven-nvim',
{
'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{
'folke/tokyonight.nvim',
priority = 1000,
},
{
'folke/trouble.nvim', dependencies =
{ 'nvim-tree/nvim-web-devicons' }
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate'
},
{
'nvim-treesitter/playground'
},
{
'nvim-treesitter/nvim-treesitter-context'
},
{
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
}
},
{
'mbbill/undotree'
},
{
'tpope/vim-fugitive'
},
{
'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'
},
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-path'},
{'hrsh7th/cmp-buffer'},
{'hrsh7th/cmp-nvim-lua'},
{'L3MON4D3/LuaSnip'},
{'saadparwaiz1/cmp_luasnip'},
{'rafamadriz/friendly-snippets'},
{
'supermaven-inc/supermaven-nvim',
config = function()
require('supermaven-nvim').setup({
keymaps = {
accept_suggestion = '<Tab>',
clear_suggestion = '<C-]>',
accept_word = '<C-.>',
},
disable_inline_completion = false, -- for cmp
})
end,
},
{
'laytan/cloak.nvim'
},
{
'nvim-lualine/lualine.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
'folke/tokyonight.nvim',
}
},
{
'scrooloose/nerdcommenter'
},
{
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
'3rd/image.nvim',
{
's1n7ax/nvim-window-picker',
version = '2.*',
config = function()
require('supermaven-nvim').setup({
keymaps = {
accept_suggestion = '<Tab>',
clear_suggestion = '<C-]>',
accept_word = '<C-.>',
require 'window-picker'.setup({
filter_rules = {
include_current_win = false,
autoselect_one = true,
bo = {
filetype = { 'neo-tree', "neo-tree-popup", "notify" },
buftype = { 'terminal', "quickfix" },
},
},
disable_inline_completion = false, -- for cmp
condition = function()
return true
end,
})
end,
},
},
{
'laytan/cloak.nvim'
},
{
'nvim-lualine/lualine.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
'folke/tokyonight.nvim',
config = function()
require('neo-tree').setup({
close_if_last_window = true,
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
default_component_configs = {
container = {
enable_character_fade = true
},
indent = {
indent_size = 2,
padding = 1,
}
}
})
end,
},
{
'romgrk/barbar.nvim', dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
{
'scrooloose/nerdcommenter'
init = function() vim.g.barbar_auto_setup = false end,
opts = {
animation = true,
insert_at_start = true,
},
{
'nvim-neo-tree/neo-tree.nvim', branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
'3rd/image.nvim',
{
's1n7ax/nvim-window-picker', version = '2.*',
config = function()
require 'window-picker'.setup({
filter_rules = {
include_current_win = false,
autoselect_one = true,
bo = {
filetype = { 'neo-tree', "neo-tree-popup", "notify" },
buftype = { 'terminal', "quickfix" },
},
},
})
end,
},
version = '^1.0.0',
},
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true
},
{
'windwp/nvim-ts-autotag',
config = function ()
require('nvim-ts-autotag').setup()
end
},
{
'kawre/leetcode.nvim',
build = ':TSUpdate html',
dependencies = {
'nvim-telescope/telescope.nvim',
'nvim-lua/plenary.nvim',
'MunifTanjim/nui.nvim',
'nvim-treesitter/nvim-treesitter',
'rcarriga/nvim-notify',
'nvim-tree/nvim-web-devicons',
'3rd/image.nvim',
},
opts = {
arg = "lc",
lang = "typescript",
image_support = false,
},
},
{
"3rd/image.nvim",
event = "VeryLazy",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
opts = {
backend = "kitty",
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
},
{
'romgrk/barbar.nvim', dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
neorg = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "norg" },
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
animation = true,
insert_at_start = true,
},
version = '^1.0.0',
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
kitty_method = "normal",
},
},
})

View File

@ -1,6 +1,8 @@
local lsp_zero = require('lsp-zero')
local lsp = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
lsp.preset('recommended')
lsp.on_attach(function(client, bufnr)
local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
@ -15,35 +17,37 @@ lsp_zero.on_attach(function(client, bufnr)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
require('mason').setup({})
require('mason').setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
require('mason-lspconfig').setup({
ensure_installed = {
'bashls',
'clangd',
'cmake',
'cssls',
'cssmodules_ls',
'docker_compose_language_service',
'dockerls',
'eslint',
'graphql',
'intelephense',
'jsonls',
'kotlin_language_server',
'lua_ls',
'pyright',
'rust_analyzer',
'sqlls',
'svelte',
'tailwindcss',
'tsserver',
'yamlls',
'vimls',
},
handlers = {
lsp_zero.default_setup,
lsp.default_setup,
lua_ls = function()
local lua_opts = lsp_zero.nvim_lua_ls()
local lua_opts = lsp.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts)
end,
}
@ -53,6 +57,11 @@ local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sources = {
--{name = 'supermaven'},
{name = 'path'},
@ -61,7 +70,7 @@ cmp.setup({
{name = 'luasnip', keyword_length = 2},
{name = 'buffer', keyword_length = 3},
},
formatting = lsp_zero.cmp_format(),
formatting = lsp.cmp_format(),
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
@ -70,4 +79,4 @@ cmp.setup({
}),
})
lsp_zero.setup()
lsp.setup()

View File

@ -51,6 +51,9 @@ vim.keymap.set("n", "Q", "<nop>")
-- Format the current buffer using the language server protocol (LSP)
vim.keymap.set("n", "<leader>kf", vim.lsp.buf.format)
-- Toggle Supermaven with :SupermavenToggle
vim.keymap.set("n", "<leader>sm", ":SupermavenToggle<CR>")
-- Perform a search and replace operation using the word under the cursor
vim.keymap.set("n", "<leader>sr", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])

View File

@ -26,6 +26,6 @@ vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "90"
vim.opt.colorcolumn = "120"
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme tokyonight-moon]])