my demo first config lua

This commit is contained in:
2023-12-13 00:27:19 +03:00
commit 61e95391fb
268 changed files with 12847 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
return {
"windwp/nvim-autopairs",
lazy = true,
config = true,
}

View File

@@ -0,0 +1,75 @@
return {
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
config = function()
local cmp = require("cmp")
-- cmp.setup.cmdline(":", {
-- mapping = cmp.mapping.preset.cmdline(),
-- sources = cmp.config.sources({
-- { name = "path" },
-- }, {
-- {
-- name = "cmdline",
-- option = {
-- ignore_cmds = { "Man", "!" },
-- },
-- },
-- }),
-- })
end,
},
-- @param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.preselect = cmp.PreselectMode.None
opts.completion = {
completeopt = "noselect",
}
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@@ -0,0 +1,7 @@
return {
"ziontee113/color-picker.nvim",
keys = {
{ "<C-c>", "<cmd>PickColorInsert<cr>", mode = "i", desc = "ColorPicker" },
},
config = true,
}

View File

@@ -0,0 +1,5 @@
return {
"norcalli/nvim-colorizer.lua",
event = "VeryLazy",
config = true,
}

View File

@@ -0,0 +1,11 @@
return {
"neanias/everforest-nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme "everforest"
vim.cmd "let g:everforest_better_performance = 1"
vim.cmd "let g:everforest_background = 'soft'"
vim.cmd "let g:airline_theme = 'everforest'"
end,
}

View File

@@ -0,0 +1,4 @@
return {
"adalessa/composer.nvim",
lazy = true,
}

View File

@@ -0,0 +1,39 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
-- Customize or remove this keymap to your liking
"<leader>cf",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
-- Everything in opts will be passed to setup()
opts = {
-- Define your formatters
formatters_by_ft = {
lua = { "stylua" },
python = { "isort", "black" },
javascript = { { "prettierd", "prettier" } },
php = { { "php_cs_fixer" } },
blade = { "blade-formatter" },
},
-- Set up format-on-save
format_on_save = { timeout_ms = 500, lsp_fallback = true },
-- Customize formatters
formatters = {
shfmt = {
prepend_args = { "-i", "2" },
},
},
},
init = function()
-- If you want the formatexpr, here is the place to set it
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}

View File

@@ -0,0 +1,31 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
"theHamsta/nvim-dap-virtual-text",
"rcarriga/nvim-dap-ui",
"leoluz/nvim-dap-go",
"mxsdev/nvim-dap-vscode-js",
"anuvyklack/hydra.nvim",
"nvim-telescope/telescope-dap.nvim",
"rcarriga/cmp-dap",
},
keys = { { "<leader>d", desc = "Open Debug menu" } },
config = function()
require "alpha.dap"
local ok_telescope, telescope = pcall(require, "telescope")
if ok_telescope then
telescope.load_extension "dap"
end
local ok_cmp, cmp = pcall(require, "cmp")
if ok_cmp then
cmp.setup.filetype({ "dap-repl", "dapui_watches" }, {
sources = cmp.config.sources({
{ name = "dap" },
}, {
{ name = "buffer" },
}),
})
end
end,
}

View File

@@ -0,0 +1,5 @@
return {
"Bekaboo/deadcolumn.nvim",
enabled = false,
event = { "VeryLazy" },
}

View File

@@ -0,0 +1,8 @@
return {
{ "echasnovski/mini.indentscope", enabled = false },
-- { "folke/noice.nvim", enabled = false },
-- { "rcarriga/nvim-notify", enabled = false },
{ "folke/flash.nvim", enabled = false },
{ "ggandor/flit.nvim", enabled = false },
-- { "ggandor/leap.nvim", enabled = false },
}

View File

@@ -0,0 +1,160 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
opts = {
input = {
-- Set to false to disable the vim.ui.input implementation
enabled = true,
-- Default prompt string
default_prompt = "Input:",
-- Can be 'left', 'right', or 'center'
prompt_align = "center",
-- When true, <Esc> will close the modal
insert_only = true,
-- When true, input will start in insert mode.
start_in_insert = true,
-- These are passed to nvim_open_win
-- anchor = "SW",
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "editor",
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
prefer_width = 40,
width = nil,
-- min_width and max_width can be a list of mixed types.
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
win_options = {
-- Window transparency (0-100)
winblend = 10,
-- Disable line wrapping
wrap = false,
},
-- Set to `false` to disable
mappings = {
n = {
["<Esc>"] = "Close",
["<CR>"] = "Confirm",
},
i = {
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
["<Up>"] = "HistoryPrev",
["<Down>"] = "HistoryNext",
},
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
-- see :help dressing_get_config
get_config = nil,
},
select = {
-- Set to false to disable the vim.ui.select implementation
enabled = false,
-- Priority list of preferred vim.select implementations
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
-- Options for fzf selector
fzf = {
window = {
width = 0.5,
height = 0.4,
},
},
-- Options for fzf_lua selector
fzf_lua = {
winopts = {
width = 0.5,
height = 0.4,
},
},
-- Options for nui Menu
nui = {
position = "50%",
size = nil,
relative = "editor",
border = {
style = "rounded",
},
buf_options = {
swapfile = false,
filetype = "DressingSelect",
},
win_options = {
winblend = 10,
},
max_width = 80,
max_height = 40,
min_width = 40,
min_height = 10,
},
-- Options for built-in selector
builtin = {
-- These are passed to nvim_open_win
-- anchor = "NW",
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "editor",
win_options = {
-- Window transparency (0-100)
winblend = 10,
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
width = nil,
max_width = { 140, 0.8 },
min_width = { 40, 0.2 },
height = nil,
max_height = 0.9,
min_height = { 10, 0.2 },
-- Set to `false` to disable
mappings = {
["<Esc>"] = "Close",
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Used to override format_item. See :help dressing-format
format_item_override = {},
-- see :help dressing_get_config
get_config = nil,
},
},
}

View File

@@ -0,0 +1,4 @@
return {
"junegunn/vim-easy-align",
keys = { { "ga", "<Plug>(EasyAlign)", mode = { "n", "v" }, desc = "EasyAlign" } },
}

View File

@@ -0,0 +1,15 @@
return {
{
"jwalton512/vim-blade",
enabled = true,
},
{
"tpope/vim-dispatch",
cmd = { "Make", "Dispatch" },
},
"tpope/vim-surround",
"tpope/vim-repeat",
"tpope/vim-rhubarb",
"tpope/vim-dotenv",
"tpope/vim-eunuch",
}

View File

@@ -0,0 +1,45 @@
return {
"adalessa/laravel.nvim",
dependencies = {
"rcarriga/nvim-notify",
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
cmd = { "Sail", "Artisan", "Composer", "Npm", "Laravel", "LaravelInfo", "DockerCompose" },
keys = {
{ "<leader>la", ":Laravel artisan<cr>", desc = "Laravel Application Commands" },
{ "<leader>lr", ":Laravel routes<cr>", desc = "Laravel Application Routes" },
{
"<leader>lt",
function()
require("laravel.tinker").send_to_tinker()
end,
mode = "v",
desc = "Laravel Application Routes",
},
},
init = function()
vim.g.laravel_log_level = "debug"
end,
config = function()
local uid = vim.system({ "id", "-u" }, { text = true }):wait().stdout or "1000"
local gid = vim.system({ "id", "-g" }, { text = true }):wait().stdout or "1000"
local user_arg = string.format("%s:%s", vim.trim(uid), vim.trim(gid))
require("laravel").setup {
route_info = {
position = "top",
},
environment = {
environments = {
["ao"] = require("laravel.environment.docker_compose").setup {
container_name = "panel-webserver",
cmd = { "docker", "compose", "exec", "-u", user_arg, "-it", "panel-webserver" },
},
},
},
}
require("telescope").load_extension "laravel"
end,
}

View File

@@ -0,0 +1,28 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
-- "jose-elias-alvarez/null-ls.nvim",
{
"williamboman/mason.nvim",
opts = {
ui = {
border = "rounded",
},
},
},
"folke/neodev.nvim",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
event = "VeryLazy",
main = "alpha.lsp",
opts = {
mason = {
enable = true,
auto_install = false,
},
servers = {
phpactor = { enable = true },
},
},
}

View File

@@ -0,0 +1,51 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "kyazdani42/nvim-web-devicons" },
config = function()
require("lualine").setup {
options = {
theme = "auto",
icons_enabled = true,
globalstatus = true,
},
extensions = { "quickfix", "fugitive" },
sections = {
lualine_a = { { "mode", upper = true } },
lualine_b = { { "branch", icon = "" }, "db_ui#statusline" },
lualine_c = { { "filename", file_status = true, path = 1 } },
lualine_x = {
"diagnostics",
"diff",
{
require("noice").api.status.mode.get,
cond = require("noice").api.status.mode.has,
color = { fg = "#ff9e64" },
},
{
require("lazy.status").updates,
cond = require("lazy.status").has_updates,
color = { fg = "ff9e64" },
},
},
lualine_y = { "filetype" },
lualine_z = { "location" },
},
winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
}
end,
}

View File

@@ -0,0 +1,8 @@
return {
"adalessa/markdown-preview.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = true,
ft = "markdown",
}

View File

@@ -0,0 +1,8 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
-- table.insert(opts.ensure_installed, "google-java-format")
end,
},
}

View File

@@ -0,0 +1,254 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
reqrires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
{
-- only needed if you want to use the commands with "_with_window_picker" suffix
's1n7ax/nvim-window-picker',
tag = "v1.*",
config = function()
require 'window-picker'.setup({
autoselect_one = true,
include_current = false,
filter_rules = {
-- filter using buffer options
bo = {
-- if the file type is one of following, the window will be ignored
filetype = { 'neo-tree', "neo-tree-popup", "notify" },
-- if the buffer type is one of following, the window will be ignored
buftype = { 'terminal', "quickfix" },
},
},
other_win_hl_color = '#e35e4f',
})
end,
}
},
config = function()
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define("DiagnosticSignError",
{ text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DiagnosticSignWarn",
{ text = "", texthl = "DiagnosticSignWarn" })
vim.fn.sign_define("DiagnosticSignInfo",
{ text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint",
{ text = "", texthl = "DiagnosticSignHint" })
-- NOTE: this is changed from v1.x, which used the old style of highlight groups
-- in the form "LspDiagnosticsSignWarning"
require("neo-tree").setup({
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil, -- use a custom function for sorting files and directories in the tree
-- sort_function = function (a,b)
-- if a.type == b.type then
-- return a.path > b.path
-- else
-- return a.type > b.type
-- end
-- end , -- this sorts files and directories descendantly
default_component_configs = {
container = {
enable_character_fade = true
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "│",
last_indent_marker = "└",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "ﰊ",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon"
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "✖", -- this can only be used in the git_status source
renamed = "", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
}
},
},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["<esc>"] = "revert_preview",
["P"] = { "toggle_preview", config = { use_float = true } },
["l"] = "focus_preview",
["S"] = "open_split",
["s"] = "open_vsplit",
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
["t"] = "open_tabnew",
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none" -- "none", "relative", "absolute"
}
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
}
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = false, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
}
}
},
buffers = {
follow_current_file = true, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
}
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
}
}
}
})
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
end
}

View File

@@ -0,0 +1,5 @@
return {
"ecthelionvi/NeoColumn.nvim",
opts = {},
cmd = { "ToggleNeoColumn" },
}

View File

@@ -0,0 +1,7 @@
return {
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
cmd = { "Neogen" },
keys = { { "<leader>n", ":Neogen<cr>", desc = "Add comment to the near possible object" } },
opts = { snippet_engine = "luasnip" },
}

View File

@@ -0,0 +1,22 @@
return {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
cmd = { "Neorg" },
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",
},
default_workspace = "notes",
},
},
},
}
end,
}

View File

@@ -0,0 +1,66 @@
return {
"nvim-neotest/neotest",
enabled = true,
keys = { { "<c-t>", desc = "Open Test menu" } },
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-go",
"rouge8/neotest-rust",
"nvim-neotest/neotest-plenary",
"nvim-neotest/neotest-vim-test",
"anuvyklack/hydra.nvim",
},
config = function()
local neotest = require "neotest"
neotest.setup {
adapters = {
require "neotest-go",
require "neotest-rust",
require "neotest-plenary",
-- require "neotest-vim-test" {
-- ignore_file_types = { "go", "lua", "rust", "php" },
-- },
-- require("laravel.neotest"),
},
library = { plugins = { "neotest" }, types = true },
}
local hydra = require "hydra"
local hint = [[
NeoTest
_n_: Near test _f_: Current file _l_: Last Test _m_: Run Marked _s_: Toggle Summary ^
^ ^ _<Esc>_
]]
hydra {
name = "neotest",
hint = hint,
mode = "n",
config = {
color = "teal",
invoke_on_body = true,
hint = {
border = "rounded",
position = "bottom",
},
},
body = "<C-t>",
heads = {
{ "n", neotest.run.run },
{
"f",
function()
neotest.run.run(vim.fn.expand "%")
end,
},
{ "l", neotest.run.run_last },
{ "m", neotest.summary.run_marked },
{ "s", neotest.summary.toggle },
{ "<Esc>", nil, { exit = true } },
},
}
end,
}

View File

@@ -0,0 +1,112 @@
return {
"folke/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
},
event = "VeryLazy",
opts = {
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
-- -- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
-- command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
-- inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
cmdline = {
view = "cmdline",
},
messages = {
enabled = true, -- enables the Noice messages UI
view = "notify", -- default view for messages
view_error = "notify", -- view for errors
view_warn = "notify", -- view for warnings
view_history = "messages", -- view for :messages
view_search = false, -- view for search count messages. Set to `false` to disable
},
routes = {
{
view = "split",
filter = {
cmdline = "G",
},
opts = {
enter = true,
render = "plain",
format = { "{message}" },
replace = true,
close = {
events = { "BufLeave" },
keys = { "q" },
},
},
},
{
view = "split",
filter = {
cmdline = "Notifications",
},
opts = {
enter = true,
render = "plain",
format = { "{message}" },
replace = true,
close = {
events = { "BufLeave" },
keys = { "q" },
},
},
},
{
view = "mini",
filter = {
cmdline = "w",
},
},
{
view = "mini",
filter = {
find = "Config Change Detected. Reloading...",
},
},
{
view = "mini",
filter = {
any = {
{
event = "msg_show",
find = "lines yanked",
},
{
event = "msg_show",
find = "more lines",
},
{
event = "msg_show",
find = "direnv:",
},
{
find = "laravel.sail.",
},
{
find = "Pattern not found",
},
{
event = "msg_show",
kind = "",
find = "change;",
},
},
},
},
},
},
}

View File

@@ -0,0 +1,10 @@
return {
"rcarriga/nvim-notify",
config = function()
local notify = require "notify"
-- this for transparency
notify.setup { background_colour = "#000000" }
-- this overwrites the vim notify function
vim.notify = notify.notify
end,
}

View File

@@ -0,0 +1,4 @@
return {
"nacro90/numb.nvim",
config = true,
}

View File

@@ -0,0 +1,17 @@
return {
"nvim-orgmode/orgmode",
enabled = false,
keys = {
{ "<Leader>oa" },
{ "<Leader>oc" },
},
ft = { "org" },
config = function()
require("orgmode").setup_ts_grammar()
require("orgmode").setup {
org_agenda_files = { "~/my-orgs/**/*" },
org_default_notes_file = "~/my-orgs/refile.org",
}
require("cmp").setup { sources = { { name = "orgmode" } } }
end,
}

View File

@@ -0,0 +1,46 @@
return {
{
-- "tigion/nvim-asciidoc-preview",
-- ft = { "asciidoc" },
-- opts = {},
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {}, -- this is equalent to setup({}) function
},
{ "isobit/vim-caddyfile" },
-- { -- maybe https://github.com/0x00-ketsu/autosave.nvim
-- "0x00-ketsu/autosave.nvim",
-- opts = {},
-- },
{
"Wansmer/treesj",
keys = {
{ "<leader>j", "<cmd>TSJToggle<cr>", desc = "Join Toggle" },
},
opts = { use_default_keymaps = false, max_join_length = 150 },
},
{
"s1n7ax/nvim-window-picker",
name = "window-picker",
event = "VeryLazy",
version = "2.*",
config = function()
require("window-picker").setup()
end,
},
{ "slim-template/vim-slim" },
{ "tpope/vim-rails" },
-- use 'slim-template/vim-slim'
{ "dhruvasagar/vim-table-mode" },
{ "tree-sitter/tree-sitter-embedded-template" },
{ "RRethy/nvim-treesitter-endwise" },
{ "dyng/ctrlsf.vim" },
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
opts = {},
},
}

View File

@@ -0,0 +1,91 @@
return { -- lazy
-- "ccaglak/namespace.nvim",
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- },
}, {
"ludovicchabant/vim-gutentags",
config = function()
-- https://www.reddit.com/r/vim/comments/d77t6j/guide_how_to_setup_ctags_with_gutentags_properly/
vim.g.gutentags_ctags_exclude = {
"*.git",
"*.svg",
"*.hg",
"*/tests/*",
"build",
"dist",
"*sites/*/files/*",
"bin",
"node_modules",
"bower_components",
"cache",
"compiled",
"docs",
"example",
"bundle",
"vendor",
"*.md",
"*-lock.json",
"*.lock",
"*bundle*.js",
"*build*.js",
".*rc*",
"*.json",
"*.min.*",
"*.map",
"*.bak",
"*.zip",
"*.pyc",
"*.class",
"*.sln",
"*.Master",
"*.csproj",
"*.tmp",
"*.csproj.user",
"*.cache",
"*.pdb",
"tags*",
"cscope.*",
-- '*.css',
-- '*.less',
-- '*.scss',
"*.exe",
"*.dll",
"*.mp3",
"*.ogg",
"*.flac",
"*.swp",
"*.swo",
"*.bmp",
"*.gif",
"*.ico",
"*.jpg",
"*.png",
"*.rar",
"*.zip",
"*.tar",
"*.tar.gz",
"*.tar.xz",
"*.tar.bz2",
"*.pdf",
"*.doc",
"*.docx",
"*.ppt",
"*.pptx",
}
vim.g.gutentags_add_default_project_roots = false
vim.g.gutentags_project_root = { "package.json", ".git" }
vim.g.gutentags_cache_dir = vim.fn.stdpath("data") .. "/ctags"
vim.g.gutentags_generate_on_new = true
vim.g.gutentags_generate_on_missing = true
vim.g.gutentags_generate_on_write = true
vim.g.gutentags_generate_on_empty_buffer = true
vim.g.gutentags_modules = true
vim.cmd([[command! -nargs=0 GutentagsClearCache call system('rm ' . g:gutentags_cache_dir . '/*')]])
vim.g.gutentags_ctags_extra_args = { "--tag-relative=yes", "--fields=+ailmnS" }
-- custom
vim.g.gutentags_modules = { "ctags" }
end,
}

View File

@@ -0,0 +1,61 @@
local phpactor = function ()
vim.ui.select({
"class_inflect",
"context_menu",
"expand_class",
"generate_accessor",
"change_visibility",
"copy_class",
"import_class",
"import_missing_classes",
"move_class",
"navigate",
"new_class",
"transform",
"update",
"config",
"status",
"cache_clear",
}, {
prompt = "Phpactor Action",
}, function(choice)
if choice == nil or choice == "" then
return
end
-- TODO: add option for new class in same directory
if choice == "new_class" then
return vim.ui.input({
prompt = "New Class",
}, function(value)
if value == nil then
return
end
-- TODO: check filename generation to validate the path
require("phpactor").rpc("new_class", { text_value = vim.fn.getcwd() .. '/' .. value .. ".php" })
end)
end
require("phpactor").rpc(choice, {})
end)
end
return {
"adalessa/phpactor.nvim",
cmd = { "PhpActor" },
keys = {
{ "<leader>pa", phpactor, desc = "PhpActor options" },
{ "<leader>pc", ":PhpActor context_menu<cr>", desc = "PhpActor context menu" },
},
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
install = {
bin = 'phpactor'
},
lspconfig = {
enabled = true,
},
},
}

View File

@@ -0,0 +1,5 @@
return {
"windwp/nvim-projectconfig",
enabled = false,
config = true,
}

View File

@@ -0,0 +1,21 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
keys = {
{
"<leader>rr",
function()
require("telescope").extensions.refactoring.refactors()
end,
mode = { "n", "v" },
desc = "Refactoring menu",
},
},
config = function()
require("refactoring").setup {}
require("telescope").load_extension "refactoring"
end,
}

View File

@@ -0,0 +1,34 @@
return {
"mrjones2014/smart-splits.nvim",
config = true,
keys = {
{
"<A-h>",
function()
require("smart-splits").resize_left()
end,
desc = "Resize window left +10",
},
{
"<A-j>",
function()
require("smart-splits").resize_down()
end,
desc = "Resize window down +10",
},
{
"<A-k>",
function()
require("smart-splits").resize_up()
end,
desc = "Resize window up +10",
},
{
"<A-l>",
function()
require("smart-splits").resize_right()
end,
desc = "Resize window right +10",
},
},
}

View File

@@ -0,0 +1,32 @@
return {
"gen740/SmoothCursor.nvim",
config = function()
require("smoothcursor").setup { cursor = "󰀫" }
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8a9baa" })
local autocmd = vim.api.nvim_create_autocmd
autocmd({ "ModeChanged" }, {
callback = function()
local current_mode = vim.fn.mode()
if current_mode == "n" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8a9baa" })
vim.fn.sign_define("smoothcursor", { text = "󰀫" })
elseif current_mode == "v" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "V" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "\22" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "i" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#668aab" })
vim.fn.sign_define("smoothcursor", { text = "" })
end
end,
})
end,
}

View File

@@ -0,0 +1,138 @@
local config = function()
if vim.g.snippets ~= "luasnip" then
return
end
local ls = require "luasnip"
local types = require "luasnip.util.types"
ls.config.set_config {
-- This tells LuaSnip to remember to keep around the last snippet.
-- You can jump back into even if you move outside of the selection
history = true,
-- This one is cool cause if you have dynamic snippets, it updatesas you type!
updateevents = "TextChanged,TextChangedI",
-- Autosnippets:
enable_autosnippets = true,
ext_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "<- Choice", "Error" } },
},
},
},
}
-- create snippet
-- s(context, nodes, condition, ...)
local snippet = ls.s
-- TODO: Write about this.
-- Useful for dynamic nodes and choice nodes
-- local snippet_from_nodes = ls.sn
-- This is the simplest node.
-- Creates a new text node. Places cursor after node by default.
-- t { "this will be inserted" }
--
-- Multiple lines are by passing a table of strings.
-- t { "line 1", "line 2" }
local t = ls.text_node
-- Insert Node
-- Creates a location for the cursor to jump to.
-- Possible options to jump to are 1 - N
-- If you use 0, that's the final place to jump to.
--
-- To create placeholder text, pass it as the second argument
-- i(2, "this is placeholder text")
local i = ls.insert_node
-- Function Node
-- Takes a function that returns text
-- local f = ls.function_node
-- This a choice snippet. You can move through with <c-l> (in my config)
-- c(1, { t {"hello"}, t {"world"}, }),
--
-- The first argument is the jump position
-- The second argument is a table of possible nodes.
-- Note, one thing that's nice is you don't have to include
-- the jump position for nodes that normally require one (can be nil)
-- local c = ls.choice_node
-- local d = ls.dynamic_node
-- TODO: Document what I've learned about lambda
-- local l = require("luasnip.extras").lambda
-- local events = require("luasnip.util.events")
local shortcut = function(val)
if type(val) == "string" then
return { t { val }, i(0) }
end
if type(val) == "table" then
for k, v in ipairs(val) do
if type(v) == "string" then
val[k] = t { v }
end
end
end
return val
end
local make = function(tbl)
local result = {}
for k, v in pairs(tbl) do
table.insert(result, (snippet({ trig = k, desc = v.desc }, shortcut(v))))
end
return result
end
ls.cleanup()
for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/snips/ft/*.lua", true)) do
local ft = vim.fn.fnamemodify(ft_path, ":t:r")
ls.add_snippets(ft, make(loadfile(ft_path)()))
end
-- <c-k> is my expansion key
-- this will expand the current item or jump to the next item within the snippet.
vim.keymap.set({ "i", "s" }, "<c-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
-- <c-j> is my jump backwards key.
-- this always moves to the previous item within the snippet
vim.keymap.set({ "i", "s" }, "<c-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true })
-- <c-l> is selecting within a list of options.
-- This is useful for choice nodes (introduced in the forthcoming episode 2)
vim.keymap.set("i", "<c-l>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end)
end
return {
"L3MON4D3/LuaSnip",
version = "v1.*",
event = "VeryLazy",
config = function()
config()
vim.keymap.set("n", "<leader><leader>s", config, { desc = "Reload snippets" })
end,
}

View File

@@ -0,0 +1,5 @@
return {
"nvim-pack/nvim-spectre",
keys = { { "<leader>F", ":Spectre<cr>", desc = "Spectre Search open" } },
config = true,
}

View File

@@ -0,0 +1,33 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-lua/popup.nvim" },
{ "nvim-telescope/telescope-fzy-native.nvim" },
{ "kyazdani42/nvim-web-devicons" },
{ "nvim-telescope/telescope-file-browser.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
dependencies = {
"junegunn/fzf.vim",
dependencies = {
{
"tpope/vim-dispatch",
cmd = { "Make", "Dispatch" },
},
{
"junegunn/fzf",
build = ":call fzf#install()",
}
},
},
},
},
event = "VeryLazy",
config = function()
require "alpha.telescope.setup"
require "alpha.telescope.mappings"
end,
}

View File

@@ -0,0 +1,54 @@
return {
"vim-test/vim-test",
keys = { { "<leader>t", desc = "Open Test menu" } },
dependencies = {
"anuvyklack/hydra.nvim",
},
init = function()
vim.g["test#strategy"] = "harpoon"
vim.g["test#neovim#term_position"] = "vert"
vim.g["test#harpoon_term"] = 1
vim.g["test#preserve_screen"] = 0
vim.g["test#harpoon#gototerminal"] = 0
vim.g["test#php#pest#executable"] = "./vendor/bin/sail test"
local function dockerComposeTransform(cmd)
local uid = vim.fn.system("id -u"):gsub("%s*$", "")
local gid = vim.fn.system("id -g"):gsub("%s*$", "")
return string.format("docker compose exec -u %s:%s php-fpm %s", uid, gid, cmd)
end
vim.g["test#php#behat#executable"] = "bin/behat --colors"
vim.g["test#custom_transformations"] = { docker = dockerComposeTransform }
end,
config = function()
local behat_paths = {
"tests/Functional/Context/**/*.php",
"tests/Behat/Context/*.php",
"tests/Behat/**/*.php",
"src/Behat/**/*.php",
}
for _, path in ipairs(behat_paths) do
if vim.fn.glob(path) ~= "" then
vim.g["test#php#behat#bootstrap_directory"] = path
vim.g["test#transformation"] = "docker"
-- many of my projects have variables necessaries so this is required
local env_vars = vim.fn.system "make vars"
for _, env_var in ipairs(vim.split(env_vars, "\n")) do
if env_var ~= "" then
env_var = env_var:gsub("^export ", "")
local key, value = unpack(vim.split(env_var, "="))
vim.fn.setenv(key, value)
end
end
break
end
end
require "alpha.test_strategy"
require "alpha.test_menu"
end,
}

View File

@@ -0,0 +1,8 @@
return {
"chrisgrieser/nvim-various-textobjs",
enabled = false,
event = "VeryLazy",
config = function ()
require("various-textobjs").setup({ useDefaultKeymaps = true })
end,
}

View File

@@ -0,0 +1,5 @@
return {
"xiyaowong/nvim-transparent",
lazy = false,
config = true,
}

View File

@@ -0,0 +1,10 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
endwise = {
enable = true,
},
},
},
}

View File

@@ -0,0 +1,7 @@
return {
"folke/trouble.nvim",
enabled = true,
dependencies = "kyazdani42/nvim-web-devicons",
keys = { { "<leader><leader>t", "<cmd>TroubleToggle<cr>", desc = "Trouble toggle" } },
config = true,
}

View File

@@ -0,0 +1,5 @@
return {
"folke/twilight.nvim",
cmd = { "Twilight" },
config = true,
}

View File

@@ -0,0 +1,23 @@
return {
"ThePrimeagen/git-worktree.nvim",
keys = {
{
"<leader>gt",
function()
require("telescope").extensions.git_worktree.git_worktrees()
end,
desc = "Git Worktree switch",
},
{
"<leader>gn",
function()
require("telescope").extensions.git_worktree.create_git_worktree()
end,
desc = "Git Worktree new branch",
},
},
config = function()
require("git-worktree").setup {}
require("telescope").load_extension "git_worktree"
end,
}