From af22846ff4cdc8cdcbe1764a0c72a027093cbb0e Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 6 Sep 2023 10:19:56 +0200 Subject: [PATCH] moving naming to plex --- init.lua | 13 +- lua/{rafi => plex}/config/autocmds.lua | 2 +- lua/{rafi => plex}/config/init.lua | 28 ++-- lua/{rafi => plex}/config/keymaps.lua | 152 +++++++----------- lua/{rafi => plex}/config/options.lua | 10 +- lua/{rafi => plex}/init.lua | 2 +- lua/{rafi => plex}/lib/badge.lua | 4 +- lua/{rafi => plex}/lib/color.lua | 0 lua/{rafi => plex}/lib/contextmenu.lua | 0 lua/{rafi => plex}/lib/edit.lua | 0 lua/{rafi => plex}/lib/preview.lua | 0 lua/{rafi => plex}/lib/utils.lua | 2 +- lua/{rafi => plex}/plugins/coding.lua | 4 +- lua/{rafi => plex}/plugins/colorscheme.lua | 0 lua/{rafi => plex}/plugins/core.lua | 2 +- lua/{rafi => plex}/plugins/editor.lua | 14 +- .../plugins/extras/coding/autopairs.lua | 0 .../plugins/extras/coding/cmp-git.lua | 0 .../plugins/extras/coding/copilot.lua | 7 +- .../plugins/extras/coding/editorconfig.lua | 0 .../plugins/extras/coding/emmet.lua | 2 +- .../plugins/extras/coding/sandwich.lua | 0 .../plugins/extras/diagnostics/proselint.lua | 0 .../plugins/extras/diagnostics/write-good.lua | 0 .../plugins/extras/editor/anyjump.lua | 2 +- .../plugins/extras/editor/flybuf.lua | 0 .../plugins/extras/editor/sidebar.lua | 0 .../plugins/extras/editor/ufo.lua | 0 .../plugins/extras/formatting/prettier.lua | 0 .../plugins/extras/git/fugitive.lua | 0 .../plugins/extras/lang/ansible.lua | 2 +- .../plugins/extras/lang/docker.lua | 0 lua/{rafi => plex}/plugins/extras/lang/go.lua | 2 +- .../plugins/extras/lang/helm.lua | 0 .../plugins/extras/lang/json.lua | 0 .../plugins/extras/lang/python.lua | 0 .../plugins/extras/lang/terraform.lua | 0 .../plugins/extras/lang/typescript.lua | 0 .../plugins/extras/lang/yaml.lua | 0 .../plugins/extras/linting/ruff.lua | 2 +- lua/{rafi => plex}/plugins/extras/lsp/gtd.lua | 0 .../plugins/extras/lsp/inlayhints.lua | 0 .../plugins/extras/lsp/lightbulb.lua | 0 .../plugins/extras/lsp/null-ls.lua | 0 .../plugins/extras/lsp/yaml-companion.lua | 2 +- .../plugins/extras/org/vimwiki.lua | 1 + .../plugins/extras/treesitter/treesj.lua | 0 .../plugins/extras/ui/barbecue.lua | 2 +- .../plugins/extras/ui/bufferline.lua | 4 +- .../plugins/extras/ui/cursorword.lua | 2 +- lua/{rafi => plex}/plugins/extras/ui/cybu.lua | 0 .../plugins/extras/ui/deadcolumn.lua | 0 .../plugins/extras/ui/goto-preview.lua | 0 .../plugins/extras/ui/incline.lua | 0 .../plugins/extras/ui/minimap.lua | 0 .../plugins/extras/ui/statuscol.lua | 0 lua/{rafi => plex}/plugins/git.lua | 2 +- lua/{rafi => plex}/plugins/lsp/format.lua | 4 +- lua/{rafi => plex}/plugins/lsp/highlight.lua | 2 +- lua/{rafi => plex}/plugins/lsp/init.lua | 18 +-- lua/{rafi => plex}/plugins/lsp/keymaps.lua | 6 +- lua/{rafi => plex}/plugins/lualine.lua | 18 +-- lua/{rafi => plex}/plugins/neo-tree.lua | 25 +-- lua/{rafi => plex}/plugins/telescope.lua | 6 +- lua/{rafi => plex}/plugins/treesitter.lua | 0 lua/{rafi => plex}/plugins/ui.lua | 6 +- lua/plugins/neo-tree.lua | 78 --------- lua/plugins/org/neorg.lua | 22 --- 68 files changed, 159 insertions(+), 289 deletions(-) rename lua/{rafi => plex}/config/autocmds.lua (98%) rename lua/{rafi => plex}/config/init.lua (93%) rename lua/{rafi => plex}/config/keymaps.lua (67%) rename lua/{rafi => plex}/config/options.lua (96%) rename lua/{rafi => plex}/init.lua (68%) rename lua/{rafi => plex}/lib/badge.lua (97%) rename lua/{rafi => plex}/lib/color.lua (100%) rename lua/{rafi => plex}/lib/contextmenu.lua (100%) rename lua/{rafi => plex}/lib/edit.lua (100%) rename lua/{rafi => plex}/lib/preview.lua (100%) rename lua/{rafi => plex}/lib/utils.lua (98%) rename lua/{rafi => plex}/plugins/coding.lua (98%) rename lua/{rafi => plex}/plugins/colorscheme.lua (100%) rename lua/{rafi => plex}/plugins/core.lua (76%) rename lua/{rafi => plex}/plugins/editor.lua (98%) rename lua/{rafi => plex}/plugins/extras/coding/autopairs.lua (100%) rename lua/{rafi => plex}/plugins/extras/coding/cmp-git.lua (100%) rename lua/{rafi => plex}/plugins/extras/coding/copilot.lua (93%) rename lua/{rafi => plex}/plugins/extras/coding/editorconfig.lua (100%) rename lua/{rafi => plex}/plugins/extras/coding/emmet.lua (91%) rename lua/{rafi => plex}/plugins/extras/coding/sandwich.lua (100%) rename lua/{rafi => plex}/plugins/extras/diagnostics/proselint.lua (100%) rename lua/{rafi => plex}/plugins/extras/diagnostics/write-good.lua (100%) rename lua/{rafi => plex}/plugins/extras/editor/anyjump.lua (90%) rename lua/{rafi => plex}/plugins/extras/editor/flybuf.lua (100%) rename lua/{rafi => plex}/plugins/extras/editor/sidebar.lua (100%) rename lua/{rafi => plex}/plugins/extras/editor/ufo.lua (100%) rename lua/{rafi => plex}/plugins/extras/formatting/prettier.lua (100%) rename lua/{rafi => plex}/plugins/extras/git/fugitive.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/ansible.lua (96%) rename lua/{rafi => plex}/plugins/extras/lang/docker.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/go.lua (98%) rename lua/{rafi => plex}/plugins/extras/lang/helm.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/json.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/python.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/terraform.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/typescript.lua (100%) rename lua/{rafi => plex}/plugins/extras/lang/yaml.lua (100%) rename lua/{rafi => plex}/plugins/extras/linting/ruff.lua (93%) rename lua/{rafi => plex}/plugins/extras/lsp/gtd.lua (100%) rename lua/{rafi => plex}/plugins/extras/lsp/inlayhints.lua (100%) rename lua/{rafi => plex}/plugins/extras/lsp/lightbulb.lua (100%) rename lua/{rafi => plex}/plugins/extras/lsp/null-ls.lua (100%) rename lua/{rafi => plex}/plugins/extras/lsp/yaml-companion.lua (91%) rename lua/{rafi => plex}/plugins/extras/org/vimwiki.lua (98%) rename lua/{rafi => plex}/plugins/extras/treesitter/treesj.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/barbecue.lua (93%) rename lua/{rafi => plex}/plugins/extras/ui/bufferline.lua (89%) rename lua/{rafi => plex}/plugins/extras/ui/cursorword.lua (93%) rename lua/{rafi => plex}/plugins/extras/ui/cybu.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/deadcolumn.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/goto-preview.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/incline.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/minimap.lua (100%) rename lua/{rafi => plex}/plugins/extras/ui/statuscol.lua (100%) rename lua/{rafi => plex}/plugins/git.lua (99%) rename lua/{rafi => plex}/plugins/lsp/format.lua (96%) rename lua/{rafi => plex}/plugins/lsp/highlight.lua (95%) rename lua/{rafi => plex}/plugins/lsp/init.lua (94%) rename lua/{rafi => plex}/plugins/lsp/keymaps.lua (96%) rename lua/{rafi => plex}/plugins/lualine.lua (92%) rename lua/{rafi => plex}/plugins/neo-tree.lua (93%) rename lua/{rafi => plex}/plugins/telescope.lua (98%) rename lua/{rafi => plex}/plugins/treesitter.lua (100%) rename lua/{rafi => plex}/plugins/ui.lua (98%) delete mode 100644 lua/plugins/neo-tree.lua delete mode 100644 lua/plugins/org/neorg.lua diff --git a/init.lua b/init.lua index f01d08e..3e9aef9 100644 --- a/init.lua +++ b/init.lua @@ -1,18 +1,17 @@ -- rafi Neovim entry-point -- https://git.cscherr.de/PlexSheep/neovim-conf -local config = require('rafi.config') +local config = require('plex.config') config.ensure_lazy() -- Start lazy.nvim plugin manager. require('lazy').setup(vim.tbl_extend('keep', config.user_lazy_opts(), { spec = { - { import = 'rafi.plugins' }, - { import = 'rafi.plugins.extras.lang.go' }, - { import = 'rafi.plugins.extras.lang.json' }, - { import = 'rafi.plugins.extras.lang.python' }, - { import = 'rafi.plugins.extras.lang.yaml' }, - { import = 'plugins' }, + { import = 'plex.plugins' }, + { import = 'plex.plugins.extras.lang.go' }, + { import = 'plex.plugins.extras.lang.json' }, + { import = 'plex.plugins.extras.lang.python' }, + { import = 'plex.plugins.extras.lang.yaml' }, -- This will load a custom user lua/plugins.lua or lua/plugins/* config.has_user_plugins() and { import = 'plugins' } or nil, diff --git a/lua/rafi/config/autocmds.lua b/lua/plex/config/autocmds.lua similarity index 98% rename from lua/rafi/config/autocmds.lua rename to lua/plex/config/autocmds.lua index 26850fa..44289c8 100644 --- a/lua/rafi/config/autocmds.lua +++ b/lua/plex/config/autocmds.lua @@ -5,7 +5,7 @@ -- This file is automatically loaded by rafi.config.init local function augroup(name) - return vim.api.nvim_create_augroup('rafi_' .. name, {}) + return vim.api.nvim_create_augroup('plex_' .. name, {}) end -- Check if we need to reload the file when it changed diff --git a/lua/rafi/config/init.lua b/lua/plex/config/init.lua similarity index 93% rename from lua/rafi/config/init.lua rename to lua/plex/config/init.lua index a91db87..c9bf8dc 100644 --- a/lua/rafi/config/init.lua +++ b/lua/plex/config/init.lua @@ -4,22 +4,22 @@ -- This is part of LazyVim's code, with my modifications. -- See: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/init.lua ----@type RafiConfig +---@type plexConfig local M = {} M.lazy_version = '>=9.1.0' ----@class RafiConfig +---@class plexConfig local defaults = { -- Load the default settings -- stylua: ignore defaults = { - autocmds = true, -- rafi.config.autocmds - keymaps = true, -- rafi.config.keymaps - -- rafi.config.options can't be configured here since it's loaded + autocmds = true, -- plex.config.autocmds + keymaps = true, -- plex.config.keymaps + -- plex.config.options can't be configured here since it's loaded -- prematurely. You can disable loading options with the following line at -- the top of your lua/config/setup.lua or init.lua: - -- `package.loaded['rafi.config.options'] = true` + -- `package.loaded['plex.config.options'] = true` }, -- String like `habamax` or a function that will load the colorscheme. @@ -107,12 +107,12 @@ function M.init() if not M.did_init then M.did_init = true -- delay notifications till vim.notify was replaced or after 500ms - require('rafi.config').lazy_notify() + require('plex.config').lazy_notify() -- load options here, before lazy init while sourcing plugin modules -- this is needed to make sure options will be correctly applied -- after installing missing plugins - require('rafi.config').load('options') + require('plex.config').load('options') -- carry over plugin options that their name has been changed. local Plugin = require('lazy.core.plugin') @@ -127,10 +127,10 @@ function M.init() end end ----@type RafiConfig +---@type plexConfig local options --- Load rafi and user config files. +-- Load plex and user config files. ---@param user_opts table|nil function M.setup(user_opts) if not M.did_init then @@ -153,7 +153,7 @@ function M.setup(user_opts) options = vim.tbl_deep_extend('force', options, user_setup.override()) end for feat_name, feat_val in pairs(options.features) do - vim.g['rafi_' .. feat_name] = feat_val + vim.g['plex_' .. feat_name] = feat_val end M.load('autocmds') @@ -209,9 +209,9 @@ function M.load(name) end, }) end - -- always load rafi's file, then user file + -- always load plex's file, then user file if M.defaults[name] or name == 'options' then - _load('rafi.config.' .. name) + _load('plex.config.' .. name) end _load('config.' .. name) if vim.bo.filetype == 'lazy' then @@ -310,7 +310,7 @@ setmetatable(M, { if options == nil then return vim.deepcopy(defaults)[key] end - ---@cast options RafiConfig + ---@cast options plexConfig return options[key] end, }) diff --git a/lua/rafi/config/keymaps.lua b/lua/plex/config/keymaps.lua similarity index 67% rename from lua/rafi/config/keymaps.lua rename to lua/plex/config/keymaps.lua index cc3f9f2..0b893c2 100644 --- a/lua/rafi/config/keymaps.lua +++ b/lua/plex/config/keymaps.lua @@ -2,21 +2,24 @@ -- github.com/rafi/vim-config -- === --- This file is automatically loaded by rafi.config.init +-- This file is automatically loaded by plex.config.init -local Util = require('rafi.lib.utils') +local Util = require('plex.lib.utils') local map = vim.keymap.set local function augroup(name) - return vim.api.nvim_create_augroup('rafi_' .. name, {}) + return vim.api.nvim_create_augroup('plex_' .. name, {}) end --- Elite-mode: Arrow-keys resize window -if vim.g.rafi_elite_mode then - map('n', '', 'resize +1', { desc = 'Resize Window' }) - map('n', '', 'resize -1', { desc = 'Resize Window' }) - map('n', '', 'vertical resize +1', { desc = 'Resize Window' }) - map('n', '', 'vertical resize -1', { desc = 'Resize Window' }) +-- enable elite mode, for people that are more used to vim than non-vim +vim.g.plex_elite_mode = true + +-- Elite-mode: ctrl + Arrow-keys resize window +if vim.g.plex_elite_mode then + map('n', '', 'resize +1', { desc = 'Resize Window' }) + map('n', '', 'resize -1', { desc = 'Resize Window' }) + map('n', '', 'vertical resize +1', { desc = 'Resize Window' }) + map('n', '', 'vertical resize -1', { desc = 'Resize Window' }) end -- Package-manager @@ -27,16 +30,13 @@ map('n', 'l', 'Lazy', { desc = 'Open Lazy UI' }) -- Navigation -- === --- Moves through display-lines, unless count is provided -map({ 'n', 'x' }, 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ 'n', 'x' }, 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +-- Move faster between lines +map({ 'n', 'x' }, 'J', "v:count == 30 ? 'gj' : 'J'", { expr = true, silent = true }) +map({ 'n', 'x' }, 'K', "v:count == 30 ? 'gk' : 'K'", { expr = true, silent = true }) -- Easier line-wise movement -map('n', 'gh', 'g^') -map('n', 'gl', 'g$') - -map('n', '', 'V', { desc = 'Visual Mode' }) -map('x', '', '', { desc = 'Exit Visual Mode' }) +map('n', 'H', 'g^') +map('n', 'L', 'g$') -- Toggle fold or select option from popup menu ---@return string @@ -52,22 +52,20 @@ if not Util.has('mini.bracketed') and not Util.has('trouble.nvim') then map('n', ']q', 'cnext', { desc = 'Next Quickfix Item' }) map('n', '[q', 'cprev', { desc = 'Previous Quickfix Item' }) end -map('n', ']a', 'lnext', { desc = 'Next Loclist Item' }) -map('n', '[a', 'lprev', { desc = 'Previous Loclist Item' }) +map('n', '', 'lnext', { desc = 'Next Loclist Item' }) +map('n', '', 'lprev', { desc = 'Previous Loclist Item' }) -- Whitespace jump (see plugin/whitespace.vim) map('n', ']s', function() - require('rafi.lib.edit').whitespace_jump(1) + require('plex.lib.edit').whitespace_jump(1) end, { desc = 'Next Whitespace' }) map('n', '[s', function() - require('rafi.lib.edit').whitespace_jump(-1) + require('plex.lib.edit').whitespace_jump(-1) end, { desc = 'Previous Whitespace' }) -- Navigation in command line map('c', '', '') map('c', '', '') -map('c', '', '') -map('c', '', '') -- Scroll step sideways map('n', 'zl', 'z4l') @@ -107,22 +105,23 @@ map('i', '', 'o', { desc = 'Start Newline' }) map('x', '<', '', '>gv|', { desc = 'Indent Left and Re-select' }) +-- Arrows to move identation in normal mode +map('n', '', '<<', { desc = 'Indent Right and Re-select' }) +map('n', '', '>>', { desc = 'Indent Left and Re-select' }) + -- Use tab for indenting in visual/select mode map('x', '', '>gv|', { desc = 'Indent Left' }) map('x', '', 'k', 'move-2==', { desc = 'Move line up' }) -map('n', 'j', 'move+==', { desc = 'Move line down' }) -map('x', 'k', ":move'<-2gv=gv", { desc = 'Move selection up' }) -map('x', 'j', ":move'>+gv=gv", { desc = 'Move selection down' }) +-- Drag current line/s vertically and auto-indent with Arrow up/down +map('n', '', 'move-2==', { desc = 'Move line up' }) +map('n', '', 'move+==', { desc = 'Move line down' }) +map('x', '', ":move'<-2gv=gv", { desc = 'Move selection up' }) +map('x', '', ":move'>+gv=gv", { desc = 'Move selection down' }) -- Duplicate lines without affecting PRIMARY and CLIPBOARD selections. -map('n', 'd', 'm`""Y""P``', { desc = 'Duplicate line' }) -map('x', 'd', '""Y""Pgv', { desc = 'Duplicate selection' }) - --- Duplicate paragraph -map('n', 'cp', 'yapp', { desc = 'Duplicate Paragraph' }) +map('n', 'yyp', 'm`""Y""P``', { desc = 'Duplicate line' }) +map('x', 'yyp', '""Y""Pgv', { desc = 'Duplicate selection' }) -- Remove spaces at the end of lines map('n', 'cw', 'lua MiniTrailspace.trim()', { desc = 'Erase Whitespace' }) @@ -130,11 +129,9 @@ map('n', 'cw', 'lua MiniTrailspace.trim()', { desc = 'Erase Whi -- Search & Replace -- === --- Switch */g* and #/g# -map('n', '*', 'g*') -map('n', 'g*', '*') -map('n', '#', 'g#') -map('n', 'g#', '#') +-- Make marks with m[some key] +-- go to mark with #[some key] +map('n', '#', '\'') -- Clear search with map('n', '', 'noh', { desc = 'Clear Search Highlight' }) @@ -154,16 +151,7 @@ map({ 'n', 'x' }, '', '%', { remap = true, desc = 'Jump to Paren' }) map('n', 'gpp', "'`['.strpart(getregtype(), 0, 1).'`]'", { expr = true, desc = 'Select Paste' }) -- Quick substitute within selected area -map('x', 'sg', ':s//gc', { desc = 'Substitute Within Selection' }) - --- C-r: Easier search and replace visual/select mode -map( - 'x', - '', - ":%s/\\V=v:lua.require'rafi.lib.edit'.get_visual_selection()" - .. '//gc', - { desc = 'Replace Selection' } -) +map('x', 'sub', ':s//gc', { desc = 'Substitute Within Selection' }) -- Command & History -- === @@ -172,28 +160,15 @@ map( map('n', '!', ':!', { desc = 'Execute Shell Command' }) -- Put vim command output into buffer -map('n', 'g!', ":put=execute('')", { desc = 'Paste Command' }) - --- Switch history search pairs, matching my bash shell ----@return string -map('c', '', function() - return vim.fn.pumvisible() == 1 and '' or '' -end, { expr = true }) - -map('c', '', function() - return vim.fn.pumvisible() == 1 and '' or '' -end, { expr = true }) - -map('c', '', '') -map('c', '', '') +--map('n', 'g!', ":put=execute('')", { desc = 'Paste Command' }) -- Allow misspellings -vim.cmd.cnoreabbrev('qw', 'wq') -vim.cmd.cnoreabbrev('Wq', 'wq') -vim.cmd.cnoreabbrev('WQ', 'wq') -vim.cmd.cnoreabbrev('Qa', 'qa') -vim.cmd.cnoreabbrev('Bd', 'bd') -vim.cmd.cnoreabbrev('bD', 'bd') +--vim.cmd.cnoreabbrev('qw', 'wq') +--vim.cmd.cnoreabbrev('Wq', 'wq') +--vim.cmd.cnoreabbrev('WQ', 'wq') +--vim.cmd.cnoreabbrev('Qa', 'qa') +--vim.cmd.cnoreabbrev('Bd', 'bd') +--vim.cmd.cnoreabbrev('bD', 'bd') -- File operations -- === @@ -208,18 +183,18 @@ map('n', 'cd', function() end, { desc = 'Change Local Directory' }) -- Fast saving from all modes -map('n', 'w', 'write', { desc = 'Save' }) -map({ 'n', 'i', 'v' }, '', 'write', { desc = 'Save' }) +--map('n', 'w', 'write', { desc = 'Save' }) +--map({ 'n', 'i', 'v' }, '', 'write', { desc = 'Save' }) -- Editor UI -- === -- Toggle editor's visual effects -map('n', 'uf', require('rafi.plugins.lsp.format').toggle, { desc = 'Toggle format on Save' }) +map('n', 'uf', require('plex.plugins.lsp.format').toggle, { desc = 'Toggle format on Save' }) map('n', 'us', 'setlocal spell!', { desc = 'Toggle Spellcheck' }) map('n', 'ul', 'setlocal nonumber!', { desc = 'Toggle Line Numbers' }) +map('n', 'ulr', 'setlocal nornu!', { desc = 'Toggle Relative Line Numbers' }) map('n', 'uo', 'setlocal nolist!', { desc = 'Toggle Whitespace Symbols' }) -map('n', 'uu', 'nohlsearch', { desc = 'Hide Search Highlight' }) if vim.lsp.inlay_hint then map('n', 'uh', function() vim.lsp.inlay_hint(0, nil) end, { desc = 'Toggle Inlay Hints' }) @@ -240,14 +215,10 @@ end, { desc = 'Toggle Wrap' }) -- Tabs: Many ways to navigate them map('n', '', 'tabnext', { desc = 'Next Tab' }) map('n', '', 'tabprevious', { desc = 'Previous Tab' }) -map('n', '', 'tabprevious', { desc = 'Previous Tab' }) -map('n', '', 'tabnext', { desc = 'Next Tab' }) -map('n', '', 'tabnext', { desc = 'Next Tab' }) -map('n', '', 'tabprevious', { desc = 'Previous Tab' }) -- Moving tabs -map('n', '', '-tabmove', { desc = 'Tab Move Backwards' }) -map('n', '', '+tabmove', { desc = 'Tab Move Forwards' }) +map('n', '', '-tabmove', { desc = 'Tab Move Backwards' }) +map('n', '', '+tabmove', { desc = 'Tab Move Forwards' }) -- Show treesitter nodes under cursor -- highlights under cursor @@ -260,25 +231,25 @@ end -- Append mode-line to current buffer map('n', 'ml', function() - require('rafi.lib.edit').append_modeline() + require('plex.lib.edit').append_modeline() end, { desc = 'Append Modeline' }) -- Jump entire buffers throughout jumplist -map('n', 'g', function() - require('rafi.lib.edit').jump_buffer(1) -end, { desc = 'Jump to newer buffer' }) -map('n', 'g', function() - require('rafi.lib.edit').jump_buffer(-1) -end, { desc = 'Jump to older buffer' }) +--map('n', 'g', function() +-- require('plex.lib.edit').jump_buffer(1) +--end, { desc = 'Jump to newer buffer' }) +--map('n', 'g', function() +-- require('plex.lib.edit').jump_buffer(-1) +--end, { desc = 'Jump to older buffer' }) -- Context aware menu. See lua/lib/contextmenu.lua map('n', 'c', function() - require('rafi.lib.contextmenu').show() + require('plex.lib.contextmenu').show() end, { desc = 'Content-aware menu' }) -- Lazygit +map('n', 'gg', function() Util.float_term({ 'lazygit' }, { cwd = Util.get_root(), esc_esc = false }) end, { desc = 'Lazygit (root dir)' }) map('n', 'tg', function() Util.float_term({ 'lazygit' }, { cwd = Util.get_root(), esc_esc = false }) end, { desc = 'Lazygit (root dir)' }) -map('n', 'tG', function() Util.float_term({ 'lazygit' }, { esc_esc = false }) end, { desc = 'Lazygit (cwd)' }) -- Floating terminal map('t', '', '', { desc = 'Enter Normal Mode' }) @@ -307,7 +278,7 @@ end -- === -- Ultimatus Quitos -if vim.F.if_nil(vim.g.rafi_window_q_mapping, true) then +if vim.F.if_nil(vim.g.plex_window_q_mapping, true) then vim.api.nvim_create_autocmd({ 'BufWinEnter', 'VimEnter' }, { group = augroup('quit_mapping'), callback = function(event) @@ -321,7 +292,7 @@ end -- Toggle quickfix window map('n', 'q', function() - require('rafi.lib.edit').toggle_list('quickfix') + require('plex.lib.edit').toggle_list('quickfix') end, { desc = 'Open Quickfix' }) -- Set locations with diagnostics and open the list. @@ -329,7 +300,7 @@ map('n', 'a', function() if vim.bo.filetype ~= 'qf' then vim.diagnostic.setloclist({ open = false }) end - require('rafi.lib.edit').toggle_list('loclist') + require('plex.lib.edit').toggle_list('loclist') end, { desc = 'Open Location List' }) -- Switch with adjacent window @@ -357,3 +328,4 @@ map('n', 'sh', function() vim.o.background = 'dark' end end, { desc = 'Toggle background dark/light' }) +-- vim: set ts=2 sw=2 tw=80 noet : diff --git a/lua/rafi/config/options.lua b/lua/plex/config/options.lua similarity index 96% rename from lua/rafi/config/options.lua rename to lua/plex/config/options.lua index 25b3421..0b3769e 100644 --- a/lua/rafi/config/options.lua +++ b/lua/plex/config/options.lua @@ -19,10 +19,6 @@ opt.errorbells = true -- Trigger bell on error opt.virtualedit = 'block' -- Position cursor anywhere in visual blockd opt.confirm = true -- Confirm to save changes before exiting modified bufferd --- number -opt.number = true -- show line number -opt.relativenumber = false -- - -- History and persistence opt.history = 5000 opt.shada = { "'1000", "<50", "s10", "h" } @@ -135,12 +131,12 @@ opt.wildmode = 'longest:full,full' -- Command-line completion mode opt.termguicolors = true opt.shortmess:append({ W = true, I = true, c = true }) -opt.showmode = false -- Don't show mode in cmd window +opt.showmode = true -- Show mode in cmd window opt.scrolloff = 2 -- Keep at least 2 lines above/below opt.sidescrolloff = 5 -- Keep at least 5 lines left/right opt.numberwidth = 2 -- Minimum number of columns to use for the line number -opt.number = false -- Don't show line numbers -opt.ruler = false -- Disable default status ruler +opt.number = true -- Show line numbers +opt.ruler = true -- Default status ruler opt.list = true -- Show hidden characters opt.showtabline = 2 -- Always show the tabs line diff --git a/lua/rafi/init.lua b/lua/plex/init.lua similarity index 68% rename from lua/rafi/init.lua rename to lua/plex/init.lua index 39c642e..7cf4116 100644 --- a/lua/rafi/init.lua +++ b/lua/plex/init.lua @@ -2,7 +2,7 @@ local M = {} ---@param opts? RafiConfig function M.setup(opts) - require('rafi.config').setup(opts) + require('plex.config').setup(opts) end return M diff --git a/lua/rafi/lib/badge.lua b/lua/plex/lib/badge.lua similarity index 97% rename from lua/rafi/lib/badge.lua rename to lua/plex/lib/badge.lua index faf00af..a3d011c 100644 --- a/lua/rafi/lib/badge.lua +++ b/lua/plex/lib/badge.lua @@ -27,7 +27,7 @@ local cache_keys = { 'badge_cache_icon', } -local augroup = vim.api.nvim_create_augroup('rafi_badge', {}) +local augroup = vim.api.nvim_create_augroup('plex_badge', {}) -- Clear cached values that relate to buffer filename. vim.api.nvim_create_autocmd( @@ -60,7 +60,7 @@ local M = {} -- Try to guess the project's name ---@return string function M.project() - return vim.fn.fnamemodify(require('rafi.lib.utils').get_root(), ':t') or '' + return vim.fn.fnamemodify(require('plex.lib.utils').get_root(), ':t') or '' end -- Provides relative path with limited characters in each directory name, and diff --git a/lua/rafi/lib/color.lua b/lua/plex/lib/color.lua similarity index 100% rename from lua/rafi/lib/color.lua rename to lua/plex/lib/color.lua diff --git a/lua/rafi/lib/contextmenu.lua b/lua/plex/lib/contextmenu.lua similarity index 100% rename from lua/rafi/lib/contextmenu.lua rename to lua/plex/lib/contextmenu.lua diff --git a/lua/rafi/lib/edit.lua b/lua/plex/lib/edit.lua similarity index 100% rename from lua/rafi/lib/edit.lua rename to lua/plex/lib/edit.lua diff --git a/lua/rafi/lib/preview.lua b/lua/plex/lib/preview.lua similarity index 100% rename from lua/rafi/lib/preview.lua rename to lua/plex/lib/preview.lua diff --git a/lua/rafi/lib/utils.lua b/lua/plex/lib/utils.lua similarity index 98% rename from lua/rafi/lib/utils.lua rename to lua/plex/lib/utils.lua index f0de2dd..7592766 100644 --- a/lua/rafi/lib/utils.lua +++ b/lua/plex/lib/utils.lua @@ -5,7 +5,7 @@ local root_patterns = { '.git', '_darcs', '.hg', '.bzr', '.svn' } local M = {} -local augroup_lsp_attach = vim.api.nvim_create_augroup('rafi_lsp_attach', {}) +local augroup_lsp_attach = vim.api.nvim_create_augroup('plex_lsp_attach', {}) ---@param on_attach fun(client:lsp.Client, buffer:integer) function M.on_attach(on_attach) diff --git a/lua/rafi/plugins/coding.lua b/lua/plex/plugins/coding.lua similarity index 98% rename from lua/rafi/plugins/coding.lua rename to lua/plex/plugins/coding.lua index a991337..a245637 100644 --- a/lua/rafi/plugins/coding.lua +++ b/lua/plex/plugins/coding.lua @@ -111,8 +111,8 @@ return { }), formatting = { format = function(entry, vim_item) - -- Prepend with a fancy icon from config lua/rafi/config/init.lua - local icons = require('rafi.config').icons + -- Prepend with a fancy icon from config lua/plex/config/init.lua + local icons = require('plex.config').icons if entry.source.name == 'git' then vim_item.kind = icons.git else diff --git a/lua/rafi/plugins/colorscheme.lua b/lua/plex/plugins/colorscheme.lua similarity index 100% rename from lua/rafi/plugins/colorscheme.lua rename to lua/plex/plugins/colorscheme.lua diff --git a/lua/rafi/plugins/core.lua b/lua/plex/plugins/core.lua similarity index 76% rename from lua/rafi/plugins/core.lua rename to lua/plex/plugins/core.lua index efe9117..1bb456d 100644 --- a/lua/rafi/plugins/core.lua +++ b/lua/plex/plugins/core.lua @@ -1,4 +1,4 @@ -require('rafi.config').init() +require('plex.config').init() return { { 'folke/lazy.nvim', version = '*' }, diff --git a/lua/rafi/plugins/editor.lua b/lua/plex/plugins/editor.lua similarity index 98% rename from lua/rafi/plugins/editor.lua rename to lua/plex/plugins/editor.lua index 9d18802..adb4167 100644 --- a/lua/rafi/plugins/editor.lua +++ b/lua/plex/plugins/editor.lua @@ -49,14 +49,14 @@ return { -- Detect if stdin has been provided. vim.g.in_pager_mode = false vim.api.nvim_create_autocmd('StdinReadPre', { - group = vim.api.nvim_create_augroup('rafi_persisted', {}), + group = vim.api.nvim_create_augroup('plex_persisted', {}), callback = function() vim.g.in_pager_mode = true end, }) -- Close all floats before loading a session. (e.g. Lazy.nvim) vim.api.nvim_create_autocmd('User', { - group = 'rafi_persisted', + group = 'plex_persisted', pattern = 'PersistedLoadPre', callback = function() for _, win in pairs(vim.api.nvim_tabpage_list_wins(0)) do @@ -69,7 +69,7 @@ return { -- Close all plugin owned buffers before saving a session. vim.api.nvim_create_autocmd('User', { pattern = 'PersistedSavePre', - group = 'rafi_persisted', + group = 'plex_persisted', callback = function() -- Detect if window is owned by plugin by checking buftype. local current_buffer = vim.api.nvim_get_current_buf() @@ -90,7 +90,7 @@ return { -- current session to avoid previous session to be overwritten. vim.api.nvim_create_autocmd('User', { pattern = 'PersistedTelescopeLoadPre', - group = 'rafi_persisted', + group = 'plex_persisted', callback = function() require('persisted').save() require('persisted').stop() @@ -100,7 +100,7 @@ return { -- will be auto-saved. vim.api.nvim_create_autocmd('User', { pattern = 'PersistedTelescopeLoadPost', - group = 'rafi_persisted', + group = 'plex_persisted', callback = function(session) require('persisted').start() print('Started session ' .. session.data.name) @@ -148,7 +148,7 @@ return { -- also set it after loading ftplugins, since a lot overwrite [[ and ]] vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('rafi_illuminate', {}), + group = vim.api.nvim_create_augroup('plex_illuminate', {}), callback = function() local buffer = vim.api.nvim_get_current_buf() map(']]', 'next', buffer) @@ -365,7 +365,7 @@ return { }, init = function() vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('rafi_outline', {}), + group = vim.api.nvim_create_augroup('plex_outline', {}), pattern = 'Outline', callback = function() vim.opt_local.winhighlight = 'CursorLine:WildMenu' diff --git a/lua/rafi/plugins/extras/coding/autopairs.lua b/lua/plex/plugins/extras/coding/autopairs.lua similarity index 100% rename from lua/rafi/plugins/extras/coding/autopairs.lua rename to lua/plex/plugins/extras/coding/autopairs.lua diff --git a/lua/rafi/plugins/extras/coding/cmp-git.lua b/lua/plex/plugins/extras/coding/cmp-git.lua similarity index 100% rename from lua/rafi/plugins/extras/coding/cmp-git.lua rename to lua/plex/plugins/extras/coding/cmp-git.lua diff --git a/lua/rafi/plugins/extras/coding/copilot.lua b/lua/plex/plugins/extras/coding/copilot.lua similarity index 93% rename from lua/rafi/plugins/extras/coding/copilot.lua rename to lua/plex/plugins/extras/coding/copilot.lua index 79254e4..1af4b68 100644 --- a/lua/rafi/plugins/extras/coding/copilot.lua +++ b/lua/plex/plugins/extras/coding/copilot.lua @@ -6,6 +6,7 @@ return { ----------------------------------------------------------------------------- { 'zbirenbaum/copilot.lua', + enabled = false, cmd = 'Copilot', build = ':Copilot auth', opts = { @@ -24,7 +25,7 @@ return { optional = true, event = 'VeryLazy', opts = function(_, opts) - local get_color = require('rafi.lib.color').get_color + local get_color = require('plex.lib.color').get_color local fg = function(...) return { fg = get_color('fg', ...) } end @@ -38,7 +39,7 @@ return { -- Add copilot icon to lualine statusline table.insert(opts.sections.lualine_x, { function() - local icon = require('rafi.config').icons.kinds.Copilot + local icon = require('plex.config').icons.kinds.Copilot local status = require('copilot.api').status.data return icon .. (status.message or '') end, @@ -80,7 +81,7 @@ return { -- attach cmp source whenever copilot attaches -- fixes lazy-loading issues with the copilot cmp source ---@param client lsp.Client - require('rafi.lib.utils').on_attach(function(client) + require('plex.lib.utils').on_attach(function(client) if client.name == 'copilot' then copilot_cmp._on_insert_enter({}) end diff --git a/lua/rafi/plugins/extras/coding/editorconfig.lua b/lua/plex/plugins/extras/coding/editorconfig.lua similarity index 100% rename from lua/rafi/plugins/extras/coding/editorconfig.lua rename to lua/plex/plugins/extras/coding/editorconfig.lua diff --git a/lua/rafi/plugins/extras/coding/emmet.lua b/lua/plex/plugins/extras/coding/emmet.lua similarity index 91% rename from lua/rafi/plugins/extras/coding/emmet.lua rename to lua/plex/plugins/extras/coding/emmet.lua index 1b8ff61..4d4dc45 100644 --- a/lua/rafi/plugins/extras/coding/emmet.lua +++ b/lua/plex/plugins/extras/coding/emmet.lua @@ -10,7 +10,7 @@ return { end, config = function() vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('rafi_emmet', {}), + group = vim.api.nvim_create_augroup('plex_emmet', {}), pattern = { 'css', 'html', diff --git a/lua/rafi/plugins/extras/coding/sandwich.lua b/lua/plex/plugins/extras/coding/sandwich.lua similarity index 100% rename from lua/rafi/plugins/extras/coding/sandwich.lua rename to lua/plex/plugins/extras/coding/sandwich.lua diff --git a/lua/rafi/plugins/extras/diagnostics/proselint.lua b/lua/plex/plugins/extras/diagnostics/proselint.lua similarity index 100% rename from lua/rafi/plugins/extras/diagnostics/proselint.lua rename to lua/plex/plugins/extras/diagnostics/proselint.lua diff --git a/lua/rafi/plugins/extras/diagnostics/write-good.lua b/lua/plex/plugins/extras/diagnostics/write-good.lua similarity index 100% rename from lua/rafi/plugins/extras/diagnostics/write-good.lua rename to lua/plex/plugins/extras/diagnostics/write-good.lua diff --git a/lua/rafi/plugins/extras/editor/anyjump.lua b/lua/plex/plugins/extras/editor/anyjump.lua similarity index 90% rename from lua/rafi/plugins/extras/editor/anyjump.lua rename to lua/plex/plugins/extras/editor/anyjump.lua index d279abb..33134f5 100644 --- a/lua/rafi/plugins/extras/editor/anyjump.lua +++ b/lua/plex/plugins/extras/editor/anyjump.lua @@ -11,7 +11,7 @@ return { init = function() vim.g.any_jump_disable_default_keybindings = 1 vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('rafi_any-jump', {}), + group = vim.api.nvim_create_augroup('plex_any-jump', {}), pattern = 'any-jump', callback = function() vim.opt.cursorline = true diff --git a/lua/rafi/plugins/extras/editor/flybuf.lua b/lua/plex/plugins/extras/editor/flybuf.lua similarity index 100% rename from lua/rafi/plugins/extras/editor/flybuf.lua rename to lua/plex/plugins/extras/editor/flybuf.lua diff --git a/lua/rafi/plugins/extras/editor/sidebar.lua b/lua/plex/plugins/extras/editor/sidebar.lua similarity index 100% rename from lua/rafi/plugins/extras/editor/sidebar.lua rename to lua/plex/plugins/extras/editor/sidebar.lua diff --git a/lua/rafi/plugins/extras/editor/ufo.lua b/lua/plex/plugins/extras/editor/ufo.lua similarity index 100% rename from lua/rafi/plugins/extras/editor/ufo.lua rename to lua/plex/plugins/extras/editor/ufo.lua diff --git a/lua/rafi/plugins/extras/formatting/prettier.lua b/lua/plex/plugins/extras/formatting/prettier.lua similarity index 100% rename from lua/rafi/plugins/extras/formatting/prettier.lua rename to lua/plex/plugins/extras/formatting/prettier.lua diff --git a/lua/rafi/plugins/extras/git/fugitive.lua b/lua/plex/plugins/extras/git/fugitive.lua similarity index 100% rename from lua/rafi/plugins/extras/git/fugitive.lua rename to lua/plex/plugins/extras/git/fugitive.lua diff --git a/lua/rafi/plugins/extras/lang/ansible.lua b/lua/plex/plugins/extras/lang/ansible.lua similarity index 96% rename from lua/rafi/plugins/extras/lang/ansible.lua rename to lua/plex/plugins/extras/lang/ansible.lua index 4e52dcf..9f3d2c3 100644 --- a/lua/rafi/plugins/extras/lang/ansible.lua +++ b/lua/plex/plugins/extras/lang/ansible.lua @@ -26,7 +26,7 @@ return { -- Setup filetype settings vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('rafi_ftplugin_ansible', {}), + group = vim.api.nvim_create_augroup('plex_ftplugin_ansible', {}), pattern = 'ansible', callback = function() -- Add '.' to iskeyword for ansible modules, e.g. ansible.builtin.copy diff --git a/lua/rafi/plugins/extras/lang/docker.lua b/lua/plex/plugins/extras/lang/docker.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/docker.lua rename to lua/plex/plugins/extras/lang/docker.lua diff --git a/lua/rafi/plugins/extras/lang/go.lua b/lua/plex/plugins/extras/lang/go.lua similarity index 98% rename from lua/rafi/plugins/extras/lang/go.lua rename to lua/plex/plugins/extras/lang/go.lua index 0f0a847..a8c89fb 100644 --- a/lua/rafi/plugins/extras/lang/go.lua +++ b/lua/plex/plugins/extras/lang/go.lua @@ -95,7 +95,7 @@ return { gopls = function(_, _) -- workaround for gopls not supporting semanticTokensProvider -- https://github.com/golang/go/issues/54531#issuecomment-1464982242 - require('rafi.lib.utils').on_attach(function(client, _) + require('plex.lib.utils').on_attach(function(client, _) if client.name == 'gopls' then if not client.server_capabilities.semanticTokensProvider then local semantic = diff --git a/lua/rafi/plugins/extras/lang/helm.lua b/lua/plex/plugins/extras/lang/helm.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/helm.lua rename to lua/plex/plugins/extras/lang/helm.lua diff --git a/lua/rafi/plugins/extras/lang/json.lua b/lua/plex/plugins/extras/lang/json.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/json.lua rename to lua/plex/plugins/extras/lang/json.lua diff --git a/lua/rafi/plugins/extras/lang/python.lua b/lua/plex/plugins/extras/lang/python.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/python.lua rename to lua/plex/plugins/extras/lang/python.lua diff --git a/lua/rafi/plugins/extras/lang/terraform.lua b/lua/plex/plugins/extras/lang/terraform.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/terraform.lua rename to lua/plex/plugins/extras/lang/terraform.lua diff --git a/lua/rafi/plugins/extras/lang/typescript.lua b/lua/plex/plugins/extras/lang/typescript.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/typescript.lua rename to lua/plex/plugins/extras/lang/typescript.lua diff --git a/lua/rafi/plugins/extras/lang/yaml.lua b/lua/plex/plugins/extras/lang/yaml.lua similarity index 100% rename from lua/rafi/plugins/extras/lang/yaml.lua rename to lua/plex/plugins/extras/lang/yaml.lua diff --git a/lua/rafi/plugins/extras/linting/ruff.lua b/lua/plex/plugins/extras/linting/ruff.lua similarity index 93% rename from lua/rafi/plugins/extras/linting/ruff.lua rename to lua/plex/plugins/extras/linting/ruff.lua index c06a2e2..20592da 100644 --- a/lua/rafi/plugins/extras/linting/ruff.lua +++ b/lua/plex/plugins/extras/linting/ruff.lua @@ -17,7 +17,7 @@ return { opts.root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor() - require('rafi.lib.utils').on_attach(function(client, _) + require('plex.lib.utils').on_attach(function(client, _) if client.name == 'ruff_lsp' then client.server_capabilities.hoverProvider = false end diff --git a/lua/rafi/plugins/extras/lsp/gtd.lua b/lua/plex/plugins/extras/lsp/gtd.lua similarity index 100% rename from lua/rafi/plugins/extras/lsp/gtd.lua rename to lua/plex/plugins/extras/lsp/gtd.lua diff --git a/lua/rafi/plugins/extras/lsp/inlayhints.lua b/lua/plex/plugins/extras/lsp/inlayhints.lua similarity index 100% rename from lua/rafi/plugins/extras/lsp/inlayhints.lua rename to lua/plex/plugins/extras/lsp/inlayhints.lua diff --git a/lua/rafi/plugins/extras/lsp/lightbulb.lua b/lua/plex/plugins/extras/lsp/lightbulb.lua similarity index 100% rename from lua/rafi/plugins/extras/lsp/lightbulb.lua rename to lua/plex/plugins/extras/lsp/lightbulb.lua diff --git a/lua/rafi/plugins/extras/lsp/null-ls.lua b/lua/plex/plugins/extras/lsp/null-ls.lua similarity index 100% rename from lua/rafi/plugins/extras/lsp/null-ls.lua rename to lua/plex/plugins/extras/lsp/null-ls.lua diff --git a/lua/rafi/plugins/extras/lsp/yaml-companion.lua b/lua/plex/plugins/extras/lsp/yaml-companion.lua similarity index 91% rename from lua/rafi/plugins/extras/lsp/yaml-companion.lua rename to lua/plex/plugins/extras/lsp/yaml-companion.lua index 3bd9ad6..378c822 100644 --- a/lua/rafi/plugins/extras/lsp/yaml-companion.lua +++ b/lua/plex/plugins/extras/lsp/yaml-companion.lua @@ -6,7 +6,7 @@ return { setup = { yamlls = function(_, _) local yamlls_opts = require('yaml-companion').setup( - require('rafi.lib.utils').opts('yaml-companion.nvim') + require('plex.lib.utils').opts('yaml-companion.nvim') ) require('lspconfig')['yamlls'].setup(yamlls_opts) return true diff --git a/lua/rafi/plugins/extras/org/vimwiki.lua b/lua/plex/plugins/extras/org/vimwiki.lua similarity index 98% rename from lua/rafi/plugins/extras/org/vimwiki.lua rename to lua/plex/plugins/extras/org/vimwiki.lua index f96f55b..a0d00eb 100644 --- a/lua/rafi/plugins/extras/org/vimwiki.lua +++ b/lua/plex/plugins/extras/org/vimwiki.lua @@ -1,6 +1,7 @@ return { { 'vimwiki/vimwiki', + enabled = false, cmd = { 'VimwikiIndex', 'VimwikiUISelect' }, keys = { { 'W', 'VimwikiIndex', { noremap = true } }, diff --git a/lua/rafi/plugins/extras/treesitter/treesj.lua b/lua/plex/plugins/extras/treesitter/treesj.lua similarity index 100% rename from lua/rafi/plugins/extras/treesitter/treesj.lua rename to lua/plex/plugins/extras/treesitter/treesj.lua diff --git a/lua/rafi/plugins/extras/ui/barbecue.lua b/lua/plex/plugins/extras/ui/barbecue.lua similarity index 93% rename from lua/rafi/plugins/extras/ui/barbecue.lua rename to lua/plex/plugins/extras/ui/barbecue.lua index 89c76ef..db3ef36 100644 --- a/lua/rafi/plugins/extras/ui/barbecue.lua +++ b/lua/plex/plugins/extras/ui/barbecue.lua @@ -15,7 +15,7 @@ return { opts = function() local kind_icons = vim.tbl_map(function(icon) return vim.trim(icon) - end, require('rafi.config').icons.kinds) + end, require('plex.config').icons.kinds) return { attach_navic = false, show_dirname = false, diff --git a/lua/rafi/plugins/extras/ui/bufferline.lua b/lua/plex/plugins/extras/ui/bufferline.lua similarity index 89% rename from lua/rafi/plugins/extras/ui/bufferline.lua rename to lua/plex/plugins/extras/ui/bufferline.lua index 2371e8c..9fdeb9c 100644 --- a/lua/rafi/plugins/extras/ui/bufferline.lua +++ b/lua/plex/plugins/extras/ui/bufferline.lua @@ -11,14 +11,14 @@ return { diagnostics = false, always_show_bufferline = true, diagnostics_indicator = function(_, _, diag) - local icons = require('rafi.config').icons.diagnostics + local icons = require('plex.config').icons.diagnostics local ret = (diag.error and icons.Error .. diag.error .. ' ' or '') .. (diag.warning and icons.Warn .. diag.warning or '') return vim.trim(ret) end, custom_areas = { right = function() - local project_root = require('rafi.lib.badge').project() + local project_root = require('plex.lib.badge').project() local result = {} local part = {} part.text = '%#BufferLineTab# ' .. project_root diff --git a/lua/rafi/plugins/extras/ui/cursorword.lua b/lua/plex/plugins/extras/ui/cursorword.lua similarity index 93% rename from lua/rafi/plugins/extras/ui/cursorword.lua rename to lua/plex/plugins/extras/ui/cursorword.lua index 70dc73f..6a99446 100644 --- a/lua/rafi/plugins/extras/ui/cursorword.lua +++ b/lua/plex/plugins/extras/ui/cursorword.lua @@ -6,7 +6,7 @@ return { vim.g.cursorword = 0 end, config = function() - local augroup = vim.api.nvim_create_augroup('rafi_cursorword', {}) + local augroup = vim.api.nvim_create_augroup('plex_cursorword', {}) vim.api.nvim_create_autocmd('FileType', { group = augroup, pattern = { diff --git a/lua/rafi/plugins/extras/ui/cybu.lua b/lua/plex/plugins/extras/ui/cybu.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/cybu.lua rename to lua/plex/plugins/extras/ui/cybu.lua diff --git a/lua/rafi/plugins/extras/ui/deadcolumn.lua b/lua/plex/plugins/extras/ui/deadcolumn.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/deadcolumn.lua rename to lua/plex/plugins/extras/ui/deadcolumn.lua diff --git a/lua/rafi/plugins/extras/ui/goto-preview.lua b/lua/plex/plugins/extras/ui/goto-preview.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/goto-preview.lua rename to lua/plex/plugins/extras/ui/goto-preview.lua diff --git a/lua/rafi/plugins/extras/ui/incline.lua b/lua/plex/plugins/extras/ui/incline.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/incline.lua rename to lua/plex/plugins/extras/ui/incline.lua diff --git a/lua/rafi/plugins/extras/ui/minimap.lua b/lua/plex/plugins/extras/ui/minimap.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/minimap.lua rename to lua/plex/plugins/extras/ui/minimap.lua diff --git a/lua/rafi/plugins/extras/ui/statuscol.lua b/lua/plex/plugins/extras/ui/statuscol.lua similarity index 100% rename from lua/rafi/plugins/extras/ui/statuscol.lua rename to lua/plex/plugins/extras/ui/statuscol.lua diff --git a/lua/rafi/plugins/git.lua b/lua/plex/plugins/git.lua similarity index 99% rename from lua/rafi/plugins/git.lua rename to lua/plex/plugins/git.lua index 15530f4..48a6225 100644 --- a/lua/rafi/plugins/git.lua +++ b/lua/plex/plugins/git.lua @@ -87,7 +87,7 @@ return { opts = function() local actions = require('diffview.actions') vim.api.nvim_create_autocmd({ 'WinEnter', 'BufEnter' }, { - group = vim.api.nvim_create_augroup('rafi_diffview', {}), + group = vim.api.nvim_create_augroup('plex_diffview', {}), pattern = 'diffview:///panels/*', callback = function() vim.opt_local.cursorline = true diff --git a/lua/rafi/plugins/lsp/format.lua b/lua/plex/plugins/lsp/format.lua similarity index 96% rename from lua/rafi/plugins/lsp/format.lua rename to lua/plex/plugins/lsp/format.lua index 6b7bed7..67b3c29 100644 --- a/lua/rafi/plugins/lsp/format.lua +++ b/lua/plex/plugins/lsp/format.lua @@ -53,7 +53,7 @@ function M.format(opts) filter = function(client) return vim.tbl_contains(client_ids, client.id) end, - }, require('rafi.lib.utils').opts('nvim-lspconfig').format or {})) + }, require('plex.lib.utils').opts('nvim-lspconfig').format or {})) end ---@param formatters LazyVimFormatters @@ -154,7 +154,7 @@ end function M.setup(opts) M.opts = opts vim.api.nvim_create_autocmd('BufWritePre', { - group = vim.api.nvim_create_augroup('rafi_format', {}), + group = vim.api.nvim_create_augroup('plex_format', {}), callback = function() if M.opts.autoformat then M.format() diff --git a/lua/rafi/plugins/lsp/highlight.lua b/lua/plex/plugins/lsp/highlight.lua similarity index 95% rename from lua/rafi/plugins/lsp/highlight.lua rename to lua/plex/plugins/lsp/highlight.lua index 7d90651..91a2fc4 100644 --- a/lua/rafi/plugins/lsp/highlight.lua +++ b/lua/plex/plugins/lsp/highlight.lua @@ -9,7 +9,7 @@ local M = {} ---@param client lsp.Client ---@param bufnr integer function M.on_attach(client, bufnr) - if require('rafi.lib.utils').has('vim-illuminate') then + if require('plex.lib.utils').has('vim-illuminate') then -- Skipped setup for document_highlight, illuminate is installed. return end diff --git a/lua/rafi/plugins/lsp/init.lua b/lua/plex/plugins/lsp/init.lua similarity index 94% rename from lua/rafi/plugins/lsp/init.lua rename to lua/plex/plugins/lsp/init.lua index ee75143..c27fce8 100644 --- a/lua/rafi/plugins/lsp/init.lua +++ b/lua/plex/plugins/lsp/init.lua @@ -18,7 +18,7 @@ return { { 'hrsh7th/cmp-nvim-lsp', cond = function() - return require('rafi.lib.utils').has('nvim-cmp') + return require('plex.lib.utils').has('nvim-cmp') end, }, }, @@ -90,19 +90,19 @@ return { }, ---@param opts PluginLspOpts config = function(_, opts) - if require('rafi.lib.utils').has('neoconf.nvim') then + if require('plex.lib.utils').has('neoconf.nvim') then local plugin = require('lazy.core.config').spec.plugins['neoconf.nvim'] require('neoconf').setup(require('lazy.core.plugin').values(plugin, 'opts', false)) end -- Setup autoformat - require('rafi.plugins.lsp.format').setup(opts) + require('plex.plugins.lsp.format').setup(opts) -- Setup formatting, keymaps and highlights. - local lsp_on_attach = require('rafi.lib.utils').on_attach + local lsp_on_attach = require('plex.lib.utils').on_attach ---@param client lsp.Client ---@param buffer integer lsp_on_attach(function(client, buffer) - require('rafi.plugins.lsp.keymaps').on_attach(client, buffer) - require('rafi.plugins.lsp.highlight').on_attach(client, buffer) + require('plex.plugins.lsp.keymaps').on_attach(client, buffer) + require('plex.plugins.lsp.highlight').on_attach(client, buffer) if vim.diagnostic.is_disabled() or vim.bo[buffer].buftype ~= '' then vim.diagnostic.disable(buffer) @@ -120,13 +120,13 @@ return { local client = vim.lsp.get_client_by_id(client_id) local buffer = vim.api.nvim_get_current_buf() if client ~= nil then - require('rafi.plugins.lsp.keymaps').on_attach(client, buffer) + require('plex.plugins.lsp.keymaps').on_attach(client, buffer) end return ret end -- Diagnostics signs and highlights - for type, icon in pairs(require('rafi.config').icons.diagnostics) do + for type, icon in pairs(require('plex.config').icons.diagnostics) do local hl = 'DiagnosticSign' .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' }) end @@ -148,7 +148,7 @@ return { opts.diagnostics.virtual_text.prefix = vim.fn.has('nvim-0.10') == 0 and '●' or function(diagnostic) - local icons = require('rafi.config').icons.diagnostics + local icons = require('plex.config').icons.diagnostics for d, icon in pairs(icons) do if diagnostic.severity == vim.diagnostic.severity[d:upper()] then return icon diff --git a/lua/rafi/plugins/lsp/keymaps.lua b/lua/plex/plugins/lsp/keymaps.lua similarity index 96% rename from lua/rafi/plugins/lsp/keymaps.lua rename to lua/plex/plugins/lsp/keymaps.lua index 597d33d..c116913 100644 --- a/lua/rafi/plugins/lsp/keymaps.lua +++ b/lua/plex/plugins/lsp/keymaps.lua @@ -12,7 +12,7 @@ function M.get() return M._keys end local format = function() - require('rafi.plugins.lsp.format').format({ force = true }) + require('plex.plugins.lsp.format').format({ force = true }) end ---@class PluginLspKeys @@ -36,7 +36,7 @@ function M.get() { 'K', function() -- Show hover documentation or folded lines. - local winid = require('rafi.lib.utils').has('nvim-ufo') + local winid = require('plex.lib.utils').has('nvim-ufo') and require('ufo').peekFoldedLinesUnderCursor() or nil if not winid then vim.lsp.buf.hover() @@ -99,7 +99,7 @@ function M.resolve(buffer) add(keymap) end - local opts = require('rafi.lib.utils').opts('nvim-lspconfig') + local opts = require('plex.lib.utils').opts('nvim-lspconfig') local clients if vim.lsp.get_clients ~= nil then clients = vim.lsp.get_clients({ bufnr = buffer }) diff --git a/lua/rafi/plugins/lualine.lua b/lua/plex/plugins/lualine.lua similarity index 92% rename from lua/rafi/plugins/lualine.lua rename to lua/plex/plugins/lualine.lua index 4e6dda0..ff71c8f 100644 --- a/lua/rafi/plugins/lualine.lua +++ b/lua/plex/plugins/lualine.lua @@ -15,12 +15,12 @@ return { vim.g.qf_disable_statusline = true end, opts = function() - local icons = require('rafi.config').icons - local get_color = require('rafi.lib.color').get_color + local icons = require('plex.config').icons + local get_color = require('plex.lib.color').get_color local fg = function(...) return { fg = get_color('fg', ...) } end local function filepath() - local fpath = require('rafi.lib.badge').filepath(0, 3, 5) + local fpath = require('plex.lib.badge').filepath(0, 3, 5) -- % char must be escaped in statusline. return fpath:gsub('%%', '%%%%') end @@ -53,11 +53,11 @@ return { x = active, y = { fg = active.fg, - bg = require('rafi.lib.color').brightness_modifier(active.bg, -20), + bg = require('plex.lib.color').brightness_modifier(active.bg, -20), }, z = { fg = active.fg, - bg = require('rafi.lib.color').brightness_modifier(active.bg, 63), + bg = require('plex.lib.color').brightness_modifier(active.bg, 63), }, }, inactive = { @@ -116,7 +116,7 @@ return { }, lualine_b = { { - function() return require('rafi.lib.badge').icon() end, + function() return require('plex.lib.badge').icon() end, padding = { left = 1, right = 0 }, }, { @@ -160,7 +160,7 @@ return { -- Whitespace trails { - function() return require('rafi.lib.badge').trails('␣') end, + function() return require('plex.lib.badge').trails('␣') end, cond = is_file_window, padding = { left = 1, right = 0 }, color = { fg = get_color('bg', {'Identifier'}, '#b294bb') }, @@ -229,7 +229,7 @@ return { }, lualine_y = { { - function() return require('rafi.lib.badge').filemedia('  ') end, + function() return require('plex.lib.badge').filemedia('  ') end, cond = function() return is_min_width(70) end, separator = { left = '' }, padding = 1, @@ -254,7 +254,7 @@ return { inactive_sections = { lualine_a = { { - function() return require('rafi.lib.badge').icon() end, + function() return require('plex.lib.badge').icon() end, padding = 1, }, { filepath, padding = { left = 1, right = 0 } }, diff --git a/lua/rafi/plugins/neo-tree.lua b/lua/plex/plugins/neo-tree.lua similarity index 93% rename from lua/rafi/plugins/neo-tree.lua rename to lua/plex/plugins/neo-tree.lua index 8afacca..fd91e78 100644 --- a/lua/rafi/plugins/neo-tree.lua +++ b/lua/plex/plugins/neo-tree.lua @@ -48,9 +48,9 @@ return { desc = 'Explorer NeoTree Toggle', }, { - 'a', - 'Neotree filesystem left reveal dir=./', - desc = 'Explorer NeoTree Reveal', + '', + 'Neotree filesystem left toggle dir=./', + desc = 'Explorer NeoTree Toggle', }, }, deactivate = function() @@ -80,15 +80,15 @@ return { }, }, - event_handlers = { - -- Close neo-tree when opening a file. - { - event = 'file_opened', - handler = function() - require('neo-tree').close_all() - end, - }, - }, + -- event_handlers = { + -- -- Close neo-tree when opening a file. + -- { + -- event = 'file_opened', + -- handler = function() + -- require('neo-tree').close_all() + -- end, + -- }, + -- }, default_component_configs = { indent = { @@ -138,6 +138,7 @@ return { ['l'] = 'open_drop', ['h'] = 'close_node', ['C'] = 'close_node', + [''] = 'set_root', ['z'] = 'close_all_nodes', [''] = 'refresh', diff --git a/lua/rafi/plugins/telescope.lua b/lua/plex/plugins/telescope.lua similarity index 98% rename from lua/rafi/plugins/telescope.lua rename to lua/plex/plugins/telescope.lua index ba0413c..e9cdf97 100644 --- a/lua/rafi/plugins/telescope.lua +++ b/lua/plex/plugins/telescope.lua @@ -122,7 +122,7 @@ end -- Enable indent-guides in telescope preview vim.api.nvim_create_autocmd('User', { pattern = 'TelescopePreviewerLoaded', - group = vim.api.nvim_create_augroup('rafi_telescope', {}), + group = vim.api.nvim_create_augroup('plex_telescope', {}), callback = function(args) if args.buf ~= vim.api.nvim_win_get_buf(0) then return @@ -286,7 +286,7 @@ return { 'gg', function() require('telescope.builtin').live_grep({ - default_text = require('rafi.lib.edit').get_visual_selection(), + default_text = require('plex.lib.edit').get_visual_selection(), }) end, mode = 'x', @@ -406,7 +406,7 @@ return { ['p'] = function() local entry = require('telescope.actions.state').get_selected_entry() - require('rafi.lib.preview').open(entry.path) + require('plex.lib.preview').open(entry.path) end, }, diff --git a/lua/rafi/plugins/treesitter.lua b/lua/plex/plugins/treesitter.lua similarity index 100% rename from lua/rafi/plugins/treesitter.lua rename to lua/plex/plugins/treesitter.lua diff --git a/lua/rafi/plugins/ui.lua b/lua/plex/plugins/ui.lua similarity index 98% rename from lua/rafi/plugins/ui.lua rename to lua/plex/plugins/ui.lua index 9737f3b..33ee63d 100644 --- a/lua/rafi/plugins/ui.lua +++ b/lua/plex/plugins/ui.lua @@ -149,7 +149,7 @@ return { ---@param client lsp.Client ---@param buffer integer - require('rafi.lib.utils').on_attach(function(client, buffer) + require('plex.lib.utils').on_attach(function(client, buffer) if client.server_capabilities.documentSymbolProvider then require('nvim-navic').attach(client, buffer) end @@ -159,7 +159,7 @@ return { return { separator = '  ', highlight = true, - icons = require('rafi.config').icons.kinds, + icons = require('plex.config').icons.kinds, } end, }, @@ -188,7 +188,7 @@ return { }, init = function() -- When noice is not enabled, install notify on VeryLazy - local Util = require('rafi.lib.utils') + local Util = require('plex.lib.utils') if not Util.has('noice.nvim') then Util.on_very_lazy(function() vim.notify = require('notify') diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua deleted file mode 100644 index 81919fb..0000000 --- a/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,78 +0,0 @@ -local winwidth = 30 - --- Toggle width. -local toggle_width = function() - local max = winwidth * 2 - local cur_width = vim.fn.winwidth(0) - local half = math.floor((winwidth + (max - winwidth) / 2) + 0.4) - local new_width = winwidth - if cur_width == winwidth then - new_width = half - elseif cur_width == half then - new_width = max - else - new_width = winwidth - end - vim.cmd(new_width .. ' wincmd |') -end - -return { - -- Change builtin plugins' options - { - 'nvim-neo-tree/neo-tree.nvim', - keys = { - { - '', - 'Neotree filesystem left toggle dir=./', - desc = 'Explorer NeoTree Toggle', - }, - }, - -- FIXME: Delete the damn event handler, keep the file window open when I - -- tell it to! - event_handlers = {nil}, - window = { - width = winwidth, - mappings = { - ['q'] = 'close_window', - ['?'] = 'noop', - [''] = 'noop', - - ['g?'] = 'show_help', - ['<2-LeftMouse>'] = 'open', - [''] = 'open_with_window_picker', - ['l'] = 'open_drop', - ['h'] = 'close_node', - ['C'] = 'close_node', - [''] = 'set_root', - ['z'] = 'close_all_nodes', - [''] = 'refresh', - - ['s'] = 'noop', - ['sv'] = 'open_split', - ['sg'] = 'open_vsplit', - ['st'] = 'open_tabnew', - - ['c'] = { 'copy', config = { show_path = 'relative' } }, - ['m'] = { 'move', config = { show_path = 'relative' } }, - ['a'] = { 'add', nowait = true, config = { show_path = 'relative' } }, - ['N'] = { 'add_directory', config = { show_path = 'relative' } }, - ['d'] = 'noop', - ['dd'] = 'delete', - ['r'] = 'rename', - ['y'] = 'copy_to_clipboard', - ['x'] = 'cut_to_clipboard', - ['P'] = 'paste_from_clipboard', - [''] = 'prev_source', - [''] = 'next_source', - - ['p'] = { - 'toggle_preview', - nowait = true, - config = { use_float = true }, - }, - - ['w'] = toggle_width, - }, - }, - }, -} diff --git a/lua/plugins/org/neorg.lua b/lua/plugins/org/neorg.lua deleted file mode 100644 index 7d78f7a..0000000 --- a/lua/plugins/org/neorg.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - "nvim-neorg/neorg", - build = ":Neorg sync-parsers", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("neorg").setup { - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.concealer"] = {}, -- Adds pretty icons to your documents - ["core.dirman"] = { -- Manages Neorg workspaces - config = { - workspaces = { - notes = "~/notes", - }, - }, - }, - }, - } - end, - }, -}