From f9827d20c3a2071d9db28a85e2654ef652149756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fernando=20Carri=C3=B3n?= Date: Thu, 10 Oct 2024 21:29:53 +0200 Subject: [PATCH] prime me up --- .../nvim/autoload/plug.vim | 0 .../nvim/autoload/plug.vim.old | 0 .../vim/.config => _backup}/nvim/bak.vimrc | 0 .../nvim/coc-settings.json | 0 .../.config => _backup}/nvim/colors/Czar.vim | 0 .../nvim/colors/inkpot.vim | 0 .../nvim/colors/srcery.vim | 0 .../nvim/colors/synthwave.vim | 0 .../nvim/colors/twilight.vim | 0 .../any/vim/.config => _backup}/nvim/init.vim | 0 .../nvim/spell/en.utf-8.add | 0 .../nvim/spell/en.utf-8.add.spl | Bin {home/any/vim/.config => _backup}/nvim/vimrc | 0 .../nvim/vimrc.d/todo-comments.lua | 0 .../nvim/vimrc.d/treesitter.lua | 0 .../nvim/vimrc.d/venv-selector.lua | 0 .../.config => _backup}/nvim/vimrc.d/zls.lua | 0 home/any/vim/.config/nvim/init.lua | 2 + .../nvim/lua/crthaze/_lazy_deact/airline.lua | 33 +++++ .../nvim/lua/crthaze/_lazy_deact/cloak.lua | 26 ++++ .../nvim/lua/crthaze/_lazy_deact/local.lua | 42 +++++++ .../nvim/lua/crthaze/_lazy_deact/neotest.lua | 30 +++++ .../nvim/lua/crthaze/_lazy_deact/trouble.lua | 23 ++++ .../lua/crthaze/_lazy_deact/vimbegood.lua | 12 ++ .../nvim/lua/crthaze/_lazy_deact/zenmode.lua | 37 ++++++ .../any/vim/.config/nvim/lua/crthaze/init.lua | 58 +++++++++ .../.config/nvim/lua/crthaze/lazy/colors.lua | 87 +++++++++++++ .../nvim/lua/crthaze/lazy/fugitive.lua | 38 ++++++ .../nvim/lua/crthaze/lazy/indentline.lua | 12 ++ .../.config/nvim/lua/crthaze/lazy/init.lua | 7 ++ .../vim/.config/nvim/lua/crthaze/lazy/lsp.lua | 115 ++++++++++++++++++ .../.config/nvim/lua/crthaze/lazy/lualine.lua | 48 ++++++++ .../nvim/lua/crthaze/lazy/nerdtree.lua | 54 ++++++++ .../nvim/lua/crthaze/lazy/snippets.lua | 30 +++++ .../nvim/lua/crthaze/lazy/telescope.lua | 30 +++++ .../nvim/lua/crthaze/lazy/toggleterm.lua | 8 ++ .../nvim/lua/crthaze/lazy/treesitter.lua | 46 +++++++ .../nvim/lua/crthaze/lazy/undotree.lua | 9 ++ .../.config/nvim/lua/crthaze/lazy_init.lua | 17 +++ .../vim/.config/nvim/lua/crthaze/remap.lua | 58 +++++++++ home/any/vim/.config/nvim/lua/crthaze/set.lua | 37 ++++++ home/any/vim/.vim | 1 - 42 files changed, 859 insertions(+), 1 deletion(-) rename {home/any/vim/.config => _backup}/nvim/autoload/plug.vim (100%) rename {home/any/vim/.config => _backup}/nvim/autoload/plug.vim.old (100%) rename {home/any/vim/.config => _backup}/nvim/bak.vimrc (100%) rename {home/any/vim/.config => _backup}/nvim/coc-settings.json (100%) rename {home/any/vim/.config => _backup}/nvim/colors/Czar.vim (100%) rename {home/any/vim/.config => _backup}/nvim/colors/inkpot.vim (100%) rename {home/any/vim/.config => _backup}/nvim/colors/srcery.vim (100%) rename {home/any/vim/.config => _backup}/nvim/colors/synthwave.vim (100%) rename {home/any/vim/.config => _backup}/nvim/colors/twilight.vim (100%) rename {home/any/vim/.config => _backup}/nvim/init.vim (100%) rename {home/any/vim/.config => _backup}/nvim/spell/en.utf-8.add (100%) rename {home/any/vim/.config => _backup}/nvim/spell/en.utf-8.add.spl (100%) rename {home/any/vim/.config => _backup}/nvim/vimrc (100%) rename {home/any/vim/.config => _backup}/nvim/vimrc.d/todo-comments.lua (100%) rename {home/any/vim/.config => _backup}/nvim/vimrc.d/treesitter.lua (100%) rename {home/any/vim/.config => _backup}/nvim/vimrc.d/venv-selector.lua (100%) rename {home/any/vim/.config => _backup}/nvim/vimrc.d/zls.lua (100%) create mode 100644 home/any/vim/.config/nvim/init.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/airline.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/cloak.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/local.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/neotest.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/trouble.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/vimbegood.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/zenmode.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/init.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/colors.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/fugitive.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/indentline.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/init.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/lsp.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/lualine.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/nerdtree.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/snippets.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/telescope.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/toggleterm.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/treesitter.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy/undotree.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/lazy_init.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/remap.lua create mode 100644 home/any/vim/.config/nvim/lua/crthaze/set.lua delete mode 120000 home/any/vim/.vim diff --git a/home/any/vim/.config/nvim/autoload/plug.vim b/_backup/nvim/autoload/plug.vim similarity index 100% rename from home/any/vim/.config/nvim/autoload/plug.vim rename to _backup/nvim/autoload/plug.vim diff --git a/home/any/vim/.config/nvim/autoload/plug.vim.old b/_backup/nvim/autoload/plug.vim.old similarity index 100% rename from home/any/vim/.config/nvim/autoload/plug.vim.old rename to _backup/nvim/autoload/plug.vim.old diff --git a/home/any/vim/.config/nvim/bak.vimrc b/_backup/nvim/bak.vimrc similarity index 100% rename from home/any/vim/.config/nvim/bak.vimrc rename to _backup/nvim/bak.vimrc diff --git a/home/any/vim/.config/nvim/coc-settings.json b/_backup/nvim/coc-settings.json similarity index 100% rename from home/any/vim/.config/nvim/coc-settings.json rename to _backup/nvim/coc-settings.json diff --git a/home/any/vim/.config/nvim/colors/Czar.vim b/_backup/nvim/colors/Czar.vim similarity index 100% rename from home/any/vim/.config/nvim/colors/Czar.vim rename to _backup/nvim/colors/Czar.vim diff --git a/home/any/vim/.config/nvim/colors/inkpot.vim b/_backup/nvim/colors/inkpot.vim similarity index 100% rename from home/any/vim/.config/nvim/colors/inkpot.vim rename to _backup/nvim/colors/inkpot.vim diff --git a/home/any/vim/.config/nvim/colors/srcery.vim b/_backup/nvim/colors/srcery.vim similarity index 100% rename from home/any/vim/.config/nvim/colors/srcery.vim rename to _backup/nvim/colors/srcery.vim diff --git a/home/any/vim/.config/nvim/colors/synthwave.vim b/_backup/nvim/colors/synthwave.vim similarity index 100% rename from home/any/vim/.config/nvim/colors/synthwave.vim rename to _backup/nvim/colors/synthwave.vim diff --git a/home/any/vim/.config/nvim/colors/twilight.vim b/_backup/nvim/colors/twilight.vim similarity index 100% rename from home/any/vim/.config/nvim/colors/twilight.vim rename to _backup/nvim/colors/twilight.vim diff --git a/home/any/vim/.config/nvim/init.vim b/_backup/nvim/init.vim similarity index 100% rename from home/any/vim/.config/nvim/init.vim rename to _backup/nvim/init.vim diff --git a/home/any/vim/.config/nvim/spell/en.utf-8.add b/_backup/nvim/spell/en.utf-8.add similarity index 100% rename from home/any/vim/.config/nvim/spell/en.utf-8.add rename to _backup/nvim/spell/en.utf-8.add diff --git a/home/any/vim/.config/nvim/spell/en.utf-8.add.spl b/_backup/nvim/spell/en.utf-8.add.spl similarity index 100% rename from home/any/vim/.config/nvim/spell/en.utf-8.add.spl rename to _backup/nvim/spell/en.utf-8.add.spl diff --git a/home/any/vim/.config/nvim/vimrc b/_backup/nvim/vimrc similarity index 100% rename from home/any/vim/.config/nvim/vimrc rename to _backup/nvim/vimrc diff --git a/home/any/vim/.config/nvim/vimrc.d/todo-comments.lua b/_backup/nvim/vimrc.d/todo-comments.lua similarity index 100% rename from home/any/vim/.config/nvim/vimrc.d/todo-comments.lua rename to _backup/nvim/vimrc.d/todo-comments.lua diff --git a/home/any/vim/.config/nvim/vimrc.d/treesitter.lua b/_backup/nvim/vimrc.d/treesitter.lua similarity index 100% rename from home/any/vim/.config/nvim/vimrc.d/treesitter.lua rename to _backup/nvim/vimrc.d/treesitter.lua diff --git a/home/any/vim/.config/nvim/vimrc.d/venv-selector.lua b/_backup/nvim/vimrc.d/venv-selector.lua similarity index 100% rename from home/any/vim/.config/nvim/vimrc.d/venv-selector.lua rename to _backup/nvim/vimrc.d/venv-selector.lua diff --git a/home/any/vim/.config/nvim/vimrc.d/zls.lua b/_backup/nvim/vimrc.d/zls.lua similarity index 100% rename from home/any/vim/.config/nvim/vimrc.d/zls.lua rename to _backup/nvim/vimrc.d/zls.lua diff --git a/home/any/vim/.config/nvim/init.lua b/home/any/vim/.config/nvim/init.lua new file mode 100644 index 0000000..a25b97c --- /dev/null +++ b/home/any/vim/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("crthaze") + diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/airline.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/airline.lua new file mode 100644 index 0000000..9175c8a --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/airline.lua @@ -0,0 +1,33 @@ +return { + { + "vim-airline/vim-airline", + dependencies = { + "vim-airline/vim-airline-themes", + }, + init = function() + vim.g.airline_theme = 'powerlineish' + vim.g.airline_powerline_fonts = 1 + vim.g["airline#extensions#branch#enabled"] = 1 + vim.g["airline#extensions#ale#enabled"] = 1 + vim.g["airline#extensions#tabline#enabled"] = 1 + vim.g["airline#extensions#tagbar#enabled"] = 1 + vim.g.airline_skip_empty_sections = 1 + + vim.g["airline#extensions#tabline#left_sep"] = '' + vim.g["airline#extensions#tabline#left_alt_sep"] = '' + + -- powerline symbols + vim.g.airline_left_sep = '' + vim.g.airline_left_alt_sep = '' + vim.g.airline_right_sep = '' + vim.g.airline_right_alt_sep = '' + -- vim.g.airline_symbols.branch = '' + vim.g.airline_symbols["branch"] = '' + vim.g.airline_symbols["readonly"] = '' + vim.g.airline_symbols["linenr"] = '' + vim.g.airline_symbols["notexists"] = ' 󱞄' + vim.g.airline_symbols["dirty"] = '󱞂' + vim.g.airline_symbols["crypt"] = '󰯄' + end + } +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/cloak.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/cloak.lua new file mode 100644 index 0000000..2dd083f --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/cloak.lua @@ -0,0 +1,26 @@ +return { + "laytan/cloak.nvim", + config = function() + require("cloak").setup({ + enabled = true, + cloak_character = "*", + -- The applied highlight group (colors) on the cloaking, see `:h highlight`. + highlight_group = "Comment", + patterns = { + { + -- Match any file starting with ".env". + -- This can be a table to match multiple file patterns. + file_pattern = { + ".env*", + "wrangler.toml", + ".dev.vars", + }, + -- Match an equals sign and any character after it. + -- This can also be a table of patterns to cloak, + -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. + cloak_pattern = "=.+" + }, + }, + }) + end +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/local.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/local.lua new file mode 100644 index 0000000..40ff9bd --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/local.lua @@ -0,0 +1,42 @@ + +local local_plugins = { + { + "harpoon", + dir = "~/personal/harpoon", + config = function() + local harpoon = require("harpoon") + + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "", function() harpoon:list():select(1) end) + vim.keymap.set("n", "", function() harpoon:list():select(2) end) + vim.keymap.set("n", "", function() harpoon:list():select(3) end) + vim.keymap.set("n", "", function() harpoon:list():select(4) end) + vim.keymap.set("n", "", function() harpoon:list():replace_at(1) end) + vim.keymap.set("n", "", function() harpoon:list():replace_at(2) end) + vim.keymap.set("n", "", function() harpoon:list():replace_at(3) end) + vim.keymap.set("n", "", function() harpoon:list():replace_at(4) end) + end + }, + { + "vim-apm", dir = "~/personal/vim-apm", + config = function() + --[[ + local apm = require("vim-apm") + + apm:setup({}) + vim.keymap.set("n", "apm", function() apm:toggle_monitor() end) + --]] + end + }, + { + "vim-with-me", dir = "~/personal/vim-with-me", + config = function() end + }, +} + +return local_plugins + diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/neotest.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/neotest.lua new file mode 100644 index 0000000..7557c0c --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/neotest.lua @@ -0,0 +1,30 @@ +return { + { + "nvim-neotest/neotest", + dependencies = { + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "marilari88/neotest-vitest", + "nvim-neotest/neotest-plenary", + }, + config = function() + local neotest = require("neotest") + neotest.setup({ + adapters = { + require("neotest-vitest"), + require("neotest-plenary").setup({ + -- this is my standard location for minimal vim rc + -- in all my projects + min_init = "./scripts/tests/minimal.vim", + }), + } + }) + + vim.keymap.set("n", "tc", function() + neotest.run.run() + end) + end, + }, +} + diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/trouble.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/trouble.lua new file mode 100644 index 0000000..fa0e7f6 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/trouble.lua @@ -0,0 +1,23 @@ +return { + { + "folke/trouble.nvim", + config = function() + require("trouble").setup({ + icons = false, + }) + + vim.keymap.set("n", "tt", function() + require("trouble").toggle() + end) + + vim.keymap.set("n", "[t", function() + require("trouble").next({skip_groups = true, jump = true}); + end) + + vim.keymap.set("n", "]t", function() + require("trouble").previous({skip_groups = true, jump = true}); + end) + + end + }, +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/vimbegood.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/vimbegood.lua new file mode 100644 index 0000000..8338dd5 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/vimbegood.lua @@ -0,0 +1,12 @@ +return { + "theprimeagen/vim-be-good", + + dependencies = { + "nvim-lua/plenary.nvim" + }, + + config = function() + end +} + + diff --git a/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/zenmode.lua b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/zenmode.lua new file mode 100644 index 0000000..3b20707 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/_lazy_deact/zenmode.lua @@ -0,0 +1,37 @@ + +return { + "folke/zen-mode.nvim", + config = function() + vim.keymap.set("n", "zz", function() + require("zen-mode").setup { + window = { + width = 90, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = true + vim.wo.rnu = true + ColorMyPencils() + end) + + + vim.keymap.set("n", "zZ", function() + require("zen-mode").setup { + window = { + width = 80, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = false + vim.wo.rnu = false + vim.opt.colorcolumn = "0" + ColorMyPencils() + end) + end +} + + diff --git a/home/any/vim/.config/nvim/lua/crthaze/init.lua b/home/any/vim/.config/nvim/lua/crthaze/init.lua new file mode 100644 index 0000000..fd087a0 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/init.lua @@ -0,0 +1,58 @@ +require("crthaze.set") +require("crthaze.remap") +require("crthaze.lazy_init") + +local augroup = vim.api.nvim_create_augroup +local autocmd = vim.api.nvim_create_autocmd + +local CRThazeGroup = augroup('CRThaze', {}) + +-- local yank_group = augroup('HighlightYank', {}) + +function R(name) + require("plenary.reload").reload_module(name) +end + +vim.filetype.add({ + extension = { + templ = 'templ', + } +}) + +-- autocmd('TextYankPost', { +-- group = yank_group, +-- pattern = '*', +-- callback = function() +-- vim.highlight.on_yank({ +-- higroup = 'IncSearch', +-- timeout = 40, +-- }) +-- end, +-- }) + +-- autocmd({"BufWritePre"}, { +-- group = CRThazeGroup, +-- pattern = "*", +-- command = [[%s/\s\+$//e]], +-- }) + +autocmd('LspAttach', { + group = CRThazeGroup, + callback = function(e) + local opts = { buffer = e.buf } + 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", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() 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) + end +}) + +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/colors.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/colors.lua new file mode 100644 index 0000000..0e2f451 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/colors.lua @@ -0,0 +1,87 @@ +function ColorMyPencils(color) + color = color or "rose-pine-moon" + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +return { + + { + "erikbackman/brightburn.vim", + }, + + { + "folke/tokyonight.nvim", + lazy = false, + opts = {}, + config = function() + ColorMyPencils() + end + }, + { + "ellisonleao/gruvbox.nvim", + name = "gruvbox", + config = function() + require("gruvbox").setup({ + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = false, + bold = true, + italic = { + strings = false, + emphasis = false, + comments = false, + operators = false, + folds = false, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) + end, + }, + { + "folke/tokyonight.nvim", + config = function() + require("tokyonight").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = false }, + keywords = { italic = false }, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "dark", -- style for sidebars, see below + floats = "dark", -- style for floating windows + }, + }) + end + }, + + { + "rose-pine/neovim", + name = "rose-pine", + config = function() + require('rose-pine').setup({ + disable_background = true, + styles = { + italic = false, + }, + }) + end + }, +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/fugitive.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/fugitive.lua new file mode 100644 index 0000000..85045eb --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/fugitive.lua @@ -0,0 +1,38 @@ +return { + "tpope/vim-fugitive", + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git) + + local ThePrimeagen_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {}) + + local autocmd = vim.api.nvim_create_autocmd + autocmd("BufWinEnter", { + group = ThePrimeagen_Fugitive, + pattern = "*", + callback = function() + if vim.bo.ft ~= "fugitive" then + return + end + + local bufnr = vim.api.nvim_get_current_buf() + local opts = {buffer = bufnr, remap = false} + vim.keymap.set("n", "p", function() + vim.cmd.Git('push') + end, opts) + + -- rebase always + vim.keymap.set("n", "P", function() + vim.cmd.Git({'pull', '--rebase'}) + end, opts) + + -- NOTE: It allows me to easily set the branch i am pushing and any tracking + -- needed if i did not set the branch up correctly + vim.keymap.set("n", "t", ":Git push -u origin ", opts); + end, + }) + + + vim.keymap.set("n", "gu", "diffget //2") + vim.keymap.set("n", "gh", "diffget //3") + end +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/indentline.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/indentline.lua new file mode 100644 index 0000000..4c2b75e --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/indentline.lua @@ -0,0 +1,12 @@ +return { + { + "Yggdroot/indentLine", + init = function() + vim.g.indentLine_enabled = 1 + vim.g.indentLine_concealcursor = '' + vim.g.indentLine_char = '┆' + vim.g.indentLine_faster = 1 + vim.g.indentLine_concealcursor = 'nc' + end + } +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/init.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/init.lua new file mode 100644 index 0000000..bc15d18 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/init.lua @@ -0,0 +1,7 @@ +return { + "nvim-lua/plenary.nvim", + "eandrju/cellular-automaton.nvim", + "tpope/vim-commentary", + "folke/todo-comments.nvim", + "psliwka/vim-smoothie", +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/lsp.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/lsp.lua new file mode 100644 index 0000000..7323ae6 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/lsp.lua @@ -0,0 +1,115 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "j-hui/fidget.nvim", + }, + + config = function() + local cmp = require('cmp') + local cmp_lsp = require("cmp_nvim_lsp") + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities()) + + require("fidget").setup({}) + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "rust_analyzer", + "gopls", + "cobol_ls", + "fortls", + "helm_ls", + "htmx", + "pylsp", + "solargraph", + "gitlab_ci_ls", + "zls", + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities + } + end, + + zls = function() + local lspconfig = require("lspconfig") + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + + end, + ["lua_ls"] = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup { + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "Lua 5.1" }, + diagnostics = { + globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, + } + } + } + } + end, + } + }) + + local cmp_select = { behavior = cmp.SelectBehavior.Select } + + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + }) + }) + + vim.diagnostic.config({ + -- update_in_insert = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + }) + end +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/lualine.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/lualine.lua new file mode 100644 index 0000000..e98de5a --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/lualine.lua @@ -0,0 +1,48 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + init = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'powerline', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end + } +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/nerdtree.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/nerdtree.lua new file mode 100644 index 0000000..6a67d9d --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/nerdtree.lua @@ -0,0 +1,54 @@ +return { + { + "scrooloose/nerdtree", + init = function() + vim.g.NERDTreeChDirMode = 2 + --vim.g.NERDTreeIgnore = {"node_modules", ".rbc$", "~$", ".pyc$", ".db$", ".sqlite$", "__pycache__"} + --vim.g.NERDTreeSortOrder = {"^__.py$", "/$", "*", ".swp$", ".bak$", "~$"} + vim.g.NERDTreeShowBookmarks = 1 + vim.g.NERDTreeMapOpenInTabSilent = '' + vim.g.NERDTreeWinSize = 50 + -- Open NERDTree on the right side of the window. + vim.g.NERDTreeWinPos = "right" + + vim.opt.wildignore:append("*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/") + + vim.keymap.set("n", "", "NERDTreeFind") + vim.keymap.set("n", "n", "NERDTreeFocus") + vim.keymap.set("n", "e", "NERDTreeToggle") + vim.keymap.set("n", "o", "NERDTreeFind") + + + -- Start NERDTree when Vim starts with a directory argument. + vim.api.nvim_create_autocmd( + "StdinReadPre", + { + pattern = {"*"}, + callback = function() + vim.s.std_in = 1 + end + } + ) + -- vim.api.nvim_create_autocmd( + -- "VimEnter", + -- { + -- pattern = {"*"}, + -- callback = function() + -- if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') + -- execute 'NERDTree' argv()[0] + -- wincmd p + -- enew + -- execute 'cd '.argv()[0] + -- end + -- end + -- } + --) + end + }, + { + "jistr/vim-nerdtree-tabs", + init = function() + vim.g.nerdtree_tabs_focus_on_files = 1 + end + } +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/snippets.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/snippets.lua new file mode 100644 index 0000000..d416029 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/snippets.lua @@ -0,0 +1,30 @@ + +return { + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + + dependencies = { "rafamadriz/friendly-snippets" }, + + config = function() + local ls = require("luasnip") + ls.filetype_extend("javascript", { "jsdoc" }) + + --- TODO: What is expand? + vim.keymap.set({"i"}, "e", function() ls.expand() end, {silent = true}) + + vim.keymap.set({"i", "s"}, ";", function() ls.jump(1) end, {silent = true}) + vim.keymap.set({"i", "s"}, ",", function() ls.jump(-1) end, {silent = true}) + + vim.keymap.set({"i", "s"}, "", function() + if ls.choice_active() then + ls.change_choice(1) + end + end, {silent = true}) + end, + } +} + diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/telescope.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/telescope.lua new file mode 100644 index 0000000..185e353 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/telescope.lua @@ -0,0 +1,30 @@ +return { + "nvim-telescope/telescope.nvim", + + tag = "0.1.5", + + dependencies = { + "nvim-lua/plenary.nvim" + }, + + config = function() + require('telescope').setup({}) + + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'pf', builtin.find_files, {}) + vim.keymap.set('n', '', builtin.git_files, {}) + vim.keymap.set('n', 'pws', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'pWs', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + vim.keymap.set('n', 'vh', builtin.help_tags, {}) + end +} + diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/toggleterm.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/toggleterm.lua new file mode 100644 index 0000000..69a15c4 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/toggleterm.lua @@ -0,0 +1,8 @@ +return { + "akinsho/toggleterm.nvim", + tag = "v2.11.0", + init = function() + require("toggleterm").setup() + vim.keymap.set("n", "t", "ToggleTerm direction=float") + end +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/treesitter.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/treesitter.lua new file mode 100644 index 0000000..6b44244 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/treesitter.lua @@ -0,0 +1,46 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { + "vimdoc", "javascript", "typescript", "c", "lua", "rust", + "jsdoc", "bash", "python", "go", + }, + + -- 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, + + indent = { + enable = true + }, + + highlight = { + -- `false` will disable the whole extension + 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 = { "markdown" }, + }, + }) + + local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() + treesitter_parser_config.templ = { + install_info = { + url = "https://github.com/vrischmann/tree-sitter-templ.git", + files = {"src/parser.c", "src/scanner.c"}, + branch = "master", + }, + } + + vim.treesitter.language.register("templ", "templ") + end +} diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy/undotree.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy/undotree.lua new file mode 100644 index 0000000..f76ae05 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy/undotree.lua @@ -0,0 +1,9 @@ + +return { + "mbbill/undotree", + + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + end +} + diff --git a/home/any/vim/.config/nvim/lua/crthaze/lazy_init.lua b/home/any/vim/.config/nvim/lua/crthaze/lazy_init.lua new file mode 100644 index 0000000..aa1dc77 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/lazy_init.lua @@ -0,0 +1,17 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = "crthaze.lazy", + change_detection = { notify = false } +}) diff --git a/home/any/vim/.config/nvim/lua/crthaze/remap.lua b/home/any/vim/.config/nvim/lua/crthaze/remap.lua new file mode 100644 index 0000000..8626e62 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/remap.lua @@ -0,0 +1,58 @@ + +vim.g.mapleader = " " +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") +vim.keymap.set("n", "zig", "LspRestart") + +-- vim.keymap.set("n", "vwm", function() +-- require("vim-with-me").StartVimWithMe() +-- end) +-- vim.keymap.set("n", "svwm", function() +-- require("vim-with-me").StopVimWithMe() +-- end) + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({"n", "v"}, "d", [["_d]]) + +-- This is going to get me cancelled +-- vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") +-- vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +-- vim.keymap.set( +-- "n", +-- "ee", +-- "oif err != nil {}Oreturn err" +-- ) + +-- vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/crthaze/packer.lua"); +vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); + +vim.keymap.set("n", "", function() + vim.cmd("so") +end) + diff --git a/home/any/vim/.config/nvim/lua/crthaze/set.lua b/home/any/vim/.config/nvim/lua/crthaze/set.lua new file mode 100644 index 0000000..10e1815 --- /dev/null +++ b/home/any/vim/.config/nvim/lua/crthaze/set.lua @@ -0,0 +1,37 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = false + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = "/.var/tmp/vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80" + +vim.opt.backupdir = os.getenv("HOME") .. "/.var/tmp/vim/backup/" +vim.opt.directory = os.getenv("HOME") .. "/.var/tmp/vim/swap/" +vim.opt.undodir = os.getenv("HOME") .. "/.var/tmp/vim/undo/" +vim.opt.listchars = {tab = '⇥ ', trail = '▓'} +vim.opt.list = true diff --git a/home/any/vim/.vim b/home/any/vim/.vim deleted file mode 120000 index 20bb3c3..0000000 --- a/home/any/vim/.vim +++ /dev/null @@ -1 +0,0 @@ -../../../../.config/nvim \ No newline at end of file