all repos

init.lua @ dbfee5674d3f47106ebbdac08d8a8a76bc2d14f9

my nvim config
27 files changed, 1370 insertions(+), 0 deletions(-)
Init
Author: neoteny ss2316544@gmail.com
Committed at: 2021-10-25 15:04:43 +0300
A .gitignore

@@ -0,0 +1,1 @@

+./plugin/
A Makefile

@@ -0,0 +1,5 @@

+fmt: + @stylua {lua,init.lua} + +lint: + @selene {lua,init.lua}
A ftplugin/go.lua

@@ -0,0 +1,6 @@

+ local ok, dapi = pcall(require, "dap-install") + if not ok then + return + end + +dapi.config("go_delve", {})
A ftplugin/javascript.lua

@@ -0,0 +1,7 @@

+ + local ok, dapi = pcall(require, "dap-install") + if not ok then + return + end + +dapi.config("jsnode", {})
A ftplugin/lua.lua

@@ -0,0 +1,6 @@

+ local ok, dapi = pcall(require, "dap-install") + if not ok then + return + end + +dapi.config("lua", {})
A init.lua

@@ -0,0 +1,5 @@

+require "options" +require "plugin" +require "keymapings" + +vim.cmd [[colo onedarker]]
A lua/keymapings.lua

@@ -0,0 +1,74 @@

+local u = require "utils" +local nmap, map, expr = u.nmap, u.map, u.expr +-- map("i", "jk", "<ESC>") +nmap("<C-s>", "<cmd>write!<cr>") +nmap("<leader>h", "<cmd>nohlsearch<cr>") +nmap("<leader>q", "<cmd>quit!<cr>") +nmap("<leader>w", "<cmd>write!<cr>") +nmap("<leader>e", "<cmd>NvimTreeToggle<cr>") +nmap("<leader>/", "<cmd>lua require[[Comment]].toggle()<cr>") +map("v", "<leader>/", "gc") +nmap("<leader>ps", "<cmd>PackerSync<cr>") + +-- Windows +for _, k in ipairs { "h", "j", "k", "l" } do + nmap(string.format("<C-%s>", k), string.format("<cmd>wincmd %s<cr>", k)) + map("t", string.format("<C-%s>", k), string.format("<C-\\><C-N><C-w>%s", k)) +end + +nmap("<C-Left>", "<cmd>vertical resize -2<cr>") +nmap("<C-Up", "<cmd>resize -1<cr>") +nmap("<C-Down>", "<cmd>resize +2<cr>") +nmap("<C-Right>", "<cmd>vertical resize +2<CR>") + +-- Alternative up/down for arows +expr("i", "<C-j>", 'pumvisible() ? "\\<down>" : "\\<C-j>"') +expr("i", "<C-k>", 'pumvisible() ? "\\<up>" : "\\<C-k>"') +expr("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"') +expr("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"') + +-- Move line +map("i", "<A-j>", "<Esc>:m .+1<CR>==gi") +map("i", "<A-k>", "<Esc>:m .-2<CR>==gi") +map("v", "K", ":move '<-2<CR>gv-gv") +map("v", "J", ":move '>+1<CR>gv-gv") +nmap("<A-j>", ":m .+1<CR>==") +nmap("<A-k>", ":m .-2<CR>==") + +-- Telescope +nmap("<leader>f", "<cmd>Telescope find_files<cr>") +nmap("<leader>st", "<cmd>Telescope live_grep<cr>") +nmap("<leader>sp", "<cmd>Telescope projects<cr>") +nmap("<leader>sr", "<cmd>Telescope oldfiles<cr>") +nmap("<leader>sb", "<cmd>Telescope git_branches<cr>") + +-- Ultest +nmap("<leader>tt", "<cmd>Ultest<cr>") +nmap("<leader>ts", "<cmd>UltestStop<cr>") +nmap("<leader>tc", "<cmd>UltestClear<cr>") +nmap("<leader>tn", "<cmd>UltestNearest<cr>") +nmap("<leader>to", "<cmd>UltestOutput<cr>") +nmap("<leader>tj", "<Plug>(ultest-next-fail)") +nmap("<leader>tk", "<Plug>(ultest-prev-fail)") + +-- DAP +nmap("<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>") +nmap("<leader>db", "<cmd>lua require'dap'.step_back()<cr>") +nmap("<leader>dc", "<cmd>lua require'dap'.continue()<cr>") +nmap("<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>") +nmap("<leader>dg", "<cmd>lua require'dap'.session()<cr>") +nmap("<leader>di", "<cmd>lua require'dap'.step_into()<cr>") +nmap("<leader>do", "<cmd>lua require'dap'.step_over()<cr>") +nmap("<leader>du", "<cmd>lua require'dap'.setp_out()<cr>") +nmap("<leader>dp", "<cmd>lua require'dap'.pause.toggle()<cr>") +nmap("<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>") +nmap("<leader>dc", "<cmd>lua require'dap'.continue()<cr>") +nmap("<leader>dq", "<cmd>lua require'dap'.close()<cr>") + +-- Buffer +nmap("<A-0>", "<cmd>BufferLast<cr>") +nmap("<C-w>", "<cmd>BufferClose<cr>") +nmap("<leader>c", "<cmd>BufferClose!<cr>") +for i = 1, 9 do + nmap(string.format("<A-%d>", i), string.format("<cmd>BufferGoto %d<cr>", i)) +end
A lua/options.lua

@@ -0,0 +1,47 @@

+local o = vim.opt + +vim.g.mapleader = " " +vim.g.netrw_banner = false + +-- o.laststatus = 0 +o.backup = false +o.clipboard = "unnamedplus" +o.cmdheight = 1 +o.colorcolumn = "99999" +o.completeopt = { "menuone", "noselect" } +o.conceallevel = 0 +o.fileencoding = "utf-8" +o.foldmethod = "manual" +o.foldexpr = "" +o.guifont = "monospace:h17" +o.hidden = true +o.hlsearch = true +o.ignorecase = true +o.mouse = "a" +o.pumheight = 10 +o.showmode = false +o.showtabline = 2 +o.smartcase = true +o.smartindent = true +o.splitbelow = true +o.splitright = true +o.swapfile = false +o.termguicolors = true +-- o.timeoutlen = 100 +o.title = true +o.undofile = true +o.updatetime = 300 +o.writebackup = false +o.expandtab = true +o.shiftwidth = 2 +o.tabstop = 2 +o.cursorline = true +o.number = true +o.relativenumber = true +o.numberwidth = 4 +o.signcolumn = "yes" +o.wrap = false +o.spell = false +o.spelllang = "en" +o.scrolloff = 8 +o.sidescrolloff = 8
A lua/plugin/configs/cmp.lua

@@ -0,0 +1,78 @@

+local M = {} + +function M.setup() + local cmp = require "cmp" + + cmp.setup { + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + formatting = { + format = function(entry, vim_item) + vim_item.menu = ({ + nvim_lsp = "(LSP)", + nvim_lua = "(Lua)", + buffer = "(Buffer)", + path = "(Path)", + luasnip = "(Snippet)", + tabnine = "(Tabnine)", + })[entry.source.name] + + return vim_item + end, + }, + mapping = { + ["<C-j>"] = cmp.mapping.select_next_item(), + ["<C-k>"] = cmp.mapping.select_prev_item(), + ["<C-d>"] = cmp.mapping.scroll_docs(-4), + ["<C-f>"] = cmp.mapping.scroll_docs(4), + ["<C-Space>"] = cmp.mapping.complete(), + ["<C-e>"] = cmp.mapping.close(), + ["<CR>"] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + ["<Tab>"] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "") + else + fallback() + end + end, + ["<S-Tab>"] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "") + else + fallback() + end + end, + }, + sources = { + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "buffer" }, + { name = "tabnine" }, + { name = "luasnip" }, + { name = "path" }, + }, + -- experimental = { + -- native_menu = false, + -- ghost_text = true, + -- }, + } + + require("nvim-autopairs.completion.cmp").setup { + map_cr = true, + map_complete = true, + auto_select = true, + insert = false, + } +end + +return M
A lua/plugin/configs/dap.lua

@@ -0,0 +1,15 @@

+local M = {} + +function M.setup() + require("dap").defaults.fallback.terminal_win_cmd = "50vsplit new" + vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "LspDiagnosticsSignError", linehl = "", numhl = "" }) + vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "LspDiagnosticsSignHint", linehl = "", numhl = "" }) + vim.fn.sign_define("DapStopped", { + text = "", + texthl = "LspDiagnosticsSignInformation", + linehl = "DiagnosticUnderlineInfo", + numhl = "LspDiagnosticsSignInformation", + }) +end + +return M
A lua/plugin/configs/gitsigns.lua

@@ -0,0 +1,53 @@

+local M = {} + +function M.setup() + require("gitsigns").setup { + signs = { + add = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + }, + signcolumn = true, + numhl = false, + linehl = false, + word_diff = false, + keymaps = { + noremap = true, + ["n <leader>gs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>', + ["n <leader>gr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>', + ["n <leader>gR"] = '<cmd>lua require"gitsigns".reset_buffer()<CR>', + ["n <leader>gp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>', + ["n <leader>gl"] = '<cmd>lua require"gitsigns".blame_line(true)<CR>', + ["n <leader>gS"] = '<cmd>lua require"gitsigns".stage_buffer()<CR>', + ["n <leader>gU"] = '<cmd>lua require"gitsigns".reset_buffer_index()<CR>', + }, + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 300, + }, + current_line_blame_formatter_opts = { relative_time = false }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, + max_file_length = 40000, + preview_config = { + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { enable = false }, + } +end + +return M
A lua/plugin/configs/lsp/config.lua

@@ -0,0 +1,42 @@

+local M = {} + +function M.setup() + local on_attach = function(client, bufnr) + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + client.resolved_capabilities.document_formatting = false + client.resolved_capabilities.document_range_formatting = false + + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, "n", ...) + end + + local opts = { noremap = true, silent = true } + buf_set_keymap("K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts) + buf_set_keymap("gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts) + buf_set_keymap("gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts) + buf_set_keymap("gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) + buf_set_keymap("gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) + buf_set_keymap("gs", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts) + buf_set_keymap("gl", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts) + buf_set_keymap("<leader>la", "<cmd>Telescope lsp_code_actions<CR>", opts) + buf_set_keymap("<leader>ld", "<cmd>TroubleToggle<cr>", opts) + buf_set_keymap("<leader>lr", "<cmd>lua vim.lsp.buf.rename()<CR>", opts) + buf_set_keymap("<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts) + buf_set_keymap("<leader>ls", "<cmd>Telescope lsp_document_symbols<CR>", opts) + end + + require("nvim-lsp-installer").on_server_ready(function(server) + local opts = { on_attach = on_attach } + + if server.name == "sumneko_lua" then + opts = vim.tbl_deep_extend("force", opts, require "plugin.configs.lsp.providers.sumneko_lua") + end + + server:setup(opts) + require("lspconfig")["null-ls"].setup {} + + vim.cmd [[ do User LspAttachBuffers ]] + end) +end + +return M
A lua/plugin/configs/lsp/null-ls.lua

@@ -0,0 +1,35 @@

+local M = {} + +function M.setup() + local null_ls = require "null-ls" + + local fmt = null_ls.builtins.formatting + local lint = null_ls.builtins.diagnostics + + null_ls.config { + sources = { + -- Lua + fmt.stylua, + lint.selene, + + -- Golang + fmt.gofumpt, + fmt.goimports, + + -- JavaScirpt + fmt.prettierd, + lint.eslint_d, + + -- Shell + fmt.shfmt, + lint.shellcheck, + + -- Python + fmt.black, + fmt.isort, + lint.flake8, + }, + } +end + +return M
A lua/plugin/configs/lsp/providers/sumneko_lua.lua

@@ -0,0 +1,15 @@

+return { + settings = { + Lua = { + diagnostics = { globals = { "vim" } }, + workspace = { + maxPreload = 100000, + preloadFileSize = 10000, + library = { + [vim.fn.expand "$VIMRUNTIME/lua"] = true, + [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, + }, + }, + }, + }, +}
A lua/plugin/configs/nvimtree.lua

@@ -0,0 +1,41 @@

+local M = {} + +function M.setup() + local tree_cb = require("nvim-tree.config").nvim_tree_callback + + vim.g.nvim_tree_ignore = { ".git", "node_modules", ".cache", ".bin" } + vim.g.nvim_tree_gitignore = 1 + vim.g.nvim_tree_quit_on_open = 0 + vim.g.nvim_tree_hide_dotfiles = 1 + vim.g.nvim_tree_git_hl = 1 + vim.g.nvim_tree_root_folder_modifier = ":t" + + require("nvim-tree").setup { + auto_close = true, + update_cwd = true, + diagnostics = { + enable = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + view = { + width = 30, + side = "left", + auto_resize = false, + mappings = { + custom_only = false, + list = { + { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" }, + { key = "h", cb = tree_cb "close_node" }, + { key = "v", cb = tree_cb "vsplit" }, + }, + }, + }, + } +end + +return M
A lua/plugin/configs/project.lua

@@ -0,0 +1,15 @@

+local M = {} + +function M.setup() + require("project_nvim").setup { + manual_mode = false, + detection_methods = { "lsp", "pattern" }, + patterns = { ".git", ".svn", "Makefile", "package.json", "go.mod" }, + ignore_lsp = {}, + exclude_dirs = {}, + show_hidden = false, + silent_chdir = true, + } +end + +return M
A lua/plugin/configs/statusline.lua

@@ -0,0 +1,242 @@

+local M = {} + +function M.setup() + local colors = { + bg = "#282c34", + fg = "#abb2bf", + yellow = "#e0af68", + cyan = "#56b6c2", + darkblue = "#081633", + green = "#98c379", + orange = "#d19a66", + violet = "#a9a1e1", + magenta = "#c678dd", + blue = "#61afef", + red = "#e86671", + } + + local vi_mode_colors = { + NORMAL = colors.green, + INSERT = colors.red, + VISUAL = colors.magenta, + OP = colors.green, + BLOCK = colors.blue, + REPLACE = colors.violet, + ["V-REPLACE"] = colors.violet, + ENTER = colors.cyan, + MORE = colors.cyan, + SELECT = colors.orange, + COMMAND = colors.green, + SHELL = colors.green, + TERM = colors.green, + NONE = colors.yellow, + } + + local function file_osinfo() + local os = vim.bo.fileformat:upper() + local icon + if os == "UNIX" then + icon = " " + elseif os == "MAC" then + icon = " " + else + icon = " " + end + return icon .. os + end + + local lsp = require "feline.providers.lsp" + local vi_mode_utils = require "feline.providers.vi_mode" + + local lsp_get_diag = function(str) + local count = vim.lsp.diagnostic.get_count(0, str) + return (count > 0) and " " .. count .. " " or "" + end + + local comps = { + vi_mode = { + left = { + provider = function() + return "  " .. vi_mode_utils.get_vim_mode() + end, + hl = function() + local val = { + name = vi_mode_utils.get_mode_highlight_name(), + fg = vi_mode_utils.get_mode_color(), + } + return val + end, + right_sep = " ", + }, + right = { + provider = "▊", + -- provider = "", + hl = function() + local val = { + name = vi_mode_utils.get_mode_highlight_name(), + fg = vi_mode_utils.get_mode_color(), + } + return val + end, + left_sep = " ", + right_sep = " ", + }, + }, + file = { + info = { + provider = "file_info", + file_modified_icon = "", + hl = { fg = colors.blue, style = "bold" }, + }, + encoding = { + provider = "file_encoding", + left_sep = " ", + hl = { fg = colors.violet, style = "bold" }, + }, + type = { provider = "file_type" }, + os = { + provider = file_osinfo, + left_sep = " ", + hl = { + fg = colors.violet, + style = "bold", + }, + }, + position = { + provider = "position", + left_sep = " ", + hl = { + fg = colors.cyan, + style = "bold", + }, + }, + }, + left_end = { + provider = function() + return "" + end, + hl = { fg = colors.bg, bg = colors.blue }, + }, + line_percentage = { + provider = "line_percentage", + left_sep = " ", + hl = { style = "bold" }, + }, + scroll_bar = { + provider = "scroll_bar", + left_sep = " ", + hl = { fg = colors.blue, style = "bold" }, + }, + diagnos = { + err = { + -- provider = 'diagnostic_errors', + provider = function() + return "" .. lsp_get_diag "Error" + end, + enabled = function() + return lsp.diagnostics_exist "Error" + end, + hl = { + fg = colors.red, + }, + }, + warn = { + -- provider = 'diagnostic_warnings', + provider = function() + return "" .. lsp_get_diag "Warning" + end, + enabled = function() + return lsp.diagnostics_exist "Warning" + end, + hl = { + fg = colors.yellow, + }, + }, + info = { + -- provider = 'diagnostic_info', + provider = function() + return "" .. lsp_get_diag "Information" + end, + enabled = function() + return lsp.diagnostics_exist "Information" + end, + hl = { fg = colors.blue }, + }, + hint = { + provider = function() + return "" .. lsp_get_diag "Hint" + end, + enabled = function() + return lsp.diagnostics_exist "Hint" + end, + hl = { fg = colors.cyan }, + }, + }, + lsp = { + name = { + provider = "lsp_client_names", + left_sep = " ", + icon = " ", + hl = { fg = colors.yellow }, + }, + }, + git = { + branch = { + provider = "git_branch", + icon = " ", + left_sep = " ", + hl = { fg = colors.violet, style = "bold" }, + }, + add = { + provider = "git_diff_added", + hl = { fg = colors.green }, + }, + change = { + provider = "git_diff_changed", + hl = { fg = colors.orange }, + }, + remove = { + provider = "git_diff_removed", + hl = { fg = colors.red }, + }, + }, + } + + local components = { active = {}, inactive = {} } + table.insert(components.active, {}) + table.insert(components.active, {}) + table.insert(components.active, {}) + table.insert(components.inactive, {}) + table.insert(components.inactive, {}) + table.insert(components.active[1], comps.vi_mode.left) + table.insert(components.active[1], comps.file.info) + table.insert(components.active[1], comps.git.branch) + table.insert(components.active[1], comps.git.add) + table.insert(components.active[1], comps.git.change) + table.insert(components.active[1], comps.git.remove) + table.insert(components.inactive[1], comps.vi_mode.left) + table.insert(components.inactive[1], comps.file.info) + table.insert(components.active[3], comps.diagnos.err) + table.insert(components.active[3], comps.diagnos.warn) + table.insert(components.active[3], comps.diagnos.hint) + table.insert(components.active[3], comps.diagnos.info) + table.insert(components.active[3], comps.lsp.name) + table.insert(components.active[3], comps.file.os) + table.insert(components.active[3], comps.file.position) + table.insert(components.active[3], comps.line_percentage) + table.insert(components.active[3], comps.scroll_bar) + table.insert(components.active[3], comps.vi_mode.right) + + require("feline").setup { + colors = { bg = colors.bg, fg = colors.fg }, + components = components, + vi_mode_colors = vi_mode_colors, + force_inactive = { + filetypes = { "packer", "NvimTree" }, + buftypes = { "terminal", "NvimTree" }, + bufnames = {}, + }, + } +end + +return M
A lua/plugin/configs/telescope.lua

@@ -0,0 +1,59 @@

+local M = {} + +function M.setup() + local actions = require "telescope.actions" + + require("telescope").setup { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + layout_config = { + width = 0.75, + preview_cutoff = 120, + prompt_position = "top", + horizontal = { mirror = false }, + vertical = { mirror = false }, + }, + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--hidden", + }, + file_ignore_patterns = { ".git", "node_modules", "target", "env", ".bin" }, + path_display = { shorten = 5 }, + winblend = 0, + border = {}, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + set_env = { ["COLORTERM"] = "truecolor" }, + pickers = { + find_files = { find_command = { "fd", "--type=file", "--hidden", "--smart-case" } }, + live_grep = { only_sort_text = true }, + }, + mappings = { + i = { + ["<C-j>"] = actions.move_selection_next, + ["<C-k>"] = actions.move_selection_previous, + }, + n = { + ["<C-j>"] = actions.move_selection_next, + ["<C-k>"] = actions.move_selection_previous, + }, + }, + }, + } + + require("telescope").load_extension "projects" +end + +return M
A lua/plugin/configs/terminal.lua

@@ -0,0 +1,28 @@

+local M = {} + +function M.setup() + require("toggleterm").setup { + size = 20, + open_mapping = [[<c-t>]], + hide_numbers = true, + shade_filetypes = {}, + shade_terminals = true, + shading_factor = 2, + start_in_insert = true, + insert_mappings = true, + persist_size = false, + direction = "float", + close_on_exit = true, + shell = vim.o.shell, + float_opts = { + border = "curved", + winblend = 0, + highlights = { + border = "Normal", + background = "Normal", + }, + }, + } +end + +return M
A lua/plugin/configs/treesitter.lua

@@ -0,0 +1,18 @@

+local M = {} + +function M.setup() + require("nvim-treesitter.configs").setup { + ensure_installed = { "lua" }, + highlight = { enable = true }, + indent = { enable = true, disable = { "python" } }, + -- autotag = { enable = true }, + -- context_commentstring = { enable = true }, + -- rainbow = { + -- enable = false, + -- extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean + -- max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int + -- }, + } +end + +return M
A lua/plugin/configs/ultest.lua

@@ -0,0 +1,7 @@

+local M = {} + +function M.setup() + vim.g["test#go#gotest#optiongs"] = "-v" +end + +return M
A lua/plugin/init.lua

@@ -0,0 +1,177 @@

+return require("packer").startup(function(use) + use "wbthomason/packer.nvim" + use "nvim-lua/plenary.nvim" + use "LunarVim/onedarker.nvim" + use "kyazdani42/nvim-web-devicons" + use "romgrk/barbar.nvim" + use { "tpope/vim-surround", keys = { "c", "y", "d" } } + + use { + "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end, + } + + -- use { + -- "folke/trouble.nvim", + -- cmd = "TroubleToggle", + -- config = function() + -- require("trouble").setup {} + -- end, + -- } + + use { + "neovim/nvim-lspconfig", + requires = { { "williamboman/nvim-lsp-installer", after = "nvim-lspconfig" } }, + config = function() + require("plugin.configs.lsp.config").setup() + end, + } + + use { + "jose-elias-alvarez/null-ls.nvim", + after = "nvim-lspconfig", + config = function() + require("plugin.configs.lsp.null-ls").setup() + end, + } + + use { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup {} + end, + } + + use { + "ahmedkhalf/project.nvim", + config = function() + require("plugin.configs.project").setup() + end, + } + + -- use { + -- "mfussenegger/nvim-dap", + -- requires = { + -- { "Pocco81/DAPInstall.nvim" }, + -- { "theHamsta/nvim-dap-virtual-text", after = "nvim-dap" }, + -- { "jbyuki/one-small-step-for-vimkind", ft = "lua", after = "nvim-dap" }, + -- }, + -- config = function() + -- require("plugin.configs.dap").setup() + -- end, + -- } + + use { + "lewis6991/gitsigns.nvim", + config = function() + require("plugin.configs.gitsigns").setup() + end, + } + + use { + "Famiu/feline.nvim", + config = function() + require("plugin.configs.statusline").setup() + end, + } + + use { + "rcarriga/vim-ultest", + requires = "vim-test/vim-test", + cmd = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, + run = ":UpdateRemotePlugins", + config = function() + require("plugin.configs.ultest").setup() + end, + } + + use { + "folke/lua-dev.nvim", + ft = "lua", + config = function() + require("lua-dev").setup {} + end, + } + + use { + "ray-x/go.nvim", + ft = "go", + config = function() + require("go").setup { gofmt = "gofumpt" } + end, + } + + use { + "folke/todo-comments.nvim", + config = function() + require("todo-comments").setup {} + end, + } + + use { + "hrsh7th/nvim-cmp", + requires = { + { "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" }, + { "hrsh7th/cmp-buffer", after = "nvim-cmp" }, + { "hrsh7th/cmp-path", after = "nvim-cmp" }, + { "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" }, + { "L3MON4D3/LuaSnip", requires = "rafamadriz/friendly-snippets", after = "nvim-cmp" }, + { "tzachar/cmp-tabnine", run = "./install.sh", after = "nvim-cmp" }, + }, + config = function() + require("plugin.configs.cmp").setup() + end, + } + + use { + "max397574/better-escape.nvim", + config = function() + require("better_escape").setup { + mapping = { "jk" }, + } + end, + } + + use { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + config = function() + require("plugin.configs.telescope").setup() + end, + } + + use { + "kyazdani42/nvim-tree.lua", + cmd = "NvimTreeToggle", + config = function() + require("plugin.configs.nvimtree").setup() + end, + } + + use { + "nvim-treesitter/nvim-treesitter", + branch = "0.5-compat", + -- requires = { + -- "Smirnov-O/ts-unit.nvim", + -- after = "nvim-treesitter", + -- keys = { "cip", "vip", "yip", "dip" }, + -- config = function() + -- require("ts-unit").setup { keymaps = true } + -- end, + -- }, + config = function() + require("plugin.configs.treesitter").setup() + end, + } + + use { + "akinsho/toggleterm.nvim", + keys = "<C-t>", + config = function() + require("plugin.configs.terminal").setup() + end, + } +end)
A lua/utils.lua

@@ -0,0 +1,27 @@

+local M = {} + +M.opts = { noremap = true, silent = true } + +function M._map(mode, from, to, opts) + vim.api.nvim_set_keymap(mode, from, to, opts) +end + +function M.map(mode, from, to) + if type(mode) == "table" then + for _, m in pairs(mode) do + M._map(m, from, to, M.opts) + end + end + + M._map(mode, from, to, M.opts) +end + +function M.nmap(from, to) + M._map("n", from, to, M.opts) +end + +function M.expr(mode, from, to) + M._map(mode, from, to, { noremap = true, expr = true }) +end + +return M
A plugin/packer_compiled.lua

@@ -0,0 +1,358 @@

+-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + 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/sasha/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?.lua;/home/sasha/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?/init.lua;/home/sasha/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?.lua;/home/sasha/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/sasha/.cache/nvim/packer_hererocks/2.0.5/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 + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["Comment.nvim"] = { + config = { "\27LJ\1\0025\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\fComment\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/Comment.nvim" + }, + LuaSnip = { + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/LuaSnip" + }, + ["barbar.nvim"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/barbar.nvim" + }, + ["better-escape.nvim"] = { + config = { "\27LJ\1\2Y\0\0\3\0\6\0\t4\0\0\0%\1\1\0>\0\2\0027\0\2\0003\1\4\0003\2\3\0:\2\5\1>\0\2\1G\0\1\0\fmapping\1\0\0\1\2\0\0\ajk\nsetup\18better_escape\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/better-escape.nvim" + }, + ["cmp-buffer"] = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-buffer" + }, + ["cmp-nvim-lsp"] = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp" + }, + ["cmp-nvim-lua"] = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua" + }, + ["cmp-path"] = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-path/after/plugin/cmp_path.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-path" + }, + ["cmp-tabnine"] = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-tabnine/after/plugin/cmp-tabnine.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp-tabnine" + }, + cmp_luasnip = { + after_files = { "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp_luasnip/after/plugin/cmp_luasnip.lua" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/cmp_luasnip" + }, + ["feline.nvim"] = { + config = { "\27LJ\1\2G\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\30plugin.configs.statusline\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/feline.nvim" + }, + ["friendly-snippets"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/friendly-snippets" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\1\2E\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\28plugin.configs.gitsigns\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/gitsigns.nvim" + }, + ["go.nvim"] = { + config = { "\27LJ\1\2E\0\0\2\0\4\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0003\1\3\0>\0\2\1G\0\1\0\1\0\1\ngofmt\fgofumpt\nsetup\ago\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/go.nvim" + }, + ["lua-dev.nvim"] = { + config = { "\27LJ\1\0029\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\flua-dev\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/lua-dev.nvim" + }, + ["null-ls.nvim"] = { + config = { "\27LJ\1\2H\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\31plugin.configs.lsp.null-ls\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/null-ls.nvim" + }, + ["nvim-autopairs"] = { + config = { "\27LJ\1\2@\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\19nvim-autopairs\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/nvim-autopairs" + }, + ["nvim-cmp"] = { + after = { "cmp-nvim-lsp", "cmp-nvim-lua", "LuaSnip", "cmp-buffer", "cmp_luasnip", "cmp-path", "cmp-tabnine" }, + loaded = true, + only_config = true + }, + ["nvim-lsp-installer"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer" + }, + ["nvim-lspconfig"] = { + after = { "null-ls.nvim" }, + loaded = true, + only_config = true + }, + ["nvim-tree.lua"] = { + commands = { "NvimTreeToggle" }, + config = { "\27LJ\1\2E\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\28plugin.configs.nvimtree\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + config = { "\27LJ\1\2G\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\30plugin.configs.treesitter\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" + }, + ["onedarker.nvim"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/onedarker.nvim" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + ["project.nvim"] = { + config = { "\27LJ\1\2D\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\27plugin.configs.project\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/project.nvim" + }, + ["telescope.nvim"] = { + commands = { "Telescope" }, + config = { "\27LJ\1\2F\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\29plugin.configs.telescope\frequire\0" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/telescope.nvim" + }, + ["todo-comments.nvim"] = { + config = { "\27LJ\1\2?\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\18todo-comments\frequire\0" }, + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/todo-comments.nvim" + }, + ["toggleterm.nvim"] = { + config = { "\27LJ\1\2E\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\28plugin.configs.terminal\frequire\0" }, + keys = { { "", "<C-t>" } }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/toggleterm.nvim" + }, + ["ts-unit.nvim"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/ts-unit.nvim" + }, + ["vim-surround"] = { + keys = { { "", "c" }, { "", "y" }, { "", "d" } }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/vim-surround" + }, + ["vim-test"] = { + loaded = true, + path = "/home/sasha/.local/share/nvim/site/pack/packer/start/vim-test" + }, + ["vim-ultest"] = { + commands = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, + config = { "\27LJ\1\2C\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\26plugin.configs.ultest\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/sasha/.local/share/nvim/site/pack/packer/opt/vim-ultest" + } +} + +time([[Defining packer_plugins]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +try_loadstring("\27LJ\1\2G\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\30plugin.configs.treesitter\frequire\0", "config", "nvim-treesitter") +time([[Config for nvim-treesitter]], false) +-- Config for: nvim-cmp +time([[Config for nvim-cmp]], true) +try_loadstring("\27LJ\1\2@\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\23plugin.configs.cmp\frequire\0", "config", "nvim-cmp") +time([[Config for nvim-cmp]], false) +-- Config for: better-escape.nvim +time([[Config for better-escape.nvim]], true) +try_loadstring("\27LJ\1\2Y\0\0\3\0\6\0\t4\0\0\0%\1\1\0>\0\2\0027\0\2\0003\1\4\0003\2\3\0:\2\5\1>\0\2\1G\0\1\0\fmapping\1\0\0\1\2\0\0\ajk\nsetup\18better_escape\frequire\0", "config", "better-escape.nvim") +time([[Config for better-escape.nvim]], false) +-- Config for: Comment.nvim +time([[Config for Comment.nvim]], true) +try_loadstring("\27LJ\1\0025\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim") +time([[Config for Comment.nvim]], false) +-- Config for: gitsigns.nvim +time([[Config for gitsigns.nvim]], true) +try_loadstring("\27LJ\1\2E\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\28plugin.configs.gitsigns\frequire\0", "config", "gitsigns.nvim") +time([[Config for gitsigns.nvim]], false) +-- Config for: todo-comments.nvim +time([[Config for todo-comments.nvim]], true) +try_loadstring("\27LJ\1\2?\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim") +time([[Config for todo-comments.nvim]], false) +-- Config for: nvim-lspconfig +time([[Config for nvim-lspconfig]], true) +try_loadstring("\27LJ\1\2G\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\30plugin.configs.lsp.config\frequire\0", "config", "nvim-lspconfig") +time([[Config for nvim-lspconfig]], false) +-- Config for: feline.nvim +time([[Config for feline.nvim]], true) +try_loadstring("\27LJ\1\2G\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\30plugin.configs.statusline\frequire\0", "config", "feline.nvim") +time([[Config for feline.nvim]], false) +-- Config for: nvim-autopairs +time([[Config for nvim-autopairs]], true) +try_loadstring("\27LJ\1\2@\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") +time([[Config for nvim-autopairs]], false) +-- Config for: project.nvim +time([[Config for project.nvim]], true) +try_loadstring("\27LJ\1\2D\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\27plugin.configs.project\frequire\0", "config", "project.nvim") +time([[Config for project.nvim]], false) +-- Load plugins in order defined by `after` +time([[Sequenced loading]], true) +vim.cmd [[ packadd null-ls.nvim ]] + +-- Config for: null-ls.nvim +try_loadstring("\27LJ\1\2H\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\31plugin.configs.lsp.null-ls\frequire\0", "config", "null-ls.nvim") + +vim.cmd [[ packadd cmp_luasnip ]] +vim.cmd [[ packadd cmp-nvim-lua ]] +vim.cmd [[ packadd cmp-path ]] +vim.cmd [[ packadd cmp-tabnine ]] +vim.cmd [[ packadd cmp-nvim-lsp ]] +vim.cmd [[ packadd LuaSnip ]] +vim.cmd [[ packadd cmp-buffer ]] +time([[Sequenced loading]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UltestStop lua require("packer.load")({'vim-ultest'}, { cmd = "UltestStop", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Ultest lua require("packer.load")({'vim-ultest'}, { cmd = "Ultest", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UltestNearest lua require("packer.load")({'vim-ultest'}, { cmd = "UltestNearest", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UltestOutput lua require("packer.load")({'vim-ultest'}, { cmd = "UltestOutput", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UltestClear lua require("packer.load")({'vim-ultest'}, { cmd = "UltestClear", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + +-- Keymap lazy-loads +time([[Defining lazy-load keymaps]], true) +vim.cmd [[noremap <silent> d <cmd>lua require("packer.load")({'vim-surround'}, { keys = "d", prefix = "" }, _G.packer_plugins)<cr>]] +vim.cmd [[noremap <silent> <C-t> <cmd>lua require("packer.load")({'toggleterm.nvim'}, { keys = "<lt>C-t>", prefix = "" }, _G.packer_plugins)<cr>]] +vim.cmd [[noremap <silent> c <cmd>lua require("packer.load")({'vim-surround'}, { keys = "c", prefix = "" }, _G.packer_plugins)<cr>]] +vim.cmd [[noremap <silent> y <cmd>lua require("packer.load")({'vim-surround'}, { keys = "y", prefix = "" }, _G.packer_plugins)<cr>]] +time([[Defining lazy-load keymaps]], false) + +vim.cmd [[augroup packer_load_aucmds]] +vim.cmd [[au!]] + -- Filetype lazy-loads +time([[Defining lazy-load filetype autocommands]], true) +vim.cmd [[au FileType lua ++once lua require("packer.load")({'lua-dev.nvim'}, { ft = "lua" }, _G.packer_plugins)]] +vim.cmd [[au FileType go ++once lua require("packer.load")({'go.nvim'}, { ft = "go" }, _G.packer_plugins)]] +time([[Defining lazy-load filetype autocommands]], false) +vim.cmd("augroup END") +if should_profile then save_profiles() end + +end) + +if not no_errors then + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end
A selene.toml

@@ -0,0 +1,1 @@

+std="lua51+vim"
A stylua.toml

@@ -0,0 +1,6 @@

+column_width = 140 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +no_call_parentheses = true
A vim.toml

@@ -0,0 +1,2 @@

+[vim] +any = true