added after folder

This commit is contained in:
test 2024-03-24 16:10:18 -04:00
parent 82fa562c79
commit 14ede51d13
9 changed files with 112 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
plugin/
plugin/*
plugin/packer_compiled.lua

6
after/plugin/colors.lua Normal file
View File

@ -0,0 +1,6 @@
function ColorMyPencils(color)
color = color or "rose-pine"
vim.cmd.colorscheme(color)
end
ColorMyPencils()

View File

@ -0,0 +1,2 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);

9
after/plugin/genai.lua Normal file
View File

@ -0,0 +1,9 @@
vim.keymap.set({ 'n', 'v' }, '<leader>]', ':Gen<CR>')
require('gen').setup({
model = "mistral",
host = "100.74.10.45",
init = function(options) end,
debug = false
})

12
after/plugin/harpoon.lua Normal file
View File

@ -0,0 +1,12 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>r", mark.add_file)
vim.keymap.set("n", "<leader>t", ui.toggle_quick_menu)
-- vim.keymap.set("n", "<leader>a", function() ui.nav_file(1) end)
-- vim.keymap.set("n", "<leader>s", function() ui.nav_file(2) end)
-- vim.keymap.set("n", "<leader>d", function() ui.nav_file(3) end)
-- vim.keymap.set("n", "<leader>f", function() ui.nav_file(4) end)
--

54
after/plugin/lsp.lua Normal file
View File

@ -0,0 +1,54 @@
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
-- to learn how to use mason.nvim with lsp-zero
-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {'tsserver', 'rust_analyzer'},
handlers = {
lsp_zero.default_setup,
lua_ls = function()
local lua_opts = lsp_zero.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts)
end,
}
})
local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
-- this is the function that loads the extra snippets to luasnip
-- from rafamadriz/friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load()
cmp.setup({
sources = {
{name = 'path'},
{name = 'nvim_lsp'},
{name = 'nvim_lua'},
{name = 'luasnip', keyword_length = 2},
{name = 'buffer', keyword_length = 3},
},
formatting = lsp_zero.cmp_format({details = false}),
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
}),
})

View File

@ -0,0 +1,7 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<leader>pg', builtin.git_files, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)

View File

@ -0,0 +1,21 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "python", "html", "bash", "javascript", "rust", "c", "lua", "vim", "vimdoc", "query"},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}

View File

@ -0,0 +1 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)