From c55413d9894dabd4aed502667463e0e9f4c2e280 Mon Sep 17 00:00:00 2001 From: Leon Kowarschick Date: Wed, 24 Apr 2024 12:49:58 +0200 Subject: [PATCH] Include compiled nvim lua --- nvim/.config/nvim/.gitignore | 1 - nvim/.config/nvim/lua/dots/basics.lua | 4 + nvim/.config/nvim/lua/dots/colors.lua | 14 ++ nvim/.config/nvim/lua/dots/help-thingy.lua | 60 ++++++ nvim/.config/nvim/lua/dots/keybinds.lua | 90 ++++++++ .../nvim/lua/dots/plugins/bufferline.lua | 24 +++ nvim/.config/nvim/lua/dots/plugins/cmp.lua | 51 +++++ .../.config/nvim/lua/dots/plugins/copilot.lua | 3 + .../nvim/lua/dots/plugins/diffview.lua | 10 + nvim/.config/nvim/lua/dots/plugins/emmet.lua | 9 + nvim/.config/nvim/lua/dots/plugins/feline.lua | 133 ++++++++++++ .../nvim/lua/dots/plugins/flutter-tools.lua | 5 + .../nvim/lua/dots/plugins/gitsigns.lua | 11 + .../nvim/lua/dots/plugins/gruvbox8.lua | 111 ++++++++++ nvim/.config/nvim/lua/dots/plugins/lsp.lua | 163 ++++++++++++++ .../.config/nvim/lua/dots/plugins/ltex-ls.lua | 182 ++++++++++++++++ nvim/.config/nvim/lua/dots/plugins/noice.lua | 4 + .../nvim/lua/dots/plugins/nvim-colorizer.lua | 9 + .../nvim/lua/dots/plugins/obsidian.lua | 6 + .../.config/nvim/lua/dots/plugins/plugins.lua | 26 +++ .../nvim/lua/dots/plugins/telescope.lua | 12 ++ .../nvim/lua/dots/plugins/todo-comments.lua | 3 + .../nvim/lua/dots/plugins/treesitter.lua | 7 + .../.config/nvim/lua/dots/plugins/trouble.lua | 17 ++ nvim/.config/nvim/lua/dots/plugins/vimtex.lua | 15 ++ nvim/.config/nvim/lua/dots/prelude.lua | 4 + .../nvim/lua/dots/smart-compe-conjure.lua | 35 +++ nvim/.config/nvim/lua/dots/utils.lua | 201 ++++++++++++++++++ nvim/.config/nvim/lua/main.lua | 103 +++++++++ 29 files changed, 1312 insertions(+), 1 deletion(-) create mode 100644 nvim/.config/nvim/lua/dots/basics.lua create mode 100644 nvim/.config/nvim/lua/dots/colors.lua create mode 100644 nvim/.config/nvim/lua/dots/help-thingy.lua create mode 100644 nvim/.config/nvim/lua/dots/keybinds.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/bufferline.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/cmp.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/copilot.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/diffview.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/emmet.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/feline.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/flutter-tools.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/gitsigns.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/gruvbox8.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/lsp.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/ltex-ls.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/noice.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/nvim-colorizer.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/obsidian.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/plugins.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/telescope.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/todo-comments.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/treesitter.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/trouble.lua create mode 100644 nvim/.config/nvim/lua/dots/plugins/vimtex.lua create mode 100644 nvim/.config/nvim/lua/dots/prelude.lua create mode 100644 nvim/.config/nvim/lua/dots/smart-compe-conjure.lua create mode 100644 nvim/.config/nvim/lua/dots/utils.lua create mode 100644 nvim/.config/nvim/lua/main.lua diff --git a/nvim/.config/nvim/.gitignore b/nvim/.config/nvim/.gitignore index 70bfd1b..268dd9f 100644 --- a/nvim/.config/nvim/.gitignore +++ b/nvim/.config/nvim/.gitignore @@ -1,3 +1,2 @@ -lua plugin lua-old diff --git a/nvim/.config/nvim/lua/dots/basics.lua b/nvim/.config/nvim/lua/dots/basics.lua new file mode 100644 index 0000000..0f2b990 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/basics.lua @@ -0,0 +1,4 @@ +-- [nfnl] Compiled from fnl/dots/basics.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("nfnl.module") +local autoload = _local_1_["autoload"] +return {autoload = autoload, a = autoload("nfnl.core"), str = autoload("nfnl.string"), utils = autoload("dots.utils"), colors = autoload("dots.colors")} diff --git a/nvim/.config/nvim/lua/dots/colors.lua b/nvim/.config/nvim/lua/dots/colors.lua new file mode 100644 index 0000000..d5128f0 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/colors.lua @@ -0,0 +1,14 @@ +-- [nfnl] Compiled from fnl/dots/colors.fnl by https://github.com/Olical/nfnl, do not edit. +local _1_ +if ("epix" == vim.fn.hostname()) then + _1_ = "#1d2021" +else + _1_ = "#282828" +end +local _3_ +if ("epix" == vim.fn.hostname()) then + _3_ = "#181A1B" +else + _3_ = "#1d2021" +end +return {bg_main = _1_, bg_second = _3_, dark0_hard = "#1d2021", dark0 = "#282828", dark0_soft = "#32302f", dark1 = "#3c3836", dark2 = "#504945", dark3 = "#665c54", dark4 = "#7c6f64", light0_hard = "#f9f5d7", light0 = "#fbf1c7", light0_soft = "#f2e5bc", light1 = "#ebdbb2", light2 = "#d5c4a1", light3 = "#bdae93", light4 = "#a89984", bright_red = "#fb4934", bright_green = "#b8bb26", bright_yellow = "#fabd2f", bright_blue = "#83a598", bright_purple = "#d3869b", bright_aqua = "#8ec07c", bright_orange = "#fe8019", neutral_red = "#cc241d", neutral_green = "#98971a", neutral_yellow = "#d79921", neutral_blue = "#458588", neutral_purple = "#b16286", neutral_aqua = "#689d6a", neutral_orange = "#d65d0e", faded_red = "#9d0006", faded_green = "#79740e", faded_yellow = "#b57614", faded_blue = "#076678", faded_purple = "#8f3f71", faded_aqua = "#427b58", faded_orange = "#af3a03", gray = "#928374"} diff --git a/nvim/.config/nvim/lua/dots/help-thingy.lua b/nvim/.config/nvim/lua/dots/help-thingy.lua new file mode 100644 index 0000000..17bdf93 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/help-thingy.lua @@ -0,0 +1,60 @@ +-- [nfnl] Compiled from fnl/dots/help-thingy.fnl by https://github.com/Olical/nfnl, do not edit. +local function help_thingy_kram() + local _local_1_ = require("nfnl.module") + local autoload = _local_1_["autoload"] + local utils = autoload("dots.utils") + local a = autoload("aniseed.core") + local str = autoload("aniseed.string") + local popup = autoload("popup") + local ts = autoload("nvim-treesitter") + local width = 20 + for _, line in ipairs(text) do + width = math.max(width, #line) + end + local function _2_() + local bufnr = vim.api.nvim_create_buf(false, true) + vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe") + vim.api.nvim_buf_set_option(bufnr, "filetype", ft) + vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, text) + return popup.create(bufnr, {padding = {1, 1, 1, 1}, width = width}) + end + defn(pop, {text, ft}, "Open a popup with the given text and filetype", nil, nil, _2_()) + local function _3_() + local col = (vim.api.nvim_win_get_cursor(0))[2] + local line = vim.api.nvim_get_current_line() + return (vim.fn.matchstr(line:sub(1, (col + 1)), "\\k*$") .. string.sub(vim.fn.matchstr(line:sub((col + 1)), "^\\k*"), 2)) + end + defn(__fnl_global__get_2dcurrent_2dword, {}, "Return the word the cursor is currently hovering over", _3_()) + def(__fnl_global__helpfiles_2dpath, str.join("/", a.butlast(str.split(vim.o.helpfile, "/")))) + local entries = {} + for line, _ in io.lines((__fnl_global__helpfiles_2dpath .. "/tags")) do + local _let_4_ = str.split(line, "\9") + local key = _let_4_[1] + local file = _let_4_[2] + local address = _let_4_[3] + entries[key] = {file = (__fnl_global__helpfiles_2dpath .. "/" .. file), address = address} + end + def(tags, nil, nil, entries) + defn(__fnl_global__find_2dhelp_2dtag_2dfor, {topic}, (tags[topic] or tags[(topic .. "()")] or tags[(string.gsub(topic, "vim%.api%.", "") .. "()")] or tags[(string.gsub(topic, "vim%.fn%.", "") .. "()")] or tags[(string.gsub(topic, "fn%.", "") .. "()")] or tags[(string.gsub(topic, "vim%.o%.", "") .. "()")] or tags[(string.gsub(topic, "vim%.b%.", "") .. "()")] or tags[(string.gsub(topic, "vim%.g%.", "") .. "()")])) + local data = nil + for line, _ in io.lines(tag.file) do + if (nil == data) then + if (-1 ~= vim.fn.match(line, (tag.address):sub(2))) then + data = {line} + else + end + else + if ((2 > #data) or ("" == line) or (" " == line:sub(1, 1)) or ("\9" == line:sub(1, 1)) or ("<" == line:sub(1, 1))) then + table.insert(data, line) + else + return data + end + end + end + defn(__fnl_global__help_2dfor_2dtag, {tag}, nil, nil) + _G.get_help = function() + return __fnl_global__if_2dlet({__fnl_global__help_2dtag, __fnl_global__find_2dhelp_2dtag_2dfor(__fnl_global__get_2dcurrent_2dword())}, pop(__fnl_global__help_2dfor_2dtag(__fnl_global__help_2dtag), "help")) + end + return utils.keymap("n", "ML", ":call v:lua.get_help()") +end +return {} diff --git a/nvim/.config/nvim/lua/dots/keybinds.lua b/nvim/.config/nvim/lua/dots/keybinds.lua new file mode 100644 index 0000000..fa8d802 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/keybinds.lua @@ -0,0 +1,90 @@ +-- [nfnl] Compiled from fnl/dots/keybinds.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local a = _local_1_["a"] +local str = _local_1_["str"] +local utils = _local_1_["utils"] +local wk = autoload("which-key") +local glance = autoload("glance") +local crates = autoload("crates") +local dap = autoload("dap") +local dapui = autoload("dapui") +vim.g.AutoPairsShortcutBackInsert = "" +utils.keymap("n", "K", "") +utils.keymap("v", "K", "") +utils.keymap("i", "\8", "") +utils.keymap("i", "", "") +utils.keymap("i", "", "") +utils.keymap("n", "zt", "zt") +utils.keymap("n", "zb", "zb") +utils.keymap("n", "c", "call nerdcommenter#Comment(\"m\", \"Toggle\")", {}) +utils.keymap("v", "c", "call nerdcommenter#Comment(\"x\", \"Toggle\")", {}) +utils.keymap("n", "", "lua vim.lsp.buf.definition()") +utils.keymap("n", "", "lua vim.lsp.buf.hover()") +utils.keymap({"n", "v"}, "c", "\"+y") +utils.keymap("n", "", "RustMoveItemDownj") +utils.keymap("n", "", "RustMoveItemUpk") +utils.keymap("n", "", "HopChar2") +local function open_selection_zotero() + local _, _0, sel = utils["get-selection"]() + return vim.cmd(("silent !xdg-open zotero://select/items/@" .. str.join(sel))) +end +local function cmd(s, desc) + return {("" .. s .. ""), desc} +end +local function sel_cmd(s, desc) + return {("'<,'>" .. s .. ""), desc} +end +local function rebind(s, desc) + return {s, desc} +end +local function format() + local function _2_(_241) + return _241.server_capabilities.documentFormattingProvider + end + if a.some(_2_, vim.lsp.get_active_clients()) then + return vim.lsp.buf.format({async = true}) + else + return vim.cmd("Neoformat") + end +end +local function open_rename() + return vim.api.nvim_feedkeys((":IncRename " .. vim.fn.expand("")), "n", "") +end +local function toggle_lsp_lines() + vim.diagnostic.config({virtual_lines = not vim.diagnostic.config().virtual_lines}) + return vim.diagnostic.config({virtual_text = not vim.diagnostic.config().virtual_lines}) +end +local function toggle_lsp_lines_current() + return vim.diagnostic.config({virtual_lines = {only_current_line = true}}) +end +wk.setup({}) +local function _4_() + vim.o.spell = not vim.o.spell + return nil +end +local function _5_() + return vim.diagnostic.open_float({scope = "cursor"}) +end +local function _6_() + return vim.diagnostic.open_float({}) +end +local function _7_() + return glance.open("definitions") +end +local function _8_() + return glance.open("references") +end +local function _9_() + return glance.open("type_definitions") +end +local function _10_() + return glance.open("implementations") +end +wk.register({c = {name = "+comment out"}, e = {name = "+emmet"}, ["["] = cmd("HopWord", "Hop to a word"), h = cmd("bprevious", "previous buffer"), l = cmd("bnext", "next buffer"), o = cmd("Telescope live_grep", "Grep files"), P = cmd("Telescope frecency frecency default_text=:CWD:", "Frecency magic"), p = cmd("Telescope find_files", "Open file-browser"), [":"] = cmd("Telescope commands", "Search command with fzf"), s = cmd("w", "Save file"), g = cmd("Neogit", "Git"), n = {(require("persistence")).load, "Load last session"}, d = {name = "+Debugging", b = {dap.toggle_breakpoint, "toggle breakpoint"}, u = {dapui.toggle, "toggle dapui"}, c = {dap.step_into, "continue"}, r = {dap.repl.open, "open repl"}, s = {name = "+Step", o = {dap.step_over, "over"}, u = {dap.step_out, "out"}, i = {dap.step_into, "into"}}}, m = {name = "+Code actions", [";"] = {_4_, "Toggle spell checking"}, d = {vim.lsp.buf.hover, "Show documentation"}, o = cmd("SymbolsOutline", "Outline"), S = cmd("Telescope lsp_document_symbols", "Symbols in document"), s = cmd("Telescope lsp_dynamic_workspace_symbols", "Symbols in workspace"), T = {vim.lsp.buf.signature_help, "Show signature help"}, n = {open_rename, "Rename"}, v = cmd("CodeActionMenu", "Apply codeaction"), A = {_5_, "Cursor diagnostics"}, a = {_6_, "Line diagnostics"}, h = cmd("RustToggleInlayHints", "Toggle inlay hints"), r = cmd("Trouble lsp_references", "Show references"), E = cmd("Trouble document_diagnostics", "List diagnostics"), e = cmd("Trouble workspace_diagnostics", "Show diagnostics"), t = cmd("Trouble lsp_type_definitions", "Go to type-definition"), i = cmd("Trouble lsp_implementations", "Show implementation"), g = cmd("Trouble lsp_definitions", "Go to definition"), w = {toggle_lsp_lines, "Toggle LSP lines"}, W = {toggle_lsp_lines_current, "Toggle LSP line"}, f = {format, "format file"}, [","] = cmd("RustRunnables", "Run rust stuff"), x = {name = "+Glance", d = {_7_, "Definitions"}, r = {_8_, "References"}, t = {_9_, "Type definitions"}, i = {_10_, "Implementations"}}, c = {name = "+Crates", j = {crates.show_popup, "crates popup"}, f = {crates.show_features_popup, "crate features"}, v = {crates.show_versions_popup, "crate versions"}, d = {crates.show_dependencies_popup, "crate dependencies"}, h = {crates.open_documentation, "crate documentation"}}}, f = {name = "+folds", o = cmd("foldopen", "open fold"), n = cmd("foldclose", "close fold"), j = rebind("zj", "jump to next fold"), k = rebind("zk", "jump to previous fold")}, v = {name = "+view-and-layout", n = cmd("set relativenumber!", "toggle relative numbers"), m = cmd("set nonumber! norelativenumber", "toggle numbers"), g = cmd("ZenMode", "toggle zen mode"), i = cmd("IndentGuidesToggle", "toggle indent guides"), w = cmd("set wrap! linebreak!", "toggle linewrapping")}, b = {name = "+buffers", b = cmd(":Telescope buffers", "select open buffer"), c = cmd(":Bdelete!", "close open buffer"), w = cmd(":Bwipeout!", "wipeout open buffer")}}, {prefix = ""}) +wk.register({[""] = "which_key_ignore", gss = "init selection", z = {name = "+folds", c = cmd("foldclose", "close fold"), o = cmd("foldopen", "open fold")}}) +wk.register({[""] = "which_key_ignore"}, {mode = "i"}) +wk.register({s = sel_cmd("VSSplit", "keep selection visible in split"), z = {open_selection_zotero, "open in zotero"}}, {prefix = "", mode = "v"}) +wk.register({name = "+Selection", j = "increment selection", k = "decrement selection", l = "increment node", h = "decrement node"}, {prefix = "gs", mode = "v"}) +vim.o.timeoutlen = 200 +return nil diff --git a/nvim/.config/nvim/lua/dots/plugins/bufferline.lua b/nvim/.config/nvim/lua/dots/plugins/bufferline.lua new file mode 100644 index 0000000..1deaacc --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/bufferline.lua @@ -0,0 +1,24 @@ +-- [nfnl] Compiled from fnl/dots/plugins/bufferline.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local a = _local_1_["a"] +local utils = _local_1_["utils"] +local colors = _local_1_["colors"] +local bufferline = autoload("bufferline") +vim.cmd("hi link BufferLineTabSeparatorSelected BufferLineSeparatorSelected") +vim.cmd("hi link BufferLineTabSeparator BufferLineSeparator") +local function mk_active(fg) + return {bg = colors.neutral_aqua, fg = fg, italic = false, bold = false} +end +local function mk_visible(fg) + return {bg = colors.dark1, fg = fg, italic = false, bold = false} +end +local function setup() + local selected = {bg = colors.neutral_aqua, fg = colors.bg_main, gui = "NONE"} + local visible = {bg = colors.dark1, fg = colors.neutral_aqua} + local function _2_(cnt, _lvl, _diagnostics_dict) + return (" (" .. cnt .. ")") + end + return bufferline.setup({options = {diagnostics = "nvim_lsp", diagnostics_indicator = _2_, tab_size = 10, enforce_regular_tabs = false, show_buffer_close_icons = false, show_tab_indicators = false, show_close_icon = false, show_buffer_icons = false}, highlights = {fill = {bg = colors.bg_main, fg = colors.light0}, background = visible, buffer_visible = visible, buffer_selected = a.assoc(selected, "bold", false, "italic", false), modified = visible, modified_visible = visible, modified_selected = selected, hint = visible, hint_visible = visible, hint_selected = selected, info = visible, info_visible = visible, info_selected = selected, warning = visible, warning_visible = visible, warning_selected = selected, error = visible, error_visible = visible, error_selected = selected, duplicate = visible, duplicate_visible = visible, duplicate_selected = selected, diagnostic = mk_visible(colors.neutral_red), diagnostic_visible = mk_visible(colors.neutral_red), diagnostic_selected = mk_active(colors.faded_red), info_diagnostic = mk_visible(colors.neutral_blue), info_diagnostic_visible = mk_visible(colors.neutral_blue), info_diagnostic_selected = mk_active(colors.faded_blue), hint_diagnostic = mk_visible(colors.neutral_yellow), hint_diagnostic_visible = mk_visible(colors.neutral_yellow), hint_diagnostic_selected = mk_active(colors.faded_orange), warning_diagnostic = mk_visible(colors.neutral_orange), warning_diagnostic_visible = mk_visible(colors.neutral_orange), warning_diagnostic_selected = mk_active(colors.faded_orange), error_diagnostic = mk_visible(colors.neutral_red), error_diagnostic_visible = mk_visible(colors.neutral_red), error_diagnostic_selected = mk_active(colors.red), separator = visible, separator_visible = {bg = colors.red}, separator_selected = {bg = colors.red}, indicator_selected = {bg = colors.neutral_aqua, fg = colors.neutral_aqua, italic = false, bold = false}, tab_separator = {bg = colors.red}, tab_separator_selected = {bg = colors.neutral_aqua, fg = colors.neutral_aqua}, pick_selected = {bg = colors.bright_red, fg = colors.bright_red}, tab_selected = {bg = colors.bright_green, fg = colors.bright_green}, tab = {bg = colors.bright_yellow, fg = colors.bright_yellow}}}) +end +return {utils.plugin("akinsho/nvim-bufferline.lua", {config = setup, tag = "v4.5.2"})} diff --git a/nvim/.config/nvim/lua/dots/plugins/cmp.lua b/nvim/.config/nvim/lua/dots/plugins/cmp.lua new file mode 100644 index 0000000..438b313 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/cmp.lua @@ -0,0 +1,51 @@ +-- [nfnl] Compiled from fnl/dots/plugins/cmp.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local cmp = autoload("cmp") +local function item_formatter(item, vim_item) + do + local padding = string.rep(" ", (10 - vim.fn.strwidth(vim_item.abbr))) + local details + do + local t_2_ = item + if (nil ~= t_2_) then + t_2_ = (t_2_).completion_item + else + end + if (nil ~= t_2_) then + t_2_ = (t_2_).detail + else + end + details = t_2_ + end + if details then + vim_item.abbr = (vim_item.abbr .. padding .. " " .. details) + else + end + end + return vim_item +end +local function setup() + local function _6_(args) + return vim.fn["vsnip#anonymous"](args.body) + end + local function _7_() + cmp.mapping.close() + return vim.cmd("stopinsert") + end + local function _8_(_241, _242) + if ((15 == _241:get_kind()) and (15 == _242:get_kind())) then + return nil + elseif (15 == _241:get_kind()) then + return false + elseif (15 == _242:get_kind()) then + return true + else + return nil + end + end + cmp.setup({snippet = {expand = _6_}, completion = {autocomplete = false}, mapping = cmp.mapping.preset.insert({[""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = _7_, [""] = cmp.mapping.confirm({select = true})}), experimental = {custom_menu = true}, sources = {{name = "nvim_lsp", priority = 5}, {name = "vsnip", priority = 3}, {name = "nvim_lua"}, {name = "calc"}, {name = "path"}, {name = "nvim_lsp_signature_help"}, {name = "conventionalcommits"}, {name = "crates"}}, formatting = {format = item_formatter}, sorting = {priority_weight = 2, comparators = {_8_, cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, cmp.config.compare.kind, cmp.config.compare.sort_text, cmp.config.compare.length, cmp.config.compare.order}}}) + return cmp.setup.cmdline("/", {sources = {{name = "buffer"}}}) +end +return {utils.plugin("hrsh7th/vim-vsnip", {lazy = true, event = {"VeryLazy"}}), utils.plugin("hrsh7th/vim-vsnip-integ", {lazy = true, event = {"VeryLazy"}}), utils.plugin("rafamadriz/friendly-snippets"), utils.plugin("hrsh7th/nvim-cmp", {lazy = true, event = {"VeryLazy"}, dependencies = {{"hrsh7th/cmp-nvim-lsp"}, {"hrsh7th/cmp-buffer"}, {"hrsh7th/cmp-vsnip"}, {"hrsh7th/cmp-nvim-lua"}, {"hrsh7th/cmp-calc"}, {"hrsh7th/cmp-path"}, {"hrsh7th/cmp-nvim-lsp-signature-help"}, {"davidsierradz/cmp-conventionalcommits"}, {"hrsh7th/cmp-omni"}}, config = setup})} diff --git a/nvim/.config/nvim/lua/dots/plugins/copilot.lua b/nvim/.config/nvim/lua/dots/plugins/copilot.lua new file mode 100644 index 0000000..cf750df --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/copilot.lua @@ -0,0 +1,3 @@ +-- [nfnl] Compiled from fnl/dots/plugins/copilot.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +return {utils.plugin("zbirenbaum/copilot.lua", {cmd = "Copilot", event = "InsertEnter", opts = {panel = {enabled = false}, suggestion = {enabled = true, auto_trigger = "true", keymap = {accept = "", next = ""}}}})} diff --git a/nvim/.config/nvim/lua/dots/plugins/diffview.lua b/nvim/.config/nvim/lua/dots/plugins/diffview.lua new file mode 100644 index 0000000..7503ab5 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/diffview.lua @@ -0,0 +1,10 @@ +-- [nfnl] Compiled from fnl/dots/plugins/diffview.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local cb = autoload("diffview.config") +local diffview = autoload("diffview") +local function _2_() + return diffview.setup({file_panel = {width = 35, use_icons = false}, key_bindings = {view = {["dn"] = cb.diffview_callback("select_next_entry"), ["dp"] = cb.diffview_callback("select_prev_entry"), ["dd"] = cb.diffview_callback("toggle_files")}}, diff_binaries = false}) +end +return {utils.plugin("sindrets/diffview.nvim", {cmd = {"DiffviewOpen", "DiffviewToggleFiles"}, config = _2_})} diff --git a/nvim/.config/nvim/lua/dots/plugins/emmet.lua b/nvim/.config/nvim/lua/dots/plugins/emmet.lua new file mode 100644 index 0000000..9748e74 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/emmet.lua @@ -0,0 +1,9 @@ +-- [nfnl] Compiled from fnl/dots/plugins/emmet.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +local function setup() + vim.g.user_emmet_mode = "n" + vim.g.user_emmet_leader_key = "e" + vim.g.user_emmet_settings = {["javascript.jsx"] = {extends = "jsx"}, ["typescript.jsx"] = {extends = "jsx"}} + return nil +end +return {utils.plugin("mattn/emmet-vim", {lazy = true, config = setup})} diff --git a/nvim/.config/nvim/lua/dots/plugins/feline.lua b/nvim/.config/nvim/lua/dots/plugins/feline.lua new file mode 100644 index 0000000..24e7997 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/feline.lua @@ -0,0 +1,133 @@ +-- [nfnl] Compiled from fnl/dots/plugins/feline.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local a = _local_1_["a"] +local str = _local_1_["str"] +local colors = _local_1_["colors"] +local feline = autoload("feline") +local function setup() + vim.opt.termguicolors = true + local modes = {n = {text = "NORMAL", color = colors.neutral_aqua}, i = {text = "INSERT", color = colors.neutral_yellow}, c = {text = "CMMAND", color = colors.neutral_aqua}, ce = {text = "NORMEX", color = colors.neutral_aqua}, cv = {text = "EX", color = colors.neutral_aqua}, ic = {text = "INSCOMP", color = colors.neutral_aqua}, no = {text = "OP-PENDING", color = colors.neutral_aqua}, r = {text = "HIT-ENTER", color = colors.neutral_aqua}, ["r?"] = {text = "CONFIRM", color = colors.neutral_aqua}, R = {text = "REPLACE", color = colors.neutral_aqua}, Rv = {text = "VIRTUAL", color = colors.neutral_aqua}, s = {text = "SELECT", color = colors.neutral_aqua}, S = {text = "SELECT", color = colors.neutral_aqua}, t = {text = "TERM", color = colors.neutral_aqua}, v = {text = "VISUAL", color = colors.neutral_blue}, V = {text = "VISUAL LINE", color = colors.neutral_blue}, ["\22"] = {text = "VISUAL BLOCK", color = colors.neutral_blue}} + local bar_bg = colors.bg_main + local horiz_separator_color = colors.light1 + local function or_empty(x) + return (x or "") + end + local function spaces(x) + if x then + return (" " .. x .. " ") + else + return "" + end + end + local function get_current_filepath() + local file = utils["shorten-path"](vim.fn.bufname(), 30, 30) + if a["empty?"](file) then + return "" + elseif vim.bo.readonly then + return ("RO " .. file) + elseif (vim.bo.modifiable and vim.bo.modified) then + return (file .. " \226\151\143") + else + return (file .. " ") + end + end + local function vim_mode_hl(use_as_fg_3f) + local color = modes[vim.fn.mode()].color + if use_as_fg_3f then + return {bg = bar_bg, fg = color} + else + return {bg = color, fg = bar_bg} + end + end + local function git_status_provider() + local function _5_(_241) + return ("master" ~= _241) + end + local function _7_() + local t_6_ = vim.b + if (nil ~= t_6_) then + t_6_ = (t_6_).gitsigns_status_dict + else + end + if (nil ~= t_6_) then + t_6_ = (t_6_).head + else + end + return t_6_ + end + return or_empty(utils["keep-if"](_5_, _7_())) + end + local function vim_mode() + return (" " .. (modes[vim.fn.mode()].text or vim.fn.mode) .. " ") + end + local function lsp_progress_provider() + local msgs = vim.lsp.util.get_progress_messages() + local s + do + local tbl_17_auto = {} + local i_18_auto = #tbl_17_auto + for _, msg in ipairs(msgs) do + local val_19_auto + if msg.message then + val_19_auto = (msg.title .. " " .. msg.message) + else + val_19_auto = nil + end + if (nil ~= val_19_auto) then + i_18_auto = (i_18_auto + 1) + do end (tbl_17_auto)[i_18_auto] = val_19_auto + else + end + end + s = tbl_17_auto + end + return or_empty(str.join(" | ", s)) + end + local function lsp_diagnostic_component(kind, color) + local function _12_() + return (0 ~= #vim.diagnostic.get(0, {severity = kind})) + end + local function _13_() + return spaces(#vim.diagnostic.get(0, {severity = kind})) + end + return {enabled = _12_, provider = _13_, left_sep = "", right_sep = "", hl = {fg = bar_bg, bg = color}} + end + local function coordinates() + local _let_14_ = vim.api.nvim_win_get_cursor(0) + local line = _let_14_[1] + local col = _let_14_[2] + return (" " .. line .. ":" .. col .. " ") + end + local function inactive_separator_provider() + if (vim.fn.winnr() ~= vim.fn.winnr("j")) then + return string.rep("\226\148\128", vim.api.nvim_win_get_width(0)) + else + return "" + end + end + local components = {active = {}, inactive = {}} + local function _16_() + return vim_mode_hl(false) + end + local function _17_() + return vim_mode_hl(true) + end + components.active[1] = {{provider = vim_mode, hl = _16_}, {provider = get_current_filepath, left_sep = " ", hl = {fg = colors.light4}}, {provider = git_status_provider, left_sep = " ", hl = _17_}} + local function _18_() + return (0 < #vim.lsp.buf_get_clients()) + end + components.active[2] = {{provider = lsp_progress_provider, left_sep = " ", right_sep = " ", enabled = _18_}} + local function _19_() + return vim_mode_hl(true) + end + local function _20_() + return vim_mode_hl(false) + end + components.active[3] = {{provider = vim.bo.filetype, right_sep = " ", hl = _19_}, lsp_diagnostic_component(vim.diagnostic.severity.INFO, colors.neutral_green), lsp_diagnostic_component(vim.diagnostic.severity.HINT, colors.neutral_aqua), lsp_diagnostic_component(vim.diagnostic.severity.WARN, colors.neutral_yellow), lsp_diagnostic_component(vim.diagnostic.severity.ERROR, colors.neutral_red), {provider = coordinates, hl = _20_}} + components.inactive[1] = {{provider = inactive_separator_provider, hl = {bg = "NONE", fg = horiz_separator_color}}} + utils["highlight-add"]("StatusLineNC", {bg = "NONE", fg = colors.light1}) + return feline.setup({theme = {fg = colors.light1, bg = colors.bg_main}, components = components}) +end +return {utils.plugin("Famiu/feline.nvim", {config = setup})} diff --git a/nvim/.config/nvim/lua/dots/plugins/flutter-tools.lua b/nvim/.config/nvim/lua/dots/plugins/flutter-tools.lua new file mode 100644 index 0000000..43b1aa7 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/flutter-tools.lua @@ -0,0 +1,5 @@ +-- [nfnl] Compiled from fnl/dots/plugins/flutter-tools.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +return {utils.plugin("akinsho/flutter-tools.nvim", {config = true, dependencies = {"nvim-lua/plenary.nvim", "stevearc/dressing.nvim"}, lazy = false})} diff --git a/nvim/.config/nvim/lua/dots/plugins/gitsigns.lua b/nvim/.config/nvim/lua/dots/plugins/gitsigns.lua new file mode 100644 index 0000000..5c6aed6 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/gitsigns.lua @@ -0,0 +1,11 @@ +-- [nfnl] Compiled from fnl/dots/plugins/gitsigns.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("nfnl.module") +local autoload = _local_1_["autoload"] +local utils = autoload("dots.utils") +local gitsigns = autoload("gitsigns") +local function setup() + gitsigns.setup({signs = {add = {text = "\226\150\141"}, change = {text = "\226\150\141"}, delete = {text = "\226\150\141"}, topdelete = {text = "\226\150\141"}, changedelete = {text = "\226\150\141"}}, update_debounce = 100, current_line_blame = false}) + local scrollbar_gitsigns = require("scrollbar.handlers.gitsigns") + return scrollbar_gitsigns.setup() +end +return {utils.plugin("lewis6991/gitsigns.nvim", {dependencies = {"vim-gruvbox8", "petertriho/nvim-scrollbar"}, config = setup})} diff --git a/nvim/.config/nvim/lua/dots/plugins/gruvbox8.lua b/nvim/.config/nvim/lua/dots/plugins/gruvbox8.lua new file mode 100644 index 0000000..83ecc53 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/gruvbox8.lua @@ -0,0 +1,111 @@ +-- [nfnl] Compiled from fnl/dots/plugins/gruvbox8.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("nfnl.module") +local autoload = _local_1_["autoload"] +local utils = autoload("dots.utils") +local colors = autoload("dots.colors") +local function setup() + vim.g.gruvbox_italics = 0 + vim.g.gruvbox_italicise_strings = 0 + vim.g.gruvbox_filetype_hi_groups = 1 + vim.g.gruvbox_plugin_hi_groups = 1 + local function setup_colors() + utils["highlight-add"]({"GruvboxBlueSign", "GruvboxAquaSign", "GruvboxRedSign", "GruvboxYellowSign", "GruvboxGreenSign", "GruvboxOrangeSign", "GruvboxPurpleSign"}, {bg = "NONE"}) + utils.highlight("EndOfBuffer", {bg = "NONE", fg = colors.bg_main}) + utils.highlight("LineNr", {bg = "NONE"}) + utils["highlight-add"]("Pmenu", {bg = colors.bg_second}) + utils["highlight-add"]("PmenuSel", {bg = colors.bright_aqua}) + utils["highlight-add"]("PmenuSbar", {bg = colors.bg_second}) + utils["highlight-add"]("PmenuThumb", {bg = colors.dark1}) + utils["highlight-add"]("NormalFloat", {bg = colors.bg_second}) + utils["highlight-add"]("SignColumn", {bg = colors.bg_main}) + utils["highlight-add"]("FloatBorder", {bg = colors.bg_second}) + utils["highlight-add"]("SpecialComment", {fg = colors.dark4}) + utils["highlight-add"]({"LspDiagnosticsSignError", "LspDiagnosticsSignWarning", "LspDiagnosticsSignInformation", "LspDiagnosticsSignHint"}, {bg = "NONE"}) + utils["highlight-add"]("DiagnosticError", {fg = colors.bright_red}) + utils["highlight-add"]("DiagnosticWarning", {fg = colors.bright_orange}) + utils["highlight-add"]("DiagnosticInformation", {fg = colors.bright_aqua}) + utils["highlight-add"]("DiagnosticHint", {fg = colors.bright_yellow}) + utils["highlight-add"]("DiagnosticVirtualTextError", {bg = "#342828", fg = colors.bright_red}) + utils["highlight-add"]("DiagnosticVirtualTextWarning", {bg = "#473027", fg = colors.bright_orange}) + utils["highlight-add"]("DiagnosticVirtualTextWarning", {bg = "#3b2c28", fg = colors.bright_orange}) + utils["highlight-add"]("DiagnosticVirtualTextInformation", {bg = "#272d2f", fg = colors.bright_aqua}) + utils["highlight-add"]("DiagnosticVirtualTextHint", {bg = "#272d2f", fg = colors.bright_yellow}) + utils.highlight("LspDiagnosticsUnderlineError", {gui = "undercurl"}) + utils.highlight("StatusLine", {bg = colors.dark1, fg = colors.light0}) + vim.cmd("highlight link Function GruvboxGreen") + return utils["highlight-add"]("Function", {gui = "NONE"}) + end + local function setup_telescope_theme() + local prompt = "blacker" + if (prompt == "bright") then + local promptbg = "#689d6a" + utils["highlight-add"]("TelescopePromptBorder", {bg = promptbg, fg = promptbg}) + utils["highlight-add"]("TelescopePromptNormal", {bg = promptbg, fg = colors.bg_main}) + utils["highlight-add"]("TelescopePromptTitle", {bg = promptbg, fg = colors.dark1}) + elseif (prompt == "dark") then + local promptbg = "#252525" + utils["highlight-add"]("TelescopePromptBorder", {bg = promptbg, fg = promptbg}) + utils["highlight-add"]("TelescopePromptNormal", {bg = promptbg, fg = colors.light2}) + utils["highlight-add"]("TelescopePromptPrefix", {bg = promptbg, fg = colors.neutral_aqua}) + utils["highlight-add"]("TelescopePromptTitle", {bg = colors.neutral_blue, fg = colors.dark1}) + elseif (prompt == "black") then + local promptbg = "#212526" + utils["highlight-add"]("TelescopePromptBorder", {bg = promptbg, fg = promptbg}) + utils["highlight-add"]("TelescopePromptNormal", {bg = promptbg, fg = colors.light2}) + utils["highlight-add"]("TelescopePromptPrefix", {bg = promptbg, fg = colors.neutral_aqua}) + utils["highlight-add"]("TelescopePromptTitle", {bg = colors.neutral_green, fg = colors.dark1}) + elseif (prompt == "blacker") then + local promptbg = "#1f2324" + utils["highlight-add"]("TelescopePromptBorder", {bg = promptbg, fg = promptbg}) + utils["highlight-add"]("TelescopePromptNormal", {bg = promptbg, fg = colors.light2}) + utils["highlight-add"]("TelescopePromptPrefix", {bg = promptbg, fg = colors.neutral_aqua}) + utils["highlight-add"]("TelescopePromptTitle", {bg = colors.neutral_blue, fg = colors.dark1}) + else + end + local side = "darker" + if (side == "brighter") then + local previewbg = "#1f2324" + utils["highlight-add"]("TelescopePreviewNormal", {bg = previewbg}) + utils["highlight-add"]("TelescopePreviewBorder", {bg = previewbg, fg = previewbg}) + elseif (side == "darker") then + local previewbg = "#1a1e1f" + utils["highlight-add"]("TelescopePreviewNormal", {bg = previewbg}) + utils["highlight-add"]("TelescopePreviewBorder", {bg = previewbg, fg = previewbg}) + else + end + utils["highlight-add"]("TelescopeBorder", {bg = colors.bg_second, fg = colors.bg_second}) + utils["highlight-add"]("TelescopeNormal", {bg = colors.bg_second}) + utils["highlight-add"]("TelescopePreviewTitle", {bg = colors.neutral_green, fg = colors.dark1}) + utils["highlight-add"]("TelescopeResultsTitle", {bg = colors.neutral_aqua, fg = colors.dark1}) + return utils["highlight-add"]("TelescopeSelection", {bg = colors.neutral_aqua, fg = colors.dark1}) + end + local function setup_noice_theme() + utils["highlight-add"]("NoicePopupmenu", {bg = colors.bg_second}) + utils["highlight-add"]("NoiceCmdline", {bg = "#1f2324"}) + utils["highlight-add"]("NoiceCmdlinePopup", {bg = "#1f2324"}) + utils["highlight-add"]("NoiceCmdlinePrompt", {bg = "#1f2324"}) + utils["highlight-add"]("NoiceCmdlinePopupBorder", {fg = colors.bright_aqua}) + return utils["highlight-add"]("NoiceCmdlineIcon", {fg = colors.bright_aqua}) + end + vim.api.nvim_create_autocmd("ColorScheme", {pattern = "*", callback = setup_colors}) + setup_colors() + vim.api.nvim_create_autocmd("ColorScheme", {pattern = "*", callback = setup_telescope_theme}) + setup_telescope_theme() + vim.api.nvim_create_autocmd("ColorScheme", {pattern = "*", callback = setup_noice_theme}) + setup_noice_theme() + local function _4_() + utils["highlight-add"]("GitSignsAdd", {gui = "NONE", bg = "NONE", fg = colors.bright_aqua}) + utils["highlight-add"]("GitSignsDelete", {gui = "NONE", bg = "NONE", fg = colors.neutral_red}) + utils["highlight-add"]("GitSignsChange", {gui = "NONE", bg = "NONE", fg = colors.bright_blue}) + utils["highlight-add"]("ScrollbarGitAdd", {gui = "NONE", bg = "NONE", fg = colors.bright_aqua}) + utils["highlight-add"]("ScrollbarGitDelete", {gui = "NONE", bg = "NONE", fg = colors.neutral_red}) + return utils["highlight-add"]("ScrollbarGitChange", {gui = "NONE", bg = "NONE", fg = colors.bright_blue}) + end + vim.api.nvim_create_autocmd("ColorScheme", {pattern = "*", callback = _4_}) + if ("epix" == vim.fn.hostname()) then + return vim.cmd("colorscheme gruvbox8_hard") + else + return vim.cmd("colorscheme gruvbox8") + end +end +return {utils.plugin("lifepillar/vim-gruvbox8", {priority = 1000, config = setup, lazy = false})} diff --git a/nvim/.config/nvim/lua/dots/plugins/lsp.lua b/nvim/.config/nvim/lua/dots/plugins/lsp.lua new file mode 100644 index 0000000..6497108 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/lsp.lua @@ -0,0 +1,163 @@ +-- [nfnl] Compiled from fnl/dots/plugins/lsp.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local a = _local_1_["a"] +local utils = _local_1_["utils"] +local lsp = autoload("lspconfig") +local lsp_configs = autoload("lspconfig/configs") +local cmp_nvim_lsp = autoload("cmp_nvim_lsp") +local function setup() + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {virtual_text = {prefix = "\226\151\134"}, severity_sort = true, signs = false, update_in_insert = false}) + local function on_attach(client, bufnr) + if client.server_capabilities.documentHighlight then + utils.highlight("LspReferenceRead", {gui = "underline"}) + utils.highlight("LspReferenceText", {gui = "underline"}) + utils.highlight("LspReferenceWrite", {gui = "underline"}) + return vim.api.nvim_exec("augroup lsp_document_highlight\n autocmd! * \n autocmd CursorHold lua vim.lsp.buf.document_highlight() \n autocmd CursorMoved lua vim.lsp.buf.clear_references()\n augroup END", false) + else + return nil + end + end + local function better_root_pattern(patterns, except_patterns) + local function _3_(path) + if not lsp.util.root_pattern(except_patterns)(path) then + return lsp.util.root_pattern(patterns)(path) + else + return nil + end + end + return _3_ + end + local default_capabilities + do + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + default_capabilities = cmp_nvim_lsp.default_capabilities(capabilities) + end + local function init_lsp(lsp_name, _3fopts) + local merged_opts = a.merge({on_attach = on_attach, capabilities = default_capabilities}, (_3fopts or {})) + return lsp[lsp_name].setup(merged_opts) + end + local function _5_() + return vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0}) + end + init_lsp("jsonls", {commands = {Format = {_5_}}}) + init_lsp("denols", {root_dir = better_root_pattern({".git"}, {"package.json"})}) + init_lsp("hls", {settings = {languageServerHaskell = {formattingProvider = "stylish-haskell"}}}) + init_lsp("ocamllsp") + init_lsp("vimls") + init_lsp("gopls") + init_lsp("bashls") + init_lsp("erlangls") + init_lsp("yamlls") + init_lsp("html") + init_lsp("svelte") + init_lsp("elmls") + init_lsp("texlab") + init_lsp("pyright") + init_lsp("vls") + init_lsp("perlls") + init_lsp("powershell_es", {bundle_path = "/home/leon/powershell"}) + init_lsp("clangd") + init_lsp("cssls", {filestypes = {"css", "scss", "less", "stylus"}, root_dir = lsp.util.root_pattern({"package.json", ".git"}), settings = {css = {validate = true}, less = {validate = true}, scss = {validate = true}}}) + local function _6_(client, bufnr) + client.resolved_capabilities.document_formatting = false + return on_attach(client, bufnr) + end + lsp.tsserver.setup({root_dir = lsp.util.root_pattern("package.json"), on_attach = _6_}) + do + local rustaceanvim = require("rustaceanvim") + local rustaceanvim_config = require("rustaceanvim.config") + local extension_path = "/home/leon/.vscode/extensions/vadimcn.vscode-lldb-1.6.8/" + local codelldb_path = (extension_path .. "adapter/codelldb") + local liblldb_path = (extension_path .. "lldb/lib/liblldb.so") + local features = nil + vim.g.rustaceanvim = {tools = {inlay_hints = {show_parameter_hints = false}, autoSetHints = false}, dap = {adapter = rustaceanvim_config.get_codelldb_adapter(codelldb_path, liblldb_path)}, server = {on_attach = on_attach, capabilities = default_capabilities, settings = {["rust-analyzer"] = {cargo = {loadOutDirsFromCheck = true, features = (features or "all"), noDefaultFeatures = (nil ~= features)}, procMacro = {enable = true}, diagnostics = {experimental = {enable = false}, enable = false}, checkOnSave = {overrideCommand = {"cargo", "clippy", "--workspace", "--message-format=json", "--all-targets", "--all-features"}}}}}} + end + if (true or not lsp.fennel_language_server) then + lsp_configs["fennel_language_server"] = {default_config = {cmd = "/Users/leon/.cargo/bin/fennel-language-server", filetypes = {"fennel"}, single_file_support = true, root_dir = lsp.util.root_pattern({"fnl", "init.lua"}), settings = {fennel = {workspace = {library = vim.api.nvim_list_runtime_paths()}, diagnostics = {globals = {"vim"}}}}}} + else + end + init_lsp("fennel_language_server", {root_dir = lsp.util.root_pattern({"fnl", "init.lua"}), settings = {fennel = {workspace = {library = vim.api.nvim_list_runtime_paths()}, diagnostics = {globals = {"vim", "comment"}}}}}) + --[[ (when (not lsp.prolog_lsp) (tset lsp-configs "prolog_lsp" {:default_config {:cmd ["swipl" "-g" "use_module(library(lsp_server))." "-g" "lsp_server:main" "-t" "halt" "--" "stdio"] :filetypes ["prolog"] :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) :settings {}}})) (lsp.prolog_lsp.setup {}) ]] + --[[ (let [ewwls-path "/home/leon/coding/projects/ls-eww/crates/ewwls/target/debug/ewwls"] (when (vim.fn.filereadable ewwls-path) (when (not lsp.ewwls) (set lsp-configs.ewwls {:default_config {:cmd [ewwls-path] :filetypes ["yuck"] :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) :settings {}}})) (init-lsp "ewwls"))) ]] + local autostart_semantic_highlighting = true + local function refresh_semantic_highlighting() + if autostart_semantic_highlighting then + vim.lsp.buf_request(0, "textDocument/semanticTokens/full", {textDocument = vim.lsp.util.make_text_document_params()}, nil) + return vim.NIL + else + return nil + end + end + if not lsp.idris2_lsp then + local function _9_(new_config, new_root_dir) + new_config.cmd = {"idris2-lsp"} + new_config.capabilities.workspace.semanticTokens = {refreshSupport = true} + return nil + end + local function _10_(fname) + local scandir = require("plenary.scandir") + local function find_ipkg_ancestor(fname0) + local function _11_(path) + local res = scandir.scan_dir(path, {depth = 1, search_pattern = ".+%.ipkg"}) + if not vim.tbl_isempty(res) then + return path + else + return nil + end + end + return lsp.util.search_ancestors(fname0, _11_) + end + return ((find_ipkg_ancestor(fname) or lsp.util.find_git_ancestor(fname)) or vim.loop.os_homedir()) + end + lsp_configs.idris2_lsp = {default_config = {cmd = {"idris2-lsp"}, filetypes = {"idris2"}, on_new_config = _9_, root_dir = _10_, settings = {}}} + else + end + local function _14_(err, method, result, client_id, bufnr, config) + local client = vim.lsp.get_client_by_id(client_id) + local legend = client.server_capabilities.semanticTokensProvider.legend + local token_types = legend.tokenTypes + local data = result.data + local ns = vim.api.nvim_create_namespace("nvim-lsp-semantic") + vim.api.nvim_buf_clear_namespace(bufnr, ns, 0, ( - 1)) + local tokens = {} + local prev_line, prev_start = nil, 0 + for i = 1, #data, 5 do + local delta_line = data[i] + prev_line = ((prev_line and (prev_line + delta_line)) or delta_line) + local delta_start = data[(i + 1)] + prev_start = (((delta_line == 0) and (prev_start + delta_start)) or delta_start) + local token_type = token_types[(data[(i + 3)] + 1)] + vim.api.nvim_buf_add_highlight(bufnr, ns, ("LspSemantic_" .. token_type), prev_line, prev_start, (prev_start + data[(i + 2)])) + end + return nil + end + lsp.idris2_lsp.setup({on_attach = refresh_semantic_highlighting, autostart = true, handlers = {["workspace/semanticTokens/refresh"] = refresh_semantic_highlighting, ["textDocument/semanticTokens/full"] = _14_}}) + vim.cmd("highlight link LspSemantic_type Include") + vim.cmd("highlight link LspSemantic_function Identifier") + vim.cmd("highlight link LspSemantic_struct Number") + vim.cmd("highlight LspSemantic_variable guifg=gray") + vim.cmd("highlight link LspSemantic_keyword Structure") + vim.opt.signcolumn = "yes" + local function cleanup_markdown(contents) + if (contents.kind == "markdown") then + contents["value"] = string.gsub(contents.value, "%[([^%]]+)%]%(([^%)]+)%)", "[%1]") + else + end + return contents + end + local previous_handler = vim.lsp.handlers["textDocument/hover"] + local function _16_(a0, result, b, c) + if not (result and result.contents) then + return previous_handler(a0, result, b, c) + else + local new_contents = cleanup_markdown(result.contents) + do end (result)["contents"] = new_contents + return previous_handler(a0, result, b, c) + end + end + vim.lsp.handlers["textDocument/hover"] = _16_ + return nil +end +return {utils.plugin("neovim/nvim-lspconfig", {event = "VeryLazy", lazy = true, config = setup})} diff --git a/nvim/.config/nvim/lua/dots/plugins/ltex-ls.lua b/nvim/.config/nvim/lua/dots/plugins/ltex-ls.lua new file mode 100644 index 0000000..647e733 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/ltex-ls.lua @@ -0,0 +1,182 @@ +-- [nfnl] Compiled from fnl/dots/plugins/ltex-ls.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local lsp = autoload("lspconfig") +local configs = autoload("lspconfig/configs") +local lsputil = autoload("lspconfig/util") +local function cmds(xs) + local tbl_17_auto = {} + local i_18_auto = #tbl_17_auto + for _, x in ipairs(xs) do + local val_19_auto = ("\\" .. x .. "{}") + if (nil ~= val_19_auto) then + i_18_auto = (i_18_auto + 1) + do end (tbl_17_auto)[i_18_auto] = val_19_auto + else + end + end + return tbl_17_auto +end +local latex_command_settings = {dummy = cmds({"texttt", "scripture", "lstref", "figref", "tblref", "secref", "personaltextcite", "personalparencite", "textcite", "parencite", "parencite[]", "game", "acsu", "enquote", "name", "item", "reqref", "gamebtn", "fs", "cs", "appref", "sorty"}), ignore = cmds({"urlfootnote", "caption", "todo"})} +local Dictionary_file = {["de-DE"] = {(vim.fn.getenv("HOME") .. "/.config/ltex-ls/dictionary.txt")}} +local Disabled_rules_file = {["de-DE"] = {(vim.fn.getenv("HOME") .. "/.config/ltex-ls/disable.txt")}} +local False_positives_file = {["de-DE"] = {(vim.fn.getenv("HOME") .. "/.config/ltex-ls/false.txt")}} +local latex_command_settings_formatted +do + local tbl = {} + for option, commands in pairs(latex_command_settings) do + for _, command in ipairs(commands) do + tbl[command] = option + end + end + latex_command_settings_formatted = tbl +end +local function read_files(files) + local dict = {} + for _, file in ipairs(files) do + local f = io.open(file, "r") + if (nil ~= f) then + for l in f:lines() do + table.insert(dict, l) + end + else + end + end + return dict +end +local function find_ltex_lang() + local buf_clients = vim.lsp.buf_get_clients() + for _, client in ipairs(buf_clients) do + if (client.name == "ltex") then + local ___antifnl_rtn_1___ = client.config.settings.ltex.language + return ___antifnl_rtn_1___ + else + end + end + return nil +end +local function find_ltex_files(filetype, value) + if (filetype == "dictionary") then + return Dictionary_file[(value or find_ltex_lang())] + elseif (filetype == "disable") then + return Disabled_rules_file[(value or find_ltex_lang())] + elseif (filetype == "falsePositive") then + return False_positives_file[(value or find_ltex_lang())] + else + return nil + end +end +local function update_config(lang, configtype) + local buf_clients = vim.lsp.buf_get_clients() + local client = nil + for _, lsp0 in ipairs(buf_clients) do + if (lsp0.name == "ltex") then + client = lsp0 + else + end + end + if client then + if (configtype == "dictionary") then + if client.config.settings.ltex.dictionary then + client.config.settings.ltex.dictionary = {[lang] = read_files(Dictionary_file[lang])} + return client.notify("workspace/didChangeConfiguration", client.config.settings) + else + return vim.notify("Error when reading dictionary config, check it") + end + elseif (configtype == "disable") then + if client.config.settings.ltex.disabledRules then + client.config.settings.ltex.disabledRules = {[lang] = read_files(Disabled_rules_file[lang])} + return client.notify("workspace/didChangeConfiguration", client.config.settings) + else + return vim.notify("Error when reading disabledRules config, check it") + end + elseif (configtype == "falsePositive") then + if client.config.settings.ltex.hiddenFalsePositives then + client.config.settings.ltex.hiddenFalsePositives = {[lang] = read_files(False_positives_file[lang])} + return client.notify("workspace/didChangeConfiguration", client.config.settings) + else + return vim.notify("Error when reading hiddenFalsePositives config, check it") + end + else + return nil + end + else + return nil + end +end +local function add_to_file(filetype, lang, file, value) + file = io.open(file[(#file - 0)], "a+") + if file then + file:write((value .. "\n")) + file:close() + else + local ___antifnl_rtns_1___ = {print("Failed insert %q", value)} + return (table.unpack or _G.unpack)(___antifnl_rtns_1___) + end + if (filetype == "dictionary") then + return update_config(lang, "dictionary") + elseif (filetype == "disable") then + return update_config(lang, "disable") + elseif (filetype == "falsePositive") then + return update_config(lang, "falsePositive") + else + return nil + end +end +local function add_to(filetype, lang, file, value) + local dict = read_files(file) + for _, v in ipairs(dict) do + if (v == value) then + return nil + else + end + end + return add_to_file(filetype, lang, file, value) +end +local function init() + local function _15_(filename) + return lsputil.path.dirname(filename) + end + configs.ltex = {default_config = {cmd = {"ltex-ls"}, filetypes = {"tex", "latex", "bib"}, root_dir = _15_}} + lsp.ltex.setup({settings = {ltex = {enabled = {"latex", "tex", "bib"}, language = "de-DE", checkFrequency = "save", diagnosticSeverity = "information", setenceCacheSize = 5000, additionalRules = {enablePickyRules = true, motherTongue = "de-DE"}, dictionary = utils["map-values"](read_files, Dictionary_file), disabledRules = utils["map-values"](read_files, Disabled_rules_file), hiddenFalsePositives = utils["map-values"](read_files, False_positives_file), latex = {commands = latex_command_settings_formatted}}}}) + lsp.ltex.dictionary_file = Dictionary_file + lsp.ltex.disabledrules_file = Disabled_rules_file + lsp.ltex.falsepostivies_file = False_positives_file + local orig_execute_command = vim.lsp.buf.execute_command + local function _16_(command) + if (command.command == "_ltex.addToDictionary") then + local arg = (command.arguments[1]).words + for lang, words in pairs(arg) do + for _, word in ipairs(words) do + local filetype = "dictionary" + add_to(filetype, lang, find_ltex_files(filetype, lang), word) + end + end + return nil + elseif (command.command == "_ltex.disableRules") then + local arg = (command.arguments[1]).ruleIds + for lang, rules in pairs(arg) do + for _, rule in ipairs(rules) do + local filetype = "disable" + add_to(filetype, lang, find_ltex_files(filetype, lang), rule) + end + end + return nil + elseif (command.command == "_ltex.hideFalsePositives") then + local arg = (command.arguments[1]).falsePositives + for lang, rules in pairs(arg) do + for _, rule in ipairs(rules) do + local filetype = "falsePositive" + add_to(filetype, lang, find_ltex_files(filetype, lang), rule) + end + end + return nil + else + return orig_execute_command(command) + end + end + vim.lsp.buf.execute_command = _16_ + return nil +end +return {} diff --git a/nvim/.config/nvim/lua/dots/plugins/noice.lua b/nvim/.config/nvim/lua/dots/plugins/noice.lua new file mode 100644 index 0000000..f3912b8 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/noice.lua @@ -0,0 +1,4 @@ +-- [nfnl] Compiled from fnl/dots/plugins/noice.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +do local _ = {utils.plugin("folke/noice.nvim", {dependencies = {"MunifTanjim/nui.nvim"}, opts = {presets = {inc_rename = true, long_message_to_split = true, bottom_search = true}, lsp = {override = {["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, ["cmp.entry.get_documentation"] = true}}, views = {cmdline_popup = {border = {style = "none", padding = {1, 1}}, position = {row = 5, col = "50%"}, size = {width = 60, height = "auto"}}, popupmenu = {relative = "editor", border = {style = "none", padding = {1, 1}}, position = {row = 8, col = "50%"}, size = {width = 60, height = 10}}, mini = {max_height = 5}}, cmdline = {view = "cmdline", format = {cmdline = {icon = ":"}, help = false, lua = false}}, messages = {view = "mini", view_error = "cmdline_output", view_warn = "mini", view_search = "virtualtext"}, markdown = {hover = {["|(%S-)|"] = vim.cmd.help}}, routes = {{view = "notify", filter = {event = "msg_showmode"}}, {view = "mini", filter = {error = true, max_height = 5}}, {view = "cmdline_output", filter = {error = true, min_height = 6}}}}})} end +return {} diff --git a/nvim/.config/nvim/lua/dots/plugins/nvim-colorizer.lua b/nvim/.config/nvim/lua/dots/plugins/nvim-colorizer.lua new file mode 100644 index 0000000..5f3c356 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/nvim-colorizer.lua @@ -0,0 +1,9 @@ +-- [nfnl] Compiled from fnl/dots/plugins/nvim-colorizer.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local colorizer = autoload("colorizer") +local function _2_() + return colorizer.setup({"*"}, {RGB = true, RRGGBB = true, names = true, RRGGBBAA = true, rgb_fn = true, hsl_fn = true, mode = "background"}) +end +return {utils.plugin("norcalli/nvim-colorizer.lua", {event = "VeryLazy", lazy = true, config = _2_})} diff --git a/nvim/.config/nvim/lua/dots/plugins/obsidian.lua b/nvim/.config/nvim/lua/dots/plugins/obsidian.lua new file mode 100644 index 0000000..c128531 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/obsidian.lua @@ -0,0 +1,6 @@ +-- [nfnl] Compiled from fnl/dots/plugins/obsidian.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local vault_path = (vim.fn.expand("~") .. "/Documents/obsidian-vault") +return {utils.plugin("epwalsh/obsidian.nvim", {lazy = true, version = "*", ft = "markdown", event = {("BufReadPre " .. vault_path .. "/**.md"), ("BufNewFile " .. vault_path .. "/**.md")}, dependencies = {"nvim-lua/plenary.nvim"}, opts = {workspaces = {{name = "Vault", path = vault_path}}, completion = {nvim_cmp = true}}})} diff --git a/nvim/.config/nvim/lua/dots/plugins/plugins.lua b/nvim/.config/nvim/lua/dots/plugins/plugins.lua new file mode 100644 index 0000000..802415e --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/plugins.lua @@ -0,0 +1,26 @@ +-- [nfnl] Compiled from fnl/dots/plugins/plugins.fnl by https://github.com/Olical/nfnl, do not edit. +local function _1_() + do end (require("lsp_lines")).setup() + return vim.diagnostic.config({virtual_lines = false}) +end +local function _2_() + do end (require("litee.lib")).setup() + return (require("litee.gh")).setup() +end +local function _3_() + vim.g.code_action_menu_show_details = false + return nil +end +local function _4_() + vim.g.antifennel_executable = "/home/leon/tmp/antifennel/antifennel" + return nil +end +local function _5_() + vim.g.vlime_overlay = "slimv" + return nil +end +local function _6_() + vim.g.rustfmt_fail_silently = 1 + return nil +end +return {"Olical/aniseed", "Olical/nfnl", "nvim-lua/plenary.nvim", "norcalli/nvim.lua", "kyazdani42/nvim-web-devicons", "folke/which-key.nvim", {"ckipp01/nvim-jenkinsfile-linter", dependencies = {"nvim-lua/plenary.nvim"}}, "psliwka/vim-smoothie", {"nathanaelkane/vim-indent-guides", cmd = {"IndentGuidesToggle"}}, {"luukvbaal/stabilize.nvim", config = true}, {"stevearc/dressing.nvim", config = true}, {"tweekmonster/startuptime.vim", cmd = {"StartupTime"}}, {"moll/vim-bbye", lazy = true, cmd = {"Bdelete", "Bwipeout"}}, {"petertriho/nvim-scrollbar", event = "VeryLazy", lazy = true, config = true}, {"TimUntersberger/neogit", opts = {integrations = {diffview = true}}, cmd = {"Neogit"}}, {"folke/persistence.nvim", opts = {dir = vim.fn.expand((vim.fn.stdpath("cache") .. "/sessions/"))}}, {"https://git.sr.ht/~whynothugo/lsp_lines.nvim", config = _1_}, "jiangmiao/auto-pairs", "tpope/vim-repeat", {"preservim/nerdcommenter", event = "VeryLazy", lazy = true, priority = 1000}, {"godlygeek/tabular", cmd = {"Tabularize"}}, "tpope/vim-surround", "hauleth/sad.vim", "wellle/targets.vim", {"mg979/vim-visual-multi", lazy = true, event = "VeryLazy"}, "tommcdo/vim-exchange", {"phaazon/hop.nvim", lazy = true, event = "VeryLazy", opts = {keys = "jfkdls;amvieurow"}}, {"rcarriga/nvim-dap-ui", lazy = true, config = true, dependencies = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"}}, {"mfussenegger/nvim-dap", lazy = true}, {"nvim-telescope/telescope-dap.nvim", lazy = true, dependencies = {"nvim-telescope/telescope.nvim", "mfussenegger/nvim-dap"}}, {"ldelossa/gh.nvim", lazy = true, config = _2_, dependencies = {"ldelossa/litee.nvim"}}, {"pwntester/octo.nvim", lazy = true, dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "kyazdani42/nvim-web-devicons"}, config = true}, "ruanyl/vim-gh-line", "rhysd/conflict-marker.vim", {"tpope/vim-fugitive", lazy = true, event = "VeryLazy"}, {"ray-x/lsp_signature.nvim", event = "BufEnter"}, {"weilbith/nvim-code-action-menu", cmd = "CodeActionMenu", config = _3_}, {"dnlhc/glance.nvim", lazy = true, config = true}, {"smjonas/inc-rename.nvim", opts = {input_buffer_type = "dressing"}}, {"monkoose/nvlime", ft = {"lisp"}, dependencies = {"monkoose/parsley"}}, "tpope/vim-sleuth", "editorconfig/editorconfig-vim", "sbdchd/neoformat", {"elkowar/antifennel-nvim", config = _4_}, {"Olical/conjure", ft = {"fennel"}}, {"eraserhd/parinfer-rust", build = "cargo build --release"}, "kmonad/kmonad-vim", {"elkowar/yuck.vim", ft = {"yuck"}}, {"cespare/vim-toml", ft = {"toml"}}, {"bduggan/vim-raku", ft = {"raku"}}, {"LnL7/vim-nix", ft = {"nix"}}, {"kevinoid/vim-jsonc"}, {"pangloss/vim-javascript", ft = {"javascript"}}, {"ianks/vim-tsx", ft = {"typescript-react"}}, {"leafgarland/typescript-vim", ft = {"typescript", "typescript-react", "javascript"}}, {"HerringtonDarkholme/yats.vim"}, {"mxw/vim-jsx"}, {"purescript-contrib/purescript-vim", ft = {"purescript"}}, {"derekelkins/agda-vim", ft = {"agda"}}, {"neovimhaskell/haskell-vim", ft = {"haskell"}}, {"monkoose/nvlime", ft = {"lisp"}, dependencies = {"monkoose/parsley"}, config = _5_}, {"rust-lang/rust.vim", ft = {"rust"}, dependencies = {"mattn/webapi-vim"}, config = _6_}, {"Saecki/crates.nvim", dependencies = {"nvim-lua/plenary.nvim"}, dir = "/Users/leon/tmp/crates.nvim", event = {"BufRead Cargo.toml"}, lazy = true, opts = {disable_invalid_feature_diagnostic = true, enable_update_available_warning = false}}, {"mrcjkb/rustaceanvim", version = 4, ft = {"rust", "toml"}}, {"qnighy/lalrpop.vim"}, {"edwinb/idris2-vim", ft = {"idris2"}}, {"vmchale/ats-vim", ft = {"ats", "dats", "sats"}}, {"bakpakin/fennel.vim", ft = {"fennel"}}, {"evanleck/vim-svelte"}} diff --git a/nvim/.config/nvim/lua/dots/plugins/telescope.lua b/nvim/.config/nvim/lua/dots/plugins/telescope.lua new file mode 100644 index 0000000..1c6adc1 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/telescope.lua @@ -0,0 +1,12 @@ +-- [nfnl] Compiled from fnl/dots/plugins/telescope.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local telescope = autoload("telescope") +local actions = autoload("telescope.actions") +local function setup() + telescope.setup({defaults = {mappings = {i = {[""] = actions.close}}, file_ignore_patterns = {"Cargo.lock", ".*.snap", "docs/theme/.*", "node%_modules/.*", "target/.*"}}, extensions = {["ui-select"] = {(require("telescope.themes")).get_dropdown()}}}) + telescope.load_extension("dap") + return utils.keymap("n", "", ":Telescope find_files") +end +return {utils.plugin("nvim-telescope/telescope.nvim", {config = setup, cmd = {"Telescope"}, dependencies = {"nvim-lua/popup.nvim", "nvim-lua/plenary.nvim"}})} diff --git a/nvim/.config/nvim/lua/dots/plugins/todo-comments.lua b/nvim/.config/nvim/lua/dots/plugins/todo-comments.lua new file mode 100644 index 0000000..f4c4aa6 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/todo-comments.lua @@ -0,0 +1,3 @@ +-- [nfnl] Compiled from fnl/dots/plugins/todo-comments.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +return {utils.plugin("folke/todo-comments.nvim", {lazy = true, event = "VeryLazy", opts = {keywords = {TODO = {icon = "\239\128\140 "}, WARN = {icon = "\239\129\177 ", alt = {"WARNING", "XXX", "!!!"}}, NOTE = {icon = "\239\137\137 ", alt = {"INFO"}}, FIX = {icon = "\239\134\136 ", alt = {"FIXME", "BUG", "FIXIT", "ISSUE", "PHIX"}}, PERF = {icon = "\239\128\151 ", alt = {"OPTIM", "PERFORMANCE", "OPTIMIZE"}}, HACK = {icon = "\239\146\144 "}}}})} diff --git a/nvim/.config/nvim/lua/dots/plugins/treesitter.lua b/nvim/.config/nvim/lua/dots/plugins/treesitter.lua new file mode 100644 index 0000000..0a80a53 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/treesitter.lua @@ -0,0 +1,7 @@ +-- [nfnl] Compiled from fnl/dots/plugins/treesitter.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +local function setup() + local configs = require("nvim-treesitter.configs") + return configs.setup({ensure_installed = {"rust", "fennel", "commonlisp", "vim", "regex", "lua", "bash", "markdown", "markdown_inline"}, highlight = {disable = {"fennel", "rust", "haskell"}, enable = false}, incremental_selection = {keymaps = {init_selection = "gss", node_incremental = "gsl", node_decremental = "gsh", scope_incremental = "gsj", scope_decremental = "gsk"}, enable = false}, textsubjects = {enable = true, disable = {"noice"}, prev_selection = ",", keymaps = {["."] = "textsubjects-smart"}}, playground = {disable = {"fennel"}, updatetime = 25, keybindings = {toggle_query_editor = "o", toggle_hl_groups = "i", toggle_injected_languages = "t", toggle_anonymous_nodes = "a", toggle_language_display = "I", focus_language = "f", unfocus_language = "F", update = "R", goto_node = "", show_help = "?"}, enable = false, persist_queries = false}}) +end +return {} diff --git a/nvim/.config/nvim/lua/dots/plugins/trouble.lua b/nvim/.config/nvim/lua/dots/plugins/trouble.lua new file mode 100644 index 0000000..53f13f1 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/trouble.lua @@ -0,0 +1,17 @@ +-- [nfnl] Compiled from fnl/dots/plugins/trouble.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local utils = _local_1_["utils"] +local colors = _local_1_["colors"] +local trouble = autoload("trouble") +local function setup() + trouble.setup({auto_close = true, auto_jump = {"lsp_definitions", "lsp_workspace_diagnostics", "lsp_type_definitions"}, action_keys = {jump = "", jump_close = "o", close = {"", "q"}, cancel = "q", preview = "p", toggle_preview = "P", toggle_mode = "m", hover = {"a", "K"}}, icons = false, auto_open = false, multiline = false, auto_preview = false, indent_lines = false}) + utils.highlight("TroubleFoldIcon", {bg = "NONE", fg = colors.bright_orange}) + utils.highlight("TroubleCount", {bg = "NONE", fg = colors.bright_green}) + utils.highlight("TroubleText", {bg = "NONE", fg = colors.light0}) + utils.highlight("TroubleSignError", {bg = "NONE", fg = colors.bright_red}) + utils.highlight("TroubleSignWarning", {bg = "NONE", fg = colors.bright_yellow}) + utils.highlight("TroubleSignInformation", {bg = "NONE", fg = colors.bright_aqua}) + return utils.highlight("TroubleSignHint", {bg = "NONE", fg = colors.bright_blue}) +end +return {utils.plugin("folke/trouble.nvim", {lazy = true, config = setup, cmd = {"Trouble", "TroubleClose", "TroubleRefresh", "TroubleToggle"}})} diff --git a/nvim/.config/nvim/lua/dots/plugins/vimtex.lua b/nvim/.config/nvim/lua/dots/plugins/vimtex.lua new file mode 100644 index 0000000..2b71c75 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/plugins/vimtex.lua @@ -0,0 +1,15 @@ +-- [nfnl] Compiled from fnl/dots/plugins/vimtex.fnl by https://github.com/Olical/nfnl, do not edit. +local utils = require("dots.utils") +local function setup() + vim.g.vimtex_view_method = "general" + vim.g.vimtex_view_general_viewer = "zathura" + vim.g.vimtex_view_general_options = "--synctex-forward @line:1:@tex @pdf" + vim.g.vimtex_quickfix_method = "pplatex" + vim.g.vimtex_quickfix_mode = 2 + vim.g.vimtex_quickfix_open_on_warning = 0 + vim.g.vimtex_compiler_latexmk = {build_dir = "", callback = 1, continuous = 1, executable = "latexmk", hooks = {}, options = {"-verbose", "-file-line-error", "-synctex=1", "-interaction=nonstopmode", "-shell-escape"}} + vim.g.vimtex_syntax_custom_cmds = {{name = "scripture", argstyle = "ital"}} + vim.g.vimtex_syntax_conceal = {accents = 1, cites = 1, fancy = 1, greek = 1, math_bounds = 1, math_delimiters = 1, math_fracs = 1, math_super_sub = 1, math_symbols = 1, sections = 0, styles = 0} + return nil +end +return {utils.plugin("lervag/vimtex", {ft = {"latex", "tex"}, config = setup})} diff --git a/nvim/.config/nvim/lua/dots/prelude.lua b/nvim/.config/nvim/lua/dots/prelude.lua new file mode 100644 index 0000000..a41f8b4 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/prelude.lua @@ -0,0 +1,4 @@ +-- [nfnl] Compiled from fnl/dots/prelude.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("nfnl.module") +local autoload = _local_1_["autoload"] +return {autoload = autoload, a = autoload("nfnl.core"), str = autoload("nfnl.string"), utils = autoload("dots.utils"), colors = autoload("dots.colors")} diff --git a/nvim/.config/nvim/lua/dots/smart-compe-conjure.lua b/nvim/.config/nvim/lua/dots/smart-compe-conjure.lua new file mode 100644 index 0000000..a0f31fc --- /dev/null +++ b/nvim/.config/nvim/lua/dots/smart-compe-conjure.lua @@ -0,0 +1,35 @@ +-- [nfnl] Compiled from fnl/dots/smart-compe-conjure.fnl by https://github.com/Olical/nfnl, do not edit. +al(utils, dots.utils) +al(a, aniseed.core) +al(str, aniseed.string) +al(view, aniseed.view) +al(popup, popup) +al(compe, compe) +local function _1_() + return setmetatable({}, {__index = my_source}) +end +my_source.new = _1_ +my_source.determine = fuck.determine +my_source.get_metadata = fuck.get_metadata +my_source.complete = fuck.complete +my_source.abort = fuck.abort +local function _2_(self, args) + a.println(view.serialise(args)) + local function _3_() + local help_tag = help["find-help-tag-for"](args.completed_item.word) + if help_tag then + local lines = {"```help"} + for _, line in ipairs(help["help-for-tag"](help_tag)) do + table.insert(lines, line) + end + table.insert(lines, "```") + return lines + else + return nil + end + end + return args.callback(_3_()) +end +my_source.documentation = _2_ +defn(setup, {}, def(fuck, require("compe_conjure")), def(my_source, {}), nil, nil, nil, nil, nil, nil, compe.register_source("epic", my_source.new()), compe.setup({enabled = true, min_length = 1, preselect = "enable", throttle_time = 80, source_timeout = 200, incomplete_delay = 400, max_abbr_width = 100, max_kind_width = 100, max_menu_width = 100, documentation = true, source = {path = true, buffer = true, calc = true, nvim_lsp = true, nvim_lua = true, epic = true, vsnip = false}, debug = false, autocomplete = false})) +return {} diff --git a/nvim/.config/nvim/lua/dots/utils.lua b/nvim/.config/nvim/lua/dots/utils.lua new file mode 100644 index 0000000..057d427 --- /dev/null +++ b/nvim/.config/nvim/lua/dots/utils.lua @@ -0,0 +1,201 @@ +-- [nfnl] Compiled from fnl/dots/utils.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("dots.prelude") +local autoload = _local_1_["autoload"] +local a = _local_1_["a"] +local str = _local_1_["str"] +local function plugin(name, _3fopts) + if (nil == _3fopts) then + return name + else + _3fopts[1] = name + return _3fopts + end +end +local function all(f) + local function _3_(_241) + return not f(_241) + end + return not a.some(_3_) +end +local function single_to_list(x) + if a["table?"](x) then + return x + else + return {x} + end +end +local function contains_3f(list, elem) + local function _5_(_241) + return (elem == _241) + end + do local _ = a.some(_5_, list) end + return false +end +local function filter_table(f, t) + local tbl_14_auto = {} + for k, v in pairs(t) do + local k_15_auto, v_16_auto = nil, nil + if f(k, v) then + k_15_auto, v_16_auto = k, v + else + k_15_auto, v_16_auto = nil + end + if ((k_15_auto ~= nil) and (v_16_auto ~= nil)) then + tbl_14_auto[k_15_auto] = v_16_auto + else + end + end + return tbl_14_auto +end +local function split_last(s, sep) + for i = #s, 1, -1 do + local c = s:sub(i, i) + if (sep == c) then + local left = s:sub(1, (i - 1)) + local right = s:sub((i + 1)) + return { left, right } + else + end + end + return {s} +end +local function find_where(pred, xs) + for _, x in ipairs(xs) do + if pred(x) then + return x + else + end + end + return nil +end +local function find_map(f, xs) + for _, x in ipairs(xs) do + local res = f(x) + if (nil ~= res) then + return res + else + end + end + return nil +end +local function keep_if(f, x) + if f(x) then + return x + else + return nil + end +end +local function map_values(f, t) + local tbl = {} + for k, v in pairs(t) do + tbl[k] = f(v) + end + return tbl +end +local function without_keys(keys, t) + local function _12_(_241) + return not contains_3f(keys, _241) + end + return filter_table(_12_, t) +end +local function keymap(modes, from, to, _3fopts) + local full_opts = without_keys({"buffer"}, a.merge({noremap = true, silent = true}, (_3fopts or {}))) + for _, mode in ipairs(single_to_list(modes)) do + local keymap_opts + local _14_ + do + local _13_ = _3fopts + if (nil ~= _13_) then + _14_ = (_13_).buffer + else + _14_ = _13_ + end + end + if _14_ then + keymap_opts = a.assoc(full_opts, "buffer", 0) + else + keymap_opts = full_opts + end + vim.keymap.set(mode, from, to, keymap_opts) + end + return nil +end +local function del_keymap(mode, from, _3fbuf_local) + local function _17_() + if _3fbuf_local then + return {buffer = 0} + else + return {} + end + end + return vim.keymap.del(mode, from, _17_()) +end +local function buffer_content(bufnr) + return vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) +end +local function surround_if_present(a0, mid, b) + if mid then + return (a0 .. mid .. b) + else + return "" + end +end +local function highlight(group_arg, colset) + local default = {fg = "NONE", bg = "NONE", gui = "NONE"} + local opts = a.merge(default, colset) + for _, group in ipairs(single_to_list(group_arg)) do + vim.cmd(("hi! " .. group .. " guifg='" .. opts.fg .. "' guibg='" .. opts.bg .. "' gui='" .. opts.gui .. "'")) + end + return nil +end +local function highlight_add(group_arg, colset) + for _, group in ipairs(single_to_list(group_arg)) do + vim.cmd(("hi! " .. group .. surround_if_present(" guibg='", colset.bg, "'") .. surround_if_present(" guifg='", colset.fg, "'") .. surround_if_present(" gui='", colset.gui, "'"))) + end + return nil +end +local function shorten_path(path, seg_length, shorten_after) + local segments = str.split(path, "/") + if ((shorten_after > #path) or (2 > #segments)) then + return path + else + local init = a.butlast(segments) + local filename = a.last(segments) + local shortened_segs + local function _19_(_241) + return string.sub(_241, 1, seg_length) + end + shortened_segs = a.map(_19_, init) + return (str.join("/", shortened_segs) .. "/" .. filename) + end +end +local function comp(f, g) + local function _21_(...) + return f(g(...)) + end + return _21_ +end +local function get_selection() + local _let_22_ = vim.fn.getpos("'<") + local _ = _let_22_[1] + local s_start_line = _let_22_[2] + local s_start_col = _let_22_[3] + local _let_23_ = vim.fn.getpos("'>") + local _0 = _let_23_[1] + local s_end_line = _let_23_[2] + local s_end_col = _let_23_[3] + local n_lines = (1 + math.abs((s_end_line - s_start_line))) + local lines = vim.api.nvim_buf_get_lines(0, (s_start_line - 1), s_end_line, false) + if (nil == lines[1]) then + return s_start_line, s_end_line, lines + else + lines[1] = string.sub(lines[1], s_start_col, -1) + if (1 == n_lines) then + lines[n_lines] = string.sub(lines[n_lines], 1, (1 + (s_end_col - s_start_col))) + else + lines[n_lines] = string.sub(lines[n_lines], 1, s_end_col) + end + return s_start_line, s_end_line, lines + end +end +return {plugin = plugin, all = all, ["single-to-list"] = single_to_list, ["contains?"] = contains_3f, ["filter-table"] = filter_table, ["split-last"] = split_last, ["find-where"] = find_where, ["find-map"] = find_map, ["keep-if"] = keep_if, ["map-values"] = map_values, ["without-keys"] = without_keys, keymap = keymap, ["del-keymap"] = del_keymap, ["buffer-content"] = buffer_content, ["surround-if-present"] = surround_if_present, highlight = highlight, ["highlight-add"] = highlight_add, ["shorten-path"] = shorten_path, comp = comp, ["get-selection"] = get_selection} diff --git a/nvim/.config/nvim/lua/main.lua b/nvim/.config/nvim/lua/main.lua new file mode 100644 index 0000000..5330c88 --- /dev/null +++ b/nvim/.config/nvim/lua/main.lua @@ -0,0 +1,103 @@ +-- [nfnl] Compiled from fnl/main.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("nfnl.module") +local autoload = _local_1_["autoload"] +local a = autoload("nfnl.core") +local str = autoload("nfnl.string") +local utils = autoload("dots.utils") +local lazy = require("lazy") +if vim.fn.has("termguicolors") then + vim.opt.termguicolors = true +else +end +vim.cmd("let mapleader=\"\\\"") +vim.cmd("let maplocalleader=\",\"") +lazy.setup({import = "dots.plugins", install = {colorscheme = "gruvbox8"}}) +require("dots.keybinds") +do + local added_paths = {} + vim.opt.runtimepath = (vim.o.runtimepath .. str.join(",", added_paths)) +end +vim.cmd("filetype plugin indent on") +vim.cmd("syntax on") +vim.opt.foldmethod = "marker" +vim.opt.scrolloff = 5 +vim.opt.showmode = false +vim.opt.undodir = (vim.env.HOME .. "/.vim/undo-dir") +vim.opt.undofile = true +vim.opt.shortmess = (vim.o.shortmess .. "c") +vim.opt.hidden = true +vim.opt.encoding = "utf-8" +vim.opt.number = false +vim.opt.relativenumber = false +vim.opt.compatible = false +vim.opt.cursorline = true +vim.opt.incsearch = true +vim.opt.hlsearch = true +vim.opt.inccommand = "nosplit" +vim.opt.signcolumn = "yes" +vim.opt.shiftwidth = 2 +vim.opt.tabstop = 2 +vim.opt.backspace = "indent,eol,start" +vim.opt.autoindent = true +vim.opt.smartindent = true +vim.opt.expandtab = true +vim.opt.wrap = false +vim.opt.completeopt = "menuone,noselect" +vim.opt.laststatus = 2 +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.mouse = "a" +vim.opt.shell = "bash" +vim.opt.background = "dark" +vim.opt.swapfile = false +vim.opt.undolevels = 10000 +vim.opt.keywordprg = "rusty-man" +vim.g.AutoPairsMultilineClose = 0 +vim.cmd("let &t_ut=\"\"") +vim.opt.title = true +vim.opt.titlelen = 0 +vim.opt.titlestring = "%{expand(\"%:p\")} [%{mode()}]" +local function _3_() + vim.opt.shiftwidth = 2 + return nil +end +vim.api.nvim_create_autocmd("BufWritePost", {pattern = "*.hs", callback = _3_}) +local function _4_() + vim.opt_local.foldmethod = "marker" + return nil +end +vim.api.nvim_create_autocmd("FileType", {pattern = "vim", callback = _4_}) +local function _5_() + vim.opt_local.formatoptions = (vim.o.formatoptions):gsub("[cor]", "") + return nil +end +vim.api.nvim_create_autocmd("FileType", {pattern = "*", callback = _5_}) +local function _6_() + return vim.cmd("nnoremap :cclose") +end +vim.api.nvim_create_autocmd("FileType", {pattern = "qf", callback = _6_}) +local function _7_() + return vim.highlight.on_yank({higroup = "IncSearch", timeout = 300}) +end +vim.api.nvim_create_autocmd("TextYankPost", {pattern = "*", callback = _7_}) +vim.g.copilot_filetypes = {TelescopePrompt = false} +vim.diagnostic.config({float = {border = "single", style = "minimal"}}) +vim.g.VM_leader = "m" +vim.g.rust_clip_command = "xclip -selection clipboard" +vim.g["conjure#client#fennel#aniseed#aniseed_module_prefix"] = "aniseed." +vim.g.vim_parinfer_filetypes = {"carp", "fennel", "clojure"} +vim.g.parinfer_additional_filetypes = {"yuck"} +_G.clean_no_name_empty_buffers = function() + local bufs + local function _8_(_241) + return (a["empty?"](vim.fn.bufname(_241)) and (vim.fn.bufwinnr(_241) < 0) and vim.api.nvim_buf_is_loaded(_241) and ("" == str.join(utils["buffer-content"](_241))) and vim.api.nvim_buf_get_option(_241, "buflisted")) + end + bufs = a.filter(_8_, vim.fn.range(1, vim.fn.bufnr("$"))) + if not a["empty?"](bufs) then + return vim.cmd(("bdelete " .. str.join(" ", bufs))) + else + return nil + end +end +vim.cmd("autocmd! BufCreate * :call v:lua.clean_no_name_empty_buffers()") +return vim.cmd("command! -nargs=1 L :lua print(vim.inspect())")