From 6ea22fa0ec33dfe3aa65765adcec28a2f168f3e8 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Fri, 23 Apr 2021 16:46:45 +0200 Subject: [PATCH] more stuff in lua/fennel --- files/.config/nvim/fnl/init.fnl | 67 ++-- files/.config/nvim/fnl/keybinds.fnl | 10 +- files/.config/nvim/fnl/plugins/bufferline.fnl | 47 +++ files/.config/nvim/fnl/plugins/lsp.fnl | 6 +- files/.config/nvim/fnl/plugins/telescope.fnl | 4 +- files/.config/nvim/fnl/utils.fnl | 38 ++- files/.config/nvim/init.vim | 41 +-- files/.config/nvim/lua/init.lua | 31 +- files/.config/nvim/lua/keybinds.lua | 8 +- files/.config/nvim/lua/plugins/bufferline.lua | 50 +++ files/.config/nvim/lua/plugins/lsp.lua | 5 +- files/.config/nvim/lua/plugins/telescope.lua | 2 +- files/.config/nvim/lua/utils.lua | 99 +++++- files/.config/nvim/plugin/packer_compiled.vim | 322 ++++++++++++++++++ files/.config/nvim/plugins.lua | 137 ++++++++ files/.config/nvim/plugins.vim | 122 ------- 16 files changed, 725 insertions(+), 264 deletions(-) create mode 100644 files/.config/nvim/fnl/plugins/bufferline.fnl create mode 100644 files/.config/nvim/lua/plugins/bufferline.lua create mode 100644 files/.config/nvim/plugin/packer_compiled.vim create mode 100644 files/.config/nvim/plugins.lua delete mode 100644 files/.config/nvim/plugins.vim diff --git a/files/.config/nvim/fnl/init.fnl b/files/.config/nvim/fnl/init.fnl index 2c17cdd..39f84a3 100644 --- a/files/.config/nvim/fnl/init.fnl +++ b/files/.config/nvim/fnl/init.fnl @@ -9,54 +9,35 @@ (require "plugins.telescope") (require "plugins.lsp") (require "plugins.galaxyline") - - -(global pp - (fn [x] - (print (fennel.view x)))) +(require "plugins.bufferline") ;(set nvim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") -(local colors (utils.colors)) -(local bufferline (require "bufferline")) - -; :h bufferline-lua-highlights -(let [selected { :guibg colors.neutral_aqua :guifg colors.dark0 :gui ""} - visible { :guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}] - (bufferline.setup - { :options - { :diagnostics "nvim_lsp" - :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) - :show_buffer_close_icons false - :show_close_icon false - :show_tab_indicators false - :enforce_regular_tabs false - :tab_size 10} - - :highlights - { :fill { :guibg colors.dark0 :guifg colors.light0} - :background visible - :buffer_visible visible - :buffer_selected selected - :modified visible - :modified_visible visible - :modified_selected selected - :error visible - :error_selected selected - :error_visible visible - :warning visible - :warning_selected selected - :warning_visible visible - :separator visible - :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua} - - ; stuff I've never seen before :thonk: - :pick_selected {:guibg colors.bright_red :guifg colors.bright_red} - :tab_selected {:guibg colors.bright_green :guifg colors.bright_green} - :tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}})) -(utils.highlight :BufferLineInfoSelected { :bg colors.neutral_aqua :fg colors.dark0 :gui "NONE"}) +; " :: and _ as space ------------------------------------------------------------------- {{{ +(var remapped-space nil) +(fn _G.RebindShit [newKey] + (set remapped-space {:old (vim.fn.maparg : :i) + :cur newKey}) + (utils.keymap :i : newKey {:buffer true})) +(fn _G.UnbindSpaceStuff [] + (if (and remapped-space (~= remapped-space {})) + (do + (utils.del-keymap :i : true) + (if (~= remapped-space.old "") + (utils.keymap :i : remapped-space.old {:buffer true})) + (set remapped-space nil)))) + + +(nvim.command "autocmd! InsertLeave * :call v:lua.UnbindSpaceStuff()") +(utils.keymap :n "j" ":call v:lua.RebindShit('_')") +(utils.keymap :n "k" ":call v:lua.RebindShit('::')") +(utils.keymap :i "j" ":call v:lua.RebindShit('_')") +(utils.keymap :i "k" ":call v:lua.RebindShit('::')") +(utils.keymap :n "ö" "a") + +; }}} diff --git a/files/.config/nvim/fnl/keybinds.fnl b/files/.config/nvim/fnl/keybinds.fnl index 4d17d63..158341b 100644 --- a/files/.config/nvim/fnl/keybinds.fnl +++ b/files/.config/nvim/fnl/keybinds.fnl @@ -6,13 +6,11 @@ require-macros [macros]}) -(utils.noremap :n : ":WhichKey ''") -(utils.noremap :v : ":WhichKeyVisual ''") +(utils.keymap :n : ":WhichKey ''") +(utils.keymap :v : ":WhichKeyVisual ''") -;(utils.mapexpr :i : "compe#confirm(lexima#expand('CR>', 'i'))") - -(utils.mapexpr :i : "compe#complete()") -(utils.mapexpr :i : "compe#close('')") +(utils.keymap :i : "compe#complete()" {:expr true}) +(utils.keymap :i : "compe#close('')" {:expr true}) diff --git a/files/.config/nvim/fnl/plugins/bufferline.fnl b/files/.config/nvim/fnl/plugins/bufferline.fnl new file mode 100644 index 0000000..90b8e03 --- /dev/null +++ b/files/.config/nvim/fnl/plugins/bufferline.fnl @@ -0,0 +1,47 @@ +(module plugins.bufferline + {require {a aniseed.core + fennel aniseed.fennel + nvim aniseed.nvim + utils utils + bufferline bufferline}}) + +(local colors (utils.colors)) + +; :h bufferline-lua-highlights +(let [selected { :guibg colors.neutral_aqua :guifg colors.dark0 :gui ""} + visible { :guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}] + (bufferline.setup + { :options + { :diagnostics "nvim_lsp" + :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) + :show_buffer_close_icons false + :show_close_icon false + :show_tab_indicators false + :enforce_regular_tabs false + :tab_size 10} + + :highlights + { :fill { :guibg colors.dark0 :guifg colors.light0} + :background visible + :buffer_visible visible + :buffer_selected selected + :modified visible + :modified_visible visible + :modified_selected selected + :error visible + :error_selected selected + :error_visible visible + :warning visible + :warning_selected selected + :warning_visible visible + :separator visible + :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua} + + ; stuff I've never seen before :thonk: + :pick_selected {:guibg colors.bright_red :guifg colors.bright_red} + :tab_selected {:guibg colors.bright_green :guifg colors.bright_green} + :tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}})) + + +(utils.highlight :BufferLineInfoSelected { :bg colors.neutral_aqua :fg colors.dark0 :gui "NONE"}) + diff --git a/files/.config/nvim/fnl/plugins/lsp.fnl b/files/.config/nvim/fnl/plugins/lsp.fnl index 7e7cf58..37d13b8 100644 --- a/files/.config/nvim/fnl/plugins/lsp.fnl +++ b/files/.config/nvim/fnl/plugins/lsp.fnl @@ -41,11 +41,9 @@ (fn init-lsp [lsp-name ?opts] "initialize a language server with defaults" - (let [merged-opts {:on_attach on_attach}] - (each [k v (pairs (or opts {}))] - (tset merged-opts k v)) + (let [merged-opts (a.merge {:on_attach on_attach} (or ?opts {}))] ((. lsp lsp-name :setup) merged-opts))) - + (init-lsp :rust_analyzer { :capabilities capabilities}) (init-lsp :tsserver { :root_dir (lsp.util.root_pattern "package.json")}) diff --git a/files/.config/nvim/fnl/plugins/telescope.fnl b/files/.config/nvim/fnl/plugins/telescope.fnl index 52b2246..2abaf78 100644 --- a/files/.config/nvim/fnl/plugins/telescope.fnl +++ b/files/.config/nvim/fnl/plugins/telescope.fnl @@ -7,12 +7,10 @@ telescope telescope actions telescope.actions}}) - - (telescope.setup {:defaults {:i { "" actions.close}}}) (telescope.load_extension "media_files") -(utils.noremap :n : ":Telescope find_files") +(utils.keymap :n : ":Telescope find_files") diff --git a/files/.config/nvim/fnl/utils.fnl b/files/.config/nvim/fnl/utils.fnl index 76618ce..6e8cbc8 100644 --- a/files/.config/nvim/fnl/utils.fnl +++ b/files/.config/nvim/fnl/utils.fnl @@ -1,15 +1,37 @@ (module utils {require {a aniseed.core - nvim aniseed.nvim} + nvim aniseed.nvim + fun fun} require-macros [macros]}) - -(defn noremap [mode from to] - "Sets a mapping with {:noremap true :silent true}." - (nvim.set_keymap mode from to {:noremap true :silent true})) + -(defn mapexpr [mode from to] - "Sets a mapping with {:noremap true :silent true :expr true}." - (nvim.set_keymap mode from to {:noremap true :silent true :expr true})) +(defn dbg [x] + (a.pr x) + x) + +(defn contains? [list elem] + (fun.any #(= elem $1) list)) + +(defn without-keys [keys t] + (fun.filter #(not (contains? keys $1)) t)) + +(defn keymap [mode from to ?opts] + "Set a mapping in the given mode, and some optional parameters, defaulting to {:noremap true :silent true}. + If :buffer is set, uses buf_set_keymap rather than set_keymap" + (local full-opts + (->> (or ?opts {}) + (a.merge {:noremap true :silent true}) + (without-keys [:buffer]) + fun.tomap)) + (if (and ?opts (?. ?opts :buffer)) + (nvim.buf_set_keymap 0 mode from to full-opts) + (nvim.set_keymap mode from to full-opts))) + +(defn del-keymap [mode from ?buf-local] + "Remove a keymap. Arguments: mode, mapping, bool if mapping should be buffer-local." + (if ?buf-local + (nvim.buf_del_keymap 0 mode from) + (nvim.del_keymap mode from))) diff --git a/files/.config/nvim/init.vim b/files/.config/nvim/init.vim index d361030..b24b6c5 100644 --- a/files/.config/nvim/init.vim +++ b/files/.config/nvim/init.vim @@ -9,8 +9,7 @@ let g:vim_config_root = expand(':p:h') let $VIM_ROOT = g:vim_config_root -source $VIM_ROOT/plugins.vim - +luafile $VIM_ROOT/plugins.lua if &shell =~# 'fish$' set shell=bash @@ -219,44 +218,6 @@ hi SignifySignAdd cterm=NONE gui=NONE guifg='#8ec07c' " }}} -" }}} - -" :: and _ as space ------------------------------------------------------------------- {{{ - -function RebindShit(newKey) - let b:RemappedSpace={ - \ 'old': maparg("", "i"), - \ 'cur': a:newKey - \ } - exe 'inoremap ' a:newKey -endfun - -function! UnbindSpaceStuff() - if get(b:, "RemappedSpace", {}) != {} - exe 'iunmap ' - if b:RemappedSpace['old'] != "" - exe 'inoremap ' b:RemappedSpace['old'] - endif - unlet b:RemappedSpace - endif -endfun - -augroup UnmapSpaceStuff - autocmd! - autocmd InsertLeave * call UnbindSpaceStuff() -augroup END - - -nnoremap j :call RebindShit("_")a -nnoremap k :call RebindShit("::")a - -inoremap j :call RebindShit("_") -inoremap k :call RebindShit("::") - - -nnoremap ö a - - " }}} diff --git a/files/.config/nvim/lua/init.lua b/files/.config/nvim/lua/init.lua index 8417b3b..7daac4c 100644 --- a/files/.config/nvim/lua/init.lua +++ b/files/.config/nvim/lua/init.lua @@ -41,18 +41,25 @@ do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end require("plugins.telescope") require("plugins.lsp") require("plugins.galaxyline") -local function _2_(x) - return print(fennel.view(x)) +require("plugins.bufferline") +local remapped_space = nil +_G.RebindShit = function(newKey) + remapped_space = {cur = newKey, old = vim.fn.maparg("", "i")} + return utils.keymap("i", "", newKey, {buffer = true}) end -pp = _2_ -local colors = utils.colors() -local bufferline = require("bufferline") -do - local selected = {gui = "", guibg = colors.neutral_aqua, guifg = colors.dark0} - local visible = {gui = "", guibg = colors.dark1, guifg = colors.neutral_aqua} - local function _3_(cnt, lvl, diagnostics_dict) - return (" (" .. cnt .. ")") +_G.UnbindSpaceStuff = function() + if (remapped_space and (remapped_space ~= {})) then + utils["del-keymap"]("i", "", true) + if (remapped_space.old ~= "") then + utils.keymap("i", "", remapped_space.old, {buffer = true}) + end + remapped_space = nil + return nil end - bufferline.setup({highlights = {background = visible, buffer_selected = selected, buffer_visible = visible, error = {guifg = colors.bright_green}, error_selected = selected, error_visible = visible, fill = {guibg = colors.dark0, guifg = colors.light0}, indicator_selected = {guibg = colors.neutral_aqua, guifg = colors.neutral_aqua}, modified = visible, modified_selected = selected, modified_visible = visible, pick_selected = {guibg = colors.bright_red, guifg = colors.bright_red}, separator = visible, tab = {guibg = colors.bright_yellow, guifg = colors.bright_yellow}, tab_selected = {guibg = colors.bright_green, guifg = colors.bright_green}, warning = visible, warning_selected = selected, warning_visible = visible}, options = {diagnostics = "nvim_lsp", diagnostics_indicator = _3_, enforce_regular_tabs = false, show_buffer_close_icons = false, show_close_icon = false, show_tab_indicators = false, tab_size = 10}}) end -return utils.highlight("BufferLineInfoSelected", {bg = colors.neutral_aqua, fg = colors.dark0, gui = "NONE"}) \ No newline at end of file +nvim.command("autocmd! InsertLeave * :call v:lua.UnbindSpaceStuff()") +utils.keymap("n", "j", ":call v:lua.RebindShit('_')") +utils.keymap("n", "k", ":call v:lua.RebindShit('::')") +utils.keymap("i", "j", ":call v:lua.RebindShit('_')") +utils.keymap("i", "k", ":call v:lua.RebindShit('::')") +return utils.keymap("n", "\195\182", "a") \ No newline at end of file diff --git a/files/.config/nvim/lua/keybinds.lua b/files/.config/nvim/lua/keybinds.lua index f385748..d61d782 100644 --- a/files/.config/nvim/lua/keybinds.lua +++ b/files/.config/nvim/lua/keybinds.lua @@ -37,10 +37,10 @@ local utils = _local_0_[4] local _2amodule_2a = _0_0 local _2amodule_name_2a = "keybinds" do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end -utils.noremap("n", "", ":WhichKey ''") -utils.noremap("v", "", ":WhichKeyVisual ''") -utils.mapexpr("i", "", "compe#complete()") -utils.mapexpr("i", "", "compe#close('')") +utils.keymap("n", "", ":WhichKey ''") +utils.keymap("v", "", ":WhichKeyVisual ''") +utils.keymap("i", "", "compe#complete()", {expr = true}) +utils.keymap("i", "", "compe#close('')", {expr = true}) local function le(s) return (":call luaeval(\"" .. s .. "\")") end diff --git a/files/.config/nvim/lua/plugins/bufferline.lua b/files/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..d3ede6c --- /dev/null +++ b/files/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,50 @@ +local _0_0 = nil +do + local name_0_ = "plugins.bufferline" + local module_0_ = nil + do + local x_0_ = package.loaded[name_0_] + if ("table" == type(x_0_)) then + module_0_ = x_0_ + else + module_0_ = {} + end + end + module_0_["aniseed/module"] = name_0_ + module_0_["aniseed/locals"] = ((module_0_)["aniseed/locals"] or {}) + module_0_["aniseed/local-fns"] = ((module_0_)["aniseed/local-fns"] or {}) + package.loaded[name_0_] = module_0_ + _0_0 = module_0_ +end +local function _1_(...) + local ok_3f_0_, val_0_ = nil, nil + local function _1_() + return {require("aniseed.core"), require("bufferline"), require("aniseed.fennel"), require("aniseed.nvim"), require("utils")} + end + ok_3f_0_, val_0_ = pcall(_1_) + if ok_3f_0_ then + _0_0["aniseed/local-fns"] = {require = {a = "aniseed.core", bufferline = "bufferline", fennel = "aniseed.fennel", nvim = "aniseed.nvim", utils = "utils"}} + return val_0_ + else + return print(val_0_) + end +end +local _local_0_ = _1_(...) +local a = _local_0_[1] +local bufferline = _local_0_[2] +local fennel = _local_0_[3] +local nvim = _local_0_[4] +local utils = _local_0_[5] +local _2amodule_2a = _0_0 +local _2amodule_name_2a = "plugins.bufferline" +do local _ = ({nil, _0_0, {{}, nil, nil, nil}})[2] end +local colors = utils.colors() +do + local selected = {gui = "", guibg = colors.neutral_aqua, guifg = colors.dark0} + local visible = {gui = "", guibg = colors.dark1, guifg = colors.neutral_aqua} + local function _2_(cnt, lvl, diagnostics_dict) + return (" (" .. cnt .. ")") + end + bufferline.setup({highlights = {background = visible, buffer_selected = selected, buffer_visible = visible, error = visible, error_selected = selected, error_visible = visible, fill = {guibg = colors.dark0, guifg = colors.light0}, indicator_selected = {guibg = colors.neutral_aqua, guifg = colors.neutral_aqua}, modified = visible, modified_selected = selected, modified_visible = visible, pick_selected = {guibg = colors.bright_red, guifg = colors.bright_red}, separator = visible, tab = {guibg = colors.bright_yellow, guifg = colors.bright_yellow}, tab_selected = {guibg = colors.bright_green, guifg = colors.bright_green}, warning = visible, warning_selected = selected, warning_visible = visible}, options = {diagnostics = "nvim_lsp", diagnostics_indicator = _2_, enforce_regular_tabs = false, show_buffer_close_icons = false, show_close_icon = false, show_tab_indicators = false, tab_size = 10}}) +end +return utils.highlight("BufferLineInfoSelected", {bg = colors.neutral_aqua, fg = colors.dark0, gui = "NONE"}) \ No newline at end of file diff --git a/files/.config/nvim/lua/plugins/lsp.lua b/files/.config/nvim/lua/plugins/lsp.lua index 033d1e3..71a7f23 100644 --- a/files/.config/nvim/lua/plugins/lsp.lua +++ b/files/.config/nvim/lua/plugins/lsp.lua @@ -61,10 +61,7 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.completion.completionItem.resolveSupport = {properties = {"documentation", "detail", "additionalTextEdits"}} local function init_lsp(lsp_name, _3fopts) - local merged_opts = {on_attach = on_attach} - for k, v in pairs((opts or {})) do - merged_opts[k] = v - end + local merged_opts = a.merge({on_attach = on_attach}, (_3fopts or {})) return lsp[lsp_name].setup(merged_opts) end init_lsp("rust_analyzer", {capabilities = capabilities}) diff --git a/files/.config/nvim/lua/plugins/telescope.lua b/files/.config/nvim/lua/plugins/telescope.lua index 0d1ea9a..6fb52ea 100644 --- a/files/.config/nvim/lua/plugins/telescope.lua +++ b/files/.config/nvim/lua/plugins/telescope.lua @@ -41,4 +41,4 @@ local _2amodule_name_2a = "plugins.telescope" do local _ = ({nil, _0_0, {{}, nil, nil, nil}})[2] end telescope.setup({defaults = {i = {[""] = actions.close}}}) telescope.load_extension("media_files") -return utils.noremap("n", "", ":Telescope find_files") \ No newline at end of file +return utils.keymap("n", "", ":Telescope find_files") \ No newline at end of file diff --git a/files/.config/nvim/lua/utils.lua b/files/.config/nvim/lua/utils.lua index 67b2660..20f7db4 100644 --- a/files/.config/nvim/lua/utils.lua +++ b/files/.config/nvim/lua/utils.lua @@ -19,11 +19,11 @@ end local function _1_(...) local ok_3f_0_, val_0_ = nil, nil local function _1_() - return {require("aniseed.core"), require("aniseed.nvim")} + return {require("aniseed.core"), require("fun"), require("aniseed.nvim")} end ok_3f_0_, val_0_ = pcall(_1_) if ok_3f_0_ then - _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {a = "aniseed.core", nvim = "aniseed.nvim"}} + _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {a = "aniseed.core", fun = "fun", nvim = "aniseed.nvim"}} return val_0_ else return print(val_0_) @@ -31,41 +31,106 @@ local function _1_(...) end local _local_0_ = _1_(...) local a = _local_0_[1] -local nvim = _local_0_[2] +local fun = _local_0_[2] +local nvim = _local_0_[3] local _2amodule_2a = _0_0 local _2amodule_name_2a = "utils" do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end -local noremap = nil +local dbg = nil do local v_0_ = nil do local v_0_0 = nil - local function noremap0(mode, from, to) - return nvim.set_keymap(mode, from, to, {noremap = true, silent = true}) + local function dbg0(x) + a.pr(x) + return x end - v_0_0 = noremap0 - _0_0["noremap"] = v_0_0 + v_0_0 = dbg0 + _0_0["dbg"] = v_0_0 v_0_ = v_0_0 end local t_0_ = (_0_0)["aniseed/locals"] - t_0_["noremap"] = v_0_ - noremap = v_0_ + t_0_["dbg"] = v_0_ + dbg = v_0_ end -local mapexpr = nil +local contains_3f = nil do local v_0_ = nil do local v_0_0 = nil - local function mapexpr0(mode, from, to) - return nvim.set_keymap(mode, from, to, {expr = true, noremap = true, silent = true}) + local function contains_3f0(list, elem) + local function _2_(_241) + return (elem == _241) + end + return fun.any(_2_, list) end - v_0_0 = mapexpr0 - _0_0["mapexpr"] = v_0_0 + v_0_0 = contains_3f0 + _0_0["contains?"] = v_0_0 v_0_ = v_0_0 end local t_0_ = (_0_0)["aniseed/locals"] - t_0_["mapexpr"] = v_0_ - mapexpr = v_0_ + t_0_["contains?"] = v_0_ + contains_3f = v_0_ +end +local without_keys = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function without_keys0(keys, t) + local function _2_(_241) + return not contains_3f(keys, _241) + end + return fun.filter(_2_, t) + end + v_0_0 = without_keys0 + _0_0["without-keys"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["without-keys"] = v_0_ + without_keys = v_0_ +end +local keymap = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function keymap0(mode, from, to, _3fopts) + local full_opts = fun.tomap(without_keys({"buffer"}, a.merge({noremap = true, silent = true}, (_3fopts or {})))) + if (_3fopts and (_3fopts).buffer) then + return nvim.buf_set_keymap(0, mode, from, to, full_opts) + else + return nvim.set_keymap(mode, from, to, full_opts) + end + end + v_0_0 = keymap0 + _0_0["keymap"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["keymap"] = v_0_ + keymap = v_0_ +end +local del_keymap = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function del_keymap0(mode, from, _3fbuf_local) + if _3fbuf_local then + return nvim.buf_del_keymap(0, mode, from) + else + return nvim.del_keymap(mode, from) + end + end + v_0_0 = del_keymap0 + _0_0["del-keymap"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["del-keymap"] = v_0_ + del_keymap = v_0_ end local colors = nil do diff --git a/files/.config/nvim/plugin/packer_compiled.vim b/files/.config/nvim/plugin/packer_compiled.vim new file mode 100644 index 0000000..a122173 --- /dev/null +++ b/files/.config/nvim/plugin/packer_compiled.vim @@ -0,0 +1,322 @@ +" Automatically generated packer.nvim plugin loader code + +if !has('nvim-0.5') + echohl WarningMsg + echom "Invalid Neovim version for packer.nvim!" + echohl None + finish +endif + +packadd packer.nvim + +try + +lua << END + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time("Luarocks path setup", true) +local package_path_str = "/home/leon/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/leon/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/leon/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/leon/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/leon/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time("Luarocks path setup", false) +time("try_loadstring definition", true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s)) + if not success then + print('Error running ' .. component .. ' for ' .. name) + error(result) + end + return result +end + +time("try_loadstring definition", false) +time("Defining packer_plugins", true) +_G.packer_plugins = { + aniseed = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/aniseed" + }, + ["any-jump.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/any-jump.vim" + }, + detectindent = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/detectindent" + }, + ["editorconfig-vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/editorconfig-vim" + }, + ["fennel.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/fennel.vim" + }, + ["galaxyline.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/galaxyline.nvim" + }, + ["goyo.vim"] = { + commands = { "Goyo" }, + loaded = false, + needs_bufread = false, + path = "/home/leon/.local/share/nvim/site/pack/packer/opt/goyo.vim" + }, + gruvbox = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/gruvbox" + }, + ["haskell-vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/haskell-vim" + }, + ["lspsaga.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/lspsaga.nvim" + }, + ["markdown-preview.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim" + }, + nerdcommenter = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nerdcommenter" + }, + ["nlua.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nlua.nvim" + }, + ["nvim-bqf"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim-bqf" + }, + ["nvim-bufferline.lua"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua" + }, + ["nvim-compe"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim-compe" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" + }, + ["nvim-lsputils"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim-lsputils" + }, + ["nvim.lua"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/nvim.lua" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + popfix = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/popfix" + }, + ["popup.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/popup.nvim" + }, + ["purescript-vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/purescript-vim" + }, + ["quick-scope"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/quick-scope" + }, + ["rainbow_parentheses.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/rainbow_parentheses.vim" + }, + ["rust.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/rust.vim" + }, + ["sad.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/sad.vim" + }, + ["startuptime.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/startuptime.vim" + }, + tabular = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/tabular" + }, + ["targets.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/targets.vim" + }, + ["telescope-media-files.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/telescope-media-files.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/telescope.nvim" + }, + ["typescript-vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/typescript-vim" + }, + ["vim-css-color"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-css-color" + }, + ["vim-exchange"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-exchange" + }, + ["vim-fugitive"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-fugitive" + }, + ["vim-highlightedyank"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-highlightedyank" + }, + ["vim-indent-guides"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-indent-guides" + }, + ["vim-javascript"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-javascript" + }, + ["vim-jsonc"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-jsonc" + }, + ["vim-jsx"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-jsx" + }, + ["vim-nix"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-nix" + }, + ["vim-parinfer"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-parinfer" + }, + ["vim-polyglot"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-polyglot" + }, + ["vim-raku"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-raku" + }, + ["vim-repeat"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-repeat" + }, + ["vim-signify"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-signify" + }, + ["vim-smoothie"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-smoothie" + }, + ["vim-sneak"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-sneak" + }, + ["vim-snippets"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-snippets" + }, + ["vim-surround"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-surround" + }, + ["vim-tmux-navigator"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-tmux-navigator" + }, + ["vim-tsx"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-tsx" + }, + ["vim-visual-multi"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-visual-multi" + }, + ["vim-which-key"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/vim-which-key" + }, + ["webapi-vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/webapi-vim" + }, + ["yats.vim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/yats.vim" + } +} + +time("Defining packer_plugins", false) + +-- Command lazy-loads +time("Defining lazy-load commands", true) +vim.cmd [[command! -nargs=* -range -bang -complete=file Goyo lua require("packer.load")({'goyo.vim'}, { cmd = "Goyo", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +time("Defining lazy-load commands", false) + +if should_profile then save_profiles() end + +END + +catch + echohl ErrorMsg + echom "Error in packer_compiled: " .. v:exception + echom "Please check your config for correctness" + echohl None +endtry diff --git a/files/.config/nvim/plugins.lua b/files/.config/nvim/plugins.lua new file mode 100644 index 0000000..8d6833d --- /dev/null +++ b/files/.config/nvim/plugins.lua @@ -0,0 +1,137 @@ +local execute = vim.api.nvim_command +local fn = vim.fn + +local install_path = fn.stdpath("data").."/site/pack/packer/opt/packer.nvim" + +if fn.empty(fn.glob(install_path)) > 0 then + fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path}) + execute "packadd packer.nvim" +end + + +vim.cmd [[packadd packer.nvim]] + +require("packer").startup(function(use) + + use_rocks 'rtsisyk/fun' + + use "kevinhwang91/nvim-bqf" + + use "akinsho/nvim-bufferline.lua" + + use { + "Olical/aniseed", + tag = "v3.16.0" + } + + -- general purpose lua wrappers for nvim stuff + use "norcalli/nvim.lua" + + use "tweekmonster/startuptime.vim" + use "tpope/vim-repeat" + + use { + "junegunn/goyo.vim", + cmd = "Goyo", + } + + use "liuchengxu/vim-which-key" + + use "mhinz/vim-signify" + + use "tpope/vim-fugitive" + + use "preservim/nerdcommenter" + + use "glepnir/galaxyline.nvim" + + use "gruvbox-community/gruvbox" + + use "godlygeek/tabular" -- :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block. + use "tpope/vim-surround" + + use "christoomey/vim-tmux-navigator" -- good integration with tmux pane switching + use "nathanaelkane/vim-indent-guides" -- Can be toggled using ig (intent-guides) + + -- to select current word. to select next occurrence. + -- with multiple lines selected in Visual mode, to insert cursor in each line. I not i to insert in Visual-mode. + -- use "terryma/vim-multiple-cursors" + use "mg979/vim-visual-multi" + use "hauleth/sad.vim" -- Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too + use "wellle/targets.vim" -- more text objects. IE: cin) (change in next parens). generally better handling of surrounding objects. + + use "unblevable/quick-scope" -- highlight targets when pressing f + use { + "iamcco/markdown-preview.nvim", + run = vim.fn["mkdp#util#install"] + } + + use "machakann/vim-highlightedyank" + + use "ciaranm/detectindent" + use "pechorin/any-jump.vim" + use "justinmk/vim-sneak" + use "psliwka/vim-smoothie" + + use "editorconfig/editorconfig-vim" + + use "honza/vim-snippets" + + use "tommcdo/vim-exchange" + + use "kien/rainbow_parentheses.vim" + + use "bhurlow/vim-parinfer" + + -- Language Plugins ----------------------------------------------------- {{{ + + use "bduggan/vim-raku" + use "LnL7/vim-nix" + + use "kevinoid/vim-jsonc" + + use "ap/vim-css-color" + use "pangloss/vim-javascript" -- syntax highlighting JS + use "ianks/vim-tsx" + use "leafgarland/typescript-vim" + use "sheerun/vim-polyglot" -- Syntax highlighting for most languages + -- use "mattn/emmet-vim" + + use "purescript-contrib/purescript-vim" + + use "HerringtonDarkholme/yats.vim" -- typescript syntax highlighting + use "mxw/vim-jsx" + + -- Haskell + use "neovimhaskell/haskell-vim" + + -- Rust + use "rust-lang/rust.vim" + use "mattn/webapi-vim" + + use "bakpakin/fennel.vim" + use "tjdevries/nlua.nvim" + + -- use "mxw/vim-prolog" + + + use "neovim/nvim-lspconfig" + + -- use "nvim-lua/completion-nvim" + use "hrsh7th/nvim-compe" + use "glepnir/lspsaga.nvim" + -- use "cohama/lexima.vim" + + use "nvim-lua/popup.nvim" + use "nvim-lua/plenary.nvim" + use "nvim-telescope/telescope.nvim" + + use "RishabhRD/popfix" + use "RishabhRD/nvim-lsputils" + + use "nvim-telescope/telescope-media-files.nvim" + + -- }}} + +end) + diff --git a/files/.config/nvim/plugins.vim b/files/.config/nvim/plugins.vim deleted file mode 100644 index 1f0a7c9..0000000 --- a/files/.config/nvim/plugins.vim +++ /dev/null @@ -1,122 +0,0 @@ -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif - - -call plug#begin('~/.vim/plugged') - - Plug 'kevinhwang91/nvim-bqf' - - Plug 'akinsho/nvim-bufferline.lua' - - Plug 'Olical/aniseed', { 'tag': 'v3.16.0' } - - " general purpose lua wrappers for nvim stuff - Plug 'norcalli/nvim.lua' - - Plug 'tweekmonster/startuptime.vim' - Plug 'tpope/vim-repeat' - - Plug 'junegunn/goyo.vim', {'on': 'Goyo'} - - Plug 'liuchengxu/vim-which-key' - - Plug 'mhinz/vim-signify' - - Plug 'tpope/vim-fugitive' - - Plug 'preservim/nerdcommenter' - - Plug 'glepnir/galaxyline.nvim' - - Plug 'gruvbox-community/gruvbox' - - Plug 'godlygeek/tabular' " :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block. - Plug 'tpope/vim-surround' - - Plug 'christoomey/vim-tmux-navigator' " good integration with tmux pane switching - Plug 'nathanaelkane/vim-indent-guides' " Can be toggled using ig (intent-guides) - - " to select current word. to select next occurrence. - " with multiple lines selected in Visual mode, to insert cursor in each line. I not i to insert in Visual-mode. - "Plug 'terryma/vim-multiple-cursors' - Plug 'mg979/vim-visual-multi' - Plug 'hauleth/sad.vim' " Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too - Plug 'wellle/targets.vim' " more text objects. IE: cin) (change in next parens). generally better handling of surrounding objects. - - Plug 'unblevable/quick-scope' " highlight targets when pressing f - Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } } " :MarkdownPreview for live markdown preview - - Plug 'machakann/vim-highlightedyank' - - Plug 'ciaranm/detectindent' - Plug 'pechorin/any-jump.vim' - Plug 'justinmk/vim-sneak' - Plug 'psliwka/vim-smoothie' - - Plug 'editorconfig/editorconfig-vim' - - Plug 'honza/vim-snippets' - - Plug 'tommcdo/vim-exchange' - - Plug 'kien/rainbow_parentheses.vim' - - Plug 'bhurlow/vim-parinfer' - - "Plug 'Olical/conjure', {'tag': 'v4.17.0'} - - - " Language Plugins ----------------------------------------------------- {{{ - - Plug 'bduggan/vim-raku' - Plug 'LnL7/vim-nix' - - Plug 'kevinoid/vim-jsonc' - - Plug 'ap/vim-css-color' - Plug 'pangloss/vim-javascript' " syntax highlighting JS - Plug 'ianks/vim-tsx' - Plug 'leafgarland/typescript-vim' - Plug 'sheerun/vim-polyglot' " Syntax highlighting for most languages - "Plug 'mattn/emmet-vim' - - Plug 'purescript-contrib/purescript-vim' - - Plug 'HerringtonDarkholme/yats.vim' " typescript syntax highlighting - Plug 'mxw/vim-jsx' - - "" Haskell - Plug 'neovimhaskell/haskell-vim' - - " Rust - Plug 'rust-lang/rust.vim' - Plug 'mattn/webapi-vim' - - Plug 'bakpakin/fennel.vim' - Plug 'tjdevries/nlua.nvim' - - "Plug 'mxw/vim-prolog' - - - Plug 'neovim/nvim-lspconfig' - - "Plug 'nvim-lua/completion-nvim' - Plug 'hrsh7th/nvim-compe' - Plug 'glepnir/lspsaga.nvim' - "Plug 'cohama/lexima.vim' - - Plug 'nvim-lua/popup.nvim' - Plug 'nvim-lua/plenary.nvim' - Plug 'nvim-telescope/telescope.nvim' - - Plug 'RishabhRD/popfix' - Plug 'RishabhRD/nvim-lsputils' - - Plug 'nvim-telescope/telescope-media-files.nvim' - - " }}} -call plug#end() -