From 527a1fbe93bf5f6a676eb50307afdd6528e9672d Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:58:46 -0600 Subject: [PATCH] Delete neovim directory --- neovim/after/plugin/color.lua | 11 -- neovim/after/plugin/lsp.lua | 118 ------------------- neovim/after/plugin/movement.lua | 12 -- neovim/init.lua | 1 - neovim/lua/rf/binds.lua | 20 ---- neovim/lua/rf/init.lua | 2 - neovim/lua/rf/packer.lua | 41 ------- neovim/lua/rf/set.lua | 18 --- neovim/plugin/packer_compiled.lua | 187 ------------------------------ 9 files changed, 410 deletions(-) delete mode 100644 neovim/after/plugin/color.lua delete mode 100644 neovim/after/plugin/lsp.lua delete mode 100644 neovim/after/plugin/movement.lua delete mode 100644 neovim/init.lua delete mode 100644 neovim/lua/rf/binds.lua delete mode 100644 neovim/lua/rf/init.lua delete mode 100644 neovim/lua/rf/packer.lua delete mode 100644 neovim/lua/rf/set.lua delete mode 100644 neovim/plugin/packer_compiled.lua diff --git a/neovim/after/plugin/color.lua b/neovim/after/plugin/color.lua deleted file mode 100644 index 713fd8f..0000000 --- a/neovim/after/plugin/color.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.opt.background = 'dark' -vim.cmd('colorscheme cosme') -vim.g.airline_theme = 'cosme' - -local cl = function(t, o) - vim.api.nvim_set_hl(0, t, o) -end - -cl('LineNr', { - bg = '#222222', -}) diff --git a/neovim/after/plugin/lsp.lua b/neovim/after/plugin/lsp.lua deleted file mode 100644 index b785572..0000000 --- a/neovim/after/plugin/lsp.lua +++ /dev/null @@ -1,118 +0,0 @@ -local nnoremap = require('rf.binds').nnoremap -local inoremap = require('rf.binds').inoremap - -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true - --- cmp -local cmp = require('cmp') -local source_mapping = { - buffer = '[Buffer]', - nvim_lsp = '[LSP]', - nvim_lua = '[Lua]', - cmp_tabnine = '[TN]', - path = '[Path]', -} - -local lspkind = require('lspkind') - -cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }), - [''] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - }), - - formatting = { - format = function(entry, vim_item) - vim_item.kind = lspkind.presets.default[vim_item.kind] - local menu = source_mapping[entry.source.name] - if entry.source.name == "cmp_tabnine" then - if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then - menu = entry.completion_item.data.detail .. " " .. menu - end - vim_item.kind = "" - end - vim_item.menu = menu - return vim_item - end, - }, - - sources = { - { name = "cmp_tabnine" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - }, -}) - -local function config(conf) - return vim.tbl_deep_extend('force', { - capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attch = function() - inoremap('', function() vim.lsp.buf.signature_help() end) - end, - }, conf or {}) -end - --- LSP configurations -local simple_language_servers = { 'tsserver', 'solargraph', 'ocamllsp' } - -for _, v in ipairs(simple_language_servers) do - require('lspconfig')[v].setup(config()) -end - -require('lspconfig').gopls.setup(config({ - cmd = { 'gopls', 'serve' }, - settings = { - gopls = { - analyses = { - unusedparams = true, - }, - staticcheck = true, - }, - }, -})); - --- Lua snip -local snippets_paths = function() - local plugs = { 'friendly-snippets' } - local paths = {} - local path - local root_path = vim.env.HOME .. '/.vim/plugged/' - - for _, plug in ipairs(plugs) do - path = root_path .. plug - if vim.fn.isdirectory(path) ~= 0 then - table.insert(paths, path) - end - end - return paths -end - -require('luasnip.loaders.from_vscode').lazy_load({ - paths = snippets_paths(), - include = nil, - exclude = {}, -}) - --- Auto complete -vim.cmd([[ -" Use and to navigate through popup menu -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" - -" Set completeopt to have a better completion experience -set completeopt=menuone,noinsert,noselect - -" Avoid showing message extra message when using completion -set shortmess+=c -]]) diff --git a/neovim/after/plugin/movement.lua b/neovim/after/plugin/movement.lua deleted file mode 100644 index 71e9133..0000000 --- a/neovim/after/plugin/movement.lua +++ /dev/null @@ -1,12 +0,0 @@ -local nnoremap = require('rf.binds').nnoremap -local nmap = require('rf.binds').nmap - --- Buffer cycling -nnoremap('', ':bprev') -nnoremap('', ':bnext') - --- Fuzzy finder (fzf) -nmap('', ':Rg') - --- NetRW -nnoremap('', ':Ex') diff --git a/neovim/init.lua b/neovim/init.lua deleted file mode 100644 index 8b96f13..0000000 --- a/neovim/init.lua +++ /dev/null @@ -1 +0,0 @@ -require('rf') diff --git a/neovim/lua/rf/binds.lua b/neovim/lua/rf/binds.lua deleted file mode 100644 index 4d4a38b..0000000 --- a/neovim/lua/rf/binds.lua +++ /dev/null @@ -1,20 +0,0 @@ -local M = {} - -local function bind(operation, outer_operations) - outer_operations = outer_operations or { noremap = true } - return function(l, r, o) - o = vim.tbl_extend('force', - outer_operations, - o or {} - ) - vim.keymap.set(operation, l, r, o) - end -end - -M.nmap = bind('n', { noremap = false }) -M.nnoremap = bind('n') -M.vnoremap = bind('v') -M.xnoremap = bind('x') -M.inoremap = bind('i') - -return M diff --git a/neovim/lua/rf/init.lua b/neovim/lua/rf/init.lua deleted file mode 100644 index c91977d..0000000 --- a/neovim/lua/rf/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require('rf.set') -require('rf.packer') diff --git a/neovim/lua/rf/packer.lua b/neovim/lua/rf/packer.lua deleted file mode 100644 index 9e35879..0000000 --- a/neovim/lua/rf/packer.lua +++ /dev/null @@ -1,41 +0,0 @@ -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function() - -- Packer - use 'wbthomason/packer.nvim' - - -- Color theme/aesthetics - use 'beikome/cosme.vim' - use 'ajmwagar/vim-emoticons' - - -- tpope - use 'tpope/vim-surround' - use 'tpope/vim-rails' - - -- LSP - use 'neovim/nvim-lsp' - use 'neovim/nvim-lspconfig' - use 'hrsh7th/nvim-cmp' - use 'hrsh7th/cmp-buffer' - use 'hrsh7th/cmp-nvim-lsp' - use 'saadparwaiz1/cmp_luasnip' - use 'l3mon4d3/luasnip' - use 'onsails/lspkind.nvim' - - -- Language specific - use 'groenewege/vim-less' - use 'vim-ruby/vim-ruby' - use 'fatih/vim-go' - use 'ocaml/vim-ocaml' - - -- Others - use ('junegunn/fzf', { run = function() vim.fn['fzf#install'](0) end }) - use 'junegunn/fzf.vim' - use 'ap/vim-css-color' - use 'jiangmiao/auto-pairs' - use 'docunext/closetag.vim' - - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/neovim/lua/rf/set.lua b/neovim/lua/rf/set.lua deleted file mode 100644 index 4a768a5..0000000 --- a/neovim/lua/rf/set.lua +++ /dev/null @@ -1,18 +0,0 @@ -local set = vim.opt - -set.nu = true -set.tabstop = 2 -set.shiftwidth = 2 -set.hlsearch = false -set.incsearch = true -set.smartindent = true -set.wrap = false -set.encoding = 'utf-8' -set.guifont = 'Iosevka Nerd Font Mono 14' - -vim.cmd([[ -set rtp^="home/rf/.opam/default/share/ocp-indent/vim" -]]) - --- Lower update time the better (ms) -set.updatetime = 50 diff --git a/neovim/plugin/packer_compiled.lua b/neovim/plugin/packer_compiled.lua deleted file mode 100644 index 906e695..0000000 --- a/neovim/plugin/packer_compiled.lua +++ /dev/null @@ -1,187 +0,0 @@ --- 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/rf/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/rf/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/rf/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/rf/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/rf/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" -if not string.find(package.path, package_path_str, 1, true) then - package.path = package.path .. ';' .. package_path_str -end - -if not string.find(package.cpath, install_cpath_pattern, 1, true) then - package.cpath = package.cpath .. ';' .. install_cpath_pattern -end - -time([[Luarocks path setup]], false) -time([[try_loadstring definition]], true) -local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) - 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 = { - ["auto-pairs"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/auto-pairs", - url = "https://github.com/jiangmiao/auto-pairs" - }, - ["closetag.vim"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/closetag.vim", - url = "https://github.com/docunext/closetag.vim" - }, - ["cmp-buffer"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/cmp-buffer", - url = "https://github.com/hrsh7th/cmp-buffer" - }, - ["cmp-nvim-lsp"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", - url = "https://github.com/hrsh7th/cmp-nvim-lsp" - }, - cmp_luasnip = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/cmp_luasnip", - url = "https://github.com/saadparwaiz1/cmp_luasnip" - }, - ["cosme.vim"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/cosme.vim", - url = "https://github.com/beikome/cosme.vim" - }, - fzf = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/fzf", - url = "https://github.com/junegunn/fzf" - }, - ["fzf.vim"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/fzf.vim", - url = "https://github.com/junegunn/fzf.vim" - }, - ["lspkind.nvim"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/lspkind.nvim", - url = "https://github.com/onsails/lspkind.nvim" - }, - luasnip = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/luasnip", - url = "https://github.com/l3mon4d3/luasnip" - }, - ["nvim-cmp"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/nvim-cmp", - url = "https://github.com/hrsh7th/nvim-cmp" - }, - ["nvim-lsp"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/nvim-lsp", - url = "https://github.com/neovim/nvim-lsp" - }, - ["nvim-lspconfig"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", - url = "https://github.com/neovim/nvim-lspconfig" - }, - ["packer.nvim"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/packer.nvim", - url = "https://github.com/wbthomason/packer.nvim" - }, - ["vim-airline"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-airline", - url = "https://github.com/vim-airline/vim-airline" - }, - ["vim-airline-themes"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-airline-themes", - url = "https://github.com/vim-airline/vim-airline-themes" - }, - ["vim-buftabline"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-buftabline", - url = "https://github.com/ap/vim-buftabline" - }, - ["vim-css-color"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-css-color", - url = "https://github.com/ap/vim-css-color" - }, - ["vim-emoticons"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-emoticons", - url = "https://github.com/ajmwagar/vim-emoticons" - }, - ["vim-rails"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-rails", - url = "https://github.com/tpope/vim-rails" - }, - ["vim-surround"] = { - loaded = true, - path = "/home/rf/.local/share/nvim/site/pack/packer/start/vim-surround", - url = "https://github.com/tpope/vim-surround" - } -} - -time([[Defining packer_plugins]], false) -if should_profile then save_profiles() end - -end) - -if not no_errors then - error_msg = error_msg:gsub('"', '\\"') - vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') -end