diff --git a/hypr/autostart.conf b/hypr/autostart.conf index 92acffa..88b67b2 100755 --- a/hypr/autostart.conf +++ b/hypr/autostart.conf @@ -9,6 +9,7 @@ exec-once=[workspace 1 silent] steam exec-once= xembedsniproxy & # for wine system tray exec-once=solaar --window=hide exec-once=blueman-applet +exec-once=armcord & disown # exec-once=wallengine --screen-root HDMI-A-2 1383845959 # exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox diff --git a/nvim/after/plugin/cloak.lua b/nvim/_after/plugin/cloak.lua similarity index 97% rename from nvim/after/plugin/cloak.lua rename to nvim/_after/plugin/cloak.lua index 1eaf7d0..9a91293 100644 --- a/nvim/after/plugin/cloak.lua +++ b/nvim/_after/plugin/cloak.lua @@ -11,6 +11,7 @@ require("cloak").setup({ ".env*", "wrangler.toml", ".dev.vars", + "*.env*" }, -- Match an equals sign and any character after it. -- This can also be a table of patterns to cloak, diff --git a/nvim/after/plugin/comments.lua b/nvim/_after/plugin/comments.lua similarity index 100% rename from nvim/after/plugin/comments.lua rename to nvim/_after/plugin/comments.lua diff --git a/nvim/after/plugin/copilot.lua b/nvim/_after/plugin/copilot.lua similarity index 100% rename from nvim/after/plugin/copilot.lua rename to nvim/_after/plugin/copilot.lua diff --git a/nvim/after/plugin/dap.lua b/nvim/_after/plugin/dap.lua similarity index 100% rename from nvim/after/plugin/dap.lua rename to nvim/_after/plugin/dap.lua diff --git a/nvim/after/plugin/dashboard.lua b/nvim/_after/plugin/dashboard.lua similarity index 100% rename from nvim/after/plugin/dashboard.lua rename to nvim/_after/plugin/dashboard.lua diff --git a/nvim/after/plugin/fugitive.lua b/nvim/_after/plugin/fugitive.lua similarity index 100% rename from nvim/after/plugin/fugitive.lua rename to nvim/_after/plugin/fugitive.lua diff --git a/nvim/after/plugin/gitsigns.lua b/nvim/_after/plugin/gitsigns.lua similarity index 100% rename from nvim/after/plugin/gitsigns.lua rename to nvim/_after/plugin/gitsigns.lua diff --git a/nvim/after/plugin/harpoon.lua b/nvim/_after/plugin/harpoon.lua similarity index 100% rename from nvim/after/plugin/harpoon.lua rename to nvim/_after/plugin/harpoon.lua diff --git a/nvim/after/plugin/image.lua b/nvim/_after/plugin/image.lua similarity index 100% rename from nvim/after/plugin/image.lua rename to nvim/_after/plugin/image.lua diff --git a/nvim/after/plugin/indent.lua b/nvim/_after/plugin/indent.lua similarity index 100% rename from nvim/after/plugin/indent.lua rename to nvim/_after/plugin/indent.lua diff --git a/nvim/after/plugin/lightbulb.lua b/nvim/_after/plugin/lightbulb.lua similarity index 100% rename from nvim/after/plugin/lightbulb.lua rename to nvim/_after/plugin/lightbulb.lua diff --git a/nvim/after/plugin/lsp.lua b/nvim/_after/plugin/lsp.lua similarity index 93% rename from nvim/after/plugin/lsp.lua rename to nvim/_after/plugin/lsp.lua index d39a7d3..fff9818 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/_after/plugin/lsp.lua @@ -9,12 +9,12 @@ local lsp = require("lsp-zero") --- use csharp_ls language server("https://github.com/razzmatazz/csharp-language-server") --- i'm using this instead of Mason because the version of it is old in Mason, --- the version here is maintained by dotnet tool and it's the latest --- lsp.configure('csharp_ls', { --- force_setup = true --- }) +lsp.configure('csharp_ls', { + handlers = { + ["textDocument/definition"] = require("csharpls_extended").handler, + ["textDocument/typeDefinition"] = require("csharpls_extended").handler + } +}) lsp.configure('clangd', { cmd = { 'clangd', '--offset-encoding=utf-16' }, diff --git a/nvim/after/plugin/lualine.lua b/nvim/_after/plugin/lualine.lua similarity index 100% rename from nvim/after/plugin/lualine.lua rename to nvim/_after/plugin/lualine.lua diff --git a/nvim/after/plugin/neotree.lua b/nvim/_after/plugin/neotree.lua similarity index 100% rename from nvim/after/plugin/neotree.lua rename to nvim/_after/plugin/neotree.lua diff --git a/nvim/after/plugin/noice.lua b/nvim/_after/plugin/noice.lua similarity index 100% rename from nvim/after/plugin/noice.lua rename to nvim/_after/plugin/noice.lua diff --git a/nvim/after/plugin/presence.lua b/nvim/_after/plugin/presence.lua similarity index 100% rename from nvim/after/plugin/presence.lua rename to nvim/_after/plugin/presence.lua diff --git a/nvim/after/plugin/refactoring.lua b/nvim/_after/plugin/refactoring.lua similarity index 100% rename from nvim/after/plugin/refactoring.lua rename to nvim/_after/plugin/refactoring.lua diff --git a/nvim/after/plugin/telescope.lua b/nvim/_after/plugin/telescope.lua similarity index 100% rename from nvim/after/plugin/telescope.lua rename to nvim/_after/plugin/telescope.lua diff --git a/nvim/after/plugin/theme.lua b/nvim/_after/plugin/theme.lua similarity index 100% rename from nvim/after/plugin/theme.lua rename to nvim/_after/plugin/theme.lua diff --git a/nvim/after/plugin/treesitter.lua b/nvim/_after/plugin/treesitter.lua similarity index 100% rename from nvim/after/plugin/treesitter.lua rename to nvim/_after/plugin/treesitter.lua diff --git a/nvim/after/plugin/trouble.lua b/nvim/_after/plugin/trouble.lua similarity index 100% rename from nvim/after/plugin/trouble.lua rename to nvim/_after/plugin/trouble.lua diff --git a/nvim/after/plugin/ufo.lua b/nvim/_after/plugin/ufo.lua similarity index 100% rename from nvim/after/plugin/ufo.lua rename to nvim/_after/plugin/ufo.lua diff --git a/nvim/after/plugin/undotree.lua b/nvim/_after/plugin/undotree.lua similarity index 100% rename from nvim/after/plugin/undotree.lua rename to nvim/_after/plugin/undotree.lua diff --git a/nvim/after/plugin/zenmode.lua b/nvim/_after/plugin/zenmode.lua similarity index 100% rename from nvim/after/plugin/zenmode.lua rename to nvim/_after/plugin/zenmode.lua diff --git a/nvim/after/plugin/bufferline.lua b/nvim/after/plugin/bufferline.lua deleted file mode 100644 index ff4ea5b..0000000 --- a/nvim/after/plugin/bufferline.lua +++ /dev/null @@ -1,43 +0,0 @@ --- local map = vim.api.nvim_set_keymap --- local opts = { noremap = true, silent = true } --- --- -- Move to previous/next --- map('n', '', 'BufferLineCycleNext', opts) --- map('n', '', 'BufferLineCyclePrev', opts) --- --- -- Re-order to previous/next --- map('n', '', 'BufferLineMovePrev', opts) --- map('n', '', 'BufferLineMoveNext', opts) --- -- Goto buffer in position... --- map('n', '1', 'BufferLineGoToBuffer 1', opts) --- map('n', '2', 'BufferLineGoToBuffer 2', opts) --- map('n', '3', 'BufferLineGoToBuffer 3', opts) --- map('n', '4', 'BufferLineGoToBuffer 4', opts) --- map('n', '5', 'BufferLineGoToBuffer 5', opts) --- map('n', '6', 'BufferLineGoToBuffer 6', opts) --- map('n', '7', 'BufferLineGoToBuffer 7', opts) --- map('n', '8', 'BufferLineGoToBuffer 8', opts) --- map('n', '9', 'BufferLineGoToBuffer 9', opts) --- map('n', '0', 'BufferLineGoToBuffer -1', opts) --- --- -- Pin/unpin buffer --- map('n', '', 'BufferLineTogglePin', opts) --- -- Close buffer --- map('n', '', 'BufferLinePickClose', opts) --- --- -- Close commands --- map('n', 'cll', 'BufferLineCloseLeft', opts) --- map('n', 'clr', 'BufferLineCloseRight', opts) --- --- require('bufferline').setup{ --- options = { --- offsets = { --- { --- filetype = "neo-tree", --- text = "Neo-tree", --- text_align = "left", --- highlight = "Directory", --- } --- }, --- } --- } diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..440660e --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,51 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "Ionide-vim": { "branch": "master", "commit": "8435bae84b26b602dbb68399661b3989915cc4d3" }, + "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, + "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, + "cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot.vim": { "branch": "release", "commit": "49e0348bfb913fae63ca5ddb987a8bccd193da86" }, + "csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" }, + "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, + "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, + "harpoon": { "branch": "harpoon2", "commit": "2cd4e03372f7ee5692c8caa220f479ea07970f17" }, + "image.nvim": { "branch": "master", "commit": "245422e5c4774f0640d41c0eadec77396f2be4a9" }, + "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, + "lazy.nvim": { "branch": "main", "commit": "747bb955c5bfb2dc5d51280132f00a56a53f9f6d" }, + "leap.nvim": { "branch": "main", "commit": "0c2f6a27d0706fa86f2512bb0c470b68876e55fe" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "dec1c21204e2d9d49dad989b577c88958ed2c113" }, + "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" }, + "mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" }, + "neodev.nvim": { "branch": "main", "commit": "482abc6688a028ce183719b0350d0235ae2c2e83" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, + "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" }, + "nvim-dap-ui": { "branch": "master", "commit": "a6beb3a855b42faa1d0fee1081602257719c2c5e" }, + "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, + "nvim-lspconfig": { "branch": "master", "commit": "042aa6b27b8b8d4f4e1bd42de2037c83d676a8a0" }, + "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, + "nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" }, + "nvim-treesitter": { "branch": "master", "commit": "4a4dbe1cb1da34d87fc42a40aaf8e218af4cfe0f" }, + "nvim-treesitter-context": { "branch": "master", "commit": "85cf977181fb8e816e47ac05df7f756e9cb72caf" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" }, + "nvim-ufo": { "branch": "main", "commit": "b0741a647efd98d9abb6cb653e056d24a07e4581" }, + "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, + "onedarkpro.nvim": { "branch": "main", "commit": "44badbaa1c4408679adc6b6979b669540db3fb46" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "9cf58f438f95f04cf1709b734bbcb9243c262d70" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "vim-fugitive": { "branch": "master", "commit": "ec8f7eed103c6d5b75eac69196bb87db0825629a" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" } +} \ No newline at end of file diff --git a/nvim/lua/themystery/init.lua b/nvim/lua/themystery/init.lua index 0f158e1..d87e388 100644 --- a/nvim/lua/themystery/init.lua +++ b/nvim/lua/themystery/init.lua @@ -1,8 +1,9 @@ require("themystery.set") require("themystery.remap") - package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" +require("themystery.lazy") + local augroup = vim.api.nvim_create_augroup local TheMysteryGroup = augroup('TheMystery', {}) diff --git a/nvim/lua/themystery/lazy.lua b/nvim/lua/themystery/lazy.lua new file mode 100644 index 0000000..bc6f337 --- /dev/null +++ b/nvim/lua/themystery/lazy.lua @@ -0,0 +1,16 @@ +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("themystery.plugins"); + diff --git a/nvim/lua/themystery/packer.lua b/nvim/lua/themystery/packer.lua index bcf5d66..c2702dc 100644 --- a/nvim/lua/themystery/packer.lua +++ b/nvim/lua/themystery/packer.lua @@ -12,22 +12,10 @@ return require('packer').startup(function(use) requires = { { 'nvim-lua/plenary.nvim' } } } - -- use({ - -- 'rose-pine/neovim', - -- as = 'rose-pine', - -- config = function() - -- vim.cmd('colorscheme rose-pine') - -- end - -- }) - use 'numToStr/Comment.nvim' - -- use 'navarasu/onedark.nvim' use "olimorris/onedarkpro.nvim" - - -- use 'folke/tokyonight.nvim' - use({ "folke/trouble.nvim", config = function() @@ -78,12 +66,6 @@ return require('packer').startup(function(use) use("eandrju/cellular-automaton.nvim") use("laytan/cloak.nvim") - -- use { - -- 'nvim-tree/nvim-tree.lua', - -- requires = { - -- 'nvim-tree/nvim-web-devicons', -- optional - -- }, - -- } use { "nvim-neo-tree/neo-tree.nvim", @@ -114,11 +96,6 @@ return require('packer').startup(function(use) use 'andweeb/presence.nvim' - -- use {'romgrk/barbar.nvim', requires = { - -- 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status - -- 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons - -- } - -- } use { 'glepnir/dashboard-nvim', @@ -153,8 +130,6 @@ return require('packer').startup(function(use) end, }) - use { 'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons' } - use { 'kosayoda/nvim-lightbulb' } use "lukas-reineke/indent-blankline.nvim" @@ -188,4 +163,6 @@ return require('packer').startup(function(use) require('leap').create_default_mappings() end }) + + use {"Decodetalkers/csharpls-extended-lsp.nvim"} end) diff --git a/nvim/lua/themystery/plugins/barbecue.lua b/nvim/lua/themystery/plugins/barbecue.lua new file mode 100644 index 0000000..ef6e1fc --- /dev/null +++ b/nvim/lua/themystery/plugins/barbecue.lua @@ -0,0 +1,12 @@ +return { + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + opts = { + attach_navic = false + }, +} diff --git a/nvim/lua/themystery/plugins/cloak.lua b/nvim/lua/themystery/plugins/cloak.lua new file mode 100644 index 0000000..f2cf95b --- /dev/null +++ b/nvim/lua/themystery/plugins/cloak.lua @@ -0,0 +1,27 @@ +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", + "*.env*" + }, + -- 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/nvim/lua/themystery/plugins/comments.lua b/nvim/lua/themystery/plugins/comments.lua new file mode 100644 index 0000000..6cfebc0 --- /dev/null +++ b/nvim/lua/themystery/plugins/comments.lua @@ -0,0 +1,17 @@ +return { + "numToStr/Comment.nvim", + config = function() + require('Comment').setup({ + toggler = { + -- if you're using other terminals use '' but for some reason in kitty this didn't work, so i used '' + line = '', + block = '', + }, + opleader = { + -- look at the comment above + line = '', + block = '', + }, + }) + end +} diff --git a/nvim/lua/themystery/plugins/dap.lua b/nvim/lua/themystery/plugins/dap.lua new file mode 100644 index 0000000..1800e05 --- /dev/null +++ b/nvim/lua/themystery/plugins/dap.lua @@ -0,0 +1,22 @@ +return { + "rcarriga/nvim-dap-ui", + dependencies = { "mfussenegger/nvim-dap" }, + config = function() + -- dap keymaps + vim.keymap.set("n", "", "lua require'dap'.continue()") + vim.keymap.set("n", "", "lua require'dap'.step_over()") + vim.keymap.set("n", "", "lua require'dap'.step_into()") + vim.keymap.set("n", "", "lua require'dap'.step_out()") + vim.keymap.set("n", "b", "lua require'dap'.toggle_breakpoint()") + vim.keymap.set("n", "B", + "lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") + vim.keymap.set("n", "lp", + "lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") + vim.keymap.set("n", "dr", "lua require'dap'.repl.open()") + + require("dapui").setup() + + -- dapui keymaps + vim.keymap.set("n", "dui", "lua require'dapui'.toggle()") + end +} diff --git a/nvim/lua/themystery/plugins/fugitive.lua b/nvim/lua/themystery/plugins/fugitive.lua new file mode 100644 index 0000000..9cbfdd3 --- /dev/null +++ b/nvim/lua/themystery/plugins/fugitive.lua @@ -0,0 +1,34 @@ +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, + }) + end +} diff --git a/nvim/lua/themystery/plugins/harpoon.lua b/nvim/lua/themystery/plugins/harpoon.lua new file mode 100644 index 0000000..34aad9c --- /dev/null +++ b/nvim/lua/themystery/plugins/harpoon.lua @@ -0,0 +1,21 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():append() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + + vim.keymap.set("n", "hlc", function() harpoon:list():clear() end) + vim.keymap.set("n", "hc", function() harpoon:list():remove() end) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end) + end +} diff --git a/nvim/lua/themystery/plugins/image.lua b/nvim/lua/themystery/plugins/image.lua new file mode 100644 index 0000000..3768467 --- /dev/null +++ b/nvim/lua/themystery/plugins/image.lua @@ -0,0 +1,33 @@ +return { + "3rd/image.nvim", + config = function() + require("image").setup({ + 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 + }, + neorg = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "norg" }, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + window_overlap_clear_enabled = false, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, + editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus + tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened + }) + end +} diff --git a/nvim/lua/themystery/plugins/init.lua b/nvim/lua/themystery/plugins/init.lua new file mode 100644 index 0000000..b7a50e3 --- /dev/null +++ b/nvim/lua/themystery/plugins/init.lua @@ -0,0 +1,67 @@ +return { + "nvim-lua/plenary.nvim", + { + "github/copilot.vim", + config = function() + vim.g.copilot_no_tab_map = true + vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', { silent = true, expr = true }) + end + }, + { + "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" + }, + { + "mbbill/undotree", + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + end + }, + "lewis6991/gitsigns.nvim", + "windwp/nvim-ts-autotag", + "windwp/nvim-autopairs", + { + "kosayoda/nvim-lightbulb", + opts = { + autocmd = { enabled = true } + } + }, + { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }, + "mfussenegger/nvim-dap", + "folke/neodev.nvim", + { + "ionide/Ionide-vim", + event = "VimEnter" + }, + { + 'ggandor/leap.nvim', + dependencies = { 'tpope/vim-repeat' }, + config = function() + require('leap').create_default_mappings() + end + }, + "SmiteshP/nvim-navic", + "Decodetalkers/csharpls-extended-lsp.nvim", + { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + dependencies = { + -- LSP Support + 'neovim/nvim-lspconfig', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + + -- Autocompletion + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-nvim-lua', + + -- Snippets + 'L3MON4D3/LuaSnip', + 'rafamadriz/friendly-snippets', + } + } + +} diff --git a/nvim/lua/themystery/plugins/lualine.lua b/nvim/lua/themystery/plugins/lualine.lua new file mode 100644 index 0000000..90aabe6 --- /dev/null +++ b/nvim/lua/themystery/plugins/lualine.lua @@ -0,0 +1,220 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons', lazy = true }, + config = function() + local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + theme = 'onedark_vivid', + globalstatus = true + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = { + { + require("noice").api.status.command.get, + cond = require("noice").api.status.command.has, + color = { fg = "#ff9e64" }, + } + }, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x at right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + ins_left { + function() + return '▊' + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 0, right = 1 }, -- We don't need space before this + } + + ins_left { + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + ins_left { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, + } + + ins_left { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = 'bold' }, + } + + ins_left { 'location' } + + ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } + + ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + } + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + ins_left { + function() + return '%=' + end, + } + + ins_left { + -- Lsp server name . + function() + local msg = 'No Active Lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' LSP:', + color = { fg = '#ffffff', gui = 'bold' }, + } + + -- Add components to right sections + ins_right { + 'o:encoding', -- option component same as &encoding in viml + fmt = string.upper, -- I'm not sure why it's upper case either ;) + cond = conditions.hide_in_width, + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'fileformat', + fmt = string.upper, + icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, + } + + ins_right { + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + } + + ins_right { + function() + return '▊' + end, + color = { fg = colors.blue }, + padding = { left = 1 }, + } + + require('lualine').setup(config) + end +} diff --git a/nvim/lua/themystery/plugins/noice.lua b/nvim/lua/themystery/plugins/noice.lua new file mode 100644 index 0000000..f5b6b88 --- /dev/null +++ b/nvim/lua/themystery/plugins/noice.lua @@ -0,0 +1,44 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + routes = { + { + -- this is needed to filter out excessive lsp progress messages from Ionide(F#) + -- we just check if the message contains .fs extension and skip it + filter = { + event = "lsp", + kind = "progress", + find = ".*%.fs.*", + }, + opts = { skip = true }, + }, + }, + }) + + require("notify").setup({ + background_colour = "#000000", + }) + end +} diff --git a/nvim/lua/themystery/plugins/telescope.lua b/nvim/lua/themystery/plugins/telescope.lua new file mode 100644 index 0000000..8502487 --- /dev/null +++ b/nvim/lua/themystery/plugins/telescope.lua @@ -0,0 +1,61 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-ui-select.nvim" + }, + config = function() + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'pf', builtin.find_files, {}) + vim.keymap.set('n', '', builtin.git_files, {}) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + vim.keymap.set('n', 'pb', builtin.buffers, {}) + vim.keymap.set('n', 'vh', builtin.help_tags, {}) + + + local actions = require('telescope.actions') + + require('telescope').setup { + extensions = { + ["ui-select"] = { + require("telescope.themes").get_cursor {} + } + }, + defaults = { + mappings = { + i = { + [""] = actions.select_vertical, + }, + n = { + [""] = actions.select_vertical, + }, + }, + }, + pickers = { + find_files = { + theme = "dropdown" + }, + git_files = { + theme = "dropdown" + }, + grep_string = { + theme = "dropdown" + }, + buffers = { + theme = "dropdown", + mappings = { + n = { + [''] = actions.delete_buffer + }, + i = { + [''] = actions.delete_buffer + } + } + } + } + } + require("telescope").load_extension("ui-select") + end +} diff --git a/nvim/lua/themystery/plugins/theme.lua b/nvim/lua/themystery/plugins/theme.lua new file mode 100644 index 0000000..da82269 --- /dev/null +++ b/nvim/lua/themystery/plugins/theme.lua @@ -0,0 +1,12 @@ +return { + "olimorris/onedarkpro.nvim", + config = function() + require("onedarkpro").setup({ + options = { + transparency = true, + } + }) + + vim.cmd("colorscheme onedark_vivid") + end +} diff --git a/nvim/lua/themystery/plugins/tree.lua b/nvim/lua/themystery/plugins/tree.lua new file mode 100644 index 0000000..4facace --- /dev/null +++ b/nvim/lua/themystery/plugins/tree.lua @@ -0,0 +1,72 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config = function() + -- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/202#issuecomment-1428278234 + -- These two functions were taken from the issue above. So, Thanks! + + local delete = function(state) + local inputs = require("neo-tree.ui.inputs") + local path = state.tree:get_node().path + local msg = "Are you sure you want to trash " .. path + inputs.confirm(msg, function(confirmed) + if not confirmed then return end + + vim.fn.system { "trash", path } + require("neo-tree.sources.manager").refresh(state.name) + end) + end + + -- over write default 'delete_visual' command to 'trash' x n. + local delete_visual = function(state, selected_nodes) + local inputs = require("neo-tree.ui.inputs") + + -- get table items count + function GetTableLen(tbl) + local len = 0 + for n in pairs(tbl) do + len = len + 1 + end + return len + end + + local count = GetTableLen(selected_nodes) + local msg = "Are you sure you want to trash " .. count .. " files ?" + inputs.confirm(msg, function(confirmed) + if not confirmed then return end + for _, node in ipairs(selected_nodes) do + vim.fn.system { "trash", node.path } + end + require("neo-tree.sources.manager").refresh(state.name) + end) + end + + + + vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + require("neo-tree").setup({ + window = { + position = "float", + }, + filesystem = { + filtered_items = { + visible = true + }, + use_libuv_file_watcher = true, + commands = { + delete = delete, + delete_visual = delete_visual, + }, + hijack_netrw_behavior = "open_current" + }, + }) + vim.keymap.set("n", "tf", vim.cmd.Neotree) + vim.keymap.set("n", "tt", "Neotree reveal=true position=float toggle ") + end + +} diff --git a/nvim/lua/themystery/plugins/treesitter.lua b/nvim/lua/themystery/plugins/treesitter.lua new file mode 100644 index 0000000..05d2945 --- /dev/null +++ b/nvim/lua/themystery/plugins/treesitter.lua @@ -0,0 +1,34 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + config = function() + require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { "vimdoc", "javascript", "typescript", "c", "lua", "rust", "c_sharp" }, + + -- 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 = { + -- `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 = false, + }, + autotag = { + enable = true, + } + } + end + }, + "nvim-treesitter/nvim-treesitter-context" + +} diff --git a/nvim/lua/themystery/plugins/trouble.lua b/nvim/lua/themystery/plugins/trouble.lua new file mode 100644 index 0000000..2e224c5 --- /dev/null +++ b/nvim/lua/themystery/plugins/trouble.lua @@ -0,0 +1,9 @@ +return { + "folke/trouble.nvim", + config = function() + require("trouble").setup() + vim.keymap.set("n", "xq", "TroubleToggle", + { silent = true, noremap = true } + ) + end +} diff --git a/nvim/lua/themystery/plugins/ufo.lua b/nvim/lua/themystery/plugins/ufo.lua new file mode 100644 index 0000000..ad17817 --- /dev/null +++ b/nvim/lua/themystery/plugins/ufo.lua @@ -0,0 +1,19 @@ +return { + "kevinhwang91/nvim-ufo", + dependencies = { + "kevinhwang91/promise-async" + }, + config = function() + vim.o.foldcolumn = '1' -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + require('ufo').setup() + + vim.keymap.set('n', 'zR', require('ufo').openAllFolds) + vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) + vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds) + vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0) + end +}