From 2f73d1c533ff56d91f92f39687edce81658a34e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 29 Apr 2022 13:40:44 +0200 Subject: [PATCH] Move lua files into unique package to prevent clashes --- symlinks/config/nvim/after/ftplugin/java.lua | 2 +- symlinks/config/nvim/init.lua | 10 +++++----- .../nvim/lua/{ => esensar}/common/projects.lua | 0 .../lua/{ => esensar}/direnv_vimrc_local.lua | 0 .../lua/{ => esensar}/fugitive_extensions.lua | 0 .../nvim/lua/{ => esensar}/init/colors.lua | 0 .../nvim/lua/{ => esensar}/init/first_load.lua | 0 .../nvim/lua/{ => esensar}/init/options.lua | 0 .../nvim/lua/{ => esensar}/init/plugins.lua | 0 .../nvim/lua/{ => esensar}/lsp/completion.lua | 0 .../nvim/lua/{ => esensar}/lsp/diagnostic.lua | 2 +- .../{ => esensar}/lsp/extra_servers/init.lua | 0 .../config/nvim/lua/{ => esensar}/lsp/init.lua | 6 +++--- .../nvim/lua/{ => esensar}/lsp/jdtls_setup.lua | 2 +- .../lsp/null-ls_sources/gdformat.lua | 0 .../lsp/null-ls_sources/gdlint.lua | 0 .../lua/esensar/lsp/null-ls_sources/init.lua | 9 +++++++++ .../lua/{ => esensar}/lsp/server_config.lua | 0 .../nvim/lua/{ => esensar}/lsp/servers.lua | 2 +- .../vim_rest_console_extensions.lua | 4 ++-- .../lua/{ => esensar}/vimwiki_extensions.lua | 0 .../nvim/lua/lsp/null-ls_sources/init.lua | 9 --------- symlinks/config/nvim/plugin/fugitive.lua | 18 +++++++++--------- symlinks/config/nvim/plugin/local_vimrc.lua | 2 +- symlinks/config/nvim/plugin/rest.lua | 2 +- symlinks/config/nvim/plugin/vimwiki.vim | 2 +- 26 files changed, 35 insertions(+), 35 deletions(-) rename symlinks/config/nvim/lua/{ => esensar}/common/projects.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/direnv_vimrc_local.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/fugitive_extensions.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/init/colors.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/init/first_load.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/init/options.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/init/plugins.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/completion.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/diagnostic.lua (96%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/extra_servers/init.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/init.lua (65%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/jdtls_setup.lua (96%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/null-ls_sources/gdformat.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/null-ls_sources/gdlint.lua (100%) create mode 100644 symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/init.lua rename symlinks/config/nvim/lua/{ => esensar}/lsp/server_config.lua (100%) rename symlinks/config/nvim/lua/{ => esensar}/lsp/servers.lua (96%) rename symlinks/config/nvim/lua/{ => esensar}/vim_rest_console_extensions.lua (93%) rename symlinks/config/nvim/lua/{ => esensar}/vimwiki_extensions.lua (100%) delete mode 100644 symlinks/config/nvim/lua/lsp/null-ls_sources/init.lua diff --git a/symlinks/config/nvim/after/ftplugin/java.lua b/symlinks/config/nvim/after/ftplugin/java.lua index 7af6ede..908c452 100644 --- a/symlinks/config/nvim/after/ftplugin/java.lua +++ b/symlinks/config/nvim/after/ftplugin/java.lua @@ -1,4 +1,4 @@ -require("lsp.jdtls_setup").setup() +require("esensar.lsp.jdtls_setup").setup() vim.opt.shiftwidth = 4 vim.opt.tabstop = 4 diff --git a/symlinks/config/nvim/init.lua b/symlinks/config/nvim/init.lua index f1f8d3d..24cf189 100644 --- a/symlinks/config/nvim/init.lua +++ b/symlinks/config/nvim/init.lua @@ -1,4 +1,4 @@ -if require("init.first_load")() then +if require("esensar.init.first_load")() then return end @@ -15,15 +15,15 @@ vim.api.nvim_exec('let $VIMPLUGINS = expand($VIMHOME."/lua/personal/plugins.lua" -- Leader config to vim.g.mapleader = " " -require("init.plugins") +require("esensar.init.plugins") -require("init.options") +require("esensar.init.options") -require("lsp") +require("esensar.lsp") -- Colorscheme vim.cmd("syntax on") -require("init.colors") +require("esensar.init.colors") vim.keymap.set("n", "Q", "gq", { noremap = false }) vim.keymap.set("i", "", "u") diff --git a/symlinks/config/nvim/lua/common/projects.lua b/symlinks/config/nvim/lua/esensar/common/projects.lua similarity index 100% rename from symlinks/config/nvim/lua/common/projects.lua rename to symlinks/config/nvim/lua/esensar/common/projects.lua diff --git a/symlinks/config/nvim/lua/direnv_vimrc_local.lua b/symlinks/config/nvim/lua/esensar/direnv_vimrc_local.lua similarity index 100% rename from symlinks/config/nvim/lua/direnv_vimrc_local.lua rename to symlinks/config/nvim/lua/esensar/direnv_vimrc_local.lua diff --git a/symlinks/config/nvim/lua/fugitive_extensions.lua b/symlinks/config/nvim/lua/esensar/fugitive_extensions.lua similarity index 100% rename from symlinks/config/nvim/lua/fugitive_extensions.lua rename to symlinks/config/nvim/lua/esensar/fugitive_extensions.lua diff --git a/symlinks/config/nvim/lua/init/colors.lua b/symlinks/config/nvim/lua/esensar/init/colors.lua similarity index 100% rename from symlinks/config/nvim/lua/init/colors.lua rename to symlinks/config/nvim/lua/esensar/init/colors.lua diff --git a/symlinks/config/nvim/lua/init/first_load.lua b/symlinks/config/nvim/lua/esensar/init/first_load.lua similarity index 100% rename from symlinks/config/nvim/lua/init/first_load.lua rename to symlinks/config/nvim/lua/esensar/init/first_load.lua diff --git a/symlinks/config/nvim/lua/init/options.lua b/symlinks/config/nvim/lua/esensar/init/options.lua similarity index 100% rename from symlinks/config/nvim/lua/init/options.lua rename to symlinks/config/nvim/lua/esensar/init/options.lua diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/esensar/init/plugins.lua similarity index 100% rename from symlinks/config/nvim/lua/init/plugins.lua rename to symlinks/config/nvim/lua/esensar/init/plugins.lua diff --git a/symlinks/config/nvim/lua/lsp/completion.lua b/symlinks/config/nvim/lua/esensar/lsp/completion.lua similarity index 100% rename from symlinks/config/nvim/lua/lsp/completion.lua rename to symlinks/config/nvim/lua/esensar/lsp/completion.lua diff --git a/symlinks/config/nvim/lua/lsp/diagnostic.lua b/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua similarity index 96% rename from symlinks/config/nvim/lua/lsp/diagnostic.lua rename to symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua index f961682..ea7aa36 100644 --- a/symlinks/config/nvim/lua/lsp/diagnostic.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------- local null_ls = require("null-ls") -local custom_sources = require("lsp.null-ls_sources") +local custom_sources = require("esensar.lsp.null-ls_sources") null_ls.setup({ sources = { diff --git a/symlinks/config/nvim/lua/lsp/extra_servers/init.lua b/symlinks/config/nvim/lua/esensar/lsp/extra_servers/init.lua similarity index 100% rename from symlinks/config/nvim/lua/lsp/extra_servers/init.lua rename to symlinks/config/nvim/lua/esensar/lsp/extra_servers/init.lua diff --git a/symlinks/config/nvim/lua/lsp/init.lua b/symlinks/config/nvim/lua/esensar/lsp/init.lua similarity index 65% rename from symlinks/config/nvim/lua/lsp/init.lua rename to symlinks/config/nvim/lua/esensar/lsp/init.lua index 8d331e3..90de87a 100644 --- a/symlinks/config/nvim/lua/lsp/init.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/init.lua @@ -2,6 +2,6 @@ -- - LSP configuration - ------------------------------------------------------------------------------- -require("lsp.diagnostic") -require("lsp.servers") -require("lsp.completion") +require("esensar.lsp.diagnostic") +require("esensar.lsp.servers") +require("esensar.lsp.completion") diff --git a/symlinks/config/nvim/lua/lsp/jdtls_setup.lua b/symlinks/config/nvim/lua/esensar/lsp/jdtls_setup.lua similarity index 96% rename from symlinks/config/nvim/lua/lsp/jdtls_setup.lua rename to symlinks/config/nvim/lua/esensar/lsp/jdtls_setup.lua index f1fbeb4..dc24744 100644 --- a/symlinks/config/nvim/lua/lsp/jdtls_setup.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/jdtls_setup.lua @@ -2,7 +2,7 @@ -- - JDTLS server configuration - ------------------------------------------------------------------------------- -local common_config = require("lsp.server_config") +local common_config = require("esensar.lsp.server_config") local M = {} function M.setup() diff --git a/symlinks/config/nvim/lua/lsp/null-ls_sources/gdformat.lua b/symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/gdformat.lua similarity index 100% rename from symlinks/config/nvim/lua/lsp/null-ls_sources/gdformat.lua rename to symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/gdformat.lua diff --git a/symlinks/config/nvim/lua/lsp/null-ls_sources/gdlint.lua b/symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/gdlint.lua similarity index 100% rename from symlinks/config/nvim/lua/lsp/null-ls_sources/gdlint.lua rename to symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/gdlint.lua diff --git a/symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/init.lua b/symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/init.lua new file mode 100644 index 0000000..ee52e3f --- /dev/null +++ b/symlinks/config/nvim/lua/esensar/lsp/null-ls_sources/init.lua @@ -0,0 +1,9 @@ +-- Place for custom null-ls sources +return { + formatters = { + gdformat = require("esensar.lsp.null-ls_sources.gdformat"), + }, + diagnostics = { + gdlint = require("esensar.lsp.null-ls_sources.gdlint"), + }, +} diff --git a/symlinks/config/nvim/lua/lsp/server_config.lua b/symlinks/config/nvim/lua/esensar/lsp/server_config.lua similarity index 100% rename from symlinks/config/nvim/lua/lsp/server_config.lua rename to symlinks/config/nvim/lua/esensar/lsp/server_config.lua diff --git a/symlinks/config/nvim/lua/lsp/servers.lua b/symlinks/config/nvim/lua/esensar/lsp/servers.lua similarity index 96% rename from symlinks/config/nvim/lua/lsp/servers.lua rename to symlinks/config/nvim/lua/esensar/lsp/servers.lua index 7b2ca29..e5d6530 100644 --- a/symlinks/config/nvim/lua/lsp/servers.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/servers.lua @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------- local lspconfig = require("lspconfig") -local common_config = require("lsp.server_config") +local common_config = require("esensar.lsp.server_config") local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) diff --git a/symlinks/config/nvim/lua/vim_rest_console_extensions.lua b/symlinks/config/nvim/lua/esensar/vim_rest_console_extensions.lua similarity index 93% rename from symlinks/config/nvim/lua/vim_rest_console_extensions.lua rename to symlinks/config/nvim/lua/esensar/vim_rest_console_extensions.lua index 35fc9da..53f7641 100644 --- a/symlinks/config/nvim/lua/vim_rest_console_extensions.lua +++ b/symlinks/config/nvim/lua/esensar/vim_rest_console_extensions.lua @@ -45,14 +45,14 @@ end function M.open_cached_rest_console(args) local name = args[0] or args[1] if not name then - name = require("common.projects").get_project_id() + name = require("esensar.common.projects").get_project_id() end open_cached_rest_console(name) end -- Opens up a rest console which can be saved -- cached by name function M.open_named_cached_rest_console(name) - name = require("common.projects").get_project_id() .. name + name = require("esensar.common.projects").get_project_id() .. name open_cached_rest_console(name) end diff --git a/symlinks/config/nvim/lua/vimwiki_extensions.lua b/symlinks/config/nvim/lua/esensar/vimwiki_extensions.lua similarity index 100% rename from symlinks/config/nvim/lua/vimwiki_extensions.lua rename to symlinks/config/nvim/lua/esensar/vimwiki_extensions.lua diff --git a/symlinks/config/nvim/lua/lsp/null-ls_sources/init.lua b/symlinks/config/nvim/lua/lsp/null-ls_sources/init.lua deleted file mode 100644 index a3d838f..0000000 --- a/symlinks/config/nvim/lua/lsp/null-ls_sources/init.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Place for custom null-ls sources -return { - formatters = { - gdformat = require("lsp.null-ls_sources.gdformat"), - }, - diagnostics = { - gdlint = require("lsp.null-ls_sources.gdlint"), - }, -} diff --git a/symlinks/config/nvim/plugin/fugitive.lua b/symlinks/config/nvim/plugin/fugitive.lua index e4448aa..4320019 100644 --- a/symlinks/config/nvim/plugin/fugitive.lua +++ b/symlinks/config/nvim/plugin/fugitive.lua @@ -2,15 +2,15 @@ -- - Fugitive.vim setup and extra commands - ------------------------------------------------------------------------------- -vim.cmd([[command! -nargs=0 Ggpush :lua require('fugitive_extensions').push_origin()]]) -vim.cmd([[command! -nargs=0 Ggpull :lua require('fugitive_extensions').pull_origin()]]) -vim.cmd([[command! -nargs=? Gpropen :lua require('fugitive_extensions').open_new_pr()]]) +vim.cmd([[command! -nargs=0 Ggpush :lua require('esensar.fugitive_extensions').push_origin()]]) +vim.cmd([[command! -nargs=0 Ggpull :lua require('esensar.fugitive_extensions').pull_origin()]]) +vim.cmd([[command! -nargs=? Gpropen :lua require('esensar.fugitive_extensions').open_new_pr()]]) vim.cmd([[command! -nargs=? Gpr Gpropen ]]) -vim.cmd([[command! -nargs=? Gprprint :lua require('fugitive_extensions').print_pr_url()]]) -vim.cmd([[command! -nargs=? Gprcopy :lua require('fugitive_extensions').copy_pr_url()]]) -vim.cmd([[command! -nargs=1 Gcbranch :lua require('fugitive_extensions').create_branch()]]) -vim.cmd([[command! -nargs=0 Gcmaster :lua require('fugitive_extensions').checkout_branch('main')]]) +vim.cmd([[command! -nargs=? Gprprint :lua require('esensar.fugitive_extensions').print_pr_url()]]) +vim.cmd([[command! -nargs=? Gprcopy :lua require('esensar.fugitive_extensions').copy_pr_url()]]) +vim.cmd([[command! -nargs=1 Gcbranch :lua require('esensar.fugitive_extensions').create_branch()]]) +vim.cmd([[command! -nargs=0 Gcmaster :lua require('esensar.fugitive_extensions').checkout_branch('main')]]) vim.cmd([[command! -nargs=0 Gcm Gcmaster]]) -vim.cmd([[command! -nargs=0 Gcdev :lua require('fugitive_extensions').checkout_branch('develop')]]) -vim.cmd([[command! -nargs=1 Gcheckout :lua require('fugitive_extensions').checkout_branch()]]) +vim.cmd([[command! -nargs=0 Gcdev :lua require('esensar.fugitive_extensions').checkout_branch('develop')]]) +vim.cmd([[command! -nargs=1 Gcheckout :lua require('esensar.fugitive_extensions').checkout_branch()]]) vim.cmd([[command! -nargs=1 Gc Gcheckout ]]) diff --git a/symlinks/config/nvim/plugin/local_vimrc.lua b/symlinks/config/nvim/plugin/local_vimrc.lua index bafe793..087275d 100644 --- a/symlinks/config/nvim/plugin/local_vimrc.lua +++ b/symlinks/config/nvim/plugin/local_vimrc.lua @@ -3,5 +3,5 @@ ------------------------------------------------------------------------------- vim.api.nvim_create_user_command("EditLocalVimrc", function(_) - require("direnv_vimrc_local").open_local_vimrc() + require("esensar.direnv_vimrc_local").open_local_vimrc() end, { nargs = 0 }) diff --git a/symlinks/config/nvim/plugin/rest.lua b/symlinks/config/nvim/plugin/rest.lua index fcec2e0..feb83eb 100644 --- a/symlinks/config/nvim/plugin/rest.lua +++ b/symlinks/config/nvim/plugin/rest.lua @@ -2,7 +2,7 @@ -- - Vim REST Console setup and extra commands - ------------------------------------------------------------------------------- -local vim_rest_console_extensions = require("vim_rest_console_extensions") +local vim_rest_console_extensions = require("esensar.vim_rest_console_extensions") vim.api.nvim_create_user_command( "ScratchRestConsole", vim_rest_console_extensions.open_scratch_rest_console, diff --git a/symlinks/config/nvim/plugin/vimwiki.vim b/symlinks/config/nvim/plugin/vimwiki.vim index b18dd90..50094b4 100644 --- a/symlinks/config/nvim/plugin/vimwiki.vim +++ b/symlinks/config/nvim/plugin/vimwiki.vim @@ -29,4 +29,4 @@ let g:vimwiki_global_ext = 0 let g:vimwiki_listsyms = '✗○◐●✓' -command! -count=0 -nargs=1 VimwikiOpenSubdirectoryIndex :lua require('vimwiki_extensions').open_subdirectory_index_file(, ) +command! -count=0 -nargs=1 VimwikiOpenSubdirectoryIndex :lua require('esensar.vimwiki_extensions').open_subdirectory_index_file(, )