From 827193de75ecd7dd8da83272aafd036e12d9a573 Mon Sep 17 00:00:00 2001 From: Aotrix Date: Sun, 23 Feb 2025 03:27:58 +0100 Subject: refactored config --- lua/aotrix/plugins/duskfox.lua | 12 +++++++++ lua/aotrix/plugins/harpoon.lua | 12 +++++++++ lua/aotrix/plugins/lsp.lua | 6 +++++ lua/aotrix/plugins/nvim_dap.lua | 51 ++++++++++++++++++++++++++++++++++++++ lua/aotrix/plugins/statusline.lua | 40 ++++++++++++++++++++++++++++++ lua/aotrix/plugins/telescope.lua | 41 ++++++++++++++++++++++++++++++ lua/aotrix/plugins/transparent.lua | 16 ++++++++++++ lua/aotrix/plugins/treesitter.lua | 47 +++++++++++++++++++++++++++++++++++ 8 files changed, 225 insertions(+) create mode 100644 lua/aotrix/plugins/duskfox.lua create mode 100644 lua/aotrix/plugins/harpoon.lua create mode 100644 lua/aotrix/plugins/lsp.lua create mode 100644 lua/aotrix/plugins/nvim_dap.lua create mode 100644 lua/aotrix/plugins/statusline.lua create mode 100644 lua/aotrix/plugins/telescope.lua create mode 100644 lua/aotrix/plugins/transparent.lua create mode 100644 lua/aotrix/plugins/treesitter.lua (limited to 'lua/aotrix/plugins') diff --git a/lua/aotrix/plugins/duskfox.lua b/lua/aotrix/plugins/duskfox.lua new file mode 100644 index 0000000..ac59521 --- /dev/null +++ b/lua/aotrix/plugins/duskfox.lua @@ -0,0 +1,12 @@ +return { + "EdenEast/nightfox.nvim", + config = function() + local colorscheme = "duskfox" + local ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) + vim.o.background = "dark" -- or "light" for light mode + if not ok then + vim.notify("colorscheme " .. colorscheme .. " not found!") + return + end + end +} diff --git a/lua/aotrix/plugins/harpoon.lua b/lua/aotrix/plugins/harpoon.lua new file mode 100644 index 0000000..c016b32 --- /dev/null +++ b/lua/aotrix/plugins/harpoon.lua @@ -0,0 +1,12 @@ +return { + 'ThePrimeagen/harpoon', + dependencies = {'nvim-lua/plenary.nvim'}, + config = function() + vim.keymap.set("n", "a", function() require("harpoon.mark").add_file() end) + vim.keymap.set("n", "hv", function() require("harpoon.ui").toggle_quick_menu() end) + vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(1) end) + vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(2) end) + vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(3) end) + vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(4) end) + end +} diff --git a/lua/aotrix/plugins/lsp.lua b/lua/aotrix/plugins/lsp.lua new file mode 100644 index 0000000..625618f --- /dev/null +++ b/lua/aotrix/plugins/lsp.lua @@ -0,0 +1,6 @@ +return { + "neovim/nvim-lspconfig", + config = function() + require('lspconfig').clangd.setup({}) + end, +} diff --git a/lua/aotrix/plugins/nvim_dap.lua b/lua/aotrix/plugins/nvim_dap.lua new file mode 100644 index 0000000..19ab17e --- /dev/null +++ b/lua/aotrix/plugins/nvim_dap.lua @@ -0,0 +1,51 @@ +return { + 'mfussenegger/nvim-dap', + dependencies = { + 'rcarriga/nvim-dap-ui', + 'theHamsta/nvim-dap-virtual-text', + 'nvim-neotest/nvim-nio', + 'williamboman/mason.nvim', + }, + + config = function() + local dap = require("dap") + local ui = require("dapui") + + require("dapui").setup() + require("nvim-dap-virtual-text").setup() + require("mason").setup() + + dap.adapters.codelldb = { + type = "executable", + command = "codelldb", -- or if not in $PATH: "/absolute/path/to/codelldb" + } + + dap.configurations.cpp = { + { + name = "Launch file", + type = "codelldb", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + }, + } + + dap.listeners.before.attach.dapui_config = function() + ui.open() + end + dap.listeners.before.launch.dapui_config = function() + ui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + ui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + ui.close() + end + + end, +} + diff --git a/lua/aotrix/plugins/statusline.lua b/lua/aotrix/plugins/statusline.lua new file mode 100644 index 0000000..3563a98 --- /dev/null +++ b/lua/aotrix/plugins/statusline.lua @@ -0,0 +1,40 @@ +return { + 'nvim-lualine/lualine.nvim', + config = function() + require('lualine').setup({ + options = { + icons_enabled = false, + theme = 'material', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + }, + 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/lua/aotrix/plugins/telescope.lua b/lua/aotrix/plugins/telescope.lua new file mode 100644 index 0000000..780fde5 --- /dev/null +++ b/lua/aotrix/plugins/telescope.lua @@ -0,0 +1,41 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.5', + -- or , branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-live-grep-args.nvim', + 'nvim-telescope/telescope-file-browser.nvim', + {'nvim-telescope/telescope-fzf-native.nvim', build = 'make'}, + }, + + config = function() + require('telescope').load_extension('fzf') + local actions = require("telescope.actions") + require("telescope").setup({ + defaults = { + -- Default configuration for telescope goes here: + -- config_key = value, + mappings = { + i = { + -- map actions.which_key to (default: ) + -- actions.which_key shows the mappings for your picker, + -- e.g. git_{create, delete, ...}_branch for the git_branches picker + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + [""] = actions.preview_scrolling_down, + [""] = actions.preview_scrolling_up, + [""] = actions.close, + } + } + }, + extensions = { + fzf = {} + }, + }) + + vim.keymap.set("n", "pv", function() require("telescope").extensions.file_browser.file_browser() end) + vim.keymap.set("n", "pf", function() require("telescope.builtin").find_files() end) + + require('aotrix.multigrep').setup() + end +} diff --git a/lua/aotrix/plugins/transparent.lua b/lua/aotrix/plugins/transparent.lua new file mode 100644 index 0000000..f4e2e45 --- /dev/null +++ b/lua/aotrix/plugins/transparent.lua @@ -0,0 +1,16 @@ +return { + "xiyaowong/transparent.nvim", + config = function() + require("transparent").setup({ + extra_groups = { -- table/string: additional groups that should be cleared + -- In particular, when you set it to 'all', that means all available groups + -- "NormalFloat", + -- "FloatBorder", + -- "TelescopeBorder", + -- "TelescopeNormal", + -- "TelescopeSelection", + -- "TelescopeSelectionCaret" + }, + }) + end +} diff --git a/lua/aotrix/plugins/treesitter.lua b/lua/aotrix/plugins/treesitter.lua new file mode 100644 index 0000000..09dc61c --- /dev/null +++ b/lua/aotrix/plugins/treesitter.lua @@ -0,0 +1,47 @@ +return { + "nvim-treesitter/nvim-treesitter", + config = function() + require('nvim-treesitter.configs').setup({ + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "python"}, + + -- 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, + + -- List of parsers to ignore installing (or "all") + ignore_install = { "html" }, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + enable = true, + + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + -- disable = { "c", "rust" }, + disable = { "cpp" }, + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + -- disable = function(lang, buf) + -- local max_filesize = 100 * 1024 -- 100 KB + -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + -- if ok and stats and stats.size > max_filesize then + -- return true + -- end + -- end, + + -- 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, + }, + }) + end +} -- cgit v1.2.3