diff --git a/files/.config/kak-lsp/kak-lsp.toml b/files/.config/kak-lsp/kak-lsp.toml new file mode 100644 index 0000000..65279d1 --- /dev/null +++ b/files/.config/kak-lsp/kak-lsp.toml @@ -0,0 +1,157 @@ +verbosity = 3 +[semantic_scopes] +# Map textmate scopes to kakoune faces for semantic highlighting +# the underscores are translated to dots, and indicate nesting. +# That is, if variable_other_field is omitted, it will try the face for +# variable_other and then variable +# +# To see a list of available scopes in the debug buffer, run lsp-semantic-available-scopes +variable="variable" +entity_name_function="function" +entity_name_type="type" +variable_other_enummember="variable" +entity_name_namespace="module" + +[server] +# exit session if no requests were received during given period in seconds +# works only in unix sockets mode (-s/--session) +# set to 0 to disable +timeout = 1800 # seconds = 30 minutes + +[language.nix] +filetypes = ["nix"] +roots = [".git"] +command = "/home/leon/coding/projects/rnix-lsp/target/debug/rnix-lsp" +args = [] + +[language.tsx] +filetypes = ["typescript", "typescript-tsx"] +roots = ["package.json", "tsconfig.json"] +command = "npx" +args = ["typescript-language-server", "--stdio"] + +[language.rust] +filetypes = ["rust"] +roots = ["Cargo.toml"] +command = "rust-analyzer" + +[language.crystal] +filetypes = ["crystal"] +roots = ["shard.yml"] +command = "scry" + +[language.javascript] +filetypes = ["javascript"] +roots = [".flowconfig"] +command = "flow" +args = ["lsp"] + +[language.json] +filetypes = ["json"] +roots = ["package.json"] +command = "json-languageserver" +args = ["--stdio"] + +[language.css] +filetypes = ["css"] +roots = ["package.json"] +command = "css-languageserver" +args = ["--stdio"] + +[language.html] +filetypes = ["html"] +roots = ["package.json"] +command = "html-languageserver" +args = ["--stdio"] + +[language.ocaml] +filetypes = ["ocaml"] +roots = ["Makefile", "opam", "*.opam", "dune"] +command = "ocaml-language-server" +args = ["--stdio"] + +[language.reason] +filetypes = ["reason"] +roots = ["package.json", "Makefile", ".git", ".hg"] +command = "ocaml-language-server" +args = ["--stdio"] + +[language.ruby] +filetypes = ["ruby"] +roots = ["Gemfile"] +command = "solargraph" +args = ["stdio"] + +[language.python] +filetypes = ["python"] +roots = ["requirements.txt", "setup.py", ".git", ".hg"] +command = "pyls" +offset_encoding = "utf-8" + +[language.c_cpp] +filetypes = ["c", "cpp"] +roots = ["compile_commands.json", ".clangd"] +command = "clangd" +snippet_support = true +verbosity = 2 + +[language.haskell] +filetypes = ["haskell"] +roots = ["Setup.hs", "stack.yaml", "*.cabal"] +command = "hie" +args = ["--lsp"] + +[language.go] +filetypes = ["go"] +roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] +command = "gopls" +offset_encoding = "utf-8" + +[language.bash] +filetypes = ["sh"] +roots = [".git", ".hg"] +command = "bash-language-server" +args = ["start"] + +[language.dart] +# start shell to find path to dart analysis server source +filetypes = ["dart"] +roots = ["pubspec.yaml", ".git"] +command = "sh" +args = ["-c", "dart $(dirname $(which dart))/snapshots/analysis_server.dart.snapshot --lsp"] + +[language.d] +filetypes = ["d", "di"] +roots = [".git", "dub.sdl", "dub.json"] +command = "dls" + +[language.php] +filetypes = ["php"] +roots = [".htaccess", "composer.json"] +command = "intelephense" +args = ["--stdio"] + +[language.php.initialization_options] +storagePath = "/tmp/intelephense" + +[language.nim] +filetypes = ["nim"] +roots = ["*.nimble", ".git"] +command = "nimlsp" + +[language.elm] +filetypes = ["elm"] +roots = ["elm.json"] +command = "elm-language-server" +args = ["--stdio"] + +[language.elm.initialization_options] +runtime = "node" +elmPath = "elm" +elmFormatPath = "elm-format" +elmTestPath = "elm-test" + +[language.latex] +filetypes = ["latex"] +roots = [".git"] +command = "texlab" diff --git a/files/.config/kak/kakrc b/files/.config/kak/kakrc new file mode 100644 index 0000000..b41598c --- /dev/null +++ b/files/.config/kak/kakrc @@ -0,0 +1,99 @@ +source "%val{config}/plugins/plug.kak/rc/plug.kak" + +plug "h-youhei/kakoune-surround" + +plug "andreyorst/fzf.kak" config %{ + map global user -docstring 'fzf' f ': fzf-mode' +} defer fzf %{ + set-option global fzf_grep_command rg + set-option global fzf_file_command rg +} + +plug "ul/kak-lsp" do %{ + cargo install --locked --force --path . +} config %{ + hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp) %{ + lsp-enable-window + # lsp-auto-hover-enable + lsp-auto-hover-insert-mode-disable + set-option window lsp_hover_anchor true + set-face window DiagnosticError default+u + set-face window DiagnosticWarning default+u + set global lsp_hover_anchor true + } + hook global WinSetOption filetype=rust %{ + # hook window -group rust-inlay-hints BufReload .* rust-analyzer-inlay-hints + # hook window -group rust-inlay-hints NormalIdle .* rust-analyzer-inlay-hints + # hook window -group rust-inlay-hints InsertIdle .* rust-analyzer-inlay-hints + + # hook -once -always window WinSetOption filetype=.* %{ + # remove-hooks window rust-inlay-hints + # } + # + hook window -group semantic-tokens BufReload .* lsp-semantic-tokens + hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens + hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens + hook -once -always window WinSetOption filetype=.* %{ + remove-hooks window semantic-tokens + } + + lsp-inlay-diagnostics-enable global + } +} + + +plug 'delapouite/kakoune-buffers' %{ + map global normal ^ q + map global normal Q + map global normal q b + map global normal Q B + map global normal + map global normal + map global user b ': enter-buffers-mode' -docstring 'buffers' + map global normal B ': enter-user-mode -lock buffers' -docstring 'buffers (lock)' +} + + +map global user m ':enter-user-mode lsp' -docstring 'code stuff' +map global lsp g ':lsp-definition' -docstring 'go to definition' +map global lsp d ':lsp-hover' -docstring 'lsp hover' +map global lsp n ':lsp-rename-prompt' -docstring 'rename symbol' +map global lsp m ':lsp-find-error --next' -docstring 'next error' + +map global normal , '' +map global normal ':enter-user-mode user' + +map global insert '' +map global insert '' +map global insert 'bc' + +declare-user-mode surround +map global surround s ':surround' -docstring 'surround' +map global surround c ':change-surround' -docstring 'change' +map global surround d ':delete-surround' -docstring 'delete' +map global surround t ':select-surrounding-tag' -docstring 'select tag' +map global user s ':enter-user-mode surround' -docstring 'surround mode' + +# map global user b ':buffer ' -docstring 'switch buffer' +map global normal ':fzf-mode' + +declare-user-mode commenting +map global user c ':enter-user-mode commenting' -docstring 'comment' +map global commenting ':comment-line' -docstring 'comment block' + + + +map global user y 'xsel -i -b' -docstring 'yank to system clipboard' +map global user P '!xsel --output --clipboard' -docstring 'paste before from system clipboard' +map global user p 'xsel --output --clipboard' -docstring 'paste after from system clipboard' + +colorscheme gruvbox + +add-highlighter global/ show-matching + + + # fancy rust :; shit +hook global InsertChar ";" %{ try %{ + exec -draft hH ":;" d + exec "::" +}} diff --git a/files/.config/kak/plugins/fzf.kak b/files/.config/kak/plugins/fzf.kak new file mode 160000 index 0000000..b2aeb26 --- /dev/null +++ b/files/.config/kak/plugins/fzf.kak @@ -0,0 +1 @@ +Subproject commit b2aeb26473962ab0bf3b51ba5c81c50c1d8253d3 diff --git a/files/.config/kak/plugins/kak-lsp b/files/.config/kak/plugins/kak-lsp new file mode 160000 index 0000000..3f9a34a --- /dev/null +++ b/files/.config/kak/plugins/kak-lsp @@ -0,0 +1 @@ +Subproject commit 3f9a34a418ae777f9f315dbbaa0f0eb58b4b6f37 diff --git a/files/.config/kak/plugins/kakoune-buffers b/files/.config/kak/plugins/kakoune-buffers new file mode 160000 index 0000000..67959fb --- /dev/null +++ b/files/.config/kak/plugins/kakoune-buffers @@ -0,0 +1 @@ +Subproject commit 67959fbad727ba8470fe8cd6361169560f4fb532 diff --git a/files/.config/kak/plugins/kakoune-rainbow b/files/.config/kak/plugins/kakoune-rainbow new file mode 160000 index 0000000..cce1b41 --- /dev/null +++ b/files/.config/kak/plugins/kakoune-rainbow @@ -0,0 +1 @@ +Subproject commit cce1b411f52dd146a83611f2b1335e0781637a3e diff --git a/files/.config/kak/plugins/kakoune-surround b/files/.config/kak/plugins/kakoune-surround new file mode 160000 index 0000000..efe74c6 --- /dev/null +++ b/files/.config/kak/plugins/kakoune-surround @@ -0,0 +1 @@ +Subproject commit efe74c6f434d1e30eff70d4b0d737f55bf6c5022 diff --git a/files/.config/kak/plugins/plug.kak b/files/.config/kak/plugins/plug.kak new file mode 160000 index 0000000..8a9dba5 --- /dev/null +++ b/files/.config/kak/plugins/plug.kak @@ -0,0 +1 @@ +Subproject commit 8a9dba51a3ca32e27526538e75ec7e4e3b09c94a diff --git a/files/.config/nvim/lua/init.lua b/files/.config/nvim/lua/init.lua new file mode 100644 index 0000000..5326368 --- /dev/null +++ b/files/.config/nvim/lua/init.lua @@ -0,0 +1,58 @@ +local _0_0 = nil +do + local name_0_ = "init" + 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("aniseed.fennel"), require("keybinds"), require("aniseed.nvim"), require("utils")} + 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", fennel = "aniseed.fennel", kb = "keybinds", 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 fennel = _local_0_[2] +local kb = _local_0_[3] +local nvim = _local_0_[4] +local utils = _local_0_[5] +local _2amodule_2a = _0_0 +local _2amodule_name_2a = "init" +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)) +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 .. ")") + 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 = _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 diff --git a/files/.config/nvim/lua/keybinds.lua b/files/.config/nvim/lua/keybinds.lua new file mode 100644 index 0000000..f385748 --- /dev/null +++ b/files/.config/nvim/lua/keybinds.lua @@ -0,0 +1,51 @@ +local _0_0 = nil +do + local name_0_ = "keybinds" + 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("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-macros"] = {macros = true}, require = {a = "aniseed.core", 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 fennel = _local_0_[2] +local nvim = _local_0_[3] +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('')") +local function le(s) + return (":call luaeval(\"" .. s .. "\")") +end +nvim.g.which_key_map = {} +nvim.command("call which_key#register('', \"g:which_key_map\")") +nvim.g.which_key_map = {[":"] = {":Commands", "Search command with fzf"}, ["["] = {"(YoinkPostPasteSwapBack)", "Swap last paste backwards"}, ["]"] = {"(YoinkPostPasteSwapForward)", "Swap last paste backwards"}, b = {b = {":Buffers", "select open buffer"}, c = {":bdelete!", "close open buffer"}, name = "+buffers", w = {":bwipeout!", "wipeout open buffer"}}, c = {name = "+comment_out"}, e = {name = "+emmet"}, f = {j = {"zj", "jump to next fold"}, k = {"zk", "jump to previous fold"}, n = {":foldclose", "close fold"}, name = "+folds", o = {":foldopen", "open fold"}}, h = {":bprevious", "previous buffer"}, l = {":bnext", "next buffer"}, m = {A = {":Lspsaga show_line_diagnostics", "Line diagnostics"}, E = {":Telescope lsp_workspace_diagnostics", "List diagnostics"}, a = {":Lspsaga show_cursor_diagnostics", "Cursor diagnostics"}, b = {":Lspsaga lsp_finder", "find stuff"}, d = {":Lspsaga hover_doc", "show documentation"}, e = {le("vim.lsp.diagnostic.goto_next()"), "Jump to the next error"}, f = {le("vim.lsp.buf.formatting()"), "format file"}, g = {le("vim.lsp.buf.definition()"), "go to definition"}, i = {le("vim.lsp.buf.implementation()"), "show implementation"}, n = {":Lspsaga rename", "rename"}, name = "+Code-actions", o = {":Telescope lsp_document_symbols", "symbols in document"}, r = {":Telescope lsp_references", "show references"}, s = {":Telescope lsp_workspace_symbols", "symbols in workspace"}, t = {":Lspsaga signature_help", "Show signature help"}, v = {":Lspsaga code_action", "apply codeaction"}, x = {":Lspsaga preview_definition", "Preview definition"}}, o = {":Telescope live_grep", "Grep files"}, p = {":Telescope file_browser", "Open file-browser"}, s = "which_key_ignore", v = {g = {":Goyo | set linebreak", "toggle focus mode"}, i = {":IndentGuidesToggle", "toggle indent guides"}, m = {":set nonumber! norelativenumber", "toggle numbers"}, n = {":set relativenumber!", "toggle relative numbers"}, name = "+view-and-layout"}, z = {c = {"foldclose", "close fold"}, name = "+folds", o = {"foldopen", "open fold"}}} +nvim.o.timeoutlen = 200 +return nvim.command("autocmd! VimEnter * :unmap ig\n autocmd! FileType which_key") \ No newline at end of file diff --git a/files/.config/nvim/lua/plugins/galaxyline.lua b/files/.config/nvim/lua/plugins/galaxyline.lua new file mode 100644 index 0000000..b129e14 --- /dev/null +++ b/files/.config/nvim/lua/plugins/galaxyline.lua @@ -0,0 +1,127 @@ +local _0_0 = nil +do + local name_0_ = "plugins.galaxyline" + 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("aniseed.fennel"), require("galaxyline"), require("galaxyline.condition"), require("galaxyline.provider_diagnostic"), require("galaxyline.provider_fileinfo"), require("galaxyline.provider_vcs"), require("aniseed.nvim"), require("utils")} + end + ok_3f_0_, val_0_ = pcall(_1_) + if ok_3f_0_ then + _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {["gl-condition"] = "galaxyline.condition", ["gl-diagnostic"] = "galaxyline.provider_diagnostic", ["gl-fileinfo"] = "galaxyline.provider_fileinfo", ["gl-vcs"] = "galaxyline.provider_vcs", a = "aniseed.core", fennel = "aniseed.fennel", galaxyline = "galaxyline", 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 fennel = _local_0_[2] +local galaxyline = _local_0_[3] +local gl_condition = _local_0_[4] +local gl_diagnostic = _local_0_[5] +local gl_fileinfo = _local_0_[6] +local gl_vcs = _local_0_[7] +local nvim = _local_0_[8] +local utils = _local_0_[9] +local _2amodule_2a = _0_0 +local _2amodule_name_2a = "plugins.galaxyline" +do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end +local colors = utils.colors() +local modes = {R = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "REPLACE"}, Rv = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "VIRTUAL"}, S = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "SELECT"}, V = {colors = {bg = colors.neutral_blue, fg = colors.dark0}, text = "VISUAL LINE"}, ["\22"] = {colors = {bg = colors.neutral_blue, fg = colors.dark0}, text = "VISUAL BLOCK"}, ["r?"] = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "CONFIRM"}, c = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "CMD"}, ce = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "NORMEX"}, cv = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "EX"}, i = {colors = {bg = colors.neutral_yellow, fg = colors.dark0}, text = "INSERT"}, ic = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "INSCOMP"}, n = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "NORMAL"}, no = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "OP-PENDING"}, r = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "HIT-ENTER"}, s = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "SELECT"}, t = {colors = {bg = colors.neutral_aqua, fg = colors.dark0}, text = "TERM"}, v = {colors = {bg = colors.neutral_blue, fg = colors.dark0}, text = "VISUAL"}} +local function buf_empty_3f() + return (1 == nvim.fn.empty(nvim.fn.expand("%:t"))) +end +local function get_current_file_name() + local file = nvim.fn.expand("%:t") + if (1 == nvim.fn.empty(file)) then + return "" + elseif nvim.bo.readonly then + return ("RO " .. file) + elseif (nvim.bo.modifiable and nvim.bo.modified) then + return (file .. " \239\129\128") + else + return file + end +end +local function get_mode_data() + return (modes[nvim.fn.mode()] or {colors = {bg = colors.neutral_orange, fg = colors.dark0}, text = nvim.fn.mode()}) +end +local function vim_mode_provider() + local modedata = get_mode_data() + utils.highlight("GalaxyViMode", modedata.colors) + return (" " .. modedata.text .. " ") +end +utils.highlight("StatusLine", {bg = colors.dark1, fg = colors.light0}) +galaxyline.short_line_list = {"dbui", "diff", "peekaboo", "undotree", "vista", "vista_markdown"} +local function _2_() + return "" +end +galaxyline.section.left = {{ViMode = {provider = vim_mode_provider}}, {FileName = {highlight = {colors.light4, colors.dark1}, provider = get_current_file_name}}, {Space = {highlight = {colors.light0, colors.dark1}, provider = _2_}}} +local function make_lsp_diagnostic_provider(kind) + local function _3_() + local n = vim.lsp.diagnostic.get_count(0, kind) + if (n == 0) then + return "" + else + return (" " .. n .. " ") + end + end + return _3_ +end +local function git_branch_provider() + local branch = gl_vcs.get_git_branch() + if ("master" == branch) then + return "" + else + return branch + end +end +local function _3_() + return nvim.bo.filetype +end +local function _4_() + return (" " .. gl_fileinfo.line_column() .. " ") +end +galaxyline.section.right = {{GitBranch = {highlight = {colors.light4, colors.dark1}, provider = git_branch_provider}}, {FileType = {highlight = {colors.neutral_aqua, colors.dark1}, provider = _3_}}, {DiagnosticInfo = {highlight = {colors.dark1, colors.neutral_blue}, provider = make_lsp_diagnostic_provider("Info")}}, {DiagnosticWarn = {highlight = {colors.dark1, colors.neutral_yellow}, provider = make_lsp_diagnostic_provider("Warning"), separator = ""}}, {DiagnosticError = {highlight = {colors.dark1, colors.bright_red}, provider = make_lsp_diagnostic_provider("Error"), separator = ""}}, {LineInfo = {highlight = "GalaxyViMode", provider = _4_, separator = ""}}} +local function add_segment_defaults(data) + return a.merge({highlight = {colors.light0, colors.dark1}, separator = " ", separator_highlight = "StatusLine"}, data) +end +local function map_gl_section(f, section) + local tbl_0_ = {} + for _, elem in ipairs(section) do + local _5_ + do + local tbl_0_0 = {} + for k, v in pairs(elem) do + local _6_0, _7_0 = k, f(v) + if ((nil ~= _6_0) and (nil ~= _7_0)) then + local k_0_ = _6_0 + local v_0_ = _7_0 + tbl_0_0[k_0_] = v_0_ + end + end + _5_ = tbl_0_0 + end + tbl_0_[(#tbl_0_ + 1)] = _5_ + end + return tbl_0_ +end +galaxyline.section.left = map_gl_section(add_segment_defaults, galaxyline.section.left) +galaxyline.section.right = map_gl_section(add_segment_defaults, galaxyline.section.right) +return nil \ No newline at end of file diff --git a/files/.config/nvim/lua/plugins/lsp.lua b/files/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..033d1e3 --- /dev/null +++ b/files/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,93 @@ +local _0_0 = nil +do + local name_0_ = "plugins.lsp" + 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("compe"), require("aniseed.fennel"), require("lspconfig"), require("lspconfig.configs"), require("aniseed.nvim"), require("lspsaga"), require("utils")} + end + ok_3f_0_, val_0_ = pcall(_1_) + if ok_3f_0_ then + _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {["lsp-configs"] = "lspconfig.configs", a = "aniseed.core", compe = "compe", fennel = "aniseed.fennel", lsp = "lspconfig", nvim = "aniseed.nvim", saga = "lspsaga", utils = "utils"}} + return val_0_ + else + return print(val_0_) + end +end +local _local_0_ = _1_(...) +local a = _local_0_[1] +local compe = _local_0_[2] +local fennel = _local_0_[3] +local lsp = _local_0_[4] +local lsp_configs = _local_0_[5] +local nvim = _local_0_[6] +local saga = _local_0_[7] +local utils = _local_0_[8] +local _2amodule_2a = _0_0 +local _2amodule_name_2a = "plugins.lsp" +do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end +local function on_attach(client, bufnr) + if client.resolved_capabilities.document_highlight 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) + end +end +local function better_root_pattern(patterns, except_patterns) + local function _2_(path) + if not lsp.util.root_pattern(except_patterns)(path) then + return lsp.util.root_pattern(patterns)(path) + end + end + return _2_ +end +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 + return lsp[lsp_name].setup(merged_opts) +end +init_lsp("rust_analyzer", {capabilities = capabilities}) +init_lsp("tsserver", {root_dir = lsp.util.root_pattern("package.json")}) +local function _2_() + return vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0}) +end +init_lsp("jsonls", {commands = {Format = {_2_}}}) +init_lsp("denols", {root_dir = better_root_pattern({".git"}, {"package.json"})}) +init_lsp("hls", {settings = {languageServerHaskell = {formattingProvider = "stylish-haskell"}}}) +init_lsp("vimls") +init_lsp("bashls") +init_lsp("erlangls") +init_lsp("yamlls") +init_lsp("html") +init_lsp("cssls") +compe.setup({autocomplete = false, debug = false, documentation = true, enabled = true, incomplete_delay = 400, max_abbr_width = 100, max_kind_width = 100, max_menu_width = 100, min_length = 1, preselect = "enable", source = {buffer = true, calc = true, nvim_lsp = true, nvim_lua = true, path = true, vsnip = false}, source_timeout = 200, throttle_time = 80}) +saga.init_lsp_saga({border_style = 1, code_action_keys = {exec = "", quit = ""}, finder_action_keys = {open = "", quit = "", scroll_down = "", scroll_up = "", split = "b", vsplit = "v"}, rename_action_keys = {exec = "", quit = ""}}) +utils.highlight("LspSagaCodeActionTitle", {fg = "#8ec07c"}) +utils.highlight("LspSagaBorderTitle", {fg = "#8ec07c"}) +utils.highlight("LspSagaCodeActionContent", {fg = "#8ec07c"}) +utils.highlight("LspSagaFinderSelection", {fg = "#8ec07c"}) +utils.highlight("LspSagaDiagnosticHeader", {fg = "#8ec07c"}) +utils.highlight("TargetWord", {fg = "#8ec07c"}) +nvim.o.signcolumn = "yes" +return nil \ No newline at end of file diff --git a/files/.config/nvim/lua/plugins/telescope.lua b/files/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..0d1ea9a --- /dev/null +++ b/files/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,44 @@ +local _0_0 = nil +do + local name_0_ = "plugins.telescope" + 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("telescope.actions"), require("aniseed.fennel"), require("aniseed.nvim"), require("telescope"), require("utils")} + end + ok_3f_0_, val_0_ = pcall(_1_) + if ok_3f_0_ then + _0_0["aniseed/local-fns"] = {require = {a = "aniseed.core", actions = "telescope.actions", fennel = "aniseed.fennel", nvim = "aniseed.nvim", telescope = "telescope", utils = "utils"}} + return val_0_ + else + return print(val_0_) + end +end +local _local_0_ = _1_(...) +local a = _local_0_[1] +local actions = _local_0_[2] +local fennel = _local_0_[3] +local nvim = _local_0_[4] +local telescope = _local_0_[5] +local utils = _local_0_[6] +local _2amodule_2a = _0_0 +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 diff --git a/files/.config/nvim/lua/utils.lua b/files/.config/nvim/lua/utils.lua new file mode 100644 index 0000000..67b2660 --- /dev/null +++ b/files/.config/nvim/lua/utils.lua @@ -0,0 +1,123 @@ +local _0_0 = nil +do + local name_0_ = "utils" + 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("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"}} + return val_0_ + else + return print(val_0_) + end +end +local _local_0_ = _1_(...) +local a = _local_0_[1] +local nvim = _local_0_[2] +local _2amodule_2a = _0_0 +local _2amodule_name_2a = "utils" +do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end +local noremap = 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}) + end + v_0_0 = noremap0 + _0_0["noremap"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["noremap"] = v_0_ + noremap = v_0_ +end +local mapexpr = 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}) + end + v_0_0 = mapexpr0 + _0_0["mapexpr"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["mapexpr"] = v_0_ + mapexpr = v_0_ +end +local colors = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function colors0() + return {bright_aqua = "#8ec07c", bright_blue = "#83a598", bright_green = "#b8bb26", bright_orange = "#fe8019", bright_purple = "#d3869b", bright_red = "#fb4934", bright_yellow = "#fabd2f", dark0 = "#282828", dark0_hard = "#1d2021", dark0_soft = "#32302f", dark1 = "#3c3836", dark2 = "#504945", dark3 = "#665c54", dark4 = "#7c6f64", faded_aqua = "#427b58", faded_blue = "#076678", faded_green = "#79740e", faded_orange = "#af3a03", faded_purple = "#8f3f71", faded_red = "#9d0006", faded_yellow = "#b57614", gray = "#928374", light0 = "#fbf1c7", light0_hard = "#f9f5d7", light0_soft = "#f2e5bc", light1 = "#ebdbb2", light2 = "#d5c4a1", light3 = "#bdae93", light4 = "#a89984", neutral_aqua = "#689d6a", neutral_blue = "#458588", neutral_green = "#98971a", neutral_orange = "#d65d0e", neutral_purple = "#b16286", neutral_red = "#cc241d", neutral_yellow = "#d79921"} + end + v_0_0 = colors0 + _0_0["colors"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["colors"] = v_0_ + colors = v_0_ +end +local highlight = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function highlight0(group, colset) + local default = {bg = "NONE", fg = "NONE", gui = "NONE"} + local opts = a.merge(default, colset) + return nvim.command(("hi! " .. group .. " guifg='" .. opts.fg .. "' guibg='" .. opts.bg .. "' gui='" .. opts.gui .. "'")) + end + v_0_0 = highlight0 + _0_0["highlight"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["highlight"] = v_0_ + highlight = v_0_ +end +local comp = nil +do + local v_0_ = nil + do + local v_0_0 = nil + local function comp0(f, g) + local function _2_(...) + return f(g(...)) + end + return _2_ + end + v_0_0 = comp0 + _0_0["comp"] = v_0_0 + v_0_ = v_0_0 + end + local t_0_ = (_0_0)["aniseed/locals"] + t_0_["comp"] = v_0_ + comp = v_0_ +end +return nil \ No newline at end of file diff --git a/files/elkowars_gruvbox.vim b/files/elkowars_gruvbox.vim new file mode 100644 index 0000000..fd0404d --- /dev/null +++ b/files/elkowars_gruvbox.vim @@ -0,0 +1,58 @@ +" symlink this to ~/.vim/plugged/vim-airline-themes/autoload/airline/themes/elkowars_gruvbox.vim +let g:airline#themes#elkowars_gruvbox#palette = {} + +let s:gui_bg0 = "#1d2021" +let s:gui_bg1 = "#282828" +let s:gui_bg2 = "#3c3836" +let s:gui_bg3 = "#504945" +let s:gui_bg4 = "#665c54" +let s:gui_fg1 = "#ebdbb2" +let s:gui_fg2 = "#fbf1c7" +let s:gui_red = "#fb4934" +let s:gui_orange = "#fe8019" +let s:gui_yellow = "#fabd2f" +let s:gui_green = "#b8bb26" +let s:gui_cyan = "#689d6a" +let s:gui_blue = "#83a598" +let s:gui_pink = "#d3869b" +let s:gui_orange2 = "#d65d0e" + +let s:cterm_bg1 = 234 +let s:cterm_bg2 = 235 +let s:cterm_bg3 = 236 +let s:cterm_bg4 = 240 +let s:cterm_fg1 = 223 +let s:cterm_fg2 = 230 +let s:cterm_red = 203 +let s:cterm_orange = 208 +let s:cterm_yellow = 214 +let s:cterm_green = 142 +let s:cterm_cyan = 108 +let s:cterm_blue = 108 +let s:cterm_pink = 175 +let s:cterm_orange2 = 166 + + + +let s:N1 = [ s:gui_bg2, s:gui_cyan, s:cterm_bg1, s:cterm_cyan ] +let s:N2 = [ s:gui_fg1, s:gui_bg3, s:cterm_fg1, s:cterm_bg3 ] +let s:N3 = [ s:gui_cyan, s:gui_bg2, s:cterm_orange, s:cterm_bg2 ] +" ^ is for background in statusline +let s:I1 = [ s:gui_bg2, s:gui_yellow, s:cterm_bg2, s:cterm_yellow ] +let s:V1 = [ s:gui_bg2, s:gui_orange2, s:cterm_bg2, s:cterm_orange ] +let s:R1 = [ s:gui_bg2, s:gui_green, s:cterm_bg2, s:cterm_green ] + +"let s:N1 = [ s:gui_cyan, s:gui_bg1, s:cterm_bg1, s:cterm_cyan ] +"let s:N2 = [ s:gui_fg1, s:gui_bg3, s:cterm_fg1, s:cterm_bg3 ] +"let s:N3 = [ s:gui_cyan, s:gui_bg1, s:cterm_orange, s:cterm_bg2 ] +"" ^ is for background in statusline +"let s:I1 = [ s:gui_yellow, s:gui_bg1, s:cterm_bg2, s:cterm_yellow ] +"let s:V1 = [ s:gui_orange2, s:gui_bg1, s:cterm_bg2, s:cterm_orange ] +"let s:R1 = [ s:gui_bg2, s:gui_green, s:cterm_bg2, s:cterm_green ] + +let g:airline#themes#elkowars_gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#elkowars_gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:N3) +let g:airline#themes#elkowars_gruvbox#palette.replace = airline#themes#generate_color_map(s:R1, s:N2, s:N3) +let g:airline#themes#elkowars_gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:N3) +let g:airline#themes#elkowars_gruvbox#palette.inactive = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +