From 11bb713b600e3a335de2f3b65e5bc5d232fc0384 Mon Sep 17 00:00:00 2001 From: Shadow Cat Date: Thu, 16 Feb 2023 01:24:40 -0500 Subject: [PATCH] switched to lazy.nvim and clean up a bit --- .gitignore | 2 +- init.lua | 16 +++---- lua/config/lsp-settings.lua | 34 +++++++------- lua/config/mappings.lua | 74 +++++++++++++++--------------- lua/config/plugins.lua | 35 +++++---------- lua/config/plugins/cmp.lua | 36 --------------- lua/config/plugins/telescope.lua | 39 ---------------- lua/config/plugins/visual.lua | 62 ------------------------- lua/config/preview.lua | 16 +++---- lua/config/reload.lua | 30 +++++-------- lua/config/settings.lua | 17 ++++--- lua/config/theme.lua | 14 +++--- lua/config/utils.lua | 18 ++++---- lua/plugins/cmp.lua | 39 ++++++++++++++++ lua/{config => }/plugins/lsp.lua | 75 +++++++++++++++++-------------- lua/plugins/telescope.lua | 38 ++++++++++++++++ lua/{config => }/plugins/tree.lua | 10 ++--- lua/{config => }/plugins/util.lua | 20 +++------ lua/plugins/visual.lua | 46 +++++++++++++++++++ 19 files changed, 290 insertions(+), 331 deletions(-) delete mode 100644 lua/config/plugins/cmp.lua delete mode 100644 lua/config/plugins/telescope.lua delete mode 100644 lua/config/plugins/visual.lua create mode 100644 lua/plugins/cmp.lua rename lua/{config => }/plugins/lsp.lua (51%) create mode 100644 lua/plugins/telescope.lua rename lua/{config => }/plugins/tree.lua (89%) rename lua/{config => }/plugins/util.lua (55%) create mode 100644 lua/plugins/visual.lua diff --git a/.gitignore b/.gitignore index 8cb205e..e033bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -plugin +lazy-lock.json diff --git a/init.lua b/init.lua index c01a90d..55b0955 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,9 @@ for _, name in ipairs({ - 'reload', - 'settings', - 'mappings', - 'plugins', - 'neovide', - 'theme', - 'preview' -}) do require('config.' .. name) end + "reload", + "settings", + "mappings", + "plugins", + "neovide", + "theme", + "preview" +}) do require("config." .. name) end diff --git a/lua/config/lsp-settings.lua b/lua/config/lsp-settings.lua index 63a8164..c569c8d 100644 --- a/lua/config/lsp-settings.lua +++ b/lua/config/lsp-settings.lua @@ -1,35 +1,35 @@ local on_attach = function(_, bufnr) - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - vim.o.signcolumn = 'yes' + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + vim.o.signcolumn = "yes" local map = function(from, to) - vim.keymap.set('n', from, to, + vim.keymap.set("n", from, to, { noremap = true, silent = true, buffer = bufnr } ) end - map('gd', vim.lsp.buf.definition) - map('gr', vim.lsp.buf.references) - map('gi', vim.lsp.buf.implementation) - map('gD', vim.lsp.buf.declaration) + map("gd", vim.lsp.buf.definition) + map("gr", vim.lsp.buf.references) + map("gi", vim.lsp.buf.implementation) + map("gD", vim.lsp.buf.declaration) - map('K', vim.lsp.buf.hover) - map('', vim.lsp.buf.signature_help) + map("K", vim.lsp.buf.hover) + map("", vim.lsp.buf.signature_help) - map('wa', vim.lsp.buf.add_workspace_folder) - map('wr', vim.lsp.buf.remove_workspace_folder) - map('wl', function() + map("wa", vim.lsp.buf.add_workspace_folder) + map("wr", vim.lsp.buf.remove_workspace_folder) + map("wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) - map('D', vim.lsp.buf.type_definition) - map('rn', vim.lsp.buf.rename) - map('ca', vim.lsp.buf.code_action) - map('fm', function() + map("D", vim.lsp.buf.type_definition) + map("rn", vim.lsp.buf.rename) + map("ca", vim.lsp.buf.code_action) + map("fm", function() vim.lsp.buf.format { async = true } end) end -local capabilities = require 'cmp_nvim_lsp'.default_capabilities( +local capabilities = require "cmp_nvim_lsp".default_capabilities( vim.lsp.protocol.make_client_capabilities() ) diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index c892668..ed3d3f2 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -1,56 +1,56 @@ -local u = require 'config.utils' +local u = require "config.utils" -- terminal local m = u.mapping -m.map('t', '', '') -m.map('t', '', 'h') -m.map('t', '', 'j') -m.map('t', '', 'k') -m.map('t', '', 'l') -m.nmap('tm', 'belowright 7sptermsetlocal nonuA') +m.map("t", "", "") +m.map("t", "", "h") +m.map("t", "", "j") +m.map("t", "", "k") +m.map("t", "", "l") +m.nmap("tm", "belowright 7sptermsetlocal nonuA") -- off search highlight when escape is pressed -m.nmap('', 'noh') +m.nmap("", "noh") -- spell checking -m.cmd('spl', 'setlocal spell spelllang=en_us') -m.cmd('spL', 'setlocal nospell') +m.cmd("spl", "setlocal spell spelllang=en_us") +m.cmd("spL", "setlocal nospell") -- lsp -m.nmap('E', vim.diagnostic.open_float) -m.nmap('[d', vim.diagnostic.goto_prev) -m.nmap(']d', vim.diagnostic.goto_next) -m.nmap('q', vim.diagnostic.setloclist) +m.nmap("E", vim.diagnostic.open_float) +m.nmap("[d", vim.diagnostic.goto_prev) +m.nmap("]d", vim.diagnostic.goto_next) +m.nmap("q", vim.diagnostic.setloclist) -- colemak-dh local l = u.layout -l.swap('n', 'h') -l.swap('e', 'j') -l.swap('i', 'k') -l.swap('o', 'l') -l.map('e','gj') -l.map('i','gk') +l.swap("n", "h") +l.swap("e", "j") +l.swap("i", "k") +l.swap("o", "l") +l.map("e","gj") +l.map("i","gk") -l.swap('n', 'h') -l.swap('e', 'j') -l.swap('i', 'k') -l.swap('o', 'l') -l.swap('N', 'H') -l.swap('E', 'J') -l.swap('I', 'K') -l.swap('O', 'L') +l.swap("n", "h") +l.swap("e", "j") +l.swap("i", "k") +l.swap("o", "l") +l.swap("N", "H") +l.swap("E", "J") +l.swap("I", "K") +l.swap("O", "L") -l.swap('N', 'H') -l.swap('O', 'L') +l.swap("N", "H") +l.swap("O", "L") -l.map('', 'h') -l.map('', 'j') -l.map('', 'k') -l.map('', 'l') +l.map("", "h") +l.map("", "j") +l.map("", "k") +l.map("", "l") -l.map('', 'vert res -1') -l.map('', 'vert res +1') +l.map("", "vert res -1") +l.map("", "vert res +1") -- ascension -m.map('x','p', '\"_dp') +m.map("x","p", "\"_dp") diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua index 06d1427..2af5d06 100644 --- a/lua/config/plugins.lua +++ b/lua/config/plugins.lua @@ -1,26 +1,15 @@ -local fn = vim.fn - -- bootstrap -local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd [[packadd packer.nvim]] +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end +vim.opt.rtp:prepend(lazypath) -local packer = require('packer') -packer.startup(function(use) - use 'wbthomason/packer.nvim' - - -- plugin categories - require 'config.plugins.telescope'(use) - require 'config.plugins.tree'(use) - require 'config.plugins.cmp'(use) - require 'config.plugins.lsp'(use) - require 'config.plugins.visual'(use) - require 'config.plugins.util'(use) - - -- sync if bootstrapped - if PACKER_BOOTSTRAP then - require('packer').sync() - end -end) +require("lazy").setup("plugins") diff --git a/lua/config/plugins/cmp.lua b/lua/config/plugins/cmp.lua deleted file mode 100644 index c270ad6..0000000 --- a/lua/config/plugins/cmp.lua +++ /dev/null @@ -1,36 +0,0 @@ -return function(use) - use 'hrsh7th/cmp-nvim-lsp' - use 'hrsh7th/cmp-buffer' - use 'hrsh7th/cmp-path' - use 'hrsh7th/cmp-cmdline' - use { - 'hrsh7th/nvim-cmp', - config = function() - local cmp = require 'cmp' - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.select_next_item(), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - { name = 'neorg' }, - }), - }) - end - } - - use 'L3MON4D3/LuaSnip' - use 'saadparwaiz1/cmp_luasnip' -end diff --git a/lua/config/plugins/telescope.lua b/lua/config/plugins/telescope.lua deleted file mode 100644 index 562c58c..0000000 --- a/lua/config/plugins/telescope.lua +++ /dev/null @@ -1,39 +0,0 @@ -return function(use) - use { - 'nvim-telescope/telescope.nvim', - tag = '0.1.0', - requires = { 'nvim-lua/plenary.nvim' }, - config = function() - require 'telescope'.setup {} - - local u = require 'config.utils'.mapping - - u.cmd('ff', 'Telescope find_files') - u.cmd('fg', 'Telescope live_grep') - u.cmd('fb', 'Telescope buffers') - u.cmd('fh', 'Telescope help_tags') - end - } - use { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make', - requires = { 'nvim-telescope/telescope.nvim' }, - -- doesn't work? - -- config = function() require 'telescope'.load_extension('fzf') end - } - use { - 'nvim-telescope/telescope-ui-select.nvim', - requires = { 'nvim-telescope/telescope.nvim' }, - config = function() require 'telescope'.load_extension('ui-select') end - } - use({ - 'ziontee113/icon-picker.nvim', - requires = { 'stevearc/dressing.nvim' }, - config = function() - require('icon-picker').setup {} - local u = require 'config.utils'.mapping - u.cmd('fi', 'IconPickerYank alt_font symbols nerd_font emoji') - vim.keymap.set('i', '', 'IconPickerInsert alt_font symbols nerd_font emoji') - end, - }) -end diff --git a/lua/config/plugins/visual.lua b/lua/config/plugins/visual.lua deleted file mode 100644 index 909c8c4..0000000 --- a/lua/config/plugins/visual.lua +++ /dev/null @@ -1,62 +0,0 @@ -return function(use) - use { - 'navarasu/onedark.nvim', - config = function() - require 'onedark'.setup { style = 'darker' } - require 'onedark'.load() - package.loaded['config.theme'] = nil - require 'config.theme' - end - } - use { - 'norcalli/nvim-colorizer.lua', - config = function() - if vim.o.termguicolors then - require 'colorizer'.setup() - end - end - } - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true }, - config = function() - require 'lualine'.setup {} - -- refresh bar when cursor moved to update line & col - local cb = function() - require 'lualine'.refresh { - scope = 'window', - place = { 'statusline' }, - } - end - --[[local group = vim.api.nvim_create_augroup('lualine', {}) - vim.api.nvim_create_autocmd('CursorMoved', { - group = group, - callback = cb - })]] - end - } - use { - 'lewis6991/gitsigns.nvim', - config = function() require 'gitsigns'.setup() end - } - use { - 'nvim-treesitter/nvim-treesitter', - run = function() - require 'nvim-treesitter.install'.update { - with_sync = true - } - end, - config = function() - require 'nvim-treesitter.configs'.setup { - ensure_installed = {"norg"}, - highlight = { enable = true } - } - end, - } - use { - 'elkowar/yuck.vim' - } - use { - 'kmonad/kmonad-vim' - } -end diff --git a/lua/config/preview.lua b/lua/config/preview.lua index 3ab17db..ec8a477 100644 --- a/lua/config/preview.lua +++ b/lua/config/preview.lua @@ -1,17 +1,15 @@ -local u = require 'config.utils' +local g = vim.api.nvim_create_augroup("preview", {}) -local g = vim.api.nvim_create_augroup('preview', {}) - -vim.api.nvim_create_autocmd('BufWritePost', { +vim.api.nvim_create_autocmd("BufWritePost", { group = g, - pattern = '*.tex', + pattern = "*.tex", callback = function(arg) - local dir = arg.file:match('.*/') - local args = '' + local dir = arg.file:match(".*/") + local args = "" if dir ~= nil then - args = '-output-directory=\''..dir..'\' ' + args = "-output-directory='"..dir.."' " end - vim.cmd('silent exec "!pdflatex '..args..'\''..arg.file..'\'"') + vim.cmd("silent exec \"!pdflatex "..args.."'"..arg.file.."'\"") end }) diff --git a/lua/config/reload.lua b/lua/config/reload.lua index 916f916..911c348 100644 --- a/lua/config/reload.lua +++ b/lua/config/reload.lua @@ -1,28 +1,18 @@ -local u = require 'config.utils'.load +local u = require "config.utils".load -local g = vim.api.nvim_create_augroup('reload', {}) +local g = vim.api.nvim_create_augroup("reload", {}) -- reload these files when written to for _, mod in ipairs({ - 'reload', - 'settings', - 'mappings', - 'utils', - 'neovide', - 'theme', - 'preview', -}) do u.mod_post_write(g, 'config.' .. mod, u.reload) end + "reload", + "settings", + "mappings", + "utils", + "neovide", + "theme", + "preview", +}) do u.mod_post_write(g, "config." .. mod, u.reload) end -- reload plugin files when written to -u.mod_post_write(g, 'config.plugins', function(mod) - u.reload(mod) - require 'packer'.compile() -end) -u.mod_post_write(g, 'config.plugins.*', function(mod) - print(mod) - u.unload(mod) - u.reload('config.plugins') - require 'packer'.compile() -end) diff --git a/lua/config/settings.lua b/lua/config/settings.lua index 0020c7f..3ba3945 100644 --- a/lua/config/settings.lua +++ b/lua/config/settings.lua @@ -5,19 +5,19 @@ local g = vim.g o.number = true o.relativenumber = true o.showmode = false -o.clipboard = 'unnamedplus' +o.clipboard = "unnamedplus" -g.mapleader = ' ' -vim.cmd('filetype plugin on') -vim.cmd('syntax on') +g.mapleader = " " +vim.cmd("filetype plugin on") +vim.cmd("syntax on") -- line break (wrapping) settings o.linebreak = true o.breakindent = true -o.showbreak = '\\ ' +o.showbreak = "\\ " -- lines after end of file empty instead of ~ (fillchars) -o.fcs = 'eob: ' +o.fcs = "eob: " -- tab o.expandtab = true @@ -25,7 +25,7 @@ o.softtabstop = 4 o.shiftwidth = 4 -- turn of gui colors if in tty -if os.getenv('TERM') ~= 'linux' then +if os.getenv("TERM") ~= "linux" then o.termguicolors = true else o.termguicolors = false @@ -39,6 +39,5 @@ for type, icon in pairs(signs) do end vim.diagnostic.config({ - virtual_text = { prefix = '●' }; + virtual_text = { prefix = "●" }, }) - diff --git a/lua/config/theme.lua b/lua/config/theme.lua index 55a96fe..544813f 100644 --- a/lua/config/theme.lua +++ b/lua/config/theme.lua @@ -6,14 +6,14 @@ local gbhl = function(name, color) end -- highlight extra white space with red -hl('ExtraWhitespace', { ctermbg = 'red', bg = '#ff8888' }) +hl("ExtraWhitespace", { ctermbg = "red", bg = "#ff8888" }) vim.cmd [[match ExtraWhitespace /\s\+$/]] -- make background transparent -gbhl('Normal', 'none') -gbhl('EndOfBuffer', 'none') -gbhl('SignColumn', 'none') -gbhl('NeoTreeNormal', 'none') -gbhl('NeoTreeNormalNC', 'none') -gbhl('NeoTreeEndOfBuffer', 'none') +gbhl("Normal", "none") +gbhl("EndOfBuffer", "none") +gbhl("SignColumn", "none") +gbhl("NeoTreeNormal", "none") +gbhl("NeoTreeNormalNC", "none") +gbhl("NeoTreeEndOfBuffer", "none") diff --git a/lua/config/utils.lua b/lua/config/utils.lua index 7ffaef9..a96b870 100644 --- a/lua/config/utils.lua +++ b/lua/config/utils.lua @@ -3,16 +3,16 @@ local opts = { noremap = true, silent = true } -- mapping local mapping = {} mapping.map = function(mode, from, to) vim.keymap.set(mode, from, to, opts) end -mapping.nmap = function(from, to) vim.keymap.set('n', from, to, opts) end +mapping.nmap = function(from, to) vim.keymap.set("n", from, to, opts) end mapping.cmd = function(from, content) - vim.keymap.set('n', from, '' .. content .. '', opts) + vim.keymap.set("n", from, "" .. content .. "", opts) end -- layout (mapping) local layout = {} layout.map = function(from, to) - vim.keymap.set('n', from, to, opts) - vim.keymap.set('x', from, to, opts) + vim.keymap.set("n", from, to, opts) + vim.keymap.set("x", from, to, opts) end layout.swap = function(a, b) layout.map(a, b) @@ -22,10 +22,10 @@ mapping.layout = layout -- loading stuff local load = {} -load.lua_path = vim.fn.stdpath('config') .. '/lua/' +load.lua_path = vim.fn.stdpath("config") .. "/lua/" load.post_write = function(group, path, fn) - vim.api.nvim_create_autocmd('BufWritePost', { + vim.api.nvim_create_autocmd("BufWritePost", { group = group, pattern = load.lua_path .. path, callback = fn, @@ -33,12 +33,12 @@ load.post_write = function(group, path, fn) end load.mod_post_write = function(group, mod, fn) local set_name = false - if mod:sub(-1, -1) == '*' then set_name = true end - local path = mod:gsub('[.]', '/') .. '.lua' + if mod:sub(-1, -1) == "*" then set_name = true end + local path = mod:gsub("[.]", "/") .. ".lua" load.post_write(group, path, function(arg) local m = mod if set_name then - local name = arg.file:match('.*/(.*).lua') + local name = arg.file:match(".*/(.*).lua") m = mod:sub(0, -2) .. name end fn(m, arg) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..df35369 --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,39 @@ +local config = function() + local cmp = require("cmp") + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs( -4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.select_next_item(), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + { name = "neorg" }, + }), + }) +end + +return { + { + "hrsh7th/nvim-cmp", + config = config, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + } + }, + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", +} diff --git a/lua/config/plugins/lsp.lua b/lua/plugins/lsp.lua similarity index 51% rename from lua/config/plugins/lsp.lua rename to lua/plugins/lsp.lua index edb839e..e1a2b8e 100644 --- a/lua/config/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,15 +1,15 @@ local config = function() - local settings = require 'config.lsp-settings' + local settings = require("config.lsp-settings") local on_attach = settings.on_attach local capabilities = settings.capabilities - require 'lspconfig'.lua_ls.setup { + require("lspconfig").lua_ls.setup { on_attach = on_attach, capabilities = capabilities, settings = { Lua = { diagnostics = { - globals = { 'vim' }, + globals = { "vim" }, }, workspace = { library = vim.api.nvim_get_runtime_file("", true), @@ -22,57 +22,64 @@ local config = function() }, } - require 'rust-tools'.setup { - server = { - on_attach = on_attach, - capabilities = capabilities, - } - } - vim.g.markdown_fenced_languages = { "ts=typescript" } - require 'lspconfig'.denols.setup { + require("lspconfig").denols.setup { on_attach = on_attach, capabilities = capabilities, } - require 'lspconfig'.clangd.setup { + require("lspconfig").clangd.setup { on_attach = on_attach, capabilities = capabilities, } - require 'lspconfig'.asm_lsp.setup { + require("lspconfig").asm_lsp.setup { on_attach = on_attach, capabilities = capabilities, } - require 'lspconfig'.pylsp.setup { + require("lspconfig").pylsp.setup { on_attach = on_attach, capabilities = capabilities, } - require'lspconfig'.kotlin_language_server.setup { + require("lspconfig").kotlin_language_server.setup { on_attach = on_attach, capabilities = capabilities } end -return function(use) - use { - 'neovim/nvim-lspconfig', - config = config - } - use { - 'simrat39/rust-tools.nvim', - requires = { - 'nvim-lua/plenary.nvim', - 'mfussenegger/nvim-dap', +local rs_config = function() + local settings = require "config.lsp-settings" + local on_attach = settings.on_attach + local capabilities = settings.capabilities + require "rust-tools".setup { + server = { + on_attach = on_attach, + capabilities = capabilities, } } - use { - 'windwp/nvim-autopairs', - config = function() require 'nvim-autopairs'.setup {} end - } - use { - 'scalameta/nvim-metals', - requires = { "nvim-lua/plenary.nvim" } - } - use 'mfussenegger/nvim-jdtls' end + +return { + { + "neovim/nvim-lspconfig", + config = config + }, + { + "simrat39/rust-tools.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "mfussenegger/nvim-dap", + }, + rs_config = rs_config + }, + { + "windwp/nvim-autopairs", + config = function() require "nvim-autopairs".setup {} end + }, + { + "scalameta/nvim-metals", + dependencies = { "nvim-lua/plenary.nvim" } + }, + "mfussenegger/nvim-jdtls", + "folke/neodev.nvim" +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..b52bb3c --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,38 @@ +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.0", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("telescope").setup {} + + local u = require("config.utils").mapping + + u.cmd("ff", "Telescope find_files") + u.cmd("fg", "Telescope live_grep") + u.cmd("fb", "Telescope buffers") + u.cmd("fh", "Telescope help_tags") + end + }, + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() require("telescope").load_extension("fzf") end + }, + { + "nvim-telescope/telescope-ui-select.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() require("telescope").load_extension("ui-select") end + }, + { + "ziontee113/icon-picker.nvim", + dependencies = { "stevearc/dressing.nvim" }, + config = function() + require("icon-picker").setup {} + local u = require("config.utils").mapping + u.cmd("fi", "IconPickerYank alt_font symbols nerd_font emoji") + vim.keymap.set("i", "", "IconPickerInsert alt_font symbols nerd_font emoji") + end, + } +} diff --git a/lua/config/plugins/tree.lua b/lua/plugins/tree.lua similarity index 89% rename from lua/config/plugins/tree.lua rename to lua/plugins/tree.lua index 9b56c35..7169d0d 100644 --- a/lua/config/plugins/tree.lua +++ b/lua/plugins/tree.lua @@ -1,15 +1,15 @@ -return function(use) - use { +return { + { 'nvim-neo-tree/neo-tree.nvim', branch = "v2.x", - requires = { + dependencies = { 'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons', 'MunifTanjim/nui.nvim' }, config = function() vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]] - require 'neo-tree'.setup { + require('neo-tree').setup { close_if_last_window = true, filesystem = { filtered_items = { @@ -29,4 +29,4 @@ return function(use) u.cmd('e', 'Neotree toggle') end } -end +} diff --git a/lua/config/plugins/util.lua b/lua/plugins/util.lua similarity index 55% rename from lua/config/plugins/util.lua rename to lua/plugins/util.lua index 8270c70..07b0687 100644 --- a/lua/config/plugins/util.lua +++ b/lua/plugins/util.lua @@ -1,5 +1,5 @@ -return function(use) - use { +return { + { 'nvim-neorg/neorg', tag = '0.0.12', config = function() @@ -16,16 +16,6 @@ return function(use) } } end, - requires = 'nvim-lua/plenary.nvim' - } - use({ - "iamcco/markdown-preview.nvim", - run = function() vim.fn["mkdp#util#install"]() end, - }) - vim.cmd([[ - function! OpenMarkdownPreview (url) - execute "silent ! firefox --new-window " . a:url - endfunction - let g:mkdp_browserfunc = 'OpenMarkdownPreview' - ]]) -end + dependencies = 'nvim-lua/plenary.nvim' + }, +} diff --git a/lua/plugins/visual.lua b/lua/plugins/visual.lua new file mode 100644 index 0000000..a70cefd --- /dev/null +++ b/lua/plugins/visual.lua @@ -0,0 +1,46 @@ +return { + { + "navarasu/onedark.nvim", + config = function() + require("onedark").setup { style = "darker" } + require("onedark").load() + package.loaded["config.theme"] = nil + require("config.theme") + end + }, + { + "norcalli/nvim-colorizer.lua", + config = function() + if vim.o.termguicolors then + require("colorizer").setup() + end + end + }, + { + "nvim-lualine/lualine.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + config = function() + require("lualine").setup {} + end + }, + { + "lewis6991/gitsigns.nvim", + config = function() require("gitsigns").setup() end + }, + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update { + with_sync = true + } + end, + config = function() + require("nvim-treesitter.configs").setup { + ensure_installed = { "norg" }, + highlight = { enable = true } + } + end, + }, + "elkowar/yuck.vim", + "kmonad/kmonad-vim" +}