From 5f7013e77099724884fcbdac7d395601b91bb200 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Wed, 24 Jan 2024 21:28:12 +0200 Subject: [PATCH] Update 24.01.2024 --- after/ftplugin/tex.lua | 2 +- after/ftplugin/typst.lua | 5 + after/plugin/ccc.lua | 131 -------- after/plugin/cheatsheet.lua | 35 --- after/plugin/clang-extension.lua | 67 ----- after/plugin/cloak.lua | 31 -- after/plugin/cmake-tools.lua | 68 ----- after/plugin/colorizer.lua | 33 --- after/plugin/comment.lua | 61 ---- after/plugin/crates.lua | 139 --------- after/plugin/dap.lua | 85 ------ after/plugin/git-worktree.lua | 10 - after/plugin/gitsigns.lua | 33 --- after/plugin/harpoon.lua | 18 -- after/plugin/illuminate.lua | 57 ---- after/plugin/indent-blankline.lua | 30 -- after/plugin/lsp.lua | 325 -------------------- after/plugin/luasnip.lua | 75 ----- after/plugin/neorg.lua | 31 -- after/plugin/obsidian.lua | 37 --- after/plugin/oil.lua | 135 --------- after/plugin/runner.lua | 50 ---- after/plugin/rust-tools.lua | 30 -- after/plugin/snips/rust.lua | 13 +- after/plugin/sql_rust_automagic.lua | 89 ++++++ after/plugin/telescope.lua | 177 ----------- after/plugin/treesitter.lua | 82 ----- after/plugin/whichkey.lua | 346 ---------------------- bin/sql-format-via-python.py | 30 ++ lazy-lock.json | 160 +++++----- lua/plugins.lua | 287 ------------------ lua/plugins/ccc.lua | 132 +++++++++ lua/plugins/cellular_automaton.lua | 10 + lua/plugins/cheatsheet.lua | 41 +++ lua/plugins/clang_extensions.lua | 67 +++++ lua/plugins/cloak.lua | 30 ++ lua/plugins/closetag.lua | 1 + lua/plugins/cmake_tools.lua | 69 +++++ lua/plugins/cmp.lua | 135 +++++++++ lua/plugins/codeium.lua | 6 + lua/plugins/colorizer.lua | 32 ++ lua/plugins/colorscheme.lua | 28 ++ lua/plugins/comment.lua | 61 ++++ lua/plugins/copilot.lua | 47 +++ lua/plugins/crates.lua | 147 +++++++++ lua/plugins/dadbod.lua | 5 + lua/plugins/dap.lua | 241 +++++++++++++++ lua/plugins/diffview.lua | 1 + lua/plugins/fugitive.lua | 1 + lua/plugins/gitsigns.lua | 41 +++ lua/plugins/harpoon.lua | 39 +++ lua/plugins/hypersonic.lua | 17 ++ lua/plugins/ibl.lua | 41 +++ lua/plugins/illuminate.lua | 58 ++++ lua/plugins/lazy.lua | 1 + lua/plugins/lazygit.lua | 10 + lua/plugins/log_highlighting.lua | 1 + lua/plugins/lsp/bash.lua | 14 + lua/plugins/lsp/c.lua | 9 + lua/plugins/lsp/emmet.lua | 20 ++ lua/plugins/lsp/lua.lua | 42 +++ lua/plugins/lsp/tex.lua | 32 ++ lua/plugins/lsp/typst.lua | 12 + lua/plugins/lspconfig.lua | 228 ++++++++++++++ {after/plugin => lua/plugins}/lualine.lua | 34 ++- lua/plugins/luasnip.lua | 83 ++++++ lua/plugins/markdown_preview.lua | 8 + lua/plugins/neodev.lua | 26 ++ lua/plugins/neogen.lua | 6 + lua/plugins/neorg.lua | 33 +++ lua/plugins/null_ls.lua | 71 +++++ lua/plugins/oil.lua | 140 +++++++++ lua/plugins/presence.lua | 1 + lua/plugins/rest.lua | 42 +++ lua/plugins/runner.lua | 55 ++++ lua/plugins/rust_tools.lua | 44 +++ lua/plugins/surround.lua | 5 + lua/plugins/tagbar.lua | 6 + lua/plugins/telescope.lua | 320 ++++++++++++++++++++ lua/plugins/tmux_navigator.lua | 1 + lua/plugins/todo_comments.lua | 1 + lua/plugins/treesitter.lua | 181 +++++++++++ lua/plugins/trouble.lua | 96 ++++++ lua/plugins/twilight.lua | 23 ++ lua/plugins/typst.lua | 5 + lua/plugins/undotree.lua | 6 + lua/plugins/vim_be_good.lua | 1 + lua/plugins/vimtex.lua | 12 + lua/plugins/vimwiki.lua | 14 + lua/plugins/web_devicons.lua | 1 + lua/plugins/which_key.lua | 121 ++++++++ lua/plugins/worktree.lua | 11 + lua/plugins/yuck.lua | 1 + lua/plugins/zen_mode.lua | 62 ++++ lua/solo/autocmds.lua | 2 +- lua/solo/cmds.lua | 9 + lua/solo/init.lua | 6 +- {plugin => lua/solo}/keymaps.lua | 24 +- {plugin => lua/solo}/options.lua | 15 +- lua/solo/snips.lua | 2 - lua/solo/typst.lua | 9 + queries/lua/highlights.scm | 4 + queries/rust/injections.scm | 8 + spell/lv.utf-8.add | 97 ++++++ spell/lv.utf-8.add.spl | Bin 591 -> 1792 bytes 105 files changed, 3389 insertions(+), 2488 deletions(-) create mode 100644 after/ftplugin/typst.lua delete mode 100644 after/plugin/ccc.lua delete mode 100644 after/plugin/cheatsheet.lua delete mode 100644 after/plugin/clang-extension.lua delete mode 100644 after/plugin/cloak.lua delete mode 100644 after/plugin/cmake-tools.lua delete mode 100644 after/plugin/colorizer.lua delete mode 100644 after/plugin/comment.lua delete mode 100644 after/plugin/crates.lua delete mode 100644 after/plugin/dap.lua delete mode 100644 after/plugin/git-worktree.lua delete mode 100644 after/plugin/gitsigns.lua delete mode 100644 after/plugin/harpoon.lua delete mode 100644 after/plugin/illuminate.lua delete mode 100644 after/plugin/indent-blankline.lua delete mode 100644 after/plugin/lsp.lua delete mode 100644 after/plugin/luasnip.lua delete mode 100644 after/plugin/neorg.lua delete mode 100644 after/plugin/obsidian.lua delete mode 100644 after/plugin/oil.lua delete mode 100644 after/plugin/runner.lua delete mode 100644 after/plugin/rust-tools.lua create mode 100644 after/plugin/sql_rust_automagic.lua delete mode 100644 after/plugin/telescope.lua delete mode 100644 after/plugin/treesitter.lua delete mode 100644 after/plugin/whichkey.lua create mode 100644 bin/sql-format-via-python.py delete mode 100644 lua/plugins.lua create mode 100644 lua/plugins/ccc.lua create mode 100644 lua/plugins/cellular_automaton.lua create mode 100644 lua/plugins/cheatsheet.lua create mode 100644 lua/plugins/clang_extensions.lua create mode 100644 lua/plugins/cloak.lua create mode 100644 lua/plugins/closetag.lua create mode 100644 lua/plugins/cmake_tools.lua create mode 100644 lua/plugins/cmp.lua create mode 100644 lua/plugins/codeium.lua create mode 100644 lua/plugins/colorizer.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/comment.lua create mode 100644 lua/plugins/copilot.lua create mode 100644 lua/plugins/crates.lua create mode 100644 lua/plugins/dadbod.lua create mode 100644 lua/plugins/dap.lua create mode 100644 lua/plugins/diffview.lua create mode 100644 lua/plugins/fugitive.lua create mode 100644 lua/plugins/gitsigns.lua create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/hypersonic.lua create mode 100644 lua/plugins/ibl.lua create mode 100644 lua/plugins/illuminate.lua create mode 100644 lua/plugins/lazy.lua create mode 100644 lua/plugins/lazygit.lua create mode 100644 lua/plugins/log_highlighting.lua create mode 100644 lua/plugins/lsp/bash.lua create mode 100644 lua/plugins/lsp/c.lua create mode 100644 lua/plugins/lsp/emmet.lua create mode 100644 lua/plugins/lsp/lua.lua create mode 100644 lua/plugins/lsp/tex.lua create mode 100644 lua/plugins/lsp/typst.lua create mode 100644 lua/plugins/lspconfig.lua rename {after/plugin => lua/plugins}/lualine.lua (57%) create mode 100644 lua/plugins/luasnip.lua create mode 100644 lua/plugins/markdown_preview.lua create mode 100644 lua/plugins/neodev.lua create mode 100644 lua/plugins/neogen.lua create mode 100644 lua/plugins/neorg.lua create mode 100644 lua/plugins/null_ls.lua create mode 100644 lua/plugins/oil.lua create mode 100644 lua/plugins/presence.lua create mode 100644 lua/plugins/rest.lua create mode 100644 lua/plugins/runner.lua create mode 100644 lua/plugins/rust_tools.lua create mode 100644 lua/plugins/surround.lua create mode 100644 lua/plugins/tagbar.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/tmux_navigator.lua create mode 100644 lua/plugins/todo_comments.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/trouble.lua create mode 100644 lua/plugins/twilight.lua create mode 100644 lua/plugins/typst.lua create mode 100644 lua/plugins/undotree.lua create mode 100644 lua/plugins/vim_be_good.lua create mode 100644 lua/plugins/vimtex.lua create mode 100644 lua/plugins/vimwiki.lua create mode 100644 lua/plugins/web_devicons.lua create mode 100644 lua/plugins/which_key.lua create mode 100644 lua/plugins/worktree.lua create mode 100644 lua/plugins/yuck.lua create mode 100644 lua/plugins/zen_mode.lua create mode 100644 lua/solo/cmds.lua rename {plugin => lua/solo}/keymaps.lua (79%) rename {plugin => lua/solo}/options.lua (91%) create mode 100644 lua/solo/typst.lua create mode 100644 queries/lua/highlights.scm create mode 100644 queries/rust/injections.scm diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua index c5b5580..8f75f32 100644 --- a/after/ftplugin/tex.lua +++ b/after/ftplugin/tex.lua @@ -1,2 +1,2 @@ -vim.opt_local.wrap = true +vim.opt_local.wrap = false vim.opt_local.spell = true diff --git a/after/ftplugin/typst.lua b/after/ftplugin/typst.lua new file mode 100644 index 0000000..a71d9c0 --- /dev/null +++ b/after/ftplugin/typst.lua @@ -0,0 +1,5 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.wrap = true +vim.opt_local.spell = true diff --git a/after/plugin/ccc.lua b/after/plugin/ccc.lua deleted file mode 100644 index cd97e4e..0000000 --- a/after/plugin/ccc.lua +++ /dev/null @@ -1,131 +0,0 @@ -if not pcall(require, "ccc") then - return -end - -local ccc = require("ccc") -local ColorInput = require("ccc.input") -local convert = require("ccc.utils.convert") - -local RgbHslInput = setmetatable({ - name = "RGB/HSL", - max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 }, - min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 }, - bar_name = { "R", "G", "B", "H", "S", "L" }, -}, { __index = ColorInput }) - -function RgbHslInput.format(n, i) - if i <= 3 then - -- RGB - n = n * 255 - elseif i >= 5 then - -- S or L of HSL - n = n * 100 - end - return ("%6d"):format(n) -end - -function RgbHslInput.from_rgb(RGB) - local HSL = convert.rgb2hsl(RGB) - local R, G, B = unpack(RGB) - local H, S, L = unpack(HSL) - return { R, G, B, H, S, L } -end - -function RgbHslInput.to_rgb(value) - return { value[1], value[2], value[3] } -end - -function RgbHslInput:_set_rgb(RGB) - self.value[1] = RGB[1] - self.value[2] = RGB[2] - self.value[3] = RGB[3] -end - -function RgbHslInput:_set_hsl(HSL) - self.value[4] = HSL[1] - self.value[5] = HSL[2] - self.value[6] = HSL[3] -end - -function RgbHslInput:callback(index, new_value) - self.value[index] = new_value - local v = self.value - if index <= 3 then - local RGB = { v[1], v[2], v[3] } - local HSL = convert.rgb2hsl(RGB) - self:_set_hsl(HSL) - else - local HSL = { v[4], v[5], v[6] } - local RGB = convert.hsl2rgb(HSL) - self:_set_rgb(RGB) - end -end - -ccc.setup({ - pickers = { - ccc.picker.custom_entries({ - bg = "#1a1b26", - bg_dark = "#16161e", - bg_float = "#16161e", - bg_highlight = "#292e42", - bg_popup = "#16161e", - bg_search = "#3d59a1", - bg_sidebar = "#16161e", - bg_statusline = "#16161e", - bg_visual = "#283457", - black = "#15161e", - blue = "#7aa2f7", - blue0 = "#3d59a1", - blue1 = "#2ac3de", - blue2 = "#0db9d7", - blue5 = "#89ddff", - blue6 = "#b4f9f8", - blue7 = "#394b70", - border = "#15161e", - border_highlight = "#27a1b9", - comment = "#565f89", - cyan = "#7dcfff", - dark3 = "#545c7e", - dark5 = "#737aa2", - delta_add = "#2c5a66", - delta_delete = "#713137", - diff_add = "#20303b", - diff_change = "#1f2231", - diff_delete = "#37222c", - diff_text = "#394b70", - error = "#db4b4b", - fg = "#c0caf5", - fg_dark = "#a9b1d6", - fg_float = "#c0caf5", - fg_gutter = "#3b4261", - fg_sidebar = "#a9b1d6", - git_add = "#449dab", - git_change = "#6183bb", - git_delete = "#914c54", - git_ignore = "#545c7e", - gitSigns_add = "#266d6a", - gitSigns_change = "#536c9e", - gitSigns_delete = "#b2555b", - green = "#9ece6a", - green1 = "#73daca", - green2 = "#41a6b5", - hint = "#1abc9c", - info = "#0db9d7", - magenta = "#bb9af7", - magenta2 = "#ff007c", - none = "NONE", - orange = "#ff9e64", - purple = "#9d7cd8", - red = "#f7768e", - red1 = "#db4b4b", - teal = "#1abc9c", - terminal_black = "#414868", - warning = "#e0af68", - yellow = "#e0af68", - }), - }, - inputs = { - RgbHslInput, - }, -}) diff --git a/after/plugin/cheatsheet.lua b/after/plugin/cheatsheet.lua deleted file mode 100644 index f440306..0000000 --- a/after/plugin/cheatsheet.lua +++ /dev/null @@ -1,35 +0,0 @@ -if not pcall(require, "cheatsheet") then - return -end - -local ctactions = require("cheatsheet.telescope.actions") -require("cheatsheet").setup({ - -- Whether to show bundled cheatsheets - - -- For generic cheatsheets like default, unicode, nerd-fonts, etc - bundled_cheatsheets = { - enabled = { "default", "unicode", "regex", "markdown", "lua" }, - disabled = { "nerd-fonts" }, - }, - -- bundled_cheatsheets = true, - - -- For plugin specific cheatsheets - bundled_plugin_cheatsheets = { - enabled = {}, - disabled = {}, - }, - -- bundled_plugin_cheatsheets = true, - - -- For bundled plugin cheatsheets, do not show a sheet if you - -- don't have the plugin installed (searches runtimepath for - -- same directory name) - include_only_installed_plugins = true, - - -- Key mappings bound inside the telescope window - telescope_mappings = { - [""] = require("cheatsheet.telescope.actions").select_or_fill_commandline, - [""] = require("cheatsheet.telescope.actions").select_or_execute, - [""] = require("cheatsheet.telescope.actions").copy_cheat_value, - [""] = require("cheatsheet.telescope.actions").edit_user_cheatsheet, - }, -}) diff --git a/after/plugin/clang-extension.lua b/after/plugin/clang-extension.lua deleted file mode 100644 index fba617b..0000000 --- a/after/plugin/clang-extension.lua +++ /dev/null @@ -1,67 +0,0 @@ -if not pcall(require, "clangd_extensions") then - return -end - -require("clangd_extensions").setup({ - inlay_hints = { - inline = vim.fn.has("nvim-0.10") == 1, - -- Options other than `highlight' and `priority' only work - -- if `inline' is disabled - -- Only show inlay hints for the current line - only_current_line = false, - -- Event which triggers a refresh of the inlay hints. - -- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but - -- not that this may cause higher CPU usage. - -- This option is only respected when only_current_line and - -- autoSetHints both are true. - only_current_line_autocmd = { "CursorHold" }, - -- whether to show parameter hints with the inlay hints or not - show_parameter_hints = true, - -- prefix for parameter hints - parameter_hints_prefix = "<- ", - -- prefix for all the other hints (type, chaining) - other_hints_prefix = "=> ", - -- whether to align to the length of the longest line in the file - max_len_align = true, - -- padding from the left if max_len_align is true - max_len_align_padding = 1, - -- whether to align to the extreme right or not - right_align = false, - -- padding from the right if right_align is true - right_align_padding = 8, - -- The color of the hints - highlight = "Comment", - -- The highlight group priority for extmark - priority = 100, - }, - ast = { - role_icons = { - type = "", - declaration = "", - expression = "", - specifier = "", - statement = "", - ["template argument"] = "", - }, - kind_icons = { - Compound = "", - Recovery = "", - TranslationUnit = "", - PackExpansion = "", - TemplateTypeParm = "", - TemplateTemplateParm = "", - TemplateParamObject = "", - }, - highlights = { - detail = "Comment", - }, - }, - - memory_usage = { - border = "none", - }, - - symbol_info = { - border = "none", - }, -}) diff --git a/after/plugin/cloak.lua b/after/plugin/cloak.lua deleted file mode 100644 index aca389f..0000000 --- a/after/plugin/cloak.lua +++ /dev/null @@ -1,31 +0,0 @@ -if not pcall(require, "cloak") then - return -end - -require("cloak").setup({ - enabled = true, - cloak_character = "*", - -- The applied highlight group (colors) on the cloaking, see `:h highlight`. - highlight_group = "Comment", - -- Applies the length of the replacement characters for all matched - -- patterns, defaults to the length of the matched pattern. - cloak_length = nil, -- Provide a number if you want to hide the true length of the value. - -- Wether it should try every pattern to find the best fit or stop after the first. - try_all_patterns = true, - patterns = { - { - -- Match any file starting with '.env'. - -- This can be a table to match multiple file patterns. - file_pattern = { ".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 = "=.+", - -- A function, table or string to generate the replacement. - -- The actual replacement will contain the 'cloak_character' - -- where it doesn't cover the original text. - -- If left empty the legacy behavior of keeping the first character is retained. - replace = nil, - }, - }, -}) diff --git a/after/plugin/cmake-tools.lua b/after/plugin/cmake-tools.lua deleted file mode 100644 index 6537ca6..0000000 --- a/after/plugin/cmake-tools.lua +++ /dev/null @@ -1,68 +0,0 @@ -if not pcall(require, "cmake-tools") then - return -end - -require("cmake-tools").setup({ - cmake_command = "cmake", -- this is used to specify cmake command path - cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt - cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate` - cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild` - cmake_build_directory = "target/build/", -- this is used to specify generate directory for cmake - cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is set to "", this option will be activated - cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir - cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false - cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage - cmake_variants_message = { - short = { show = true }, -- whether to show short message - long = { show = true, max_length = 40 }, -- whether to show long message - }, - cmake_dap_configuration = { -- debug settings for cmake - name = "cpp", - type = "codelldb", - request = "launch", - stopOnEntry = false, - runInTerminal = true, - console = "integratedTerminal", - }, - cmake_executor = { -- executor to use - name = "quickfix", -- name of the executor - opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. - default_opts = { -- a list of default and possible values for executors - quickfix = { - show = "only_on_error", -- "always", "only_on_error" - position = "belowright", -- "bottom", "top" - size = 15, - }, - overseer = { - new_task_opts = {}, -- options to pass into the `overseer.new_task` command - on_new_task = function(task) end, -- a function that gets overseer.Task when it is created, before calling `task:start` - }, - terminal = {}, -- terminal executor uses the values in cmake_terminal - }, - }, - cmake_terminal = { - name = "terminal", - opts = { - name = "Main Terminal", - prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name - split_direction = "vertical", -- "horizontal", "vertical" - split_size = 50, - - -- Window handling - single_terminal_per_instance = true, -- Single viewport, multiple windows - single_terminal_per_tab = true, -- Single viewport per tab - keep_terminal_static_location = true, -- Static location of the viewport if avialable - - -- Running Tasks - start_insert_in_launch_task = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun - start_insert_in_other_tasks = false, -- If you want to enter terminal with :startinsert upon launching all other cmake tasks in the terminal. Generally set as false - focus_on_main_terminal = false, -- Focus on cmake terminal when cmake task is launched. Only used if executor is terminal. - focus_on_launch_terminal = false, -- Focus on cmake launch terminal when executable target in launched. - }, - }, - cmake_notifications = { - enabled = true, -- show cmake execution progress in nvim-notify - spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display - refresh_rate_ms = 100, -- how often to iterate icons - }, -}) diff --git a/after/plugin/colorizer.lua b/after/plugin/colorizer.lua deleted file mode 100644 index 22459be..0000000 --- a/after/plugin/colorizer.lua +++ /dev/null @@ -1,33 +0,0 @@ -if not pcall(require, "colorizer") then - return -end - -require("colorizer").setup({ - filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss" }, - user_default_options = { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - names = false, -- "Name" codes like Blue or blue - RRGGBBAA = true, -- #RRGGBBAA hex codes - AARRGGBB = true, -- 0xAARRGGBB hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - -- Available modes for `mode`: foreground, background, virtualtext - mode = "background", -- Set the display mode. - -- Available methods are false / true / "normal" / "lsp" / "both" - -- True is same as normal - tailwind = true, -- Enable tailwind colors - -- parsers can contain values used in |user_default_options| - sass = { - enable = true, - parsers = { "css" }, - }, -- Enable sass colors - virtualtext = "■", - }, - -- all the sub-options of filetypes apply to buftypes - buftypes = {}, - html = { names = true }, - css = { names = true }, -}) diff --git a/after/plugin/comment.lua b/after/plugin/comment.lua deleted file mode 100644 index e010efd..0000000 --- a/after/plugin/comment.lua +++ /dev/null @@ -1,61 +0,0 @@ -if not pcall(require, "Comment") then - return -end - -require("Comment").setup({ - ---Add a space b/w comment and the line - padding = true, - ---Whether the cursor should stay at its position - sticky = true, - ---Lines to be ignored while (un)comment - ignore = nil, - ---LHS of toggle mappings in NORMAL mode - toggler = { - ---Line-comment toggle keymap - line = "gcc", - ---Block-comment toggle keymap - block = "gbb", - }, - -- -LHS of operator-pending mappings in NORMAL and VISUAL mode - opleader = { - ---Line-comment keymap - line = "gc", - ---Block-comment keymap - block = "gb", - }, - ---LHS of extra mappings - extra = { - ---Add comment on the line above - above = "gcO", - ---Add comment on the line below - below = "gco", - ---Add comment at the end of line - eol = "gcA", - }, - --- Enable keybindings - --- NOTE: If given `false` then the plugin won't create any mappings - mappings = { - ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` - basic = true, - ---Extra mapping; `gco`, `gcO`, `gcA` - extra = true, - ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` - extended = true, - }, - ---Function to call before (un)comment - -- pre_hook = function(ctx) - -- local U = require("Comment.utils") - -- - -- local location = nil - -- if ctx.ctype == U.ctype.block then - -- location = require("ts_context_commentstring.utils").get_cursor_location() - -- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - -- location = require("ts_context_commentstring.utils").get_visual_start_location() - -- end - -- - -- return require("ts_context_commentstring.internal").calculate_commentstring({ - -- key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - -- location = location, - -- }) - -- end, -}) diff --git a/after/plugin/crates.lua b/after/plugin/crates.lua deleted file mode 100644 index 4aec7ee..0000000 --- a/after/plugin/crates.lua +++ /dev/null @@ -1,139 +0,0 @@ -if not pcall(require, "crates") then - return -end - -require("crates").setup({ - smart_insert = true, - insert_closing_quote = true, - avoid_prerelease = true, - autoload = true, - autoupdate = true, - loading_indicator = true, - date_format = "%d-%m-%Y", - thousands_separator = ".", - notification_title = "Crates", - disable_invalid_feature_diagnostic = false, - text = { - loading = "  Loading", - version = "  %s", - prerelease = "  %s", - yanked = "  %s", - nomatch = "  No match", - upgrade = "  %s", - error = "  Error fetching crate", - }, - highlight = { - loading = "CratesNvimLoading", - version = "CratesNvimVersion", - prerelease = "CratesNvimPreRelease", - yanked = "CratesNvimYanked", - nomatch = "CratesNvimNoMatch", - upgrade = "CratesNvimUpgrade", - error = "CratesNvimError", - }, - popup = { - autofocus = false, - copy_register = '"', - style = "minimal", - border = "none", - show_version_date = false, - show_dependency_version = true, - max_height = 30, - min_width = 20, - padding = 1, - text = { - title = " %s", - pill_left = "", - pill_right = "", - description = "%s", - created_label = " created ", - created = "%s", - updated_label = " updated ", - updated = "%s", - downloads_label = " downloads ", - downloads = "%s", - homepage_label = " homepage ", - homepage = "%s", - repository_label = " repository ", - repository = "%s", - documentation_label = " documentation ", - documentation = "%s", - crates_io_label = " crates.io ", - crates_io = "%s", - categories_label = " categories ", - keywords_label = " keywords ", - version = " %s", - prerelease = " %s", - yanked = " %s", - version_date = " %s", - feature = " %s", - enabled = " %s", - transitive = " %s", - normal_dependencies_title = " Dependencies", - build_dependencies_title = " Build dependencies", - dev_dependencies_title = " Dev dependencies", - dependency = " %s", - optional = " %s", - dependency_version = " %s", - loading = "  ", - }, - highlight = { - title = "CratesNvimPopupTitle", - pill_text = "CratesNvimPopupPillText", - pill_border = "CratesNvimPopupPillBorder", - description = "CratesNvimPopupDescription", - created_label = "CratesNvimPopupLabel", - created = "CratesNvimPopupValue", - updated_label = "CratesNvimPopupLabel", - updated = "CratesNvimPopupValue", - downloads_label = "CratesNvimPopupLabel", - downloads = "CratesNvimPopupValue", - homepage_label = "CratesNvimPopupLabel", - homepage = "CratesNvimPopupUrl", - repository_label = "CratesNvimPopupLabel", - repository = "CratesNvimPopupUrl", - documentation_label = "CratesNvimPopupLabel", - documentation = "CratesNvimPopupUrl", - crates_io_label = "CratesNvimPopupLabel", - crates_io = "CratesNvimPopupUrl", - categories_label = "CratesNvimPopupLabel", - keywords_label = "CratesNvimPopupLabel", - version = "CratesNvimPopupVersion", - prerelease = "CratesNvimPopupPreRelease", - yanked = "CratesNvimPopupYanked", - version_date = "CratesNvimPopupVersionDate", - feature = "CratesNvimPopupFeature", - enabled = "CratesNvimPopupEnabled", - transitive = "CratesNvimPopupTransitive", - normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle", - build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle", - dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle", - dependency = "CratesNvimPopupDependency", - optional = "CratesNvimPopupOptional", - dependency_version = "CratesNvimPopupDependencyVersion", - loading = "CratesNvimPopupLoading", - }, - keys = { - hide = { "q", "" }, - open_url = { "" }, - select = { "" }, - select_alt = { "s" }, - toggle_feature = { "" }, - copy_value = { "yy" }, - goto_item = { "gd", "K", "" }, - jump_forward = { "" }, - jump_back = { "", "" }, - }, - }, - src = { - insert_closing_quote = true, - text = { - prerelease = "  pre-release ", - yanked = "  yanked ", - }, - }, - null_ls = { - enabled = true, - name = "crates.nvim", - }, -}) diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua deleted file mode 100644 index 683ce4d..0000000 --- a/after/plugin/dap.lua +++ /dev/null @@ -1,85 +0,0 @@ -if not pcall(require, "dap") then - return -end - -local dap = require("dap") -local dapui = require("dapui") - -vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) - -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() -end - -dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() -end - -dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() -end - -local mason_registry = require("mason-registry") - -vim.keymap.set("n", "", dap.continue) -vim.keymap.set("n", "", dap.step_over) -vim.keymap.set("n", "", dap.step_into) -vim.keymap.set("n", "", dap.step_out) - -dapui.setup() -require("nvim-dap-virtual-text").setup({}) - --- Python -local debugpy = mason_registry.get_package("debugpy") -local debugpy_path = debugpy:get_install_path() .. "/venv/bin/python" -require("dap-python").setup(debugpy_path) - -local codelldb = mason_registry.get_package("codelldb") -local codelldb_path = codelldb:get_install_path() .. "/codelldb" -local liblldb_path = codelldb:get_install_path() .. "/extension/lldb/lib/liblldb.so" - --- Rust -require("rust-tools").setup({ - dap = { - adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path), - }, -}) - --- dap.configurations.rust = {} - --- C/C++ --- FIX: not working -dap.adapters.lldb = { - type = "executable", - command = codelldb_path, - name = "lldb", -} -dap.configurations.cpp = { - { - name = "Launch", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = {}, - -- 💀 - -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: - -- - -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - -- - -- Otherwise you might get the following error: - -- - -- Error on launch: Failed to attach to the target process - -- - -- But you should be aware of the implications: - -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html - -- runInTerminal = false, - }, -} - --- If you want to use this for Rust and C, add something like this: - -dap.configurations.c = dap.configurations.cpp diff --git a/after/plugin/git-worktree.lua b/after/plugin/git-worktree.lua deleted file mode 100644 index 1171928..0000000 --- a/after/plugin/git-worktree.lua +++ /dev/null @@ -1,10 +0,0 @@ -if not pcall(require, "git-worktree") then - return -end - -local worktree = require("git-worktree") -worktree.on_tree_change(function(op, metadata) - if op == worktree.Operations.Switch then - print("Switched from " .. metadata.prev_path .. " to " .. metadata.path) - end -end) diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua deleted file mode 100644 index 9e0d306..0000000 --- a/after/plugin/gitsigns.lua +++ /dev/null @@ -1,33 +0,0 @@ -if not pcall(require, "gitsigns") then - return -end - -require("gitsigns").setup({ - signs = { - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - topdelete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, -}) diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua deleted file mode 100644 index c973d7a..0000000 --- a/after/plugin/harpoon.lua +++ /dev/null @@ -1,18 +0,0 @@ -if not pcall(require, "harpoon") then - return -end - -local ui = require("harpoon.ui") - -vim.keymap.set("n", "", function() - ui.nav_file(1) -end) -vim.keymap.set("n", "", function() - ui.nav_file(2) -end) -vim.keymap.set("n", "", function() - ui.nav_file(3) -end) -vim.keymap.set("n", "", function() - ui.nav_file(4) -end) diff --git a/after/plugin/illuminate.lua b/after/plugin/illuminate.lua deleted file mode 100644 index e1ea7af..0000000 --- a/after/plugin/illuminate.lua +++ /dev/null @@ -1,57 +0,0 @@ -if not pcall(require, "illuminate") then - return -end - -require("illuminate").configure({ - providers = { - "lsp", - "treesitter", - "regex", - }, - -- delay: delay in milliseconds - delay = 100, - -- filetype_overrides: filetype specific overrides. - -- The keys are strings to represent the filetype while the values are tables that - -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist - filetype_overrides = {}, - -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist - filetypes_denylist = { - "alpha", - "NvimTree", - "dirvish", - "fugitive", - }, - -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist - filetypes_allowlist = {}, - -- modes_denylist: modes to not illuminate, this overrides modes_allowlist - -- See `:help mode()` for possible values - modes_denylist = {}, - -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist - -- See `:help mode()` for possible values - modes_allowlist = {}, - -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_denylist = {}, - -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_allowlist = {}, - -- under_cursor: whether or not to illuminate under the cursor - under_cursor = true, - -- large_file_cutoff: number of lines at which to use large_file_config - -- The `under_cursor` option is disabled when this cutoff is hit - large_file_cutoff = nil, - -- large_file_config: config to use for large files (based on large_file_cutoff). - -- Supports the same keys passed to .configure - -- If nil, vim-illuminate will be disabled for large files. - large_file_overrides = nil, - -- min_count_to_highlight: minimum number of matches required to perform highlighting - min_count_to_highlight = 1, -}) -vim.keymap.set("n", "", function() - require("illuminate").goto_next_reference() -end, { noremap = true }) -vim.keymap.set("n", "", function() - require("illuminate").goto_prev_reference() -end, { noremap = true }) diff --git a/after/plugin/indent-blankline.lua b/after/plugin/indent-blankline.lua deleted file mode 100644 index 1b06eb9..0000000 --- a/after/plugin/indent-blankline.lua +++ /dev/null @@ -1,30 +0,0 @@ -if not pcall(require, "indent_blankline") then - return -end - -vim.opt.list = true -vim.opt.listchars:append("space:⋅") -vim.opt.listchars:append("eol:↴") - -require("indent_blankline").setup({ - char = "▎", - show_trailing_blankline_indent = true, - show_first_indent_level = true, - use_treesitter = true, - show_end_of_line = true, - space_char_blankline = " ", - show_current_context = true, - show_current_context_start = false, - buftype_exclude = { "terminal", "nofile" }, - filetype_exclude = { - "NvimTree", - "Trouble", - "alpha", - "dashboard", - "help", - "lazy", - "neogitstatus", - "packer", - "startify", - }, -}) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua deleted file mode 100644 index 500d471..0000000 --- a/after/plugin/lsp.lua +++ /dev/null @@ -1,325 +0,0 @@ -if not pcall(require, "lsp-zero") then - return -end - -local lsp = require("lsp-zero").preset({ - float_border = "rounded", - call_servers = "local", - configure_diagnostics = true, - setup_servers_on_start = true, - set_lsp_keymaps = { - preserve_mappings = false, - omit = { "", "", "", "", "" }, - }, - manage_nvim_cmp = { - set_sources = "recommended", - set_basic_mappings = false, - set_extra_mappings = false, - use_luasnip = true, - set_format = true, - documentation_window = true, - }, -}) - -lsp.on_attach(function(_, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - - -- lsp.default_keymaps({ buffer = bufnr }) - local nmap = function(keys, func, desc) - if desc then - desc = "LSP: " .. desc - end - vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) - end - - nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") - nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") - nmap("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation") - nmap("K", vim.lsp.buf.hover, "Hover Documentation") - nmap("", vim.lsp.buf.signature_help, "Signature Documentation") - nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") -end) - -lsp.ensure_installed({ - "bashls", - "clangd", - "cmake", - "cssls", - "emmet_ls", - "html", - "jedi_language_server", - "jsonls", - "lua_ls", - "sqlls", - "tailwindcss", - "taplo", - "texlab", - "tsserver", -}) - -lsp.configure("clangd", { - capabilities = { - offsetEncoding = { "utf-16" }, - }, - on_attach = function() - require("clangd_extensions.inlay_hints").setup_autocmd() - require("clangd_extensions.inlay_hints").set_inlay_hints() - end, -}) - -lsp.configure("bashls", { - filetypes = { - "sh", - "bash", - "zsh", - }, -}) - -lsp.configure("emmet_ls", { - filetypes = { - "html", - "htmldjango", - "typescriptreact", - "javascriptreact", - "css", - "sass", - "scss", - "less", - "eruby", - }, -}) - -lsp.configure("texlab", { - settings = { - texlab = { - auxDirectory = ".", - bibtexFormatter = "texlab", - build = { - args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, - executable = "xelatex", - forwardSearchAfter = false, - onSave = false, - }, - chktex = { - onEdit = false, - onOpenAndSave = false, - }, - diagnosticsDelay = 0, - formatterLineLength = 120, - forwardSearch = { - args = {}, - }, - latexFormatter = "latexindent", - latexindent = { - modifyLineBreaks = false, - }, - }, - }, -}) - -if not pcall(require, "neodev") then - return -end -require("neodev").setup() -require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls({ - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim", "awesome", "client" }, - }, - -- workspace = { - -- Make the server aware of Neovim runtime files - -- library = vim.api.nvim_get_runtime_file("", true), - -- }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - root_pattern = { - ".stylua.toml", - ".luarc.json", - ".luarc.jsonc", - ".luacheckrc", - "stylua.toml", - "selene.toml", - "selene.yml", - ".git", - }, - format = { - enable = false, - }, - }, - }, -})) - -lsp.setup() - -if not pcall(require, "null-ls") then - return -end -local null_ls = require("null-ls") --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics -local formatting = null_ls.builtins.formatting --- https://github.com/prettier-solidity/prettier-plugin-solidity -local diagnostics = null_ls.builtins.diagnostics - -null_ls.setup({ - sources = { - -- Here you can add tools not supported by mason.nvim - -- make sure the source name is supported by null-ls - -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md - - diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }), - formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }), - formatting.prettier.with({ - extra_filetypes = { "toml" }, - extra_args = { - "--no-semi", - "--double-quote", - "--no-bracket-spacing", - "--tab-width", - "4", - "--bracket-same-line", - "--html-whitespace-sensitivity", - "strict", - }, - }), - -- formatting.markdownlint.with({ extra_filetypes = { "vimwiki" }, }), - formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }), - -- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), - -- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), - }, -}) - --- See mason-null-ls.nvim's documentation for more details: --- https://github.com/jay-babu/mason-null-ls.nvim#setup -require("mason-null-ls").setup({ - ensure_installed = { - "black", - "cbfmt", - "clang_format", - "cmake_format", - "cmake_lint", - "cpplint", - "djlint", - "google_java_format", - "luacheck", - "markdown_toc", - "mypy", - "stylua", - "usort", - "yamlfmt", - "rustywind", - "letexindent", - }, - automatic_installation = true, - handlers = { - -- Here you can add functions to register sources. - -- See https://github.com/jay-babu/mason-null-ls.nvim#handlers-usage - -- - -- If left empty, mason-null-ls will use a "default handler" - -- to register all sources - }, -}) - -local cmp = require("cmp") -local cmp_action = require("lsp-zero").cmp_action() -local luasnip = require("luasnip") - -local kind_icons = { - Text = "󰉿", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "", -} - -cmp.setup({ - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ select = true }), - }, - sources = { - { name = "gh_issues" }, - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "crates" }, - { name = "path" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "neorg" }, - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - formatting = { - fields = { "abbr", "kind", "menu" }, - format = function(entry, vim_item) - vim_item.kind = kind_icons[vim_item.kind] - vim_item.menu = ({ - nvim_lsp = "[LSP]", - nvim_lua = "[api]", - luasnip = "[snip]", - path = "[path]", - emoji = "[emoji]", - neorg = "[neorg]", - buffer = "[buf]", - gh_issues = "[issues]", - })[entry.source.name] - return vim_item - end, - }, - - experimental = { - ghost_text = true, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, -}) - -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua deleted file mode 100644 index 86c7e10..0000000 --- a/after/plugin/luasnip.lua +++ /dev/null @@ -1,75 +0,0 @@ -if not pcall(require, "luasnip") then - return -end - -local ls = require("luasnip") - -require("luasnip/loaders/from_vscode").lazy_load() - -local s = ls.snippet -local sn = ls.snippet_node -local isn = ls.indent_snippet_node -local t = ls.text_node -local i = ls.insert_node -local f = ls.function_node -local c = ls.choice_node -local d = ls.dynamic_node -local r = ls.restore_node -local events = require("luasnip.util.events") -local ai = require("luasnip.nodes.absolute_indexer") -local extras = require("luasnip.extras") -local l = extras.lambda -local rep = extras.rep -local p = extras.partial -local m = extras.match -local n = extras.nonempty -local dl = extras.dynamic_lambda -local fmt = require("luasnip.extras.fmt").fmt -local fmta = require("luasnip.extras.fmt").fmta -local conds = require("luasnip.extras.expand_conditions") -local postfix = require("luasnip.extras.postfix").postfix -local types = require("luasnip.util.types") -local parse = require("luasnip.util.parser").parse_snippet -local ms = ls.multi_snippet - -vim.keymap.set({ "i", "s" }, "", function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end -end, { silent = true }) - -vim.keymap.set({ "i", "s" }, "", function() - if ls.jumpable(-1) then - ls.jump(-1) - end -end, { silent = true }) - -vim.keymap.set({ "i" }, "", function() - if ls.choice_active() then - ls.change_choice(1) - end -end, { silent = true }) - -vim.keymap.set({ "i" }, "", function() - if ls.choice_active() then - ls.change_choice(-1) - end -end, { silent = true }) - -ls.config.set_config({ - -- This tells LuaSnip to remember to keep around the last snippet. - -- You can jump back into it even if you move outside of the selection - history = true, - -- This one is cool cause if you have dynamic snippets, it updates as you type! - updateevents = "TextChanged,TextChangedI", - -- Autosnippets: - enable_autosnippets = true, - -- Crazy highlights!! - ext_opts = { - [types.choiceNode] = { - active = { - virt_text = { { " « ", "NonTest" } }, - }, - }, - }, -}) diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua deleted file mode 100644 index 567877c..0000000 --- a/after/plugin/neorg.lua +++ /dev/null @@ -1,31 +0,0 @@ -if not pcall(require, "neorg") then - return -end - -require("neorg").setup({ - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.concealer"] = {}, -- Adds pretty icons to your documents - ["core.dirman"] = { -- Manages Neorg workspaces - config = { - workspaces = { - university = "~/neorg/University", - }, - default_workspace = "university", - }, - }, - ["core.completion"] = { - config = { - engine = "nvim-cmp", - name = "[Neorg]", - }, - }, - ["core.export.markdown"] = {}, - ["core.summary"] = { - config = { - strategy = "default", - }, - }, - -- ["core.ui.calendar"] = {}, - }, -}) diff --git a/after/plugin/obsidian.lua b/after/plugin/obsidian.lua deleted file mode 100644 index 8cadd15..0000000 --- a/after/plugin/obsidian.lua +++ /dev/null @@ -1,37 +0,0 @@ -if not pcall(require, "obsidian") then - return -end - -require("obsidian").setup({ - dir = "~/obsidian", - notes_subdir = "university", - - completion = { - nvim_cmp = true, - min_chars = 2, - new_notes_location = "current_dir", - prepend_note_id = true, - }, - - mappings = { - ["gf"] = require("obsidian.mapping").gf_passthrough(), - }, - - -- templates = { - -- subdir = "university/templates", - -- date_format = "%Y.%m.%d", - -- time_format = "%H:%M:%S", - -- }, - - backlinks = { - height = 10, - wrap = true, - }, - - follow_url_func = function(url) - vim.fn.jobstart({ "xdg-open", url }) - end, - use_advanced_uri = true, - open_app_foreground = false, - open_notes_in = "current", -}) diff --git a/after/plugin/oil.lua b/after/plugin/oil.lua deleted file mode 100644 index 2357f6f..0000000 --- a/after/plugin/oil.lua +++ /dev/null @@ -1,135 +0,0 @@ -if not pcall(require, "oil") then - return -end - -local nmap = require("solo.mappings").nmap -nmap("-", vim.cmd.Oil, "Open parent directory") - -require("oil").setup({ - -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) - -- Set to false if you still want to use netrw. - default_file_explorer = true, - -- Id is automatically added at the beginning, and name at the end - -- See :help oil-columns - columns = { - "icon", - -- "permissions", - "size", - -- "mtime", - }, - -- Buffer-local options to use for oil buffers - buf_options = { - buflisted = false, - bufhidden = "hide", - }, - -- Window-local options to use for oil buffers - win_options = { - wrap = false, - signcolumn = "no", - cursorcolumn = false, - foldcolumn = "0", - spell = false, - list = false, - conceallevel = 3, - concealcursor = "n", - }, - -- Restore window options to previous values when leaving an oil buffer - restore_win_options = true, - -- Skip the confirmation popup for simple operations - skip_confirm_for_simple_edits = false, - -- Deleted files will be removed with the trash_command (below). - delete_to_trash = true, - -- Change this to customize the command used when deleting to trash - trash_command = "trash-put", - -- Selecting a new/moved/renamed file or directory will prompt you to save changes first - prompt_save_on_select_new_entry = true, - -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap - -- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true }) - -- Additionally, if it is a string that matches "actions.", - -- it will use the mapping at require("oil.actions"). - -- Set to `false` to remove a keymap - -- See :help oil-actions for a list of all available actions - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - ["v"] = "actions.select_vsplit", - ["h"] = "actions.select_split", - ["t"] = "actions.select_tab", - ["p"] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", - ["Y"] = "actions.copy_entry_path", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = "actions.tcd", - ["."] = "actions.toggle_hidden", - }, - -- Set to false to disable all of the above keymaps - use_default_keymaps = false, - view_options = { - -- Show files and directories that start with "." - show_hidden = true, - -- This function defines what is considered a "hidden" file - is_hidden_file = function(name, bufnr) - return vim.startswith(name, ".") - end, - -- This function defines what will never be shown, even when `show_hidden` is set - is_always_hidden = function(name, bufnr) - return false - end, - }, - -- Configuration for the floating window in oil.open_float - float = { - -- Padding around the floating window - padding = 2, - max_width = 0, - max_height = 0, - border = "rounded", - win_options = { - winblend = 10, - }, - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - override = function(conf) - return conf - end, - }, - -- Configuration for the actions floating preview window - preview = { - -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_width and max_width can be a single value or a list of mixed integer/float types. - -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" - max_width = 0.9, - -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" - min_width = { 40, 0.4 }, - -- optionally define an integer/float for the exact width of the preview window - width = nil, - -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_height and max_height can be a single value or a list of mixed integer/float types. - -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" - max_height = 0.9, - -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" - min_height = { 5, 0.1 }, - -- optionally define an integer/float for the exact height of the preview window - height = nil, - border = "rounded", - win_options = { - winblend = 0, - }, - }, - -- Configuration for the floating progress window - progress = { - max_width = 0.9, - min_width = { 40, 0.4 }, - width = nil, - max_height = { 10, 0.9 }, - min_height = { 5, 0.1 }, - height = nil, - border = "rounded", - minimized_border = "none", - win_options = { - winblend = 0, - }, - }, -}) diff --git a/after/plugin/runner.lua b/after/plugin/runner.lua deleted file mode 100644 index 4dc587a..0000000 --- a/after/plugin/runner.lua +++ /dev/null @@ -1,50 +0,0 @@ -if not pcall(require, "runner") then - return -end - -local runner = require("runner") -local choice = require("runner.handlers.helpers").choice -local helpers = require("runner.handlers.helpers") - -runner.setup({ - position = "right", -- position of the terminal window when using the shell_handler - -- can be: top, left, right, bottom - -- will be overwritten when using the telescope mapping to open horizontally or vertically - width = 50, -- width of window when position is left or right - height = 10, -- height of window when position is top or bottom -}) - -runner.set_handler( - "cpp", - choice({ - Cmake = function() - -- vim.cmd.CMakeBuild() - vim.cmd.CMakeRun() - end, - Makefile = helpers.shell_handler("make"), - ["g++"] = helpers.shell_handler( - "g++ " .. vim.fn.expand("%") .. " -o " .. vim.fn.expand("%:r") .. " && " .. vim.fn.expand("%:r") - ), - Custom = helpers.shell_handler("", true), - }) -) - -runner.set_handler( - "c", - choice({ - Cmake = vim.cmd.CMakeRun, - Makefile = helpers.shell_handler("make"), - ["gcc"] = helpers.shell_handler( - "gcc " .. vim.fn.expand("%") .. " -o " .. vim.fn.expand("%:r") .. " && " .. vim.fn.expand("%:r") - ), - Custom = helpers.shell_handler("", true), - }) -) - --- runner.set_handler( --- "python", --- choice({ --- Python = helpers.shell_handler("python " .. vim.fn.expand("%:t")), --- Custom = helpers.shell_handler("", true), --- }) --- ) diff --git a/after/plugin/rust-tools.lua b/after/plugin/rust-tools.lua deleted file mode 100644 index 5ba16e4..0000000 --- a/after/plugin/rust-tools.lua +++ /dev/null @@ -1,30 +0,0 @@ -if not pcall(require, "rust-tools") then - return -end - -require("rust-tools").setup({ - tools = { - on_initialized = function() - vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, { - group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }), - pattern = { "*.rs" }, - callback = function() - vim.lsp.codelens.refresh() - end, - }) - end, - reload_workspace_from_cargo_toml = true, - inlay_hints = { - auto = true, - only_current_line = false, - show_parameter_hints = true, - parameter_hints_prefix = " <- ", - other_hints_prefix = " => ", - max_len_align = false, - max_len_align_padding = 1, - right_align = false, - right_align_padding = 7, - highlight = "Comment", - }, - }, -}) diff --git a/after/plugin/snips/rust.lua b/after/plugin/snips/rust.lua index 0aada9a..1153cdb 100644 --- a/after/plugin/snips/rust.lua +++ b/after/plugin/snips/rust.lua @@ -14,13 +14,12 @@ ls.add_snippets("rust", { "modtest", fmt( [[ - #[cfg(test)] - mod tests {{ - use super::*; - - {} - }} - ]], + #[cfg(test)] + mod tests {{ + use super::*; + {} + }} + ]], { i(1), } diff --git a/after/plugin/sql_rust_automagic.lua b/after/plugin/sql_rust_automagic.lua new file mode 100644 index 0000000..0e69494 --- /dev/null +++ b/after/plugin/sql_rust_automagic.lua @@ -0,0 +1,89 @@ +local run_formatter = function(text) + local split = vim.split(text, "\n") + local result = table.concat(vim.list_slice(split, 2, #split - 1), "\n") + + -- Finds sql-format-via-python somewhere in your nvim config path + local bin = vim.api.nvim_get_runtime_file("bin/sql-format-via-python.py", false)[1] + + local j = require("plenary.job"):new({ + command = "python", + args = { bin }, + writer = { result }, + }) + return j:sync() +end + +local embedded_sql = vim.treesitter.query.parse( + "rust", + [[ +(macro_invocation + (scoped_identifier + path: (identifier) @path (#eq? @path "sqlx")) + + (token_tree + (raw_string_literal) @sql) + (#offset! @sql 1 0 -1 0)) +]] +) + +local get_root = function(bufnr) + local parser = vim.treesitter.get_parser(bufnr, "rust", {}) + local tree = parser:parse()[1] + return tree:root() +end + +local format_dat_sql = function(bufnr) + bufnr = bufnr or vim.api.nvim_get_current_buf() + + if vim.bo[bufnr].filetype ~= "rust" then + vim.notify("can only be used in rust") + return + end + + local root = get_root(bufnr) + + local changes = {} + for id, node in embedded_sql:iter_captures(root, bufnr, 0, -1) do + local name = embedded_sql.captures[id] + if name == "sql" then + -- { start row, start col, end row, end col } + local range = { node:range() } + local indentation = string.rep(" ", range[2]) + + -- Run the formatter, based on the node text + local formatted = run_formatter(vim.treesitter.get_node_text(node, bufnr)) + + -- Add some indentation (can be anything you like!) + for idx, line in ipairs(formatted) do + formatted[idx] = indentation .. line + end + + -- Keep track of changes + -- But insert them in reverse order of the file, + -- so that when we make modifications, we don't have + -- any out of date line numbers + table.insert(changes, 1, { + start = range[1] + 1, + final = range[3], + formatted = formatted, + }) + end + end + + for _, change in ipairs(changes) do + vim.api.nvim_buf_set_lines(bufnr, change.start, change.final, false, change.formatted) + end +end + +vim.api.nvim_create_user_command("SqlMagic", function() + format_dat_sql() +end, {}) + +local group = vim.api.nvim_create_augroup("rust-sql-magic", { clear = true }) +vim.api.nvim_create_autocmd("BufWritePre", { + group = group, + pattern = "*.rs", + callback = function() + format_dat_sql() + end, +}) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua deleted file mode 100644 index efa3bb8..0000000 --- a/after/plugin/telescope.lua +++ /dev/null @@ -1,177 +0,0 @@ -if not pcall(require, "telescope") then - return -end - -vim.keymap.set("n", "", require("telescope.builtin").git_files, {}) - -local telescope = require("telescope") -local actions = require("telescope.actions") - -telescope.setup({ - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - }, - prompt_prefix = " ", - selection_caret = " ", - path_display = { "smart" }, - file_ignore_patterns = { ".git/", ".spl", "target/" }, - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.delete_buffer + actions.move_to_top, - -- [""] = actions.remove_selection - }, - }, - }, - pickers = { - find_files = { - hidden = true, - follow = true, - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - }, - media_files = { - -- filetypes whitelist - filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" }, - find_cmd = "rg", - }, - emoji = { - action = function(emoji) - -- argument emoji is a table. - -- {name="", value="", cagegory="", description=""} - - vim.fn.setreg("*", emoji.value) - print([[Press p or "*p to paste this emoji]] .. emoji.value) - - -- insert emoji when picked - -- vim.api.nvim_put({ emoji.value }, 'c', false, true) - end, - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown({ - -- even more opts - }), - - -- pseudo code / specification for writing custom displays, like the one - -- for "codeactions" - -- specific_opts = { - -- [kind] = { - -- make_indexed = function(items) -> indexed_items, width, - -- make_displayer = function(widths) -> displayer - -- make_display = function(displayer) -> function(e) - -- make_ordinal = function(e) -> string - -- }, - -- -- for example to disable the custom builtin "codeactions" display - -- do the following - -- codeactions = false, - -- } - }, - lazy = { - -- Optional theme (the extension doesn't set a default theme) - theme = "dropdown", - previewer = false, - -- Whether or not to show the icon in the first column - show_icon = true, - -- Mappings for the actions - mappings = { - open_in_browser = "", - open_in_file_browser = "", - open_in_find_files = "", - open_in_live_grep = "", - open_plugins_picker = "", -- Works only after having called first another action - open_lazy_root_find_files = "f", - open_lazy_root_live_grep = "g", - }, - -- Other telescope configuration options - }, - http = { - -- How the mozilla url is opened. By default will be configured based on OS: - open_url = "xdg-open %s", -- UNIX - -- open_url = 'open %s' -- OSX - -- open_url = 'start %s' -- Windows - }, - heading = { - treesitter = true, - picker_opts = { - layout_config = { width = 0.8, preview_width = 0.5 }, - layout_strategy = "horizontal", - }, - }, - bibtex = { - -- Depth for the *.bib file - depth = 1, - -- Custom format for citation label - custom_formats = {}, - -- Format to use for citation label. - -- Try to match the filetype by default, or use 'plain' - format = "", - -- Path to global bibliographies (placed outside of the project) - global_files = {}, - -- Define the search keys to use in the picker - search_keys = { "author", "year", "title" }, - -- Template for the formatted citation - citation_format = "{{author}} ({{year}}), {{title}}.", - -- Only use initials for the authors first name - citation_trim_firstname = true, - -- Max number of authors to write in the formatted citation - -- following authors will be replaced by "et al." - citation_max_auth = 2, - -- Context awareness disabled by default - context = false, - -- Fallback to global/directory .bib files if context not found - -- This setting has no effect if context = false - context_fallback = true, - -- Wrapping in the preview window is disabled by default - wrap = false, - }, - undo = { - use_delta = true, - use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" } - side_by_side = false, - diff_context_lines = vim.o.scrolloff, - entry_format = "state #$ID, $STAT, $TIME", - time_format = "", - mappings = { - i = { - -- IMPORTANT: Note that telescope-undo must be available when telescope is configured if - -- you want to replicate these defaults and use the following actions. This means - -- installing as a dependency of telescope in it's `requirements` and loading this - -- extension from there instead of having the separate plugin definition as outlined - -- above. - [""] = require("telescope-undo.actions").yank_additions, - [""] = require("telescope-undo.actions").yank_deletions, - [""] = require("telescope-undo.actions").restore, - }, - }, - }, - }, -}) - -pcall(telescope.load_extension, "fzf") -pcall(telescope.load_extension, "media_files") -- Telescope media_files -pcall(telescope.load_extension, "git_worktree") -- Telescope git_worktree -pcall(telescope.load_extension, "lazy") -- Telescope lazy -pcall(telescope.load_extension, "software-licenses") -- Telescope software-licenses list -pcall(telescope.load_extension, "http") -- Telescope http list -pcall(telescope.load_extension, "heading") -- Telescope heading -pcall(telescope.load_extension, "luasnip") -- Telescope luasnip -pcall(telescope.load_extension, "git_diffs") -- Telescope git_diffs diff_commits -pcall(telescope.load_extension, "bibtex") -- Telescope bibtex -pcall(telescope.load_extension, "undo") -- Telescope undo diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua deleted file mode 100644 index b45e0ac..0000000 --- a/after/plugin/treesitter.lua +++ /dev/null @@ -1,82 +0,0 @@ -if not pcall(require, "nvim-treesitter") then - return -end - -require("nvim-treesitter.configs").setup({ - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "cpp", "lua", "rust", "python", "markdown" }, -- one of "all" or a list of languages - -- 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 (for "all") - ignore_install = { "latex" }, - modules = {}, - - highlight = { - enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = { "markdown" }, - - 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, - }, - indent = { - enable = true, - }, - autopairs = { - enable = true, - }, - autotag = { - enable = true, - enable_rename = true, - enable_close = true, - enable_close_on_slash = true, - filetypes = { - "astro", - "glimmer", - "handlebars", - "hbs", - "html", - "htmldjango", - "javascript", - "javascriptreact", - "jsx", - "markdown", - "php", - "rescript", - "svelte", - "tsx", - "typescript", - "typescriptreact", - "vue", - "xml", - }, - }, - -- incremenral_selection = { - -- enable = true, - -- keymaps = { - -- init_selection = "", - -- node_selection = "", - -- scope_selection = "", - -- node_deselection = "", - -- }, - -- }, - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {}, -- table of colour name strings - }, -}) diff --git a/after/plugin/whichkey.lua b/after/plugin/whichkey.lua deleted file mode 100644 index ba2fe7c..0000000 --- a/after/plugin/whichkey.lua +++ /dev/null @@ -1,346 +0,0 @@ -if not pcall(require, "which-key") then - return -end - -local which_key = require("which-key") -local builtin = require("telescope.builtin") -local extensions = require("telescope").extensions -local setup = { - plugins = { - marks = true, -- shows a list of your marks on " and ` - registers = true, -- shows your registers on " in NORMAL or in INSERT mode - spelling = { - enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions - suggestions = 20, -- how many suggestions should be shown in the list? - }, - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion - motions = true, -- adds help for motions - text_objects = true, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g - }, - }, - -- add operators that will trigger motion and text object completion - -- to enable all native operators, set the preset / operators plugin above - -- operators = { gc = "Comments" }, - key_labels = { - -- override the label used to display some keys. It doesn"t effect WK in any other way. - -- For example: - -- [""] = "SPC", - -- [""] = "RET", - -- [""] = "TAB", - }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "➜", -- symbol used between a key and it"s label - group = "+", -- symbol prepended to a group - }, - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - window = { - border = "rounded", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 0, - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - align = "left", -- align columns left, center or right - }, - ignore_missing = true, -- enable this to hide mappings for which you didn"t specify a label - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate - show_help = true, -- show help message on the command line when the popup is visible - triggers = "auto", -- automatically setup triggers - -- triggers = {""} -- or specify a list manually - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - -- this is mostly relevant for key maps that start with a native binding - -- most people should not need to change this - i = { "j", "k" }, - v = { "j", "k" }, - }, -} - -local opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} -local vopts = { - mode = "v", -- VISUAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} --- NOTE: Prefer using : over as the latter avoids going back in normal-mode. --- see https://neovim.io/doc/user/map.html#:map-cmd -local vmappings = {} - -local mappings = { - c = { vim.cmd.bdelete, "[C]lose Buffer" }, - x = { "!chmod +x %", "chmod & run" }, - mr = { "CellularAutomaton make_it_rain", "[M]ake it [R]ain" }, - u = { vim.cmd.UndotreeToggle, "Toggle [U]ndotree" }, - T = { vim.cmd.TagbarToggle, "Toggle [T]agbar" }, - ["/"] = { - function() - builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ previewer = false })) - end, - "Current Buffer Fuzzy", - }, - f = { - function() - builtin.find_files(require("telescope.themes").get_dropdown({ previewer = false })) - end, - "Find [F]iles", - }, - F = { builtin.live_grep, "Live Grep" }, - b = { builtin.buffers, "Find [B]uffers" }, - ha = { require("harpoon.mark").add_file, "[H]arpoon [A]dd File" }, - hm = { require("harpoon.ui").toggle_quick_menu, "[H]arpoon [M]enu" }, - s = { - name = "Telescope [S]earch", - s = { builtin.grep_string, "[S]tring under the cursor" }, - e = { builtin.symbols, "[E]moji" }, - d = { builtin.diagnostic, "[D]iagnostics" }, - b = { builtin.git_branches, "Checkout [B]ranch" }, - h = { builtin.help_tags, "[H]elp" }, - M = { builtin.man_pages, "[M]an Pages" }, - r = { builtin.oldfiles, "Open [R]ecent Files" }, - R = { builtin.registers, "[R]egisters" }, - g = { builtin.live_grep, "[G]rep" }, - G = { builtin.git_files, "[G]it Files" }, - k = { builtin.keymaps, "[K]eymaps" }, - C = { builtin.commands, "[C]ommands" }, - t = { vim.cmd.TodoTelescope, "[T]odo" }, - m = { extensions.media_files.media_files, "[M]edia" }, - c = { - function() - builtin.colorscheme({ enable_preview = true }) - end, - "[C]olorscheme with Preview", - }, - l = { extensions.lazy.lazy, "[L]azy" }, - L = { extensions.luasnip.luasnip, "[L]uasnip" }, - D = { - name = "[D]evelopment", - s = { "Telescope software-licenses find", "[S]oftware Licenses" }, - h = { extensions.http.list, "[H]TTP" }, - }, - H = { extensions.heading.heading, "[H]eading" }, - }, - gg = { vim.cmd.LazyGit, "Lazygit" }, - gb = { - function() - vim.cmd.Gitsigns("blame_line") - end, - "[G]it [B]lame", - }, - gw = { require("telescope").extensions.git_worktree.git_worktrees, "[G]it Change [W]orktree" }, - gn = { require("telescope").extensions.git_worktree.create_git_worktree, "[G]it Create [N]ew Worktree" }, - gd = { require("telescope").extensions.git_diffs.diff_commits, "[G]it [D]iff" }, - l = { - name = "[L]SP", - ca = { vim.lsp.buf.code_action, "[C]ode [A]ction" }, - D = { vim.lsp.buf.type_definition, "Type [D]efinitions" }, - f = { - function() - vim.lsp.buf.format({ async = true }) - end, - "[F]ormat", - }, - o = { vim.diagnostic.open_float, "[O]pen Float" }, - s = { vim.diagnostic.setloclist, "[S]etloclist" }, - j = { - function() - vim.diagnostic.goto_next() - vim.cmd("norm zz") - end, - "Next Diagnostic", - }, - k = { - function() - vim.diagnostic.goto_prev() - vim.cmd("norm zz") - end, - "Prev Diagnostic", - }, - r = { vim.lsp.buf.rename, "[R]ename" }, - ds = { builtin.lsp_document_symbols, "[D]ocument [S]ymbols" }, - w = { - d = { builtin.diagnostics, "[W]orkspace [D]iagnostics" }, - s = { builtin.lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols" }, - a = { vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder" }, - r = { vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder" }, - l = { - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, - "[W]orkspace [L]ist Folder", - }, - }, - q = { builtin.quickfix, "Telescope [Q]uickfix" }, - }, - r = { - name = "[R]ust", - e = { vim.cmd.RustExpandMacro, "[E]xpand macro" }, - c = { vim.cmd.RustOpenCargo, "Open [C]argo.toml" }, - p = { vim.cmd.RustParentModule, "[P]arent module" }, - h = { vim.cmd.RustHoverActions, "[H]over actions" }, - g = { vim.cmd.RustViewCrateGraph, "View Create [G]raph" }, - d = { vim.cmd.RustOpenExternalDocs, "Open External [D]ocs" }, - r = { vim.cmd.RustRunnables, "Open [R]unnables" }, - a = { vim.cmd.RustCodeAction, "Code [A]ction Groups" }, - }, - L = { - name = "[L]anguage settings", - c = { "setlocal formatoptions-=cro", "Disable autocomment" }, - C = { "setlocal formatoptions=cro", "Enable autocomment" }, - s = { "setlocal spell!", "Toggle spellchecker" }, - e = { "setlocal spell spelllang=en_us", "Enable English spellchecker" }, - l = { "setlocal spell spelllang=lv_LV", "Enable Lavian spellchecker" }, - I = { "setlocal autoindent", "Enable autoindent" }, - i = { "setlocal noautoindent", "Disable autoindent" }, - }, - d = { - name = "[D]AP", - d = { require("dap").toggle_breakpoint, "Set breakpoint" }, - D = { - function() - require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) - end, - "Set Breakpoint with Condition", - }, - p = { - name = "[P]ython", - m = { require("dap-python").test_method, "Test [M]ethod" }, - c = { require("dap-python").test_class, "Test [C]lass" }, - s = { require("dap-python").debug_selection, "Debug [S]election" }, - }, - r = { - name = "[R]ust", - d = { vim.cmd.RustDebuggables, "[D]ebug" }, - }, - t = { require("dapui").toggle, "[T]oggle DAP-UI" }, - c = { require("dap").continue, "Launch Debug Sessions and Resume Execution" }, - i = { require("dap").step_into, "Step [I]nto Code" }, - o = { require("dap").step_over, "Step [O]ver Code" }, - O = { require("dap").step_out, "Step [O]ut of Code" }, - T = { require("dap").terminate, "[T]erminate" }, - l = { require("dap").run_last, "Run [L]ast" }, - h = { require("dap.ui.widgets").hover, "[H]over" }, - P = { require("dap.ui.widgets").preview, "[P]review" }, - f = { - function() - local widgets = require("dap.ui.widgets") - widgets.centered_float(widgets.frames) - end, - "[F]rames", - }, - s = { - function() - local widgets = require("dap.ui.widgets") - widgets.centered_float(widgets.scopes) - end, - "[S]copes", - }, - }, - w = { - name = "Vim[W]iki", - w = { vim.cmd.VimwikiIndex, "Open index file" }, - t = { vim.cmd.VimwikiTabIndex, "Open Index File in New [T]ab" }, - s = { vim.cmd.VimwikiUISelect, "Display List of Wikis" }, - i = { vim.cmd.VimwikiDiaryIndex, "Open Diary Index" }, - h = { vim.cmd.Vimwiki2HTML, "Convert File to HTML" }, - H = { vim.cmd.Vimwiki2HTMLBrowse, "Convert File to HTML and open in Browser" }, - n = { vim.cmd.VimwikiGoto, "Goto link provided by an argument" }, - d = { vim.cmd.VimwikiDeleteFile, "Rename file" }, - r = { vim.cmd.VimwikiRenameFile, "Delete file" }, - }, - t = { - name = "Vim[T]ex", - b = { vim.cmd.VimtexCompile, "[B]uild" }, - v = { vim.cmd.VimtexView, "[V]iew" }, - w = { vim.cmd.VimtexCountWords, "[W]ord Count" }, - t = { vim.cmd.VimtexTocToggle, "[T]able of Contents" }, - c = { vim.cmd.VimtexClean, "[C]lean aux" }, - e = { vim.cmd.VimtexErrors, "Report [E]rrors" }, - i = { vim.cmd.VimtexInfo, "[I]nfo" }, - B = { builtin.bibtex, "Telescope [B]ibtex" }, - }, - p = { - name = "Tem[p]lates", - l = { - name = "[L]aTeX", - p = { - function() - vim.cmd.read("~/Templates/LaTeX/PhilPaper.tex") - end, - "PhilPaper.tex", - }, - l = { - function() - vim.cmd.read("~/Templates/LaTeX/Letter.tex") - end, - "Letter.tex", - }, - g = { - function() - vim.cmd.read("~/Templates/LaTeX/Glossary.tex") - end, - "Glossary.tex", - }, - h = { - function() - vim.cmd.read("~/Templates/LaTeX/HandOut.tex") - end, - "HandOut.tex", - }, - b = { - function() - vim.cmd.read("~/Templates/LaTeX/PhilBeamer.tex") - end, - "PhilBeamer.tex", - }, - s = { - function() - vim.cmd.read("~/Templates/LaTeX/SubFile.tex") - end, - "SubFile.tex", - }, - r = { - function() - vim.cmd.read("~/Templates/LaTeX/Root.tex") - end, - "Root.tex", - }, - m = { - function() - vim.cmd.read("~/Templates/LaTeX/MultipleAnswer.tex") - end, - "MultipleAnswer.tex", - }, - }, - c = { - name = "[C]make", - }, - }, -} - -which_key.setup(setup) -which_key.register(mappings, opts, vopts, vmappings) diff --git a/bin/sql-format-via-python.py b/bin/sql-format-via-python.py new file mode 100644 index 0000000..d5345af --- /dev/null +++ b/bin/sql-format-via-python.py @@ -0,0 +1,30 @@ +import sys + +import sqlparse + +# TODO: Decide what to do about $/? +# contents = contents.replace(f"${identifier}", f"__id_{identifier}") + +contents = sys.stdin.read() +for identifier in range(10): + contents = contents.replace(f"?{identifier}", f"__id_{identifier}") + +# for nightshadedude +comma_first = False + +result = sqlparse.format( + contents, + indent_columns=True, + keyword_case="upper", + identifier_case="lower", + reindent=True, + output_format="sql", + indent_after_first=True, + wrap_after=80, + comma_first=comma_first, +) + +for identifier in range(10): + result = result.replace(f"__id_{identifier}", f"?{identifier}") + +print(result.strip()) diff --git a/lazy-lock.json b/lazy-lock.json index b264272..106b66d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,97 +1,105 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" }, - "ccc.nvim": { "branch": "main", "commit": "4a0ddaf787cc82796e84ab8a7f70d086f250aeb6" }, + "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, + "ccc.nvim": { "branch": "main", "commit": "ec6e23fd2c0bf4ffcf71c1271acdcee6e2c6f49c" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, "cheatsheet.nvim": { "branch": "master", "commit": "53325f0c7bef73f875d798f2a951362f4f3f50bc" }, - "clangd_extensions.nvim": { "branch": "main", "commit": "bafed83f79b5779f5b43e8e015e13ca99dcd8b3a" }, - "cloak.nvim": { "branch": "main", "commit": "ff5e746e787de14675396beb642bf5010b8bc96d" }, - "cmake-tools.nvim": { "branch": "master", "commit": "86bad7cb3ebc1cac51046e88cf62d5b962e8a1cc" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" }, + "cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" }, + "cmake-tools.nvim": { "branch": "master", "commit": "aba5b805082b3c1027ac4f5051b84c61989c34c8" }, + "cmp-async-path": { "branch": "main", "commit": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" }, + "cmp-dotenv": { "branch": "main", "commit": "fd78929551010bc20602e7e663e42a5e14d76c96" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nerdfont": { "branch": "main", "commit": "a3b7c0cadb7bd389f513eecda376d4c6bec90003" }, + "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": "18095520391186d634a0045dacaa346291096566" }, - "crates.nvim": { "branch": "main", "commit": "db629b5cfb2aa8de9e44efb795657297ee95ca91" }, - "darkplus.nvim": { "branch": "master", "commit": "7c236649f0617809db05cd30fb10fed7fb01b83b" }, - "diffview.nvim": { "branch": "main", "commit": "7e5a85c186027cab1e825d018f07c350177077fc" }, - "distant.nvim": { "branch": "v0.3", "commit": "998724f62386c8022a4e6c885f4509cf9477451a" }, - "dracula.nvim": { "branch": "main", "commit": "9fe831e685a76e1a1898a694623b33247c4d036c" }, - "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, - "git-worktree.nvim": { "branch": "master", "commit": "d7f4e2584e81670154f07ca9fa5dd791d9c1b458" }, - "gitsigns.nvim": { "branch": "main", "commit": "907ae8636016aab2f283576fc60d46ca3427e579" }, - "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, - "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, - "kanagawa.nvim": { "branch": "master", "commit": "a4e99f089110c6d00bc33f5497709200e914e763" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, - "lazygit.nvim": { "branch": "main", "commit": "75c920883f44243f2bbb172be423e484a58f7c45" }, - "lsp-zero.nvim": { "branch": "v2.x", "commit": "f3ad7327a92c4bf82dd43eaaef4e7e8109064187" }, + "cmp-pypi": { "branch": "main", "commit": "69a3c7eca2d430dabb8d8df5b17f4ce11b256f25" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf" }, + "crates.nvim": { "branch": "main", "commit": "8437522d12a8c523da2aee9db2979d070b2ecc33" }, + "darkplus.nvim": { "branch": "master", "commit": "617cc122718e04bafe3e8e56e46900a9b3084970" }, + "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "dracula.nvim": { "branch": "main", "commit": "a6cb758d4b182d9f2b7e742910078d94877c1059" }, + "friendly-snippets": { "branch": "main", "commit": "aced40b66b7bae9bc2c37fd7b11841d54727a7b0" }, + "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, + "gitsigns.nvim": { "branch": "main", "commit": "300a306da9973e81c2c06460f71fd7a079df1f36" }, + "harpoon": { "branch": "harpoon2", "commit": "2cd4e03372f7ee5692c8caa220f479ea07970f17" }, + "hypersonic.nvim": { "branch": "main", "commit": "a98dbd6b5ac1aac3cd895990e08d1ea40e67a9e3" }, + "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, + "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lazygit.nvim": { "branch": "main", "commit": "1e08e3f5ac1152339690140e61a4a32b3bdc7de5" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, - "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" }, - "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" }, - "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, - "melange-nvim": { "branch": "master", "commit": "517518347e41301bb2d1189d257f3918551a2ea5" }, - "neodev.nvim": { "branch": "main", "commit": "3ed1daafa0a6b64bf28ae083f1dedfd2f6fc0dcc" }, + "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b9084b1f42f790d6230dc66dbcb6bcc35b148552" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "558de4372d23bd432cc3594666c4d812cd071bbf" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" }, + "mason.nvim": { "branch": "main", "commit": "9c9416817c9f4e6f333c749327a1ed5355cfab61" }, + "melange-nvim": { "branch": "master", "commit": "ca3444c8e5002ee5ab6f077660317f869c7b6a36" }, + "neodev.nvim": { "branch": "main", "commit": "e7ca4a2ea0da5e39a639c08c3edb352b9355f09e" }, "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" }, - "neorg": { "branch": "main", "commit": "0b29eee79e08aa7e378748fd48f17dd69218749c" }, - "nightfly": { "branch": "master", "commit": "2737ba5b8d22ad6803bb0f51099f90c61bab566c" }, - "nightfox.nvim": { "branch": "main", "commit": "e886e39e592e89f316536a6f070365a9d88901c9" }, - "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" }, - "nvim-autopairs": { "branch": "master", "commit": "defad64afbf19381fe31488a7582bbac421d6e38" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "b3d4408e29d924fe130c9397a7c3b3630b3ea671" }, - "nvim-dap-python": { "branch": "master", "commit": "37b4cba02e337a95cb62ad1609b3d1dccb2e5d42" }, - "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, - "nvim-lspconfig": { "branch": "master", "commit": "57139c690dc8d594b2f9de8d1e609f2854a4fe45" }, - "nvim-surround": { "branch": "main", "commit": "1c2ef599abeeb98e40706830bcd27e90e259367a" }, - "nvim-treesitter": { "branch": "master", "commit": "5ec42175676bc4e6248b8ca9603acbc86497c68e" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" }, + "neorg": { "branch": "main", "commit": "28cbafbc0cde316d8e2618ff26377200225e9393" }, + "nightfly": { "branch": "master", "commit": "0c5f52d717c65951173455a70592f6383b3487e7" }, + "nightfox.nvim": { "branch": "main", "commit": "7e9487875dc5f69a2fd6f60d3a3ef4fb457b57c1" }, + "none-ls.nvim": { "branch": "main", "commit": "a311c7cc8f17543143a7482cdbe3a384c371d56a" }, + "nvim": { "branch": "main", "commit": "bc1f2151f23227ba02ac203c2c59ad693352a741" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" }, + "nvim-dap-python": { "branch": "master", "commit": "091e4ae00a12085f9ed4200a3cd04af7179b8a23" }, + "nvim-dap-ui": { "branch": "master", "commit": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "d4542ac257d3c7ee4131350db6179ae6340ce40b" }, + "nvim-lspconfig": { "branch": "master", "commit": "8917d2c830e04bf944a699b8c41f097621283828" }, + "nvim-surround": { "branch": "main", "commit": "0c02c52182a9c2a7fa7e122b4037f6408e98434a" }, + "nvim-treesitter": { "branch": "master", "commit": "81660800352ecab6a2e95f4ca30d637df1f3765e" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, - "nvim-web-devicons": { "branch": "master", "commit": "925e2aa30dc9fe9332060199c19f132ec0f3d493" }, - "obsidian.nvim": { "branch": "main", "commit": "256ca787b975923ff781bfbcb581ec685791477e" }, - "oil.nvim": { "branch": "master", "commit": "9e036c6a4868b971127f3cb6bac6197bb4103723" }, - "onedark.nvim": { "branch": "master", "commit": "dac8c39812dae025255c9069a260e1f69d967927" }, - "playground": { "branch": "master", "commit": "429f3e76cbb1c59fe000b690f7a5bea617b890c0" }, - "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, + "nvim-web-devicons": { "branch": "master", "commit": "b427ac5f9dff494f839e81441fb3f04a58cbcfbc" }, + "oil.nvim": { "branch": "master", "commit": "bf753c3e3f8736939ad5597f92329dfe7b1df4f5" }, + "onedark.nvim": { "branch": "master", "commit": "14e5de43cf1ff761c280d1ff5b9980897f5b46c7" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "663246936325062427597964d81d30eaa42ab1e4" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "rainbow_csv": { "branch": "master", "commit": "2dbf302ed77d40bac6d1db3028c66c301606f087" }, + "rainbow_csv": { "branch": "master", "commit": "6955d13a65e0161e8dad488b6045441d527d62ec" }, "runner.nvim": { "branch": "main", "commit": "237f7b72c10c34f60c55022d2d79a5f8e5a531a5" }, - "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, - "sqls.nvim": { "branch": "main", "commit": "4b1274b5b44c48ce784aac23747192f5d9d26207" }, - "tagbar": { "branch": "master", "commit": "402e3e117fc7b47e43dbb87c51064daae3bc3bf3" }, - "telescope-bibtex.nvim": { "branch": "master", "commit": "e4dcf64d351db23b14be3563190cf68d5cd49e90" }, + "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "tagbar": { "branch": "master", "commit": "fcd31ec145bbc628b90371be381717a1498b7c12" }, + "telescope-bibtex.nvim": { "branch": "master", "commit": "b10ec78df938a1e06217f965b32fb1b960681cff" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-git-diffs.nvim": { "branch": "main", "commit": "366df26227e6d478d5c55e04771d61875c4f22ac" }, "telescope-heading.nvim": { "branch": "main", "commit": "23ce2c9ef252aecbaa37300c1209b5ef2b51e6c5" }, "telescope-http.nvim": { "branch": "main", "commit": "b44065749560b3adfdb94bfd751642f0e480af4f" }, - "telescope-lazy.nvim": { "branch": "main", "commit": "686cbcfc384f3874bc7f7e55f85ce9b7a08921a0" }, - "telescope-luasnip.nvim": { "branch": "master", "commit": "849c4ee1951f34041a26744d2a88284545564ff0" }, + "telescope-lazy.nvim": { "branch": "main", "commit": "7a360fc33d0728cf0c18c0032ca36ebfe3cd2a8c" }, + "telescope-luasnip.nvim": { "branch": "master", "commit": "2ef7da3a363890686dbaad18ddbf59177cfe4f78" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, - "telescope-software-licenses.nvim": { "branch": "master", "commit": "cf47d9be3cc75c52ccbc13d1c212c13bc850a51a" }, - "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" }, - "telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" }, - "telescope.nvim": { "branch": "master", "commit": "59812c26d826e8c717e29406267ea1260f71e103" }, - "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, - "tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" }, - "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, + "telescope-software-licenses.nvim": { "branch": "master", "commit": "fb5fc33b6afc994756e2f372423c365bf66f2256" }, + "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" }, + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, + "tokyonight.nvim": { "branch": "main", "commit": "e3301873c1e96903daebb98cc9b5926810bf73dd" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, + "typst.vim": { "branch": "main", "commit": "816ba15885cb5eb742e06bafcd53b1a8531d334b" }, + "undotree": { "branch": "master", "commit": "d9c8b4ef872e078e8c4080812e5a3ed56d151c00" }, "vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" }, "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, - "vim-dadbod": { "branch": "master", "commit": "7d80bbd11c407a09e0f7b869c38f3dec3902805f" }, - "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, - "vim-dadbod-ui": { "branch": "master", "commit": "8157b4cf7d2111c40db28473114cab362020b7d1" }, - "vim-fugitive": { "branch": "master", "commit": "6fcb0ad03982de646e3fecb6915e585651b9a9fb" }, - "vim-illuminate": { "branch": "master", "commit": "8c910b2f84ae6acd9b4b17330bb94dd783c0c11a" }, + "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, + "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, + "vim-dadbod-ui": { "branch": "master", "commit": "e99dcfd5162d9b9b4b24a5d035cf114315f1aeec" }, + "vim-fugitive": { "branch": "master", "commit": "854a8df0d06b8d3fcb30fa7f2b08c62b553eee3b" }, + "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, - "vim-tmux-navigator": { "branch": "master", "commit": "addb64a772cb4a3ae1f1363583012b2cada2cd66" }, - "vimtex": { "branch": "master", "commit": "2b8a5f16a5768b3ae1780c266b73022dbb658af1" }, - "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, - "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } + "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, + "vimtex": { "branch": "master", "commit": "fe20ab1bd82a23441ac55054afefcd60001947a2" }, + "vimwiki": { "branch": "dev", "commit": "d0e6d5e517120c85e25d5e32d60bbd26f7d82451" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" }, + "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins.lua deleted file mode 100644 index 817734b..0000000 --- a/lua/plugins.lua +++ /dev/null @@ -1,287 +0,0 @@ -return { - -- core - { "folke/lazy.nvim" }, - { "nvim-lua/plenary.nvim" }, - - -- useful - { "ThePrimeagen/harpoon" }, - { "preservim/tagbar" }, - { "alvan/vim-closetag" }, - { "mbbill/undotree" }, - { - "doctorfree/cheatsheet.nvim", - event = "VeryLazy", - dependencies = { - { "nvim-telescope/telescope.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-lua/plenary.nvim" }, - }, - }, - - { - "kylechui/nvim-surround", - event = "VeryLazy", - opts = true, - }, - { "christoomey/vim-tmux-navigator" }, - { "folke/todo-comments.nvim", opts = true }, - { "stevearc/oil.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } }, - { - "chipsenkbeil/distant.nvim", - branch = "v0.3", - config = function() - require("distant"):setup() - end, - }, - { "laytan/cloak.nvim" }, - { "numToStr/Comment.nvim", event = { "BufReadPre", "BufNewFile" } }, - { "folke/which-key.nvim", lazy = true }, - { - "MarcHamamji/runner.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - }, - - -- lsp - { - "VonHeikemen/lsp-zero.nvim", - branch = "v2.x", - dependencies = { - -- LSP Support - { "neovim/nvim-lspconfig" }, - { - "williamboman/mason.nvim", - opts = { - ui = { - border = "single", - }, - }, - }, - { - "williamboman/mason-lspconfig.nvim", - opts = { - automatic_installation = true, - automatic_setup = true, - }, - }, - - -- Autocompletion - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- buffer completions - "hrsh7th/cmp-path", -- path completionsplu - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - }, - }, - { "hrsh7th/cmp-nvim-lsp" }, - { - "L3MON4D3/LuaSnip", - build = "make install_jsregexp", - dependencies = { - "rafamadriz/friendly-snippets", -- a bunch of snippets to use - }, - }, - { "saadparwaiz1/cmp_luasnip" }, - }, - }, - { - "folke/neodev.nvim", - opts = { - library = { plugins = { "nvim-dap-ui" }, types = true }, - }, - dependencies = { - "rcarriga/nvim-dap-ui", - }, - }, - { "elkowar/yuck.vim", ft = "yuck" }, - { "nanotee/sqls.nvim", lazy = true }, - { "p00f/clangd_extensions.nvim", ft = { "cpp", "c" } }, - { "Civitasv/cmake-tools.nvim", ft = { "cpp", "c", "cmake" }, dependencies = { "nvim-lua/plenary.nvim" } }, - { - "simrat39/rust-tools.nvim", - dependencies = { - "neovim/nvim-lspconfig", - }, - ft = "rust", - }, - { - "Saecki/crates.nvim", - ft = { "rust", "toml" }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - }, - { - "windwp/nvim-autopairs", -- Autopairs, integrates with both cmp and treesitter - event = "InsertEnter", - opts = { - check_ts = true, -- treesitter integration - disable_filetype = { - "NvimTree", - "TelescopePrompt", - }, - }, - }, - - -- formatters and linters - { - "jay-babu/mason-null-ls.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "williamboman/mason.nvim", - "jose-elias-alvarez/null-ls.nvim", - }, - }, - - -- debuggers - { - "rcarriga/nvim-dap-ui", - dependencies = { - "mfussenegger/nvim-dap", - }, - }, - { "theHamsta/nvim-dap-virtual-text" }, - { - "jayp0521/mason-nvim-dap.nvim", - opts = { - ensure_installed = { - "debugpy", - "codelldb", - }, - }, - dependencies = { - "williamboman/mason.nvim", - }, - }, - { - "mfussenegger/nvim-dap-python", - ft = "python", - dependencies = { - "mfussenegger/nvim-dap", - "rcarriga/nvim-dap-ui", - }, - }, - - -- treesitter - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - dependencies = { - "nvim-treesitter/playground", - "p00f/nvim-ts-rainbow", - "mechatroner/rainbow_csv", - "JoosepAlviste/nvim-ts-context-commentstring", - }, - }, - - -- telescope - { - "nvim-telescope/telescope.nvim", - dependencies = { - { "nvim-tree/nvim-web-devicons" }, - { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - { "nvim-telescope/telescope-media-files.nvim" }, - { "nvim-telescope/telescope-symbols.nvim" }, - { "nvim-telescope/telescope-bibtex.nvim" }, - { "tsakirist/telescope-lazy.nvim" }, - { "chip/telescope-software-licenses.nvim" }, - { "barrett-ruth/telescope-http.nvim" }, - { "crispgm/telescope-heading.nvim" }, - { "benfowler/telescope-luasnip.nvim" }, - { "paopaol/telescope-git-diffs.nvim" }, - { "debugloop/telescope-undo.nvim" }, - }, - }, - - -- DB - { "tpope/vim-dadbod" }, - { "kristijanhusak/vim-dadbod-ui" }, - { "kristijanhusak/vim-dadbod-completion" }, - - -- pretty - { "uga-rosa/ccc.nvim" }, - { "lukas-reineke/indent-blankline.nvim" }, - { "NvChad/nvim-colorizer.lua" }, - { "mtdl9/vim-log-highlighting", lazy = true }, - { "RRethy/vim-illuminate" }, - { - "danymat/neogen", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = true, - version = "*", - }, - { "nvim-lualine/lualine.nvim", dependencies = { - "arkav/lualine-lsp-progress", - } }, - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - config = function() - require("tokyonight").setup({ - style = "night", - transparent = true, - styles = { - keywords = { italic = false }, - sidebars = "transparent", - floats = "transparent", - }, - lualine_bold = true, - }) - vim.cmd.colorscheme("tokyonight") - end, - }, - { "lunarvim/darkplus.nvim" }, - { "catppuccin/nvim" }, - { "Mofiqul/dracula.nvim" }, - { "rebelot/kanagawa.nvim" }, - { "EdenEast/nightfox.nvim" }, - { "navarasu/onedark.nvim" }, - { "savq/melange-nvim" }, - { "bluz71/vim-nightfly-colors", name = "nightfly" }, - - { "nvim-tree/nvim-web-devicons" }, - - -- git - { "kdheepak/lazygit.nvim" }, - { "tpope/vim-fugitive" }, - { "lewis6991/gitsigns.nvim" }, - { "ThePrimeagen/git-worktree.nvim" }, - { "sindrets/diffview.nvim" }, - - -- text - { "vimwiki/vimwiki" }, - { - "epwalsh/obsidian.nvim", - lazy = true, - event = { - "BufReadPre " .. vim.fn.expand("~") .. "/vimwiki/**/*.md", - "BufReadPre " .. vim.fn.expand("~") .. "/obsidian/**/*.md", - }, - }, - { - "nvim-neorg/neorg", - build = ":Neorg sync-parsers", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { "lervag/vimtex" }, - { - "iamcco/markdown-preview.nvim", - ft = { "markdown", "vimwiki" }, - build = "cd app && yarn install", - init = function() - vim.g.mkdp_filetypes = { "markdown", "vimwiki" } - end, - }, - - -- fun - { "andweeb/presence.nvim" }, - { "ThePrimeagen/vim-be-good", lazy = true }, - { "eandrju/cellular-automaton.nvim" }, -} diff --git a/lua/plugins/ccc.lua b/lua/plugins/ccc.lua new file mode 100644 index 0000000..38f0ecd --- /dev/null +++ b/lua/plugins/ccc.lua @@ -0,0 +1,132 @@ +return { + "uga-rosa/ccc.nvim", + config = function() + local ccc = require("ccc") + local ColorInput = require("ccc.input") + local convert = require("ccc.utils.convert") + + local RgbHslInput = setmetatable({ + name = "RGB/HSL", + max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 }, + min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 }, + bar_name = { "R", "G", "B", "H", "S", "L" }, + }, { __index = ColorInput }) + + function RgbHslInput.format(n, i) + if i <= 3 then + -- RGB + n = n * 255 + elseif i >= 5 then + -- S or L of HSL + n = n * 100 + end + return ("%6d"):format(n) + end + + function RgbHslInput.from_rgb(RGB) + local HSL = convert.rgb2hsl(RGB) + local R, G, B = unpack(RGB) + local H, S, L = unpack(HSL) + return { R, G, B, H, S, L } + end + + function RgbHslInput.to_rgb(value) + return { value[1], value[2], value[3] } + end + + function RgbHslInput:_set_rgb(RGB) + self.value[1] = RGB[1] + self.value[2] = RGB[2] + self.value[3] = RGB[3] + end + + function RgbHslInput:_set_hsl(HSL) + self.value[4] = HSL[1] + self.value[5] = HSL[2] + self.value[6] = HSL[3] + end + + function RgbHslInput:callback(index, new_value) + self.value[index] = new_value + local v = self.value + if index <= 3 then + local RGB = { v[1], v[2], v[3] } + local HSL = convert.rgb2hsl(RGB) + self:_set_hsl(HSL) + else + local HSL = { v[4], v[5], v[6] } + local RGB = convert.hsl2rgb(HSL) + self:_set_rgb(RGB) + end + end + + ccc.setup({ + pickers = { + ccc.picker.custom_entries({ + bg = "#1a1b26", + bg_dark = "#16161e", + bg_float = "#16161e", + bg_highlight = "#292e42", + bg_popup = "#16161e", + bg_search = "#3d59a1", + bg_sidebar = "#16161e", + bg_statusline = "#16161e", + bg_visual = "#283457", + black = "#15161e", + blue = "#7aa2f7", + blue0 = "#3d59a1", + blue1 = "#2ac3de", + blue2 = "#0db9d7", + blue5 = "#89ddff", + blue6 = "#b4f9f8", + blue7 = "#394b70", + border = "#15161e", + border_highlight = "#27a1b9", + comment = "#565f89", + cyan = "#7dcfff", + dark3 = "#545c7e", + dark5 = "#737aa2", + delta_add = "#2c5a66", + delta_delete = "#713137", + diff_add = "#20303b", + diff_change = "#1f2231", + diff_delete = "#37222c", + diff_text = "#394b70", + error = "#db4b4b", + fg = "#c0caf5", + fg_dark = "#a9b1d6", + fg_float = "#c0caf5", + fg_gutter = "#3b4261", + fg_sidebar = "#a9b1d6", + git_add = "#449dab", + git_change = "#6183bb", + git_delete = "#914c54", + git_ignore = "#545c7e", + gitSigns_add = "#266d6a", + gitSigns_change = "#536c9e", + gitSigns_delete = "#b2555b", + green = "#9ece6a", + green1 = "#73daca", + green2 = "#41a6b5", + hint = "#1abc9c", + info = "#0db9d7", + magenta = "#bb9af7", + magenta2 = "#ff007c", + none = "NONE", + orange = "#ff9e64", + purple = "#9d7cd8", + red = "#f7768e", + red1 = "#db4b4b", + teal = "#1abc9c", + terminal_black = "#414868", + warning = "#e0af68", + yellow = "#e0af68", + }), + }, + inputs = { + RgbHslInput, + }, + }) + end, +} diff --git a/lua/plugins/cellular_automaton.lua b/lua/plugins/cellular_automaton.lua new file mode 100644 index 0000000..85fe14b --- /dev/null +++ b/lua/plugins/cellular_automaton.lua @@ -0,0 +1,10 @@ +return { + "eandrju/cellular-automaton.nvim", + keys = { + { + "mr", + "CellularAutomaton make_it_rain", + desc = "[M]ake it [R]ain", + }, + }, +} diff --git a/lua/plugins/cheatsheet.lua b/lua/plugins/cheatsheet.lua new file mode 100644 index 0000000..6392672 --- /dev/null +++ b/lua/plugins/cheatsheet.lua @@ -0,0 +1,41 @@ +return { + "doctorfree/cheatsheet.nvim", + event = "VeryLazy", + dependencies = { + { "nvim-telescope/telescope.nvim" }, + { "nvim-lua/popup.nvim" }, + { "nvim-lua/plenary.nvim" }, + }, + config = function() + require("cheatsheet").setup({ + -- Whether to show bundled cheatsheets + + -- For generic cheatsheets like default, unicode, nerd-fonts, etc + bundled_cheatsheets = { + enabled = { "default", "unicode", "regex", "markdown", "lua" }, + disabled = { "nerd-fonts" }, + }, + -- bundled_cheatsheets = true, + + -- For plugin specific cheatsheets + bundled_plugin_cheatsheets = { + enabled = {}, + disabled = {}, + }, + -- bundled_plugin_cheatsheets = true, + + -- For bundled plugin cheatsheets, do not show a sheet if you + -- don't have the plugin installed (searches runtimepath for + -- same directory name) + include_only_installed_plugins = true, + + -- Key mappings bound inside the telescope window + telescope_mappings = { + [""] = require("cheatsheet.telescope.actions").select_or_fill_commandline, + [""] = require("cheatsheet.telescope.actions").select_or_execute, + [""] = require("cheatsheet.telescope.actions").copy_cheat_value, + [""] = require("cheatsheet.telescope.actions").edit_user_cheatsheet, + }, + }) + end, +} diff --git a/lua/plugins/clang_extensions.lua b/lua/plugins/clang_extensions.lua new file mode 100644 index 0000000..8d08e49 --- /dev/null +++ b/lua/plugins/clang_extensions.lua @@ -0,0 +1,67 @@ +return { + "p00f/clangd_extensions.nvim", + ft = { "cpp", "c" }, + opts = { + inlay_hints = { + inline = vim.fn.has("nvim-0.10") == 1, + -- Options other than `highlight' and `priority' only work + -- if `inline' is disabled + -- Only show inlay hints for the current line + only_current_line = false, + -- Event which triggers a refresh of the inlay hints. + -- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but + -- not that this may cause higher CPU usage. + -- This option is only respected when only_current_line and + -- autoSetHints both are true. + only_current_line_autocmd = { "CursorHold" }, + -- whether to show parameter hints with the inlay hints or not + show_parameter_hints = true, + -- prefix for parameter hints + parameter_hints_prefix = "<- ", + -- prefix for all the other hints (type, chaining) + other_hints_prefix = "=> ", + -- whether to align to the length of the longest line in the file + max_len_align = true, + -- padding from the left if max_len_align is true + max_len_align_padding = 1, + -- whether to align to the extreme right or not + right_align = false, + -- padding from the right if right_align is true + right_align_padding = 8, + -- The color of the hints + highlight = "Comment", + -- The highlight group priority for extmark + priority = 100, + }, + ast = { + role_icons = { + type = "", + declaration = "", + expression = "", + specifier = "", + statement = "", + ["template argument"] = "", + }, + kind_icons = { + Compound = "", + Recovery = "", + TranslationUnit = "", + PackExpansion = "", + TemplateTypeParm = "", + TemplateTemplateParm = "", + TemplateParamObject = "", + }, + highlights = { + detail = "Comment", + }, + }, + + memory_usage = { + border = "none", + }, + + symbol_info = { + border = "none", + }, + }, +} diff --git a/lua/plugins/cloak.lua b/lua/plugins/cloak.lua new file mode 100644 index 0000000..b137572 --- /dev/null +++ b/lua/plugins/cloak.lua @@ -0,0 +1,30 @@ +return { + "laytan/cloak.nvim", + opts = { + enabled = true, + cloak_character = "*", + -- The applied highlight group (colors) on the cloaking, see `:h highlight`. + highlight_group = "Comment", + -- Applies the length of the replacement characters for all matched + -- patterns, defaults to the length of the matched pattern. + cloak_length = nil, -- Provide a number if you want to hide the true length of the value. + -- Wether it should try every pattern to find the best fit or stop after the first. + try_all_patterns = true, + patterns = { + { + -- Match any file starting with '.env'. + -- This can be a table to match multiple file patterns. + file_pattern = { ".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 = "=.+", + -- A function, table or string to generate the replacement. + -- The actual replacement will contain the 'cloak_character' + -- where it doesn't cover the original text. + -- If left empty the legacy behavior of keeping the first character is retained. + replace = nil, + }, + }, + }, +} diff --git a/lua/plugins/closetag.lua b/lua/plugins/closetag.lua new file mode 100644 index 0000000..1c15643 --- /dev/null +++ b/lua/plugins/closetag.lua @@ -0,0 +1 @@ +return { "alvan/vim-closetag" } diff --git a/lua/plugins/cmake_tools.lua b/lua/plugins/cmake_tools.lua new file mode 100644 index 0000000..36f87c2 --- /dev/null +++ b/lua/plugins/cmake_tools.lua @@ -0,0 +1,69 @@ +return { + "Civitasv/cmake-tools.nvim", + ft = { "cpp", "c", "cmake" }, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + cmake_command = "cmake", -- this is used to specify cmake command path + cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt + cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate` + cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild` + cmake_build_directory = "target/build/", -- this is used to specify generate directory for cmake + cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is set to "", this option will be activated + cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir + cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false + cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage + cmake_variants_message = { + short = { show = true }, -- whether to show short message + long = { show = true, max_length = 40 }, -- whether to show long message + }, + cmake_dap_configuration = { -- debug settings for cmake + name = "cpp", + type = "codelldb", + request = "launch", + stopOnEntry = false, + runInTerminal = true, + console = "integratedTerminal", + }, + cmake_executor = { -- executor to use + name = "quickfix", -- name of the executor + opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. + default_opts = { -- a list of default and possible values for executors + quickfix = { + show = "only_on_error", -- "always", "only_on_error" + position = "belowright", -- "bottom", "top" + size = 15, + }, + overseer = { + new_task_opts = {}, -- options to pass into the `overseer.new_task` command + on_new_task = function(task) end, -- a function that gets overseer.Task when it is created, before calling `task:start` + }, + terminal = {}, -- terminal executor uses the values in cmake_terminal + }, + }, + cmake_terminal = { + name = "terminal", + opts = { + name = "Main Terminal", + prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name + split_direction = "vertical", -- "horizontal", "vertical" + split_size = 50, + + -- Window handling + single_terminal_per_instance = true, -- Single viewport, multiple windows + single_terminal_per_tab = true, -- Single viewport per tab + keep_terminal_static_location = true, -- Static location of the viewport if avialable + + -- Running Tasks + start_insert_in_launch_task = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun + start_insert_in_other_tasks = false, -- If you want to enter terminal with :startinsert upon launching all other cmake tasks in the terminal. Generally set as false + focus_on_main_terminal = false, -- Focus on cmake terminal when cmake task is launched. Only used if executor is terminal. + focus_on_launch_terminal = false, -- Focus on cmake launch terminal when executable target in launched. + }, + }, + cmake_notifications = { + enabled = true, -- show cmake execution progress in nvim-notify + spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display + refresh_rate_ms = 100, -- how often to iterate icons + }, + }, +} diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..932be57 --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,135 @@ +return { + "hrsh7th/nvim-cmp", + event = { "InsertEnter", "CmdlineEnter" }, + lazy = false, + dependencies = { + "hrsh7th/cmp-buffer", -- buffer completions + "FelipeLema/cmp-async-path", -- path completionsplu + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp", + { "Saecki/crates.nvim", event = { "BufRead Cargo.toml" } }, + { + "vrslev/cmp-pypi", + dependencies = { "nvim-lua/plenary.nvim" }, + event = { "BufRead pyproject.toml", "BufRead requirements.txt", "BufRead requirements_dev.txt" }, + }, + { "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } }, + "SergioRibera/cmp-dotenv", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-emoji", + "hrsh7th/cmp-calc", + { "zbirenbaum/copilot-cmp", opts = {}, dependencies = { "zbirenbaum/copilot.lua" } }, + "Exafunction/codeium.nvim", + "chrisgrieser/cmp-nerdfont", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local kind_icons = { + Text = "󰉿", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "", + Copilot = "", + Codeium = "", + } + + cmp.setup({ + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + -- Accept currently selected item. If none selected, `select` first item. + -- Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ select = true }), + }, + sources = { + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "crates" }, + { name = "async_path" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "neorg" }, + { name = "pypi" }, + { name = "dadbod" }, + { name = "env" }, + { name = "calc" }, + { name = "emoji" }, + { name = "copilot" }, + { name = "codeium" }, + { name = "nerdfont" }, + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + format = function(entry, vim_item) + vim_item.kind = kind_icons[vim_item.kind] + vim_item.menu = ({ + calc = "[calc]", + emoji = "[emoji]", + nerdfont = "[nerdfont]", + nvim_lsp = "[LSP]", + nvim_lua = "[lua]", + copilot = "[copilot]", + codeium = "[codeium]", + luasnip = "[snip]", + async_path = "[path]", + neorg = "[neorg]", + crates = "[crates]", + pypi = "[pypi]", + dadbod = "[dadbod]", + env = "[env]", + buffer = "[buf]", + })[entry.source.name] + return vim_item + end, + expandable_indicator = true, + }, + + experimental = { + ghost_text = true, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + }) + end, +} diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua new file mode 100644 index 0000000..e4ded71 --- /dev/null +++ b/lua/plugins/codeium.lua @@ -0,0 +1,6 @@ +return { + "Exafunction/codeium.nvim", + cond = false, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, +} diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..6745499 --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,32 @@ +return { + "NvChad/nvim-colorizer.lua", + opts = { + filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss", "python" }, + user_default_options = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = false, -- "Name" codes like Blue or blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + AARRGGBB = true, -- 0xAARRGGBB hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Available modes for `mode`: foreground, background, virtualtext + mode = "background", -- Set the display mode. + -- Available methods are false / true / "normal" / "lsp" / "both" + -- True is same as normal + tailwind = true, -- Enable tailwind colors + -- parsers can contain values used in |user_default_options| + sass = { + enable = true, + parsers = { "css" }, + }, -- Enable sass colors + virtualtext = "■", + }, + -- all the sub-options of filetypes apply to buftypes + buftypes = {}, + html = { names = true }, + css = { names = true }, + }, +} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..43dd863 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,28 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + config = function() + require("tokyonight").setup({ + style = "night", + transparent = true, + styles = { + keywords = { italic = false }, + sidebars = "transparent", + floats = "transparent", + }, + lualine_bold = true, + }) + vim.cmd.colorscheme("tokyonight") + end, + }, + { "lunarvim/darkplus.nvim" }, + { "catppuccin/nvim" }, + { "Mofiqul/dracula.nvim" }, + { "rebelot/kanagawa.nvim" }, + { "EdenEast/nightfox.nvim" }, + { "navarasu/onedark.nvim" }, + { "savq/melange-nvim" }, + { "bluz71/vim-nightfly-colors", name = "nightfly" }, +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..8742521 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,61 @@ +return { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + ---Add a space b/w comment and the line + padding = true, + ---Whether the cursor should stay at its position + sticky = true, + ---Lines to be ignored while (un)comment + ignore = nil, + ---LHS of toggle mappings in NORMAL mode + toggler = { + ---Line-comment toggle keymap + line = "gcc", + ---Block-comment toggle keymap + block = "gbb", + }, + -- -LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + ---Line-comment keymap + line = "gc", + ---Block-comment keymap + block = "gb", + }, + ---LHS of extra mappings + extra = { + ---Add comment on the line above + above = "gcO", + ---Add comment on the line below + below = "gco", + ---Add comment at the end of line + eol = "gcA", + }, + --- Enable keybindings + --- NOTE: If given `false` then the plugin won't create any mappings + mappings = { + ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + basic = true, + ---Extra mapping; `gco`, `gcO`, `gcA` + extra = true, + ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` + extended = true, + }, + ---Function to call before (un)comment + -- pre_hook = function(ctx) + -- local U = require("Comment.utils") + -- + -- local location = nil + -- if ctx.ctype == U.ctype.block then + -- location = require("ts_context_commentstring.utils").get_cursor_location() + -- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then + -- location = require("ts_context_commentstring.utils").get_visual_start_location() + -- end + -- + -- return require("ts_context_commentstring.internal").calculate_commentstring({ + -- key = ctx.ctype == U.ctype.line and "__default" or "__multiline", + -- location = location, + -- }) + -- end, + }, +} diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..badd582 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,47 @@ +return { + "zbirenbaum/copilot.lua", + event = "InsertEnter", + opts = { + panel = { + enabled = true, + auto_refresh = false, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "", + refresh = "gr", + open = "", + }, + layout = { + position = "bottom", -- | top | left | right + ratio = 0.4, + }, + }, + suggestion = { + enabled = false, + auto_trigger = false, + debounce = 75, + keymap = { + accept = "", + accept_word = false, + accept_line = false, + next = "", + prev = "", + dismiss = "", + }, + }, + filetypes = { + yaml = false, + markdown = false, + help = false, + gitcommit = false, + gitrebase = false, + hgcommit = false, + svn = false, + cvs = false, + ["."] = false, + }, + copilot_node_command = "node", -- Node.js version must be > 18.x + server_opts_overrides = {}, + }, +} diff --git a/lua/plugins/crates.lua b/lua/plugins/crates.lua new file mode 100644 index 0000000..0234175 --- /dev/null +++ b/lua/plugins/crates.lua @@ -0,0 +1,147 @@ +return { + "Saecki/crates.nvim", + tag = "stable", + event = { "BufRead Cargo.toml" }, + keys = { + { + "ru", + require("crates").upgrade_all_crates, + desc = "[U]pgrade all crates", + }, + }, + opts = { + smart_insert = true, + insert_closing_quote = true, + avoid_prerelease = true, + autoload = true, + autoupdate = true, + loading_indicator = true, + date_format = "%d-%m-%Y", + thousands_separator = ".", + notification_title = "Crates", + disable_invalid_feature_diagnostic = false, + text = { + loading = "  Loading", + version = "  %s", + prerelease = "  %s", + yanked = "  %s", + nomatch = "  No match", + upgrade = "  %s", + error = "  Error fetching crate", + }, + highlight = { + loading = "CratesNvimLoading", + version = "CratesNvimVersion", + prerelease = "CratesNvimPreRelease", + yanked = "CratesNvimYanked", + nomatch = "CratesNvimNoMatch", + upgrade = "CratesNvimUpgrade", + error = "CratesNvimError", + }, + popup = { + autofocus = false, + copy_register = '"', + style = "minimal", + border = "none", + show_version_date = false, + show_dependency_version = true, + max_height = 30, + min_width = 20, + padding = 1, + text = { + title = " %s", + pill_left = "", + pill_right = "", + description = "%s", + created_label = " created ", + created = "%s", + updated_label = " updated ", + updated = "%s", + downloads_label = " downloads ", + downloads = "%s", + homepage_label = " homepage ", + homepage = "%s", + repository_label = " repository ", + repository = "%s", + documentation_label = " documentation ", + documentation = "%s", + crates_io_label = " crates.io ", + crates_io = "%s", + categories_label = " categories ", + keywords_label = " keywords ", + version = " %s", + prerelease = " %s", + yanked = " %s", + version_date = " %s", + feature = " %s", + enabled = " %s", + transitive = " %s", + normal_dependencies_title = " Dependencies", + build_dependencies_title = " Build dependencies", + dev_dependencies_title = " Dev dependencies", + dependency = " %s", + optional = " %s", + dependency_version = " %s", + loading = "  ", + }, + highlight = { + title = "CratesNvimPopupTitle", + pill_text = "CratesNvimPopupPillText", + pill_border = "CratesNvimPopupPillBorder", + description = "CratesNvimPopupDescription", + created_label = "CratesNvimPopupLabel", + created = "CratesNvimPopupValue", + updated_label = "CratesNvimPopupLabel", + updated = "CratesNvimPopupValue", + downloads_label = "CratesNvimPopupLabel", + downloads = "CratesNvimPopupValue", + homepage_label = "CratesNvimPopupLabel", + homepage = "CratesNvimPopupUrl", + repository_label = "CratesNvimPopupLabel", + repository = "CratesNvimPopupUrl", + documentation_label = "CratesNvimPopupLabel", + documentation = "CratesNvimPopupUrl", + crates_io_label = "CratesNvimPopupLabel", + crates_io = "CratesNvimPopupUrl", + categories_label = "CratesNvimPopupLabel", + keywords_label = "CratesNvimPopupLabel", + version = "CratesNvimPopupVersion", + prerelease = "CratesNvimPopupPreRelease", + yanked = "CratesNvimPopupYanked", + version_date = "CratesNvimPopupVersionDate", + feature = "CratesNvimPopupFeature", + enabled = "CratesNvimPopupEnabled", + transitive = "CratesNvimPopupTransitive", + normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle", + build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle", + dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle", + dependency = "CratesNvimPopupDependency", + optional = "CratesNvimPopupOptional", + dependency_version = "CratesNvimPopupDependencyVersion", + loading = "CratesNvimPopupLoading", + }, + keys = { + hide = { "q", "" }, + open_url = { "" }, + select = { "" }, + select_alt = { "s" }, + toggle_feature = { "" }, + copy_value = { "yy" }, + goto_item = { "gd", "K", "" }, + jump_forward = { "" }, + jump_back = { "", "" }, + }, + }, + src = { + insert_closing_quote = true, + text = { + prerelease = "  pre-release ", + yanked = "  yanked ", + }, + }, + null_ls = { + enabled = true, + name = "crates.nvim", + }, + }, +} diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua new file mode 100644 index 0000000..e6e8e05 --- /dev/null +++ b/lua/plugins/dadbod.lua @@ -0,0 +1,5 @@ +return { + { "tpope/vim-dadbod" }, + { "kristijanhusak/vim-dadbod-ui" }, + { "kristijanhusak/vim-dadbod-completion" }, +} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..3879094 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,241 @@ +return { + "jayp0521/mason-nvim-dap.nvim", + -- cond = false, + opts = { + ensure_installed = { + "python", + "codelldb", + }, + automatic_install = true, + }, + dependencies = { + "williamboman/mason.nvim", + "rcarriga/nvim-dap-ui", + "mfussenegger/nvim-dap", + { "simrat39/rust-tools.nvim", ft = "rust" }, + { "mfussenegger/nvim-dap-python", ft = "python" }, + "theHamsta/nvim-dap-virtual-text", + "williamboman/mason.nvim", + }, + keys = { + { + "dd", + function() + require("dap").toggle_breakpoint() + end, + desc = "Set breakpoint", + }, + { + "dD", + function() + require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) + end, + desc = "Set Breakpoint with Condition", + }, + { + "dpm", + function() + require("dap-python").test_method() + end, + desc = "Test [M]ethod", + }, + { + "dpc", + function() + require("dap-python").test_class() + end, + desc = "Test [C]lass", + }, + { + "dps", + function() + require("dap-python").debug_selection() + end, + desc = "Debug [S]election", + }, + { + "dt", + function() + require("dapui").toggle() + end, + desc = "[T]oggle DAP-UI", + }, + { + "dc", + function() + require("dap").continue() + end, + desc = "Launch Debug Sessions and Resume Execution", + }, + { + "di", + function() + require("dap").step_into() + end, + desc = "Step [I]nto Code", + }, + { + "do", + function() + require("dap").step_over() + end, + desc = "Step [O]ver Code", + }, + { + "dO", + function() + require("dap").step_out() + end, + desc = "Step [O]ut of Code", + }, + { + "dT", + function() + require("dap").terminate() + end, + desc = "[T]erminate", + }, + { + "dl", + function() + require("dap").run_last() + end, + desc = "Run [L]ast", + }, + { + "dh", + function() + require("dap.ui.widgets").hover() + end, + desc = "[H]over", + }, + { + "dP", + function() + require("dap.ui.widgets").preview() + end, + desc = "[P]review", + }, + { + "df", + function() + local widgets = require("dap.ui.widgets") + widgets.centered_float(widgets.frames) + end, + desc = "[F]rames", + }, + { + "ds", + function() + local widgets = require("dap.ui.widgets") + widgets.centered_float(widgets.scopes) + end, + desc = "[S]copes", + }, + { + "", + function() + require("dap").continue() + end, + desc = "DAP Continue", + }, + { + "", + function() + require("dap").step_over() + end, + desc = "DAP Step Over", + }, + { + "", + function() + require("dap").step_into() + end, + desc = "DAP Step Into", + }, + { + "", + function() + require("dap").step_out() + end, + desc = "DAP Step Out", + }, + }, + config = function() + local dap = require("dap") + local dapui = require("dapui") + + vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) + + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + + local mason_registry = require("mason-registry") + + dapui.setup() + require("nvim-dap-virtual-text").setup({}) + -- Python + local debugpy = mason_registry.get_package("debugpy") + local debugpy_path = debugpy:get_install_path() .. "/venv/bin/python" + require("dap-python").setup(debugpy_path) + + local codelldb = mason_registry.get_package("codelldb") + local codelldb_path = codelldb:get_install_path() .. "/codelldb" + local liblldb_path = codelldb:get_install_path() .. "/extension/lldb/lib/liblldb.so" + + -- Rust + require("rust-tools").setup({ + dap = { + adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path), + }, + }) + + -- dap.configurations.rust = {} + + -- C/C++ + -- FIX: not working + dap.adapters.lldb = { + type = "executable", + command = codelldb_path, + name = "lldb", + } + dap.configurations.cpp = { + { + name = "Launch", + type = "lldb", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = {}, + -- 💀 + -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: + -- + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + -- + -- Otherwise you might get the following error: + -- + -- Error on launch: Failed to attach to the target process + -- + -- But you should be aware of the implications: + -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html + -- runInTerminal = false, + }, + } + + -- If you want to use this for Rust and C, add something like this: + + dap.configurations.c = dap.configurations.cpp + end, +} diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua new file mode 100644 index 0000000..72f3109 --- /dev/null +++ b/lua/plugins/diffview.lua @@ -0,0 +1 @@ +return { "sindrets/diffview.nvim" } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua new file mode 100644 index 0000000..8045e1a --- /dev/null +++ b/lua/plugins/fugitive.lua @@ -0,0 +1 @@ +return { "tpope/vim-fugitive" } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..b6f31cd --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,41 @@ +return { + "lewis6991/gitsigns.nvim", + keys = { + { + "gb", + function() + vim.cmd.Gitsigns("blame_line") + end, + desc = "[G]it [B]lame", + }, + }, + opts = { + signs = { + add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + }, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..12a19f5 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,39 @@ +return { + "ThePrimeagen/harpoon", + dependencies = { "nvim-lua/plenary.nvim" }, + branch = "harpoon2", + keys = { + { + "ha", + function() + require("harpoon"):list():append() + end, + desc = "[H]arpoon [A]dd File", + }, + { + "hm", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = "[H]arpoon [M]enu", + }, + }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + + 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) + end, +} diff --git a/lua/plugins/hypersonic.lua b/lua/plugins/hypersonic.lua new file mode 100644 index 0000000..0e67985 --- /dev/null +++ b/lua/plugins/hypersonic.lua @@ -0,0 +1,17 @@ +return { + "tomiis4/hypersonic.nvim", + opts = { + ---@type "none"|"single"|"double"|"rounded"|"solid"|"shadow"|table + border = "rounded", + ---@type number 0-100 + winblend = 0, + ---@type boolean + add_padding = true, + ---@type string + hl_group = "Keyword", + ---@type string + wrapping = '"', + ---@type boolean + enable_cmdline = false, + }, +} diff --git a/lua/plugins/ibl.lua b/lua/plugins/ibl.lua new file mode 100644 index 0000000..d2ec3c5 --- /dev/null +++ b/lua/plugins/ibl.lua @@ -0,0 +1,41 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + config = function() + require("ibl").setup({ + + enabled = true, + indent = { + smart_indent_cap = true, + }, + whitespace = { + remove_blankline_trail = true, + }, + scope = { + show_start = true, + show_end = true, + show_exact_scope = true, + }, + exclude = { + filetypes = { + "NvimTree", + "Trouble", + "alpha", + "dashboard", + "help", + "lazy", + "neogitstatus", + "packer", + "startify", + "lspinfo", + }, + buftypes = { + "terminal", + "nofile", + "quickfix", + "prompt", + }, + }, + }) + end, +} diff --git a/lua/plugins/illuminate.lua b/lua/plugins/illuminate.lua new file mode 100644 index 0000000..b4d39a0 --- /dev/null +++ b/lua/plugins/illuminate.lua @@ -0,0 +1,58 @@ +return { + "RRethy/vim-illuminate", + config = function() + require("illuminate").configure({ + providers = { + "lsp", + "treesitter", + "regex", + }, + -- delay: delay in milliseconds + delay = 100, + -- filetype_overrides: filetype specific overrides. + -- The keys are strings to represent the filetype while the values are tables that + -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist + filetype_overrides = {}, + -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist + filetypes_denylist = { + "alpha", + "NvimTree", + "dirvish", + "fugitive", + }, + -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist + filetypes_allowlist = {}, + -- modes_denylist: modes to not illuminate, this overrides modes_allowlist + -- See `:help mode()` for possible values + modes_denylist = {}, + -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist + -- See `:help mode()` for possible values + modes_allowlist = {}, + -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_denylist = {}, + -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_allowlist = {}, + -- under_cursor: whether or not to illuminate under the cursor + under_cursor = true, + -- large_file_cutoff: number of lines at which to use large_file_config + -- The `under_cursor` option is disabled when this cutoff is hit + large_file_cutoff = nil, + -- large_file_config: config to use for large files (based on large_file_cutoff). + -- Supports the same keys passed to .configure + -- If nil, vim-illuminate will be disabled for large files. + large_file_overrides = nil, + -- min_count_to_highlight: minimum number of matches required to perform highlighting + min_count_to_highlight = 1, + }) + vim.keymap.set("n", "", function() + require("illuminate").goto_next_reference() + end, { noremap = true }) + vim.keymap.set("n", "", function() + require("illuminate").goto_prev_reference() + end, { noremap = true }) + end, +} diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua new file mode 100644 index 0000000..f917d0e --- /dev/null +++ b/lua/plugins/lazy.lua @@ -0,0 +1 @@ +return { "folke/lazy.nvim" } diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua new file mode 100644 index 0000000..9b67f1f --- /dev/null +++ b/lua/plugins/lazygit.lua @@ -0,0 +1,10 @@ +return { + "kdheepak/lazygit.nvim", + keys = { + -- { + -- "gg", + -- vim.cmd.LazyGit, + -- desc = "LazyGit", + -- }, + }, +} diff --git a/lua/plugins/log_highlighting.lua b/lua/plugins/log_highlighting.lua new file mode 100644 index 0000000..d92222d --- /dev/null +++ b/lua/plugins/log_highlighting.lua @@ -0,0 +1 @@ +return { "mtdl9/vim-log-highlighting", ft = "log" } diff --git a/lua/plugins/lsp/bash.lua b/lua/plugins/lsp/bash.lua new file mode 100644 index 0000000..e8f3b8f --- /dev/null +++ b/lua/plugins/lsp/bash.lua @@ -0,0 +1,14 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.bashls.setup({ + capabilities = capabilities, + filetypes = { + "sh", + "bash", + "zsh", + }, + }) +end + +return M diff --git a/lua/plugins/lsp/c.lua b/lua/plugins/lsp/c.lua new file mode 100644 index 0000000..4cbb1d9 --- /dev/null +++ b/lua/plugins/lsp/c.lua @@ -0,0 +1,9 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.clangd.setup({ + capabilities = capabilities, + }) +end + +return M diff --git a/lua/plugins/lsp/emmet.lua b/lua/plugins/lsp/emmet.lua new file mode 100644 index 0000000..a9a0413 --- /dev/null +++ b/lua/plugins/lsp/emmet.lua @@ -0,0 +1,20 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.emmet_ls.setup({ + capabilities = capabilities, + filetypes = { + "html", + "htmldjango", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "eruby", + }, + }) +end + +return M diff --git a/lua/plugins/lsp/lua.lua b/lua/plugins/lsp/lua.lua new file mode 100644 index 0000000..507d129 --- /dev/null +++ b/lua/plugins/lsp/lua.lua @@ -0,0 +1,42 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim", "awesome", "client" }, + }, + -- workspace = { + -- Make the server aware of Neovim runtime files + -- library = vim.api.nvim_get_runtime_file("", true), + -- }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + root_pattern = { + ".stylua.toml", + ".luarc.json", + ".luarc.jsonc", + ".luacheckrc", + "stylua.toml", + "selene.toml", + "selene.yml", + ".git", + }, + format = { + enable = false, + }, + }, + }, + }) +end + +return M diff --git a/lua/plugins/lsp/tex.lua b/lua/plugins/lsp/tex.lua new file mode 100644 index 0000000..7e7728c --- /dev/null +++ b/lua/plugins/lsp/tex.lua @@ -0,0 +1,32 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.texlab.setup({ + capabilities = capabilities, + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "xelatex", + forwardSearchAfter = false, + onSave = false, + }, + chktex = { + onEdit = false, + onOpenAndSave = false, + }, + diagnosticsDelay = 0, + formatterLineLength = 120, + forwardSearch = { + args = {}, + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false, + }, + }, + }) +end + +return M diff --git a/lua/plugins/lsp/typst.lua b/lua/plugins/lsp/typst.lua new file mode 100644 index 0000000..1374ea5 --- /dev/null +++ b/lua/plugins/lsp/typst.lua @@ -0,0 +1,12 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.lua_ls.setup({ + capabilities = capabilities, + settings = { + exportPdf = "onSave", + }, + }) +end + +return M diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..ecbe3fa --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,228 @@ +return { + "williamboman/mason-lspconfig.nvim", + dependencies = { + "williamboman/mason.nvim", + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "folke/neodev.nvim", + "nvim-telescope/telescope.nvim", + }, + keys = { + { + "la", + vim.lsp.buf.code_action, + desc = "Code [A]ction", + }, + { + "lD", + vim.lsp.buf.type_definition, + desc = "Type [D]efinitions", + }, + { + "lf", + function() + vim.lsp.buf.format({ async = true }) + end, + desc = "[F]ormat", + }, + { + "lo", + vim.diagnostic.open_float, + desc = "[O]pen Float", + }, + { + "ls", + vim.diagnostic.setloclist, + desc = "[S]etloclist", + }, + { + "lj", + function() + vim.diagnostic.goto_next() + vim.cmd("norm zz") + end, + desc = "Next Diagnostic", + }, + { + "lk", + function() + vim.diagnostic.goto_prev() + vim.cmd("norm zz") + end, + desc = "Prev Diagnostic", + }, + { + "lr", + vim.lsp.buf.rename, + desc = "[R]ename", + }, + { + "lds", + require("telescope.builtin").lsp_document_symbols, + desc = "[D]ocument [S]ymbols", + }, + { + "lwd", + require("telescope.builtin").diagnostics, + desc = "[W]orkspace [D]iagnostics", + }, + { + "lws", + require("telescope.builtin").lsp_dynamic_workspace_symbols, + desc = "[W]orkspace [S]ymbols", + }, + { + "lwa", + vim.lsp.buf.add_workspace_folder, + desc = "[W]orkspace [A]dd Folder", + }, + { + "lwr", + vim.lsp.buf.remove_workspace_folder, + desc = "[W]orkspace [R]emove Folder", + }, + { + "lwl", + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + desc = "[W]orkspace [L]ist Folder", + }, + { + "lq", + require("telescope.builtin").quickfix, + desc = "Telescope [Q]uickfix", + }, + { + "lc", + function() + vim.cmd("CopilotToggle") + end, + desc = "Toggle [C]opilot", + }, + }, + config = function() + require("mason").setup() + local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() + local lsp = require("lspconfig") + + local default_setup = function(server) + lsp[server].setup({ + capabilities = lsp_capabilities, + }) + end + + vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + -- these will be buffer-local keybindings + -- because they only work if language server is active + + local nmap = function(keys, func, desc) + if desc then + desc = "LSP: " .. desc + end + vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) + end + + nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") + nmap("gr", function() + require("trouble").toggle("lsp_references") + end, "[G]oto [R]eferences") + nmap("gR", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") + nmap("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation") + nmap("K", vim.lsp.buf.hover, "Hover Documentation") + -- nmap("", vim.lsp.buf.signature_help, "Signature Documentation") + nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + end, + }) + + local signs = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, + } + + for _, sign in ipairs(signs) do + vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) + end + + local config = { + virtual_text = true, -- virtual text + signs = { + active = signs, -- show signs + }, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + focusable = true, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + } + + vim.diagnostic.config(config) + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = "rounded", + }) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { + border = "rounded", + }) + + require("mason-lspconfig").setup({ + automatic_installation = true, + automatic_setup = true, + ensure_installed = { + "bashls", + "clangd", + "cmake", + "cssls", + "emmet_ls", + "html", + "jedi_language_server", + "jsonls", + "lua_ls", + "tailwindcss", + "taplo", + "texlab", + "tsserver", + }, + handlers = { + default_setup, + clangd = function() + lsp_capabilities.offsetEncoding = { "utf-16" } + vim.api.nvim_create_autocmd("LspAttach", { + desc = "Enable Inlay Hints", + callback = function() + require("clangd_extensions.inlay_hints").setup_autocmd() + require("clangd_extensions.inlay_hints").set_inlay_hints() + end, + }) + require("plugins.lsp.c").setup(lsp, lsp_capabilities) + end, + bashls = function() + require("plugins.lsp.bash").setup(lsp, lsp_capabilities) + end, + emmet_ls = function() + require("plugins.lsp.emmet").setup(lsp, lsp_capabilities) + end, + texlab = function() + require("plugins.lsp.tex").setup(lsp, lsp_capabilities) + end, + typst_lsp = function() + require("plugins.lsp.typst").setup(lsp, lsp_capabilities) + end, + lua_ls = function() + require("plugins.lsp.lua").setup(lsp, lsp_capabilities) + end, + }, + }) + end, +} diff --git a/after/plugin/lualine.lua b/lua/plugins/lualine.lua similarity index 57% rename from after/plugin/lualine.lua rename to lua/plugins/lualine.lua index c2b169b..6111acb 100644 --- a/after/plugin/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,12 +1,13 @@ -if not pcall(require, "lualine") then - return -end - -require("lualine").setup({ - options = { - component_separators = { left = "|", right = "|" }, +return { + "nvim-lualine/lualine.nvim", + dependencies = { + "arkav/lualine-lsp-progress", }, - --[[ Available components + opts = { + options = { + component_separators = { left = "|", right = "|" }, + }, + --[[ Available components `branch` (git branch) `buffers` (shows currently available buffers) `diagnostics` (diagnostics count from your preferred source) @@ -24,12 +25,13 @@ require("lualine").setup({ `selectioncount` (number of selected characters or lines) `tabs` (shows currently available tabs) `windows` (shows currently available windows) ]] - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { "filename", "diff", "lsp_progress" }, - lualine_x = { "diagnostics", "encoding", "filetype", "filesize" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { "filename", "diff", "lsp_progress" }, + lualine_x = { "diagnostics", "encoding", "filetype", "filesize" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, }, -}) +} diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..6b6c51c --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,83 @@ +return { + { + "L3MON4D3/LuaSnip", + build = "make install_jsregexp", + version = "v2.*", + dependencies = { + "rafamadriz/friendly-snippets", -- a bunch of snippets to use + }, + config = function() + local ls = require("luasnip") + + local s = ls.snippet + local sn = ls.snippet_node + local isn = ls.indent_snippet_node + local t = ls.text_node + local i = ls.insert_node + local f = ls.function_node + local c = ls.choice_node + local d = ls.dynamic_node + local r = ls.restore_node + local events = require("luasnip.util.events") + local ai = require("luasnip.nodes.absolute_indexer") + local extras = require("luasnip.extras") + local l = extras.lambda + local rep = extras.rep + local p = extras.partial + local m = extras.match + local n = extras.nonempty + local dl = extras.dynamic_lambda + local fmt = require("luasnip.extras.fmt").fmt + local fmta = require("luasnip.extras.fmt").fmta + local conds = require("luasnip.extras.expand_conditions") + local postfix = require("luasnip.extras.postfix").postfix + local types = require("luasnip.util.types") + local parse = require("luasnip.util.parser").parse_snippet + local ms = ls.multi_snippet + + vim.keymap.set({ "i", "s" }, "", function() + if ls.expand_or_jumpable() then + ls.expand_or_jump() + end + end, { silent = true }) + + vim.keymap.set({ "i", "s" }, "", function() + if ls.jumpable(-1) then + ls.jump(-1) + end + end, { silent = true }) + + vim.keymap.set({ "i" }, "", function() + if ls.choice_active() then + ls.change_choice(1) + end + end, { silent = true }) + + vim.keymap.set({ "i" }, "", function() + if ls.choice_active() then + ls.change_choice(-1) + end + end, { silent = true }) + + ls.config.set_config({ + -- This tells LuaSnip to remember to keep around the last snippet. + -- You can jump back into it even if you move outside of the selection + history = true, + -- This one is cool cause if you have dynamic snippets, it updates as you type! + updateevents = "TextChanged,TextChangedI", + -- Autosnippets: + enable_autosnippets = true, + -- Crazy highlights!! + ext_opts = { + [types.choiceNode] = { + active = { + virt_text = { { " « ", "NonTest" } }, + }, + }, + }, + }) + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + "saadparwaiz1/cmp_luasnip", +} diff --git a/lua/plugins/markdown_preview.lua b/lua/plugins/markdown_preview.lua new file mode 100644 index 0000000..7cbf8b6 --- /dev/null +++ b/lua/plugins/markdown_preview.lua @@ -0,0 +1,8 @@ +return { + "iamcco/markdown-preview.nvim", + ft = { "markdown", "vimwiki" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown", "vimwiki" } + end, +} diff --git a/lua/plugins/neodev.lua b/lua/plugins/neodev.lua new file mode 100644 index 0000000..fea62e1 --- /dev/null +++ b/lua/plugins/neodev.lua @@ -0,0 +1,26 @@ +return { + "folke/neodev.nvim", + opts = { + library = { + enabled = true, -- when not enabled, neodev will not change any settings to the LSP server + -- these settings will be used for your Neovim config directory + runtime = true, -- runtime path + types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others + plugins = true, -- installed opt or start plugins in packpath + -- you can also specify the list of plugins to make available as a workspace library + -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, + }, + setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files + -- for your Neovim config directory, the config.library settings will be used as is + -- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled + -- for any other directory, config.library.enabled will be set to false + override = function(root_dir, options) end, + -- With lspconfig, Neodev will automatically setup your lua-language-server + -- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init} + -- in your lsp start options + lspconfig = true, + -- much faster, but needs a recent built of lua-language-server + -- needs lua-language-server >= 3.6.0 + pathStrict = true, + }, +} diff --git a/lua/plugins/neogen.lua b/lua/plugins/neogen.lua new file mode 100644 index 0000000..8c85a10 --- /dev/null +++ b/lua/plugins/neogen.lua @@ -0,0 +1,6 @@ +return { + "danymat/neogen", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = true, + version = "*", +} diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua new file mode 100644 index 0000000..9f576d9 --- /dev/null +++ b/lua/plugins/neorg.lua @@ -0,0 +1,33 @@ +return { + "nvim-neorg/neorg", + build = ":Neorg sync-parsers", + dependencies = { "nvim-lua/plenary.nvim" }, + ft = "norg", + opts = { + load = { + ["core.defaults"] = {}, -- Loads default behaviour + ["core.concealer"] = {}, -- Adds pretty icons to your documents + ["core.dirman"] = { -- Manages Neorg workspaces + config = { + workspaces = { + university = "~/neorg/University", + }, + default_workspace = "university", + }, + }, + ["core.completion"] = { + config = { + engine = "nvim-cmp", + name = "[Neorg]", + }, + }, + ["core.export.markdown"] = {}, + ["core.summary"] = { + config = { + strategy = "default", + }, + }, + -- ["core.ui.calendar"] = {}, + }, + }, +} diff --git a/lua/plugins/null_ls.lua b/lua/plugins/null_ls.lua new file mode 100644 index 0000000..369c9f2 --- /dev/null +++ b/lua/plugins/null_ls.lua @@ -0,0 +1,71 @@ +return { + "jay-babu/mason-null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason.nvim", + "nvim-lua/plenary.nvim", + "nvimtools/none-ls.nvim", + }, + config = function() + local null_ls = require("null-ls") + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics + local formatting = null_ls.builtins.formatting + -- https://github.com/prettier-solidity/prettier-plugin-solidity + local diagnostics = null_ls.builtins.diagnostics + null_ls.setup({ + sources = { + -- Here you can add tools not supported by mason.nvim + -- make sure the source name is supported by null-ls + -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md + formatting.ruff.with({ extra_args = { "format" } }), + diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }), + formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }), + formatting.prettier.with({ + extra_filetypes = { "toml" }, + extra_args = { + "--no-semi", + "--double-quote", + "--no-bracket-spacing", + "--tab-width", + "4", + "--bracket-same-line", + "--html-whitespace-sensitivity", + "strict", + }, + }), + -- formatting.markdownlint.with({ extra_filetypes = { "vimwiki" }, }), + formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }), + -- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), + -- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), + -- formatting.sqlfluff.with({ extra_args = { "--dialect", "postgres" } }), + }, + }) + require("mason-null-ls").setup({ + ensure_installed = { + "cbfmt", + "clang_format", + "cmake_format", + "cmake_lint", + "cpplint", + "djlint", + "google_java_format", + "luacheck", + "markdown_toc", + "mypy", + "stylua", + "yamlfmt", + "rustywind", + "ruff", + "letexindent", + }, + automatic_installation = true, + handlers = { + -- Here you can add functions to register sources. + -- See https://github.com/jay-babu/mason-null-ls.nvim#handlers-usage + -- + -- If left empty, mason-null-ls will use a "default handler" + -- to register all sources + }, + }) + end, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..669ff47 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,140 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { + "-", + vim.cmd.Oil, + desc = "Open parent directory", + }, + }, + lazy = false, + opts = { + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you still want to use netrw. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + "icon", + -- "permissions", + "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "n", + }, + -- Restore window options to previous values when leaving an oil buffer + restore_win_options = true, + -- Skip the confirmation popup for simple operations + skip_confirm_for_simple_edits = false, + -- Deleted files will be removed with the trash_command (below). + --delete_to_trash = true, + -- Change this to customize the command used when deleting to trash + trash_command = "trash-put", + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + prompt_save_on_select_new_entry = true, + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true }) + -- Additionally, if it is a string that matches "actions.", + -- it will use the mapping at require("oil.actions"). + -- Set to `false` to remove a keymap + -- See :help oil-actions for a list of all available actions + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + ["v"] = "actions.select_vsplit", + ["h"] = "actions.select_split", + ["t"] = "actions.select_tab", + ["p"] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["Y"] = "actions.copy_entry_path", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["."] = "actions.toggle_hidden", + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = false, + view_options = { + -- Show files and directories that start with "." + show_hidden = true, + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) + return vim.startswith(name, ".") + end, + -- This function defines what will never be shown, even when `show_hidden` is set + is_always_hidden = function(name, bufnr) + return false + end, + }, + -- Configuration for the floating window in oil.open_float + float = { + -- Padding around the floating window + padding = 2, + max_width = 0, + max_height = 0, + border = "rounded", + win_options = { + winblend = 10, + }, + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + override = function(conf) + return conf + end, + }, + -- Configuration for the actions floating preview window + preview = { + -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_width and max_width can be a single value or a list of mixed integer/float types. + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" + max_width = 0.9, + -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" + min_width = { 40, 0.4 }, + -- optionally define an integer/float for the exact width of the preview window + width = nil, + -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_height and max_height can be a single value or a list of mixed integer/float types. + -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" + max_height = 0.9, + -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" + min_height = { 5, 0.1 }, + -- optionally define an integer/float for the exact height of the preview window + height = nil, + border = "rounded", + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating progress window + progress = { + max_width = 0.9, + min_width = { 40, 0.4 }, + width = nil, + max_height = { 10, 0.9 }, + min_height = { 5, 0.1 }, + height = nil, + border = "rounded", + minimized_border = "none", + win_options = { + winblend = 0, + }, + }, + }, +} diff --git a/lua/plugins/presence.lua b/lua/plugins/presence.lua new file mode 100644 index 0000000..59cde08 --- /dev/null +++ b/lua/plugins/presence.lua @@ -0,0 +1 @@ +return { "andweeb/presence.nvim" } diff --git a/lua/plugins/rest.lua b/lua/plugins/rest.lua new file mode 100644 index 0000000..6f204cb --- /dev/null +++ b/lua/plugins/rest.lua @@ -0,0 +1,42 @@ +return { + "rest-nvim/rest.nvim", + cond = false, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Encode URL before making request + encode_url = true, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + -- show the generated curl command in case you want to launch + -- the same request via the terminal (can be verbose) + show_curl_command = false, + show_http_info = true, + show_headers = true, + -- executables or functions for formatting response body [optional] + -- set them to false if you want to disable them + formatters = { + json = "jq", + html = function(body) + return vim.fn.system({ "tidy", "-i", "-q", "-" }, body) + end, + }, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = ".env", + custom_dynamic_variables = {}, + yank_dry_run = true, + }, +} diff --git a/lua/plugins/runner.lua b/lua/plugins/runner.lua new file mode 100644 index 0000000..d79b902 --- /dev/null +++ b/lua/plugins/runner.lua @@ -0,0 +1,55 @@ +return { + "MarcHamamji/runner.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + config = function() + local runner = require("runner") + local choice = require("runner.handlers.helpers").choice + local helpers = require("runner.handlers.helpers") + + runner.setup({ + position = "right", -- position of the terminal window when using the shell_handler + -- can be: top, left, right, bottom + -- will be overwritten when using the telescope mapping to open horizontally or vertically + width = 50, -- width of window when position is left or right + height = 10, -- height of window when position is top or bottom + }) + + runner.set_handler( + "cpp", + choice({ + Cmake = function() + -- vim.cmd.CMakeBuild() + vim.cmd.CMakeRun() + end, + Makefile = helpers.shell_handler("make"), + ["g++"] = helpers.shell_handler( + "g++ " .. vim.fn.expand("%") .. " -o " .. vim.fn.expand("%:r") .. " && " .. vim.fn.expand("%:r") + ), + Custom = helpers.shell_handler("", true), + }) + ) + + runner.set_handler( + "c", + choice({ + Cmake = vim.cmd.CMakeRun, + Makefile = helpers.shell_handler("make"), + ["gcc"] = helpers.shell_handler( + "gcc " .. vim.fn.expand("%") .. " -o " .. vim.fn.expand("%:r") .. " && " .. vim.fn.expand("%:r") + ), + Custom = helpers.shell_handler("", true), + }) + ) + + -- runner.set_handler( + -- "python", + -- choice({ + -- Python = helpers.shell_handler("python " .. vim.fn.expand("%:t")), + -- Custom = helpers.shell_handler("", true), + -- }) + -- ) + end, +} diff --git a/lua/plugins/rust_tools.lua b/lua/plugins/rust_tools.lua new file mode 100644 index 0000000..db00044 --- /dev/null +++ b/lua/plugins/rust_tools.lua @@ -0,0 +1,44 @@ +return { + "simrat39/rust-tools.nvim", + dependencies = { "neovim/nvim-lspconfig" }, + ft = "rust", + keys = { + { "re", vim.cmd.RustExpandMacro, desc = "[E]xpand macro" }, + { "rc", vim.cmd.RustOpenCargo, desc = "Open [C]argo.toml" }, + { "rp", vim.cmd.RustParentModule, desc = "[P]arent module" }, + { "rh", vim.cmd.RustHoverActions, desc = "[H]over actions" }, + { "rg", vim.cmd.RustViewCrateGraph, desc = "View Create [G]raph" }, + { "rd", vim.cmd.RustOpenExternalDocs, desc = "Open External [D]ocs" }, + { "rr", vim.cmd.RustRunnables, desc = "Open [R]unnables" }, + { "ra", vim.cmd.RustCodeAction, desc = "Code [A]ction Groups" }, + { "rD", vim.cmd.RustDebuggables, desc = "[D]ebug" }, + { "drd", vim.cmd.RustDebuggables, desc = "[D]ebug" }, + }, + opts = { + tools = { + -- on_initialized = nil, + on_initialized = function() + vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, { + group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }), + pattern = { "*.rs" }, + callback = function() + vim.lsp.codelens.refresh() + end, + }) + end, + reload_workspace_from_cargo_toml = true, + inlay_hints = { + auto = true, + only_current_line = false, + show_parameter_hints = true, + parameter_hints_prefix = " <- ", + other_hints_prefix = " => ", + max_len_align = false, + max_len_align_padding = 1, + right_align = false, + right_align_padding = 7, + highlight = "Comment", + }, + }, + }, +} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua new file mode 100644 index 0000000..23a24a8 --- /dev/null +++ b/lua/plugins/surround.lua @@ -0,0 +1,5 @@ +return { + "kylechui/nvim-surround", + event = "VeryLazy", + opts = true, +} diff --git a/lua/plugins/tagbar.lua b/lua/plugins/tagbar.lua new file mode 100644 index 0000000..3dabea8 --- /dev/null +++ b/lua/plugins/tagbar.lua @@ -0,0 +1,6 @@ +return { + "preservim/tagbar", + keys = { + { "t", vim.cmd.TagbarToggle, desc = "Toggle [T]agbar" }, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..650d33d --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,320 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-tree/nvim-web-devicons" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { "nvim-telescope/telescope-media-files.nvim" }, + { "nvim-telescope/telescope-symbols.nvim" }, + { "nvim-telescope/telescope-bibtex.nvim" }, + { "tsakirist/telescope-lazy.nvim" }, + { "chip/telescope-software-licenses.nvim" }, + { "barrett-ruth/telescope-http.nvim" }, + { "crispgm/telescope-heading.nvim" }, + { "benfowler/telescope-luasnip.nvim" }, + { "paopaol/telescope-git-diffs.nvim" }, + { "debugloop/telescope-undo.nvim" }, + { "ThePrimeagen/harpoon", branch = "harpoon2" }, + { "ThePrimeagen/git-worktree.nvim" }, + }, + keys = { + { + "", + require("telescope.builtin").git_files, + desc = "Telescope git_files", + }, + { + "pf", + function() + require("telescope.builtin").find_files(require("telescope.themes").get_dropdown({ previewer = false })) + end, + desc = "[F]iles", + }, + { + "/", + function() + require("telescope.builtin").current_buffer_fuzzy_find( + require("telescope.themes").get_dropdown({ previewer = false }) + ) + end, + desc = "Current Buffer Fuzzy", + }, + { + "ps", + require("telescope.builtin").live_grep, + desc = "Live Grep", + }, + { + "pb", + require("telescope.builtin").buffers, + desc = "Find [B]uffers", + }, + { + "pws", + require("telescope.builtin").grep_string, + desc = "[S]tring under the cursor", + }, + { "pe", require("telescope.builtin").symbols, desc = "[E]moji" }, + { "pd", require("telescope.builtin").diagnostic, desc = "[D]iagnostics" }, + { "pB", require("telescope.builtin").git_branches, desc = "Checkout [B]ranch" }, + { "ph", require("telescope.builtin").help_tags, desc = "[H]elp" }, + { "pM", require("telescope.builtin").man_pages, desc = "[M]an Pages" }, + { "pr", require("telescope.builtin").oldfiles, desc = "Open [R]ecent Files" }, + { "pR", require("telescope.builtin").registers, desc = "[R]egisters" }, + { "pg", require("telescope.builtin").live_grep, desc = "[G]rep" }, + { "pG", require("telescope.builtin").git_files, desc = "[G]it Files" }, + { "pk", require("telescope.builtin").keymaps, desc = "[K]eymaps" }, + { "pC", require("telescope.builtin").commands, desc = "[C]ommands" }, + { "pt", vim.cmd.TodoTelescope, desc = "[T]odo" }, + { + "pm", + function() + require("telescope").extensions.media_files.media_files() + end, + desc = "[M]edia", + }, + { + "pc", + function() + require("telescope.builtin").colorscheme({ enable_preview = true }) + end, + desc = "[C]olorscheme with Preview", + }, + { + "pl", + function() + require("telescope").extensions.lazy.lazy() + end, + desc = "[L]azy", + }, + { + "pL", + function() + require("telescope").extensions.luasnip.luasnip() + end, + desc = "[L]uasnip", + }, + { + "pH", + function() + require("telescope").extensions.heading.heading() + end, + desc = "[H]eading", + }, + { + "pDs", + "Telescope software-licenses find", + desc = "[S]oftware Licenses", + }, + { + "pDh", + function() + require("telescope").extensions.http.list() + end, + desc = "[H]TTP", + }, + { + "gw", + function() + require("telescope").extensions.git_worktree.git_worktrees() + end, + desc = "[G]it Change [W]orktree", + }, + { + "gn", + function() + require("telescope").extensions.git_worktree.create_git_worktree() + end, + desc = "[G]it Create [N]ew Worktree", + }, + { + "gd", + function() + require("telescope").extensions.git_diffs.diff_commits() + end, + desc = "[G]it [D]iff", + }, + { + "tB", + require("telescope.builtin").bibtex, + desc = "Telescope [B]ibtex", + }, + }, + config = function() + local telescope = require("telescope") + + telescope.setup({ + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--hidden", + }, + prompt_prefix = " ", + selection_caret = " ", + path_display = { "smart" }, + file_ignore_patterns = { ".git/", ".spl", "target/", "*.pdf" }, + mappings = { + i = { + [""] = require("telescope.actions").cycle_history_next, + [""] = require("telescope.actions").cycle_history_prev, + [""] = require("telescope.actions").move_selection_next, + [""] = require("telescope.actions").move_selection_previous, + [""] = require("telescope.actions").delete_buffer + + require("telescope.actions").move_to_top, + [""] = require("trouble").open_with_trouble, + -- [""] = require("telescope.actions").remove_selection + }, + n = { [""] = require("trouble").open_with_trouble }, + }, + }, + pickers = { + find_files = { + hidden = true, + follow = true, + }, + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + }, + media_files = { + -- filetypes whitelist + filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" }, + find_cmd = "rg", + }, + emoji = { + action = function(emoji) + -- argument emoji is a table. + -- {name="", value="", cagegory="", description=""} + + vim.fn.setreg("*", emoji.value) + print([[Press p or "*p to paste this emoji]] .. emoji.value) + + -- insert emoji when picked + -- vim.api.nvim_put({ emoji.value }, 'c', false, true) + end, + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }), + + -- pseudo code / specification for writing custom displays, like the one + -- for "codeactions" + -- specific_opts = { + -- [kind] = { + -- make_indexed = function(items) -> indexed_items, width, + -- make_displayer = function(widths) -> displayer + -- make_display = function(displayer) -> function(e) + -- make_ordinal = function(e) -> string + -- }, + -- -- for example to disable the custom builtin "codeactions" display + -- do the following + -- codeactions = false, + -- } + }, + lazy = { + -- Optional theme (the extension doesn't set a default theme) + theme = "dropdown", + previewer = false, + -- Whether or not to show the icon in the first column + show_icon = true, + -- Mappings for the actions + mappings = { + open_in_browser = "", + open_in_file_browser = "", + open_in_find_files = "", + open_in_live_grep = "", + open_plugins_picker = "", -- Works only after having called first another action + open_lazy_root_find_files = "f", + open_lazy_root_live_grep = "g", + }, + -- Other telescope configuration options + }, + http = { + -- How the mozilla url is opened. By default will be configured based on OS: + open_url = "xdg-open %s", -- UNIX + -- open_url = 'open %s' -- OSX + -- open_url = 'start %s' -- Windows + }, + heading = { + treesitter = true, + picker_opts = { + layout_config = { width = 0.8, preview_width = 0.5 }, + layout_strategy = "horizontal", + }, + }, + bibtex = { + -- Depth for the *.bib file + depth = 1, + -- Custom format for citation label + custom_formats = {}, + -- Format to use for citation label. + -- Try to match the filetype by default, or use 'plain' + format = "", + -- Path to global bibliographies (placed outside of the project) + global_files = {}, + -- Define the search keys to use in the picker + search_keys = { "author", "year", "title" }, + -- Template for the formatted citation + citation_format = "{{author}} ({{year}}), {{title}}.", + -- Only use initials for the authors first name + citation_trim_firstname = true, + -- Max number of authors to write in the formatted citation + -- following authors will be replaced by "et al." + citation_max_auth = 2, + -- Context awareness disabled by default + context = false, + -- Fallback to global/directory .bib files if context not found + -- This setting has no effect if context = false + context_fallback = true, + -- Wrapping in the preview window is disabled by default + wrap = false, + }, + undo = { + use_delta = true, + use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" } + side_by_side = false, + diff_context_lines = vim.o.scrolloff, + entry_format = "state #$ID, $STAT, $TIME", + time_format = "", + mappings = { + i = { + -- IMPORTANT: Note that telescope-undo must be available when telescope is configured if + -- you want to replicate these defaults and use the following actions. This means + -- installing as a dependency of telescope in it's `requirements` and loading this + -- extension from there instead of having the separate plugin definition as outlined + -- above. + [""] = require("telescope-undo.actions").yank_additions, + [""] = require("telescope-undo.actions").yank_deletions, + [""] = require("telescope-undo.actions").restore, + }, + }, + }, + }, + }) + + pcall(telescope.load_extension, "fzf") + pcall(telescope.load_extension, "media_files") -- Telescope media_files + pcall(telescope.load_extension, "git_worktree") -- Telescope git_worktree + pcall(telescope.load_extension, "lazy") -- Telescope lazy + pcall(telescope.load_extension, "software-licenses") -- Telescope software-licenses list + pcall(telescope.load_extension, "http") -- Telescope http list + pcall(telescope.load_extension, "heading") -- Telescope heading + pcall(telescope.load_extension, "luasnip") -- Telescope luasnip + pcall(telescope.load_extension, "git_diffs") -- Telescope git_diffs diff_commits + pcall(telescope.load_extension, "bibtex") -- Telescope bibtex + pcall(telescope.load_extension, "undo") -- Telescope undo + pcall(telescope.load_extension, "harpoon") + end, +} diff --git a/lua/plugins/tmux_navigator.lua b/lua/plugins/tmux_navigator.lua new file mode 100644 index 0000000..a5dbe61 --- /dev/null +++ b/lua/plugins/tmux_navigator.lua @@ -0,0 +1 @@ +return { "christoomey/vim-tmux-navigator" } diff --git a/lua/plugins/todo_comments.lua b/lua/plugins/todo_comments.lua new file mode 100644 index 0000000..fe12cc2 --- /dev/null +++ b/lua/plugins/todo_comments.lua @@ -0,0 +1 @@ +return { "folke/todo-comments.nvim", opts = true } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..ead95af --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,181 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + dependencies = { + "p00f/nvim-ts-rainbow", + "mechatroner/rainbow_csv", + "JoosepAlviste/nvim-ts-context-commentstring", + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move") + + -- Repeat movement with ; and , + -- ensure ; goes forward and , goes backward regardless of the last direction + vim.keymap.set( + { "n", "x", "o" }, + ";", + ts_repeat_move.repeat_last_move_next, + { desc = "Repeat last action and move forward" } + ) + vim.keymap.set( + { "n", "x", "o" }, + ",", + ts_repeat_move.repeat_last_move_previous, + { desc = "Repeat last action and move backward" } + ) + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "cpp", "lua", "rust", "python", "markdown", "json", "http" }, -- one of "all" or a list of languages + -- 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 (for "all") + ignore_install = { "latex" }, + modules = {}, + + highlight = { + enable = true, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = { "markdown" }, + + 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, + }, + indent = { + enable = true, + }, + autotag = { + enable = true, + enable_rename = true, + enable_close = true, + enable_close_on_slash = true, + filetypes = { + "astro", + "glimmer", + "handlebars", + "hbs", + "html", + "htmldjango", + "javascript", + "javascriptreact", + "jsx", + "markdown", + "php", + "rescript", + "svelte", + "tsx", + "typescript", + "typescriptreact", + "vue", + "xml", + }, + }, + rainbow = { + enable = true, + -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for + extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + max_file_lines = nil, -- Do not enable for files with more than n lines, int + -- colors = {}, -- table of hex strings + -- termcolors = {}, -- table of colour name strings + }, + incremenral_selection = { + enable = true, + keymaps = { + init_selection = "", + node_selection = "", + scope_selection = "", + node_deselection = "", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter" }, + ["af"] = { query = "@function.outer", desc = "Select outer part of a function" }, + ["if"] = { query = "@function.inner", desc = "Select inner part of a function" }, + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class region" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["at"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, + ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" }, + }, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + ["@class.outer"] = "", -- blockwise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true of false + include_surrounding_whitespace = true, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + -- goto_next = { + -- [']i'] = "@conditional.inner", + -- }, + -- goto_previous = { + -- ['[i'] = "@conditional.inner", + -- } + }, + swap = { + enable = true, + swap_next = { + ["]a"] = "@parameter.inner", + }, + swap_previous = { + ["[a"] = "@parameter.inner", + }, + }, + }, + }, + }) + end, +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua new file mode 100644 index 0000000..1cbeeb6 --- /dev/null +++ b/lua/plugins/trouble.lua @@ -0,0 +1,96 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { + "tx", + function() + require("trouble").toggle() + end, + desc = "Toggle trouble", + }, + { + "tw", + function() + require("trouble").toggle("workspace_diagnostics") + end, + desc = "[W]orkspace Diagnostics", + }, + { + "td", + function() + require("trouble").toggle("document_diagnostics") + end, + desc = "[D]ocument Diagnostics", + }, + { + "tn", + function() + require("trouble").next({ skip_groups = true, jump = true }) + end, + desc = "Next", + }, + { + "tp", + function() + require("trouble").previous({ skip_groups = true, jump = true }) + end, + desc = "Previous", + }, + }, + opts = { + position = "bottom", -- position of the list can be: bottom, top, left, right + height = 10, -- height of the trouble list when position is top or bottom + width = 50, -- width of the list when position is left or right + icons = true, -- use devicons for filenames + mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" + severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT + fold_open = "", -- icon used for open folds + fold_closed = "", -- icon used for closed folds + group = true, -- group results by file + padding = true, -- add an extra new line on top of the list + cycle_results = true, -- cycle item list when reaching beginning or end of list + action_keys = { -- key mappings for actions in the trouble list + -- map to {} to remove a mapping, for example: + -- close = {}, + close = "q", -- close the list + cancel = "", -- cancel the preview and get back to your last window / buffer / cursor + refresh = "r", -- manually refresh + jump = { "", "", "<2-leftmouse>" }, -- jump to the diagnostic or open / close folds + open_split = { "" }, -- open buffer in new split + open_vsplit = { "" }, -- open buffer in new vsplit + open_tab = { "" }, -- open buffer in new tab + jump_close = { "o" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location + open_code_href = "c", -- if present, open a URI with more information about the diagnostic error + close_folds = { "zM", "zm" }, -- close all folds + open_folds = { "zR", "zr" }, -- open all folds + toggle_fold = { "zA", "za" }, -- toggle fold of current file + previous = "k", -- previous item + next = "j", -- next item + help = "?", -- help menu + }, + multiline = true, -- render multi-line messages + indent_lines = true, -- add an indent guide below the fold icons + win_config = { border = "single" }, -- window configuration for floating windows. See |nvim_open_win()|. + auto_open = false, -- automatically open the list when you have diagnostics + auto_close = false, -- automatically close the list when you have no diagnostics + auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window + auto_fold = false, -- automatically fold a file trouble list at creation + auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result + include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" }, -- for the given modes, include the declaration of the current symbol in the results + signs = { + -- icons / text used for a diagnostic + error = "", + warning = "", + hint = "", + information = "", + other = "", + }, + use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client + }, +} diff --git a/lua/plugins/twilight.lua b/lua/plugins/twilight.lua new file mode 100644 index 0000000..381ed28 --- /dev/null +++ b/lua/plugins/twilight.lua @@ -0,0 +1,23 @@ +return { + "folke/twilight.nvim", + opts = { + dimming = { + alpha = 0.25, -- amount of dimming + -- we try to get the foreground from the highlight groups or fallback color + color = { "Normal", "#ffffff" }, + term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color + inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) + }, + context = 10, -- amount of lines we will try to show around the current line + treesitter = true, -- use treesitter when available for the filetype + -- treesitter is used to automatically expand the visible text, + -- but you can further control the types of nodes that should always be fully expanded + expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types + "function", + "method", + "table", + "if_statement", + }, + exclude = {}, -- exclude these filetypes + }, +} diff --git a/lua/plugins/typst.lua b/lua/plugins/typst.lua new file mode 100644 index 0000000..0919524 --- /dev/null +++ b/lua/plugins/typst.lua @@ -0,0 +1,5 @@ +return { + "kaarmu/typst.vim", + ft = "typst", + lazy = false, +} diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua new file mode 100644 index 0000000..c4823ce --- /dev/null +++ b/lua/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + "mbbill/undotree", + keys = { + { "u", vim.cmd.UndotreeToggle, desc = "Toggle [U]ndotree" }, + }, +} diff --git a/lua/plugins/vim_be_good.lua b/lua/plugins/vim_be_good.lua new file mode 100644 index 0000000..5c1fc32 --- /dev/null +++ b/lua/plugins/vim_be_good.lua @@ -0,0 +1 @@ +return { "ThePrimeagen/vim-be-good", lazy = true } diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua new file mode 100644 index 0000000..361e8c4 --- /dev/null +++ b/lua/plugins/vimtex.lua @@ -0,0 +1,12 @@ +return { + "lervag/vimtex", + keys = { + { "Tb", vim.cmd.VimtexCompile, desc = "[B]uild" }, + { "Tv", vim.cmd.VimtexView, desc = "[V]iew" }, + { "Tw", vim.cmd.VimtexCountWords, desc = "[W]ord Count" }, + { "Tt", vim.cmd.VimtexTocToggle, desc = "[T]able of Contents" }, + { "Tc", vim.cmd.VimtexClean, desc = "[C]lean aux" }, + { "Te", vim.cmd.VimtexErrors, desc = "Report [E]rrors" }, + { "Ti", vim.cmd.VimtexInfo, desc = "[I]nfo" }, + }, +} diff --git a/lua/plugins/vimwiki.lua b/lua/plugins/vimwiki.lua new file mode 100644 index 0000000..8f0c5d6 --- /dev/null +++ b/lua/plugins/vimwiki.lua @@ -0,0 +1,14 @@ +return { + "vimwiki/vimwiki", + --[[ keys = { + { "ww", vim.cmd.VimwikiIndex, desc = "Open index file" }, + { "wt", vim.cmd.VimwikiTabIndex, desc = "Open Index File in New [T]ab" }, + { "ws", vim.cmd.VimwikiUISelect, desc = "Display List of Wikis" }, + { "wi", vim.cmd.VimwikiDiaryIndex, desc = "Open Diary Index" }, + { "wh", vim.cmd.Vimwiki2HTML, desc = "Convert File to HTML" }, + { "wH", vim.cmd.Vimwiki2HTMLBrowse, desc = "Convert File to HTML and open in Browser" }, + { "wn", vim.cmd.VimwikiGoto, desc = "Goto link provided by an argument" }, + { "wd", vim.cmd.VimwikiDeleteFile, desc = "Rename file" }, + { "wr", vim.cmd.VimwikiRenameFile, desc = "Delete file" }, + }, ]] +} diff --git a/lua/plugins/web_devicons.lua b/lua/plugins/web_devicons.lua new file mode 100644 index 0000000..30835e1 --- /dev/null +++ b/lua/plugins/web_devicons.lua @@ -0,0 +1 @@ +return { "nvim-tree/nvim-web-devicons" } diff --git a/lua/plugins/which_key.lua b/lua/plugins/which_key.lua new file mode 100644 index 0000000..e1ab2ee --- /dev/null +++ b/lua/plugins/which_key.lua @@ -0,0 +1,121 @@ +return { + "folke/which-key.nvim", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = true, + config = function() + local wk = require("which-key") + + local opts = { + mode = "n", -- NORMAL mode + prefix = "", + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps + } + local vopts = { + mode = "v", -- VISUAL mode + prefix = "", + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps + } + -- NOTE: Prefer using : over as the latter avoids going back in normal-mode. + -- see https://neovim.io/doc/user/map.html#:map-cmd + local vmappings = { + s = { ":s///gI", "[s]ubstitute word" }, + } + + local mappings = { + c = { vim.cmd.bdelete, "[C]lose Buffer" }, + t = { name = "[T]rouble" }, + g = { name = "[G]it" }, + l = { name = "[L]SP" }, + p = { + name = "Telescope", + D = { name = "[D]evelopment" }, + }, + h = { name = "[H]arpoon" }, + z = { name = "[Z]en" }, + r = { name = "[R]ust" }, + w = { name = "Vim[W]iki" }, + L = { + name = "[L]anguage settings", + c = { "setlocal formatoptions-=cro", "Disable autocomment" }, + C = { "setlocal formatoptions=cro", "Enable autocomment" }, + s = { "setlocal spell!", "Toggle spellchecker" }, + e = { "setlocal spell spelllang=en_us", "Enable English spellchecker" }, + l = { "setlocal spell spelllang=lv_LV", "Enable Lavian spellchecker" }, + I = { "setlocal autoindent", "Enable autoindent" }, + i = { "setlocal noautoindent", "Disable autoindent" }, + }, + d = { + name = "[D]AP", + p = { name = "[P]ython" }, + r = { name = "[R]ust" }, + }, + T = { name = "Vim[T]ex" }, + P = { + name = "Tem[p]lates", + l = { + name = "[L]aTeX", + p = { + function() + vim.cmd.read("~/Templates/LaTeX/PhilPaper.tex") + end, + "PhilPaper.tex", + }, + l = { + function() + vim.cmd.read("~/Templates/LaTeX/Letter.tex") + end, + "Letter.tex", + }, + g = { + function() + vim.cmd.read("~/Templates/LaTeX/Glossary.tex") + end, + "Glossary.tex", + }, + h = { + function() + vim.cmd.read("~/Templates/LaTeX/HandOut.tex") + end, + "HandOut.tex", + }, + b = { + function() + vim.cmd.read("~/Templates/LaTeX/PhilBeamer.tex") + end, + "PhilBeamer.tex", + }, + s = { + function() + vim.cmd.read("~/Templates/LaTeX/SubFile.tex") + end, + "SubFile.tex", + }, + r = { + function() + vim.cmd.read("~/Templates/LaTeX/Root.tex") + end, + "Root.tex", + }, + m = { + function() + vim.cmd.read("~/Templates/LaTeX/MultipleAnswer.tex") + end, + "MultipleAnswer.tex", + }, + }, + }, + } + + wk.register(mappings, opts) + wk.register(vmappings, vopts) + end, +} diff --git a/lua/plugins/worktree.lua b/lua/plugins/worktree.lua new file mode 100644 index 0000000..82b335a --- /dev/null +++ b/lua/plugins/worktree.lua @@ -0,0 +1,11 @@ +return { + "ThePrimeagen/git-worktree.nvim", + config = function() + local worktree = require("git-worktree") + worktree.on_tree_change(function(op, metadata) + if op == worktree.Operations.Switch then + print("Switched from " .. metadata.prev_path .. " to " .. metadata.path) + end + end) + end, +} diff --git a/lua/plugins/yuck.lua b/lua/plugins/yuck.lua new file mode 100644 index 0000000..78175d9 --- /dev/null +++ b/lua/plugins/yuck.lua @@ -0,0 +1 @@ +return { "elkowar/yuck.vim", ft = "yuck" } diff --git a/lua/plugins/zen_mode.lua b/lua/plugins/zen_mode.lua new file mode 100644 index 0000000..e8e10ea --- /dev/null +++ b/lua/plugins/zen_mode.lua @@ -0,0 +1,62 @@ +return { + "folke/zen-mode.nvim", + dependencies = { "lukas-reineke/indent-blankline.nvim" }, + keys = { + { + "zz", + function() + require("zen-mode").toggle() + end, + desc = "Toggle [Z]en Mode", + }, + }, + opts = { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 120, -- width of the Zen window + height = 1, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { + signcolumn = "no", -- disable signcolumn + number = false, -- disable number column + relativenumber = false, -- disable relative numbers + cursorline = false, -- disable cursorline + cursorcolumn = false, -- disable cursor column + foldcolumn = "0", -- disable fold column + colorcolumn = "0", -- disable colorcolumn + list = false, -- disable whitespace characters + wrap = false, -- disable word wrap + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = false, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + -- you may turn on/off statusline in zen mode by setting 'laststatus' + -- statusline will be shown only if 'laststatus' == 3 + laststatus = 0, -- turn off the statusline in zen mode + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = true }, -- disables git signs + tmux = { enabled = true }, -- disables the tmux statusline + alacritty = { + enabled = false, + font = "14", -- font size + }, + }, + -- callback where you can add custom code when the Zen window opens + on_open = function(win) + require("ibl").setup({ enabled = false }) + end, + -- callback where you can add custom code when the Zen window closes + on_close = function() end, + }, +} diff --git a/lua/solo/autocmds.lua b/lua/solo/autocmds.lua index d7c9adb..4da4454 100644 --- a/lua/solo/autocmds.lua +++ b/lua/solo/autocmds.lua @@ -1,4 +1,4 @@ --- Use 'q' to quit from common plugins +-- Use 'q' to quit from common pluginscmd vim.api.nvim_create_autocmd({ "FileType" }, { pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir", "git", "dap-float" }, callback = function() diff --git a/lua/solo/cmds.lua b/lua/solo/cmds.lua new file mode 100644 index 0000000..e9083f1 --- /dev/null +++ b/lua/solo/cmds.lua @@ -0,0 +1,9 @@ +vim.api.nvim_create_user_command("CopilotToggle", function() + if vim.g.copilot_enabled == 1 then + vim.g.copilot_enabled = 0 + vim.api.nvim_echo({ { "Copilot disabled", "WarningMsg" } }, true, {}) + else + vim.g.copilot_enabled = 1 + vim.api.nvim_echo({ { "Copilot enabled", "WarningMsg" } }, true, {}) + end +end, { desc = "Toggle Copilot" }) diff --git a/lua/solo/init.lua b/lua/solo/init.lua index ab61fea..ce71dc3 100644 --- a/lua/solo/init.lua +++ b/lua/solo/init.lua @@ -1,5 +1,7 @@ ---require("solo.options") ---require("solo.keymaps") +require("solo.keymaps") +require("solo.options") require("solo.vimwiki") +require("solo.typst") require("solo.lazy") require("solo.autocmds") +require("solo.cmds") diff --git a/plugin/keymaps.lua b/lua/solo/keymaps.lua similarity index 79% rename from plugin/keymaps.lua rename to lua/solo/keymaps.lua index edf4bcf..dbdc623 100644 --- a/plugin/keymaps.lua +++ b/lua/solo/keymaps.lua @@ -2,25 +2,33 @@ local nmap = require("solo.mappings").nmap local xmap = require("solo.mappings").xmap local vmap = require("solo.mappings").vmap local tmap = require("solo.mappings").tmap +local imap = require("solo.mappings").imap +-- Unpam keys vim.keymap.set("", "", "") nmap("Q", "") -nmap("q", "") nmap("", "") +nmap("", "") +nmap("", "") +nmap("", "") +nmap("", "") +nmap("v", "") +nmap("p", "") nmap("J", "mzJ`z") nmap("", "zz") nmap("", "zz") nmap("n", "nzzzv") nmap("N", "Nzzzv") +-- nmap("'", ":normal! zz") vim.keymap.set({ "n" }, "j", "gj", { desc = "Allows to navigate though wrapped lines", noremap = true }) vim.keymap.set({ "n" }, "k", "gk", { desc = "Allows to navigate though wrapped lines", noremap = true }) -vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateLeft, { desc = "Focus window left" }) -vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateDown, { desc = "Focus window down" }) -vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateUp, { desc = "Focus window up" }) -vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateRight, { desc = "Focus window right" }) +vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateLeft, { desc = "Focus window left", noremap = true }) +vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateDown, { desc = "Focus window down", noremap = true }) +vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateUp, { desc = "Focus window up", noremap = true }) +vim.keymap.set({ "n", "t" }, "", vim.cmd.TmuxNavigateRight, { desc = "Focus window right", noremap = true }) nmap("", "resize -2", "Resize window up") nmap("", "resize +2", "Resize window down") @@ -36,6 +44,10 @@ nmap("", ":%s///gI", "[S]ubstitute wo -- nmap("", "w!!compiler '%:p'") -- nmap("", "w!!opout '%:p'") +nmap("Q", "@qj", "Run macro") + +xmap("Q", ":norm @q", "Run macro") + xmap("p", '"_dP') vim.keymap.set( "c", @@ -55,6 +67,8 @@ vmap("<", "", ":m '<-2gv=gv", "Move lines up") vmap("", ":m '>+1gv=gv", "Move lines down") +-- nmap("-", vim.cmd.Oil, "Open parent directory") + -- tmap("t", "", "h") -- tmap("t", "", "j") -- tmap("t", "", "k") diff --git a/plugin/options.lua b/lua/solo/options.lua similarity index 91% rename from plugin/options.lua rename to lua/solo/options.lua index ed0802d..8d6fa1c 100644 --- a/plugin/options.lua +++ b/lua/solo/options.lua @@ -54,8 +54,13 @@ vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua") vim.opt_local.suffixesadd:prepend(".lua") vim.opt_local.suffixesadd:prepend("init.lua") --- vim.g.netrw_banner = 0 --- vim.g.netrw_browse_split = 0 --- vim.g.netrw_keepdir = 0 --- vim.g.netrw_localcopydircmd = "cp -r" --- vim.g.netrw_winsize = 30 +vim.opt.list = true +vim.opt.listchars:append("space:⋅") +vim.opt.listchars:append("tab:▎ ") +vim.opt.listchars:append("eol:↴") + +vim.g.netrw_banner = 0 +vim.g.netrw_browse_split = 0 +vim.g.netrw_keepdir = 0 +vim.g.netrw_localcopydircmd = "cp -r" +vim.g.netrw_winsize = 30 diff --git a/lua/solo/snips.lua b/lua/solo/snips.lua index 88babaa..2e47b42 100644 --- a/lua/solo/snips.lua +++ b/lua/solo/snips.lua @@ -37,8 +37,6 @@ local parse = require("luasnip.util.parser").parse_snippet local ms = ls.multi_snippet ]] -require("luasnip/loaders/from_vscode").lazy_load() - local shortcut = function(val) if type(val) == "string" then return { t({ val }), i(0) } diff --git a/lua/solo/typst.lua b/lua/solo/typst.lua new file mode 100644 index 0000000..df80b83 --- /dev/null +++ b/lua/solo/typst.lua @@ -0,0 +1,9 @@ +vim.g.typst_cmd = "typst" -- Specifies the location of the Typst executable. Default: 'typst' +vim.g.typst_pdf_viewer = "zathura" -- Specifies pdf viewer that typst watch --open will use. Default: '' +vim.g.typst_conceal = 0 -- Enable concealment. Default: 0 +vim.g.typst_conceal_math = vim.g.typst_conceal -- Enable concealment for math symbols in math mode (i.e. replaces symbols with their actual unicode character). +-- OBS: this can affect performance, see issue #64. Default: g:typst_conceal +vim.g.typst_conceal_emoji = vim.g.typst_conceal -- Enable concealing emojis, e.g. #emoji.alien becomes 👽. Default: g:typst_conceal +vim.g.typst_auto_close_toc = 0 -- Specifies whether TOC will be automatically closed after using it. Default: 0 +vim.g.typst_auto_open_quickfix = 1 -- Specifies whether the quickfix list should automatically open when there are errors from typst. Default: 1 +vim.g.typst_embedded_languages = { "python", "rust", "c", "cpp" } -- A list of languages that will be highlighted in code blocks. Typst is always highlighted. Default: [] diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm new file mode 100644 index 0000000..829b2b0 --- /dev/null +++ b/queries/lua/highlights.scm @@ -0,0 +1,4 @@ +;; extends + +((identifier) @namespace.builtin + (#eq? @namespace.builtin "vim")) diff --git a/queries/rust/injections.scm b/queries/rust/injections.scm new file mode 100644 index 0000000..9e40d6d --- /dev/null +++ b/queries/rust/injections.scm @@ -0,0 +1,8 @@ +; Inject into sqlx::query!(r#"..."#, ...) as sql +(macro_invocation + (scoped_identifier + path: (identifier) @_path (#eq? @_path "sqlx")) + + (token_tree + (raw_string_literal) @sql) + (#offset! @sql 1 0 0 0)) diff --git a/spell/lv.utf-8.add b/spell/lv.utf-8.add index 1f6d14f..7dc8325 100644 --- a/spell/lv.utf-8.add +++ b/spell/lv.utf-8.add @@ -31,3 +31,100 @@ pirmkoda Sponsoru lietotne tērzētava +Maksimalizācijas +jācenšas +Minimalizācijas +maksa +attiecas +normatīvo +Izmantojamība +Izantojamība +tiešsaistes +vietni +entītātes +konceptuālā +ER +Konceptuālajā +piemītošās +piemītošā +īsziņa +terzēšanā +notiekošie +tekošās +notikušas +īsziņu +dzēšāna +īsziņas +Nākamā +paziņojumu +paziņojumu +paziņojumu +uztver +neabilst +Ievades +ievades +veicamās +Veic +Tekošā +iegūstamā +Alternatīvi +notikusi +notikuši +formatēts +skaitlisks +pieļaujamam +pieļaujamos +aizvieto +sagatavotie +Atļautie +neatgriezeniski +izdzēš +tekošo +digitālo +decimālskaitlis +validācija +atlasītie +apstrādāti +Tērzētavā +identifikatori +identifikatoriem +PROJEKTĒJUMA +projektējums +projektējuma +obligātums +nākamajā +dotais +sākas +interneta +entitātes +augoši +dilstoši +atšķirties +veic +Ilgtermiņa +Psiholoģiskie +Psiholoģiskā +Lietotņu +lietojamība +šinī +galvenās +slaids +slaids +statistiski +skaitlisko +vislabāk +statistisko +skaitliski +respondentu +ļauj +finanšu +nākamā +pamatmetožu +svērtie +tādas +ikmēneša +Galveno +Nosakot +galvenos +stratēģiskā +Turklāt diff --git a/spell/lv.utf-8.add.spl b/spell/lv.utf-8.add.spl index e72ae32ecf16d821128e70c3c4d9a1509ccc21ad..841f5bd9c8a73d8a908b605abc786d2bf5b04f21 100644 GIT binary patch literal 1792 zcmYLKJ&PMj5S{ATHBJ>==W7bmS$lHk)xBc)iJ2HESIF}UV>4U*wol4RUVfJ%c~ zFLV8DRqjvo&gU*P{H>%3&U$fBcdMEKsL6f1TfVWC;vTeHR9VD<{VGYnXtH+SJYqMOz^)s{!|X`7}jcBAGPbQTCPe_NWl^yM-j#?2uWhk{X`bFuml) z;^`TA(*B$D$`?p5OH#?CG{$I3yf4dR8lAD^D=4KnvI?v>fiSFBh%lK11eL^G`qWi} zv9+0!Zf%m!0UUvBfQ*Iku}5Z^%BbgP`+JsRx-`aNd^9Wu%RCtnIEx)Rfq`+EUNz-z zCml6s0d2;^mf4Oy5VF*Tv4cADkX|eiN&f9+s(CCl57I=l;?(*k45nDaj6mXCGl-mh z1WeMxs!(0d3ga4649Xq*>CoitsUI_`B}90+vg0ISyMwG#w< z0hJv8gS^2F!^cGaK_X-XPVcUPG3atAwMkh7IcpzUpXGJC8q6YSE*9+!(@>d=1#j+Y zdQ0TB(nNfW{?ePA(*iUoDm#Pyb)`j;yCYhbjiYXUCCPCkC`5KR$j1jN2O>Z}o^jmH zQ4xH<<1Q;<%!OnAXpD_(iYxIx$)ktk)RO_&o_he&9T1x6ZIhii-wh^f;P21?W2^-5 z@K=97FJ2YkB^uytKcXOr;nfaX>@mTk)N*b)F=}{W_m{728IcIgu$~M_xfUF-vuw3- z6k>}?+l(vC2%%pjQ_b2ckv6fl6iN~V_K>q%mF+_1A|vS&F5;BgdM!ow&}h zmP>|ZYu=Jea3PyJZmCUfr!(hchrtH1*Jrgt!{VkSxD&FRX6n(~*pO;ut40a$DC<63 z{|qYPpfXkbdmcS!e=ehMXsM+PHu{i9IPkpJUC2ew#P|&lniGp0;QuIz8LXi<&)szt lQL!k#XSux2WIf}PzH+TZ1D+^PjI{hC{ExUGwasXLzi+tbfkglS