From 827193de75ecd7dd8da83272aafd036e12d9a573 Mon Sep 17 00:00:00 2001 From: Aotrix Date: Sun, 23 Feb 2025 03:27:58 +0100 Subject: refactored config --- init.lua | 109 +++--------------------- lua/aotrix/multigrep.lua | 53 ++++++++++++ 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 +++++++++++ lua/aotrix/remap.lua | 40 +++++++++ lua/aotrix/set.lua | 35 ++++++++ lua/autocomplete/autocomplete.lua | 169 ------------------------------------- lua/harpoon/harpoon.lua | 0 lua/nvim_dap/nvim_dap.lua | 37 -------- lua/nvim_settings/lsp.lua | 3 - lua/nvim_settings/remap.lua | 51 ----------- lua/nvim_settings/set.lua | 37 -------- lua/statusline/statusline.lua | 40 --------- lua/telescope/multigrep.lua | 53 ------------ lua/telescope/telescope.lua | 31 ------- lua/theme/duskfox.lua | 1 - lua/theme/gruvbox.lua | 1 - lua/theme/kanagawa.lua | 1 - lua/theme/nightfox.lua | 1 - lua/theme/rose-pine.lua | 71 ---------------- lua/theme/seoul.lua | 1 - lua/transparent/transparent.lua | 11 --- lua/treesitter/treesitter.lua | 41 --------- 29 files changed, 363 insertions(+), 648 deletions(-) create mode 100644 lua/aotrix/multigrep.lua 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 create mode 100644 lua/aotrix/remap.lua create mode 100644 lua/aotrix/set.lua delete mode 100644 lua/autocomplete/autocomplete.lua delete mode 100644 lua/harpoon/harpoon.lua delete mode 100644 lua/nvim_dap/nvim_dap.lua delete mode 100644 lua/nvim_settings/lsp.lua delete mode 100644 lua/nvim_settings/remap.lua delete mode 100644 lua/nvim_settings/set.lua delete mode 100644 lua/statusline/statusline.lua delete mode 100644 lua/telescope/multigrep.lua delete mode 100644 lua/telescope/telescope.lua delete mode 100644 lua/theme/duskfox.lua delete mode 100644 lua/theme/gruvbox.lua delete mode 100644 lua/theme/kanagawa.lua delete mode 100644 lua/theme/nightfox.lua delete mode 100644 lua/theme/rose-pine.lua delete mode 100644 lua/theme/seoul.lua delete mode 100644 lua/transparent/transparent.lua delete mode 100644 lua/treesitter/treesitter.lua diff --git a/init.lua b/init.lua index d8620af..8374af9 100644 --- a/init.lua +++ b/init.lua @@ -1,105 +1,16 @@ -- Use of lazy 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, - }) + 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) --- lazy setup -require('lazy').setup({ - -- Loading theme - { - "EdenEast/nightfox.nvim", - config = function() - require('theme/duskfox') - end, - }, - - -- LSP - { - -- Autocompletion - {'neoclide/coc.nvim' , - config = function() - require('autocomplete/autocomplete') - end , - branch="release" - }, - - -- Snippets - 'L3MON4D3/LuaSnip' , -- Required - 'rafamadriz/friendly-snippets' , -- Optional -}, - -{ - "xiyaowong/transparent.nvim", - config = function() - require('transparent/transparent') - end -}, - -{ - "nvim-treesitter/nvim-treesitter", - config = function() - require('treesitter/treesitter') - end -}, - -{ - 'nvim-lualine/lualine.nvim', - -- dependencies = {'nvim-tree/nvim-web-devicons'}, - config = function() - require('statusline/statusline') - end -}, - --- Telescope -{ - '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', - 'fannheyward/telescope-coc.nvim', - 'nvim-telescope/telescope-file-browser.nvim', - {'nvim-telescope/telescope-fzf-native.nvim', build = 'make'} - }, - config = function() - require('telescope/telescope') - end -}, - -{ - 'ThePrimeagen/harpoon', - dependencies = {'nvim-lua/plenary.nvim'}, - config = function() - require('harpoon/harpoon') - end -}, - -{ - 'mfussenegger/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', - 'theHamsta/nvim-dap-virtual-text', - 'nvim-neotest/nvim-nio', - 'williamboman/mason.nvim', - }, - config = function() - require('nvim_dap/nvim_dap') - end -}, - -}) - --- nvim settings -require('nvim_settings/set') -require('nvim_settings/remap') -require('nvim_settings/lsp') - --- Custom grep from TJ -require('telescope/multigrep').setup() +require('aotrix.set') +require('aotrix.remap') +require('lazy').setup('aotrix.plugins') diff --git a/lua/aotrix/multigrep.lua b/lua/aotrix/multigrep.lua new file mode 100644 index 0000000..749102e --- /dev/null +++ b/lua/aotrix/multigrep.lua @@ -0,0 +1,53 @@ +local pickers = require "telescope.pickers" +local finders = require "telescope.finders" +local make_entry = require "telescope.make_entry" +local conf = require "telescope.config".values + +local M = {} + +local live_multigrep = function(opts) + opts = opts or {} + opts.cwd = opts.cwd or vim.uv.cwd() + + local finder = finders.new_async_job { + command_generator = function(prompt) + if not prompt or prompt == "" then + return nil + end + + local pieces = vim.split(prompt, " ") + local args = { "rg" } + if pieces[1] then + table.insert(args, "-e") + table.insert(args, pieces[1]) + end + + if pieces[2] then + table.insert(args, "-g") + table.insert(args, pieces[2]) + end + + ---@diagnostic disable-next-line: deprecated + return vim.tbl_flatten { + args, + { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }, + } + end, + entry_maker = make_entry.gen_from_vimgrep(opts), + cwd = opts.cwd, + } + + pickers.new(opts, { + debounce = 100, + prompt_title = "Multi Grep", + finder = finder, + previewer = conf.grep_previewer(opts), + sorter = require("telescope.sorters").empty(), + }):find() +end + +M.setup = function() + vim.keymap.set("n", "pg", live_multigrep) +end + +return M 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 +} diff --git a/lua/aotrix/remap.lua b/lua/aotrix/remap.lua new file mode 100644 index 0000000..cb70a7b --- /dev/null +++ b/lua/aotrix/remap.lua @@ -0,0 +1,40 @@ +vim.g.mapleader = " " + +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("x", "p", [["_dP]]) + +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +-- GoTo code navigation +-- vim.keymap.set("n", "gD", "(coc-declaration)", {silent = true}) +-- vim.keymap.set("n", "gd", "(coc-definition)", {silent = true}) +-- vim.keymap.set("n", "gr", "Telescope coc references", {silent = true}) +-- vim.keymap.set("n", "gy", "(coc-type-definition)", {silent = true}) +-- vim.keymap.set("n", "gi", "(coc-implementation)", {silent = true}) +-- vim.keymap.set("n", "K", 'lua _G.show_docs()', {silent = true}) + +-- Remove because it is not fast enough +vim.keymap.set({'n', 'i', 'v'}, '', '') + +-- nvim-dap +vim.keymap.set("n", "b", function() require("dap").toggle_breakpoint() end) +vim.keymap.set("n", "gb", function() require("dap").run_to_cursor() end) +-- Eval var under cursor +vim.keymap.set("n", "?", function() + require("dapui").eval(nil, { enter = true }) +end) +vim.keymap.set("n", "", function() require("dap").continue() end) +vim.keymap.set("n", "", function() require("dap").step_into() end) +vim.keymap.set("n", "", function() require("dap").step_over() end) +vim.keymap.set("n", "", function() require("dap").step_out() end) +vim.keymap.set("n", "", function() require("dap").step_back() end) +vim.keymap.set("n", "", function() require("dap").restart() end) diff --git a/lua/aotrix/set.lua b/lua/aotrix/set.lua new file mode 100644 index 0000000..2c71437 --- /dev/null +++ b/lua/aotrix/set.lua @@ -0,0 +1,35 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false + +if vim.fn.has('unix') == 1 then + vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +else + vim.opt.undodir = os.getenv("USERPROFILE") .. "/AppData/Local/nvim-data" +end + +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 diff --git a/lua/autocomplete/autocomplete.lua b/lua/autocomplete/autocomplete.lua deleted file mode 100644 index 1e2687b..0000000 --- a/lua/autocomplete/autocomplete.lua +++ /dev/null @@ -1,169 +0,0 @@ -local keyset = vim.keymap.set --- Autocomplete -function _G.check_back_space() - local col = vim.fn.col('.') - 1 - return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil -end - --- Use Tab for trigger completion with characters ahead and navigate --- NOTE: There's always a completion item selected by default, you may want to enable --- no select by setting `"suggest.noselect": true` in your configuration file --- NOTE: Use command ':verbose imap ' to make sure Tab is not mapped by --- other plugins before putting this into your config -local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false} -keyset("i", "", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "" : coc#refresh()', opts) -keyset("i", "", [[coc#pum#visible() ? coc#pum#prev(1) : "\"]], opts) -vim.opt.pumheight = 12 - --- Make to accept selected completion item or notify coc.nvim to format --- u breaks current undo, please make your own choice -keyset("i", "", [[coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\"]], opts) - --- keyset("i", "", "(coc-snippets-expand-jump)") --- keyset("i", "", "(coc-snippets-expand-jump)") --- Use to trigger completion -vim.g.coc_snippet_next = "" -vim.g.coc_snippet_prev = "" -keyset("i", "", "coc#refresh()", {silent = true, expr = true}) - --- Use `[g` and `]g` to navigate diagnostics --- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list -keyset("n", "[g", "(coc-diagnostic-prev)", {silent = true}) -keyset("n", "]g", "(coc-diagnostic-next)", {silent = true}) - - - --- Use K to show documentation in preview window -function _G.show_docs() - local cw = vim.fn.expand('') - if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then - vim.api.nvim_command('h ' .. cw) - elseif vim.api.nvim_eval('coc#rpc#ready()') then - vim.fn.CocActionAsync('doHover') - else - vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw) - end -end - - --- Highlight the symbol and its references on a CursorHold event(cursor is idle) -vim.api.nvim_create_augroup("CocGroup", {}) -vim.api.nvim_create_autocmd("CursorHold", { - group = "CocGroup", - command = "silent call CocActionAsync('highlight')", - desc = "Highlight symbol under cursor on CursorHold" -}) - - --- Symbol renaming -keyset("n", "rn", "(coc-rename)", {silent = true}) - - --- Formatting selected code -keyset("x", "f", "(coc-format-selected)", {silent = true}) -keyset("n", "f", "(coc-format-selected)", {silent = true}) - - --- Setup formatexpr specified filetype(s) -vim.api.nvim_create_autocmd("FileType", { - group = "CocGroup", - pattern = "typescript,json", - command = "setl formatexpr=CocAction('formatSelected')", - desc = "Setup formatexpr specified filetype(s)." -}) - --- Update signature help on jump placeholder -vim.api.nvim_create_autocmd("User", { - group = "CocGroup", - pattern = "CocJumpPlaceholder", - command = "call CocActionAsync('showSignatureHelp')", - desc = "Update signature help on jump placeholder" -}) - --- Apply codeAction to the selected region --- Example: `aap` for current paragraph -local opts = {silent = true, nowait = true} -keyset("x", "a", "(coc-codeaction-selected)", opts) -keyset("n", "a", "(coc-codeaction-selected)", opts) - --- Remap keys for apply code actions at the cursor position. -keyset("n", "ac", "(coc-codeaction-cursor)", opts) --- Remap keys for apply source code actions for current file. -keyset("n", "as", "(coc-codeaction-source)", opts) --- Apply the most preferred quickfix action on the current line. -keyset("n", "qf", "(coc-fix-current)", opts) - --- Remap keys for apply refactor code actions. -keyset("n", "re", "(coc-codeaction-refactor)", { silent = true }) -keyset("x", "r", "(coc-codeaction-refactor-selected)", { silent = true }) -keyset("n", "r", "(coc-codeaction-refactor-selected)", { silent = true }) - --- Run the Code Lens actions on the current line -keyset("n", "cl", "(coc-codelens-action)", opts) - - --- Map function and class text objects --- NOTE: Requires 'textDocument.documentSymbol' support from the language server -keyset("x", "if", "(coc-funcobj-i)", opts) -keyset("o", "if", "(coc-funcobj-i)", opts) -keyset("x", "af", "(coc-funcobj-a)", opts) -keyset("o", "af", "(coc-funcobj-a)", opts) -keyset("x", "ic", "(coc-classobj-i)", opts) -keyset("o", "ic", "(coc-classobj-i)", opts) -keyset("x", "ac", "(coc-classobj-a)", opts) -keyset("o", "ac", "(coc-classobj-a)", opts) - - --- Remap and to scroll float windows/popups ----@diagnostic disable-next-line: redefined-local -local opts = {silent = true, nowait = true, expr = true} -keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) -keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) -keyset("i", "", -'coc#float#has_scroll() ? "=coc#float#scroll(1)" : ""', opts) -keyset("i", "", -'coc#float#has_scroll() ? "=coc#float#scroll(0)" : ""', opts) -keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) -keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) - - --- Use CTRL-S for selections ranges --- Requires 'textDocument/selectionRange' support of language server -keyset("n", "", "(coc-range-select)", {silent = true}) -keyset("x", "", "(coc-range-select)", {silent = true}) - - --- Add `:Format` command to format current buffer -vim.api.nvim_create_user_command("Format", "call CocAction('format')", {}) - --- " Add `:Fold` command to fold current buffer -vim.api.nvim_create_user_command("Fold", "call CocAction('fold', )", {nargs = '?'}) - --- Add `:OR` command for organize imports of the current buffer -vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {}) - --- Add (Neo)Vim's native statusline support --- NOTE: Please see `:h coc-status` for integrations with external plugins that --- provide custom statusline: lightline.vim, vim-airline -vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}") - --- Mappings for CoCList --- code actions and coc stuff ----@diagnostic disable-next-line: redefined-local -local opts = {silent = true, nowait = true} --- Show all diagnostics -keyset("n", "a", ":CocList diagnostics", opts) --- Manage extensions -keyset("n", "e", ":CocList extensions", opts) --- Show commands -keyset("n", "c", ":CocList commands", opts) --- Find symbol of current document -keyset("n", "o", ":CocList outline", opts) --- Search workspace symbols -keyset("n", "s", ":CocList -I symbols", opts) --- Do default action for next item -keyset("n", "j", ":CocNext", opts) --- Do default action for previous item -keyset("n", "k", ":CocPrev", opts) --- Resume latest coc list -keyset("n", "p", ":CocListResume", opts) diff --git a/lua/harpoon/harpoon.lua b/lua/harpoon/harpoon.lua deleted file mode 100644 index e69de29..0000000 diff --git a/lua/nvim_dap/nvim_dap.lua b/lua/nvim_dap/nvim_dap.lua deleted file mode 100644 index 209cab1..0000000 --- a/lua/nvim_dap/nvim_dap.lua +++ /dev/null @@ -1,37 +0,0 @@ -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 diff --git a/lua/nvim_settings/lsp.lua b/lua/nvim_settings/lsp.lua deleted file mode 100644 index 407e6ce..0000000 --- a/lua/nvim_settings/lsp.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", -}) diff --git a/lua/nvim_settings/remap.lua b/lua/nvim_settings/remap.lua deleted file mode 100644 index fd4bdfd..0000000 --- a/lua/nvim_settings/remap.lua +++ /dev/null @@ -1,51 +0,0 @@ -vim.g.mapleader = " " - -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("x", "p", [["_dP]]) - -vim.keymap.set({"n", "v"}, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) - -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) -vim.keymap.set("n", "s", function() require("telescope.builtin").treesitter() end) - -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) - --- GoTo code navigation -vim.keymap.set("n", "gD", "(coc-declaration)", {silent = true}) -vim.keymap.set("n", "gd", "(coc-definition)", {silent = true}) -vim.keymap.set("n", "gr", "Telescope coc references", {silent = true}) -vim.keymap.set("n", "gy", "(coc-type-definition)", {silent = true}) -vim.keymap.set("n", "gi", "(coc-implementation)", {silent = true}) -vim.keymap.set("n", "K", 'lua _G.show_docs()', {silent = true}) - --- Remove because it is not fast enough -vim.keymap.set({'n', 'i', 'v'}, '', '') - --- nvim-dap -vim.keymap.set("n", "b", function() require("dap").toggle_breakpoint() end) -vim.keymap.set("n", "gb", function() require("dap").run_to_cursor() end) --- Eval var under cursor -vim.keymap.set("n", "?", function() - require("dapui").eval(nil, { enter = true }) -end) -vim.keymap.set("n", "", function() require("dap").continue() end) -vim.keymap.set("n", "", function() require("dap").step_into() end) -vim.keymap.set("n", "", function() require("dap").step_over() end) -vim.keymap.set("n", "", function() require("dap").step_out() end) -vim.keymap.set("n", "", function() require("dap").step_back() end) -vim.keymap.set("n", "", function() require("dap").restart() end) diff --git a/lua/nvim_settings/set.lua b/lua/nvim_settings/set.lua deleted file mode 100644 index e524c58..0000000 --- a/lua/nvim_settings/set.lua +++ /dev/null @@ -1,37 +0,0 @@ -vim.opt.guicursor = "" - -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - -vim.opt.smartindent = true - -vim.opt.wrap = false - -vim.opt.swapfile = false -vim.opt.backup = false - -if vim.fn.has('unix') == 1 then - vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -else - vim.opt.undodir = os.getenv("USERPROFILE") .. "/AppData/Local/nvim-data" -end - -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" diff --git a/lua/statusline/statusline.lua b/lua/statusline/statusline.lua deleted file mode 100644 index 73dae10..0000000 --- a/lua/statusline/statusline.lua +++ /dev/null @@ -1,40 +0,0 @@ -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, - 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 = {} -} diff --git a/lua/telescope/multigrep.lua b/lua/telescope/multigrep.lua deleted file mode 100644 index 749102e..0000000 --- a/lua/telescope/multigrep.lua +++ /dev/null @@ -1,53 +0,0 @@ -local pickers = require "telescope.pickers" -local finders = require "telescope.finders" -local make_entry = require "telescope.make_entry" -local conf = require "telescope.config".values - -local M = {} - -local live_multigrep = function(opts) - opts = opts or {} - opts.cwd = opts.cwd or vim.uv.cwd() - - local finder = finders.new_async_job { - command_generator = function(prompt) - if not prompt or prompt == "" then - return nil - end - - local pieces = vim.split(prompt, " ") - local args = { "rg" } - if pieces[1] then - table.insert(args, "-e") - table.insert(args, pieces[1]) - end - - if pieces[2] then - table.insert(args, "-g") - table.insert(args, pieces[2]) - end - - ---@diagnostic disable-next-line: deprecated - return vim.tbl_flatten { - args, - { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }, - } - end, - entry_maker = make_entry.gen_from_vimgrep(opts), - cwd = opts.cwd, - } - - pickers.new(opts, { - debounce = 100, - prompt_title = "Multi Grep", - finder = finder, - previewer = conf.grep_previewer(opts), - sorter = require("telescope.sorters").empty(), - }):find() -end - -M.setup = function() - vim.keymap.set("n", "pg", live_multigrep) -end - -return M diff --git a/lua/telescope/telescope.lua b/lua/telescope/telescope.lua deleted file mode 100644 index 5e9b476..0000000 --- a/lua/telescope/telescope.lua +++ /dev/null @@ -1,31 +0,0 @@ -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 = { - coc = { - theme = 'ivy', - prefer_locations = true, -- always use Telescope locations to preview definitions/declarations/implementations etc - push_cursor_on_edit = true, -- save the cursor position to jump back in the future - timeout = 3000, -- timeout for coc commands - }, - fzf = {} - }, -}) -require('telescope').load_extension('coc') -require('telescope').load_extension('fzf') diff --git a/lua/theme/duskfox.lua b/lua/theme/duskfox.lua deleted file mode 100644 index e135884..0000000 --- a/lua/theme/duskfox.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd([[colorscheme duskfox]]) diff --git a/lua/theme/gruvbox.lua b/lua/theme/gruvbox.lua deleted file mode 100644 index 869cc44..0000000 --- a/lua/theme/gruvbox.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd([[colorscheme gruvbox]]) diff --git a/lua/theme/kanagawa.lua b/lua/theme/kanagawa.lua deleted file mode 100644 index de4da4f..0000000 --- a/lua/theme/kanagawa.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd([[colorscheme kanagawa-dragon]]) diff --git a/lua/theme/nightfox.lua b/lua/theme/nightfox.lua deleted file mode 100644 index e8338a2..0000000 --- a/lua/theme/nightfox.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd([[colorscheme nightfox]]) diff --git a/lua/theme/rose-pine.lua b/lua/theme/rose-pine.lua deleted file mode 100644 index 4398a3e..0000000 --- a/lua/theme/rose-pine.lua +++ /dev/null @@ -1,71 +0,0 @@ -require("rose-pine").setup({ - variant = "auto", -- auto, main, moon, or dawn - dark_variant = "main", -- main, moon, or dawn - dim_inactive_windows = false, - extend_background_behind_borders = true, - - enable = { - terminal = true, - legacy_highlights = true, -- Improve compatibility for previous versions of Neovim - migrations = true, -- Handle deprecated options automatically - }, - - styles = { - bold = false, - italic = true, - transparency = false, - }, - - groups = { - border = "muted", - link = "iris", - panel = "surface", - - error = "love", - hint = "iris", - info = "foam", - note = "pine", - todo = "rose", - warn = "gold", - - git_add = "foam", - git_change = "rose", - git_delete = "love", - git_dirty = "rose", - git_ignore = "muted", - git_merge = "iris", - git_rename = "pine", - git_stage = "iris", - git_text = "rose", - git_untracked = "subtle", - - h1 = "iris", - h2 = "foam", - h3 = "rose", - h4 = "gold", - h5 = "pine", - h6 = "foam", - }, - - highlight_groups = { - -- Comment = { fg = "foam" }, - -- VertSplit = { fg = "muted", bg = "muted" }, - }, - - before_highlight = function(group, highlight, palette) - -- Disable all undercurls - -- if highlight.undercurl then - -- highlight.undercurl = false - -- end - -- - -- Change palette colour - -- if highlight.fg == palette.pine then - -- highlight.fg = palette.foam - -- end - end, -}) - -vim.cmd("colorscheme rose-pine") --- vim.cmd("colorscheme rose-pine-main") --- vim.cmd("colorscheme rose-pine-moon") --- vim.cmd("colorscheme rose-pine-dawn") diff --git a/lua/theme/seoul.lua b/lua/theme/seoul.lua deleted file mode 100644 index daa643c..0000000 --- a/lua/theme/seoul.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd([[colorscheme seoul256]]) diff --git a/lua/transparent/transparent.lua b/lua/transparent/transparent.lua deleted file mode 100644 index 818f5df..0000000 --- a/lua/transparent/transparent.lua +++ /dev/null @@ -1,11 +0,0 @@ -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" -}, -}) diff --git a/lua/treesitter/treesitter.lua b/lua/treesitter/treesitter.lua deleted file mode 100644 index 3cf605f..0000000 --- a/lua/treesitter/treesitter.lua +++ /dev/null @@ -1,41 +0,0 @@ -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"}, - - -- 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" }, - -- 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, - }, -} -- cgit v1.2.3