From 07ee8a7f3e769acf73ed304b251e03ba02648b55 Mon Sep 17 00:00:00 2001 From: neoteny Date: Sun, 28 Nov 2021 22:38:08 +0200 Subject: [PATCH] delete nvim config --- config/nvim/.gitignore | 1 - config/nvim/Makefile | 5 - config/nvim/ftplugin/go.lua | 6 - config/nvim/ftplugin/javascript.lua | 6 - config/nvim/ftplugin/lua.lua | 6 - config/nvim/ftplugin/python.lua | 6 - config/nvim/init.lua | 9 - config/nvim/lua/autocmd.lua | 1 - config/nvim/lua/disabled.lua | 26 --- config/nvim/lua/globals.lua | 10 -- config/nvim/lua/keymapings.lua | 78 --------- config/nvim/lua/lsp/attach.lua | 26 --- config/nvim/lua/lsp/init.lua | 22 --- config/nvim/lua/lsp/null.lua | 38 ---- config/nvim/lua/lsp/providers/jsonls.lua | 16 -- config/nvim/lua/lsp/providers/pyright.lua | 8 - config/nvim/lua/lsp/providers/sqls.lua | 12 -- config/nvim/lua/lsp/providers/sumneko_lua.lua | 15 -- config/nvim/lua/lsp/providers/tsserver.lua | 19 -- config/nvim/lua/lsp/providers/yamlls.lua | 14 -- config/nvim/lua/options.lua | 47 ----- config/nvim/lua/plugin.lua | 163 ------------------ config/nvim/lua/plugin/cmp.lua | 68 -------- config/nvim/lua/plugin/dap.lua | 24 --- config/nvim/lua/plugin/gitsigns.lua | 53 ------ config/nvim/lua/plugin/nvimtree.lua | 44 ----- config/nvim/lua/plugin/project.lua | 15 -- config/nvim/lua/plugin/statusline.lua | 22 --- config/nvim/lua/plugin/telescope.lua | 52 ------ config/nvim/lua/plugin/terminal.lua | 28 --- config/nvim/lua/plugin/treesitter.lua | 20 --- config/nvim/lua/plugin/ultest.lua | 7 - config/nvim/lua/utils.lua | 27 --- config/nvim/selene.toml | 1 - config/nvim/stylua.toml | 6 - config/nvim/vim.toml | 5 - 36 files changed, 906 deletions(-) delete mode 100644 config/nvim/.gitignore delete mode 100644 config/nvim/Makefile delete mode 100644 config/nvim/ftplugin/go.lua delete mode 100644 config/nvim/ftplugin/javascript.lua delete mode 100644 config/nvim/ftplugin/lua.lua delete mode 100644 config/nvim/ftplugin/python.lua delete mode 100644 config/nvim/init.lua delete mode 100644 config/nvim/lua/autocmd.lua delete mode 100644 config/nvim/lua/disabled.lua delete mode 100644 config/nvim/lua/globals.lua delete mode 100644 config/nvim/lua/keymapings.lua delete mode 100644 config/nvim/lua/lsp/attach.lua delete mode 100644 config/nvim/lua/lsp/init.lua delete mode 100644 config/nvim/lua/lsp/null.lua delete mode 100644 config/nvim/lua/lsp/providers/jsonls.lua delete mode 100644 config/nvim/lua/lsp/providers/pyright.lua delete mode 100644 config/nvim/lua/lsp/providers/sqls.lua delete mode 100644 config/nvim/lua/lsp/providers/sumneko_lua.lua delete mode 100644 config/nvim/lua/lsp/providers/tsserver.lua delete mode 100644 config/nvim/lua/lsp/providers/yamlls.lua delete mode 100644 config/nvim/lua/options.lua delete mode 100644 config/nvim/lua/plugin.lua delete mode 100644 config/nvim/lua/plugin/cmp.lua delete mode 100644 config/nvim/lua/plugin/dap.lua delete mode 100644 config/nvim/lua/plugin/gitsigns.lua delete mode 100644 config/nvim/lua/plugin/nvimtree.lua delete mode 100644 config/nvim/lua/plugin/project.lua delete mode 100644 config/nvim/lua/plugin/statusline.lua delete mode 100644 config/nvim/lua/plugin/telescope.lua delete mode 100644 config/nvim/lua/plugin/terminal.lua delete mode 100644 config/nvim/lua/plugin/treesitter.lua delete mode 100644 config/nvim/lua/plugin/ultest.lua delete mode 100644 config/nvim/lua/utils.lua delete mode 100644 config/nvim/selene.toml delete mode 100644 config/nvim/stylua.toml delete mode 100644 config/nvim/vim.toml diff --git a/config/nvim/.gitignore b/config/nvim/.gitignore deleted file mode 100644 index 6d635cb..0000000 --- a/config/nvim/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/plugin diff --git a/config/nvim/Makefile b/config/nvim/Makefile deleted file mode 100644 index 303cd2c..0000000 --- a/config/nvim/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -fmt: - @stylua {lua,init.lua} - -lint: - @selene {lua,init.lua} diff --git a/config/nvim/ftplugin/go.lua b/config/nvim/ftplugin/go.lua deleted file mode 100644 index 62b2624..0000000 --- a/config/nvim/ftplugin/go.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, dapi = pcall(require, "dap-install") -if not ok then - return -end - -dapi.config("go_delve", {}) diff --git a/config/nvim/ftplugin/javascript.lua b/config/nvim/ftplugin/javascript.lua deleted file mode 100644 index abff1e3..0000000 --- a/config/nvim/ftplugin/javascript.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, dapi = pcall(require, "dap-install") -if not ok then - return -end - -dapi.config("jsnode", {}) diff --git a/config/nvim/ftplugin/lua.lua b/config/nvim/ftplugin/lua.lua deleted file mode 100644 index 27f97af..0000000 --- a/config/nvim/ftplugin/lua.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, dapi = pcall(require, "dap-install") -if not ok then - return -end - -dapi.config("lua", {}) diff --git a/config/nvim/ftplugin/python.lua b/config/nvim/ftplugin/python.lua deleted file mode 100644 index 7fa4b3e..0000000 --- a/config/nvim/ftplugin/python.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, dapi = pcall(require, "dap-install") -if not ok then - return -end - -dapi.config("python", {}) diff --git a/config/nvim/init.lua b/config/nvim/init.lua deleted file mode 100644 index 19e1a90..0000000 --- a/config/nvim/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -require "options" -require "plugin" -require "keymapings" -require "disabled" -require "globals" -require "autocmd" - -vim.g.vscode_style = "dark" -vim.cmd [[colo vscode]] diff --git a/config/nvim/lua/autocmd.lua b/config/nvim/lua/autocmd.lua deleted file mode 100644 index 0f4b928..0000000 --- a/config/nvim/lua/autocmd.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd [[ autocmd BufWritePre * lua mkdir() ]] diff --git a/config/nvim/lua/disabled.lua b/config/nvim/lua/disabled.lua deleted file mode 100644 index 5024ca8..0000000 --- a/config/nvim/lua/disabled.lua +++ /dev/null @@ -1,26 +0,0 @@ -local disabled_built_ins = { - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "gzip", - "zip", - "tohtml", - "man", - "zipPlugin", - "tar", - "tarPlugin", - "getscript", - "getscriptPlugin", - "vimball", - "vimballPlugin", - "2html_plugin", - "logipat", - "rrhelper", - "spellfile_plugin", - "matchit", -} - -for _, plugin in pairs(disabled_built_ins) do - vim.g["loaded_" .. plugin] = 1 -end diff --git a/config/nvim/lua/globals.lua b/config/nvim/lua/globals.lua deleted file mode 100644 index 287d03a..0000000 --- a/config/nvim/lua/globals.lua +++ /dev/null @@ -1,10 +0,0 @@ -function _G.term_cmd(cmd) - require("toggleterm.terminal").Terminal:new({ cmd = cmd, hidden = true }):toggle() -end - -function _G.mkdir() - local dir = vim.fn.expand "%:p:h" - if vim.fn.isdirectory(dir) == 0 then - vim.fn.mkdir(dir, "p") - end -end diff --git a/config/nvim/lua/keymapings.lua b/config/nvim/lua/keymapings.lua deleted file mode 100644 index fda9ce3..0000000 --- a/config/nvim/lua/keymapings.lua +++ /dev/null @@ -1,78 +0,0 @@ -local u = require "utils" -local map, nmap, expr = u.map, u.nmap, u.expr - -nmap("", "write!") -nmap("h", "nohlsearch") -nmap("q", "quit!") -nmap("w", "write!") -nmap("e", "NvimTreeToggle") -nmap("/", "lua require[[Comment]].toggle()") -map("v", "/", "gc") -nmap("ps", "PackerSync") - --- Windows -for _, k in ipairs { "h", "j", "k", "l" } do - nmap(string.format("", k), string.format("wincmd %s", k)) - map("t", string.format("", k), string.format("%s", k)) -end - -nmap("", "vertical resize -2") -nmap("resize -1") -nmap("", "resize +2") -nmap("", "vertical resize +2") - --- Alternative up/down for arrows -expr("i", "", 'pumvisible() ? "\\" : "\\"') -expr("i", "", 'pumvisible() ? "\\" : "\\"') -expr("c", "", 'pumvisible() ? "\\" : "\\"') -expr("c", "", 'pumvisible() ? "\\" : "\\"') - --- Move line -map("i", "", ":m .+1==gi") -map("i", "", ":m .-2==gi") -map("v", "K", ":move '<-2gv-gv") -map("v", "J", ":move '>+1gv-gv") -nmap("", ":m .+1==") -nmap("", ":m .-2==") - --- Telescope -nmap("f", "Telescope find_files") -nmap("b", "Telescope buffers") -nmap("st", "Telescope live_grep") -nmap("sT", "Telescope grep_string") -nmap("sp", "Telescope projects") -nmap("sr", "Telescope oldfiles") -nmap("sb", "Telescope git_branches") -nmap("sc", "Telescope git_commits") -nmap("sk", "Telescope keymaps") - --- Terminal -nmap("gg", "lua term_cmd('lazygit')") -nmap("D", " lua term_cmd('lazydocker')") - --- DAP -nmap("dt", "lua require'dap'.toggle_breakpoint()") -nmap("db", "lua require'dap'.step_back()") -nmap("dc", "lua require'dap'.continue()") -nmap("dd", "lua require'dap'.disconnect()") -nmap("di", "lua require'dap'.step_into()") -nmap("do", "lua require'dap'.step_over()") -nmap("du", "lua require'dap'.step_out()") -nmap("dr", "lua require'dap'.repl.toggle()") -nmap("dp", "lua require'dap'.pause.toggle()") -nmap("dq", "lua require'dap'.close()") - --- Ultest -nmap("tt", "Ultest") -nmap("ts", "UltestStop") -nmap("tc", "UltestClear") -nmap("tn", "UltestNearest") -nmap("to", "UltestOutput") - --- Buffer -nmap("", "BufferLast") -nmap("", "BufferClose") -nmap("c", "BufferClose!") -for i = 1, 9 do - nmap(string.format("", i), string.format("BufferGoto %d", i)) -end diff --git a/config/nvim/lua/lsp/attach.lua b/config/nvim/lua/lsp/attach.lua deleted file mode 100644 index 4f3e488..0000000 --- a/config/nvim/lua/lsp/attach.lua +++ /dev/null @@ -1,26 +0,0 @@ -return 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_map(...) - vim.api.nvim_buf_set_keymap(bufnr, "n", ...) - end - - local opts = { noremap = true, silent = true } - buf_map("K", "lua vim.lsp.buf.hover()", opts) - buf_map("gd", "lua vim.lsp.buf.definition()", opts) - buf_map("gD", "lua vim.lsp.buf.declaration()", opts) - buf_map("gr", "lua vim.lsp.buf.references()", opts) - buf_map("gI", "lua vim.lsp.buf.implementation()", opts) - buf_map("gs", "lua vim.lsp.buf.signature_help()", opts) - buf_map("gl", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) - buf_map("la", "Telescope lsp_code_actions", opts) - buf_map("lA", "lua vim.lsp.buf.range_code_action()", opts) - buf_map("ld", "TroubleToggle", opts) - buf_map("lr", "lua vim.lsp.buf.rename()", opts) - buf_map("lf", "lua vim.lsp.buf.formatting()", opts) - buf_map("ls", "Telescope lsp_document_symbols", opts) - buf_map("li", "LspInfo", opts) - buf_map("lR", "LspRestart", opts) -end diff --git a/config/nvim/lua/lsp/init.lua b/config/nvim/lua/lsp/init.lua deleted file mode 100644 index bfc8f94..0000000 --- a/config/nvim/lua/lsp/init.lua +++ /dev/null @@ -1,22 +0,0 @@ -local on_attach = require "lsp.attach" -local M = {} - -function M.setup() - require("nvim-lsp-installer").on_server_ready(function(server) - local opts = { on_attach = on_attach } - - local ok, server_opts = pcall(require, "lsp.providers." .. server.name) - if ok then - opts = vim.tbl_deep_extend("force", opts, server_opts or {}) - end - - server:setup(opts) - - vim.cmd [[ do User LspAttachBuffers ]] - - require("lsp.null").setup() - require("lspconfig")["null-ls"].setup {} - end) -end - -return M diff --git a/config/nvim/lua/lsp/null.lua b/config/nvim/lua/lsp/null.lua deleted file mode 100644 index e784bd1..0000000 --- a/config/nvim/lua/lsp/null.lua +++ /dev/null @@ -1,38 +0,0 @@ -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, - - -- Rust - fmt.rustfmt, - }, - } -end - -return M diff --git a/config/nvim/lua/lsp/providers/jsonls.lua b/config/nvim/lua/lsp/providers/jsonls.lua deleted file mode 100644 index 299c0ba..0000000 --- a/config/nvim/lua/lsp/providers/jsonls.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - schemaDownload = { - enable = true, - }, - schemas = { - { fileMatch = { "package.json" }, url = "https://json.schemastore.org/package.json" }, - { url = "https://json.schemastore.org/tsconfig.json", fileMatch = { "tsconfig.json", "tsconfig.*.json" } }, - { url = "https://json.schemastore.org/lerna.json", fileMatch = { "lerna.json" } }, - { url = "https://json.schemastore.org/eslintrc.json", fileMatch = { ".eslintrc.json", ".eslintrc" } }, - { url = "https://json.schemastore.org/prettierrc", fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" } }, - { fileMatch = { ".golangci.toml", ".golangci.json" }, url = "https://json.schemastore.org/golangci-lint.json" }, - { fileMatch = { "package.json" }, url = "https://json.schemastore.org/package.json" }, - }, - }, -} diff --git a/config/nvim/lua/lsp/providers/pyright.lua b/config/nvim/lua/lsp/providers/pyright.lua deleted file mode 100644 index 52f8013..0000000 --- a/config/nvim/lua/lsp/providers/pyright.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - python = { - analysis = { - autoSearchPaths = true, - useLibraryCodeForTypes = false, - }, - }, -} diff --git a/config/nvim/lua/lsp/providers/sqls.lua b/config/nvim/lua/lsp/providers/sqls.lua deleted file mode 100644 index 9ce7bcd..0000000 --- a/config/nvim/lua/lsp/providers/sqls.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - settings = { - sqls = { - connections = { - { - driver = "postgresql", - dataSourceName = "host=0.0.0.0 port=5432 user=postgres password=qwerty123 dbname=postgres sslmode=disable", - }, - }, - }, - }, -} diff --git a/config/nvim/lua/lsp/providers/sumneko_lua.lua b/config/nvim/lua/lsp/providers/sumneko_lua.lua deleted file mode 100644 index 5d5f657..0000000 --- a/config/nvim/lua/lsp/providers/sumneko_lua.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - settings = { - Lua = { - diagnostics = { globals = { "vim" } }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - }, - maxPreload = 100000, - preloadFileSize = 10000, - }, - }, - }, -} diff --git a/config/nvim/lua/lsp/providers/tsserver.lua b/config/nvim/lua/lsp/providers/tsserver.lua deleted file mode 100644 index 8cce0be..0000000 --- a/config/nvim/lua/lsp/providers/tsserver.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - setup = { - handlers = { - ["textDocument/publishDiagnostics"] = function(_, _, p, id, _, cfg) - if p.diagnostics ~= nil then - local i = 1 - while i <= #p.diagnostics do - if p.diagnostics[i].code == 80001 then - table.remove(p.diagnostics, i) - else - i = i + 1 - end - end - end - vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, id, _, cfg) - end, - }, - }, -} diff --git a/config/nvim/lua/lsp/providers/yamlls.lua b/config/nvim/lua/lsp/providers/yamlls.lua deleted file mode 100644 index e874923..0000000 --- a/config/nvim/lua/lsp/providers/yamlls.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - settings = { - yaml = { - hover = true, - completion = true, - validate = true, - schemaStore = { - enable = true, - url = "https://www.schemastore.org/api/json/catalog.json", - }, - schemas = {}, - }, - }, -} diff --git a/config/nvim/lua/options.lua b/config/nvim/lua/options.lua deleted file mode 100644 index be901d5..0000000 --- a/config/nvim/lua/options.lua +++ /dev/null @@ -1,47 +0,0 @@ -local o = vim.opt - -vim.g.mapleader = " " -vim.g.maplocalleader = "," -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 = "JetBrains Mono Nerd Font:h17" -o.hidden = true -o.hlsearch = true -o.ignorecase = true -o.mouse = "a" -o.pumheight = 10 -o.showmode = false -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 diff --git a/config/nvim/lua/plugin.lua b/config/nvim/lua/plugin.lua deleted file mode 100644 index 46c4b6b..0000000 --- a/config/nvim/lua/plugin.lua +++ /dev/null @@ -1,163 +0,0 @@ -return require("packer").startup(function(use) - use "wbthomason/packer.nvim" - use "nvim-lua/plenary.nvim" - use "Mofiqul/vscode.nvim" - use "kyazdani42/nvim-web-devicons" - use "romgrk/barbar.nvim" - use { "dstein64/vim-startuptime", cmd = "StartupTime" } - - use { - "pwntester/octo.nvim", - cmd = "Octo", - opt = true, - config = function() - require("octo").setup() - end, - } - - use { - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - } - - use { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup() - end, - } - - use { - "neovim/nvim-lspconfig", - requires = { - "williamboman/nvim-lsp-installer", - { "jose-elias-alvarez/null-ls.nvim", after = "nvim-lspconfig" }, - }, - config = function() - require("lsp").setup() - end, - } - - use { - "ahmedkhalf/project.nvim", - config = function() - require("plugin.project").setup() - end, - } - - use { - "mfussenegger/nvim-dap", - module = "dap", - requires = { - { "Pocco81/DAPInstall.nvim", requires = "nvim-dap" }, - { "theHamsta/nvim-dap-virtual-text", after = "nvim-dap", config = [[ require"nvim-dap-virtual-text".setup() ]] }, - { "nvim-telescope/telescope-dap.nvim", after = "nvim-dap", config = [[ require("telescope").load_extension "dap" ]] }, - }, - config = function() - require("plugin.dap").setup() - end, - } - - use { - "ray-x/go.nvim", - ft = "go", - opt = true, - config = function() - require("go").setup { gofmt = "gofumpt" } - end, - } - - use { - "lewis6991/gitsigns.nvim", - config = function() - require("plugin.gitsigns").setup() - end, - } - - use { - "nvim-lualine/lualine.nvim", - config = function() - require("plugin.statusline").setup() - end, - } - - use { - "rcarriga/vim-ultest", - requires = { { "vim-test/vim-test", after = "vim-ultest" } }, - cmd = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, - run = ":UpdateRemotePlugins", - config = function() - require("plugin.ultest").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" }, - { - "saadparwaiz1/cmp_luasnip", - requires = { - { "L3MON4D3/LuaSnip", after = "cmp_luasnip" }, - { "rafamadriz/friendly-snippets", after = "LuaSnip" }, - }, - }, - }, - config = function() - require("plugin.cmp").setup() - end, - } - - use { - "max397574/better-escape.nvim", - config = function() - require("better_escape").setup { mapping = { "jk" } } - end, - } - - use { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - module = "telescope", - config = function() - require("plugin.telescope").setup() - end, - } - - use { - "kyazdani42/nvim-tree.lua", - cmd = "NvimTreeToggle", - config = function() - require("plugin.nvimtree").setup() - end, - } - - use { - "nvim-treesitter/nvim-treesitter", - branch = "0.5-compat", - config = function() - require("plugin.treesitter").setup() - end, - } - - use { - "Smirnov-O/ts-unit.nvim", - after = "nvim-treesitter", - config = function() - require("ts-unit").setup { keymaps = true } - end, - } - - use { - "akinsho/toggleterm.nvim", - module = "toggleterm", - keys = "", - config = function() - require("plugin.terminal").setup() - end, - } -end) diff --git a/config/nvim/lua/plugin/cmp.lua b/config/nvim/lua/plugin/cmp.lua deleted file mode 100644 index b7a7f9c..0000000 --- a/config/nvim/lua/plugin/cmp.lua +++ /dev/null @@ -1,68 +0,0 @@ -local M = {} - -function M.setup() - local cmp = require "cmp" - - require("luasnip/loaders/from_vscode").lazy_load { - paths = { "~/.local/share/nvim/site/pack/packer/start/friendly-snippets" }, - } - - cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) - cmp.setup { - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - formatting = { - format = function(entry, vim_item) - vim_item.menu = ({ - nvim_lsp = "(L)", - nvim_lua = "(N)", - buffer = "(B)", - luasnip = "(S)", - })[entry.source.name] - - return vim_item - end, - }, - mapping = { - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }, - [""] = 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("luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, - [""] = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end, - }, - sources = { - { name = "nvim_lua", max_item_count = 5 }, - { name = "nvim_lsp", max_item_count = 8 }, - { name = "buffer", keyword_length = 4, max_item_count = 5 }, - { name = "luasnip", max_item_count = 4, keyword_length = 2 }, - }, - experimental = { - ghost_text = true, - }, - } -end - -return M diff --git a/config/nvim/lua/plugin/dap.lua b/config/nvim/lua/plugin/dap.lua deleted file mode 100644 index 8e81392..0000000 --- a/config/nvim/lua/plugin/dap.lua +++ /dev/null @@ -1,24 +0,0 @@ -local M = {} - -function M.setup() - 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 diff --git a/config/nvim/lua/plugin/gitsigns.lua b/config/nvim/lua/plugin/gitsigns.lua deleted file mode 100644 index b8d2881..0000000 --- a/config/nvim/lua/plugin/gitsigns.lua +++ /dev/null @@ -1,53 +0,0 @@ -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 gs"] = 'lua require"gitsigns".stage_hunk()', - ["n gr"] = 'lua require"gitsigns".reset_hunk()', - ["n gR"] = 'lua require"gitsigns".reset_buffer()', - ["n gp"] = 'lua require"gitsigns".preview_hunk()', - ["n gl"] = 'lua require"gitsigns".blame_line(true)', - ["n gS"] = 'lua require"gitsigns".stage_buffer()', - ["n gU"] = 'lua require"gitsigns".reset_buffer_index()', - }, - 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 diff --git a/config/nvim/lua/plugin/nvimtree.lua b/config/nvim/lua/plugin/nvimtree.lua deleted file mode 100644 index dfd96c8..0000000 --- a/config/nvim/lua/plugin/nvimtree.lua +++ /dev/null @@ -1,44 +0,0 @@ -local M = {} - -function M.setup() - local tree_cb = require("nvim-tree.config").nvim_tree_callback - - require("nvim-tree").setup { - disable_netrw = true, - hijack_netrw = true, - auto_close = true, - auto_open = true, - update_cwd = false, - diagnostics = { - enable = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = true, - custom = { ".git", "node_modules", "__pycache__", "env", ".bin" }, - }, - view = { - width = 30, - side = "left", - auto_resize = false, - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, - }, - }, - } - - vim.g.nvim_tree_group_empty = 1 - vim.g.nvim_tree_indent_markers = 1 -end - -return M diff --git a/config/nvim/lua/plugin/project.lua b/config/nvim/lua/plugin/project.lua deleted file mode 100644 index 383ac9a..0000000 --- a/config/nvim/lua/plugin/project.lua +++ /dev/null @@ -1,15 +0,0 @@ -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 diff --git a/config/nvim/lua/plugin/statusline.lua b/config/nvim/lua/plugin/statusline.lua deleted file mode 100644 index 16f2ee2..0000000 --- a/config/nvim/lua/plugin/statusline.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = {} - -function M.setup() - require("lualine").setup { - options = { - theme = "codedark", - component_separators = { "", "" }, - section_separators = { "", "" }, - disabled_filetypes = { "NvimTree", "Telescope" }, - }, - sections = { - lualine_a = { "branch", "diff" }, - lualine_b = { "filename" }, - lualine_c = {}, - lualine_x = {}, - lualine_y = { { "diagnostics", sources = { "nvim_lsp" } } }, - lualine_z = { "location" }, - }, - } -end - -return M diff --git a/config/nvim/lua/plugin/telescope.lua b/config/nvim/lua/plugin/telescope.lua deleted file mode 100644 index cacc26f..0000000 --- a/config/nvim/lua/plugin/telescope.lua +++ /dev/null @@ -1,52 +0,0 @@ -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 }, - }, - file_ignore_patterns = { ".git", "node_modules", "__pycache__", "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 = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = false, - - [""] = "which_key", - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - }, - }, - }, - } - - require("telescope").load_extension "projects" -end - -return M diff --git a/config/nvim/lua/plugin/terminal.lua b/config/nvim/lua/plugin/terminal.lua deleted file mode 100644 index 15ad8fd..0000000 --- a/config/nvim/lua/plugin/terminal.lua +++ /dev/null @@ -1,28 +0,0 @@ -local M = {} - -function M.setup() - require("toggleterm").setup { - size = 20, - open_mapping = [[]], - 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 diff --git a/config/nvim/lua/plugin/treesitter.lua b/config/nvim/lua/plugin/treesitter.lua deleted file mode 100644 index 14ad230..0000000 --- a/config/nvim/lua/plugin/treesitter.lua +++ /dev/null @@ -1,20 +0,0 @@ -local M = {} - -function M.setup() - require("nvim-treesitter.configs").setup { - ensure_installed = { "lua", "go", "gomod" }, - highlight = { enable = true }, - indent = { enable = true, disable = { "python", "yml" } }, - autotag = { enable = true }, - context_commentstring = { enable = true }, - rainbow = { - enable = false, - extended_mode = true, - max_file_lines = 500, - }, - } - - local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() -end - -return M diff --git a/config/nvim/lua/plugin/ultest.lua b/config/nvim/lua/plugin/ultest.lua deleted file mode 100644 index 6b8ce9b..0000000 --- a/config/nvim/lua/plugin/ultest.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = {} - -function M.setup() - vim.g["test#go#gotest#optiongs"] = "-v" -end - -return M diff --git a/config/nvim/lua/utils.lua b/config/nvim/lua/utils.lua deleted file mode 100644 index 37ca28e..0000000 --- a/config/nvim/lua/utils.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 diff --git a/config/nvim/selene.toml b/config/nvim/selene.toml deleted file mode 100644 index 6540d6f..0000000 --- a/config/nvim/selene.toml +++ /dev/null @@ -1 +0,0 @@ -std="lua51+vim" diff --git a/config/nvim/stylua.toml b/config/nvim/stylua.toml deleted file mode 100644 index ff09851..0000000 --- a/config/nvim/stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 140 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -no_call_parentheses = true diff --git a/config/nvim/vim.toml b/config/nvim/vim.toml deleted file mode 100644 index 937afa0..0000000 --- a/config/nvim/vim.toml +++ /dev/null @@ -1,5 +0,0 @@ -[vim] -any = true - -[_G] -any = true