diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-12-11 11:00:04 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-12-11 11:00:28 +0100 |
| commit | e96308e884375f3a876938f8c83600741f3aa6dd (patch) | |
| tree | 552588c5d8cbe88cf28b924b6d1c3e74a282bbb3 | |
| parent | 646b01b619fa36e15804c83a521aab1aec497fd6 (diff) | |
| download | nvim-conf-e96308e884375f3a876938f8c83600741f3aa6dd.tar.gz nvim-conf-e96308e884375f3a876938f8c83600741f3aa6dd.zip | |
fix dressing, change lualine re-add null-ls
| -rw-r--r-- | after/plugin/dressing.lua | 310 | ||||
| -rw-r--r-- | after/plugin/lualine.lua | 8 | ||||
| -rw-r--r-- | after/plugin/null-ls.lua | 14 | ||||
| -rw-r--r-- | lua/alpha/plugins.lua | 7 | ||||
| -rw-r--r-- | lua/alpha/scratchs/laravel.lua | 3 | ||||
| -rw-r--r-- | lua/alpha/scratchs/sample.lua | 22 |
6 files changed, 188 insertions, 176 deletions
diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua index e37bf09..8d06cab 100644 --- a/after/plugin/dressing.lua +++ b/after/plugin/dressing.lua @@ -1,160 +1,162 @@ local ok, dressing = pcall(require, "dressing") if not ok then - return + return end dressing.setup({ - 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 = "left", - - -- 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 = "cursor", - - -- 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 }, - - -- Window transparency (0-100) - winblend = 10, - -- Change default highlight groups (see :help winhl) - winhighlight = "", - - -- 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 = true, - - -- 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", - - -- Window transparency (0-100) - winblend = 10, - -- Change default highlight groups (see :help winhl) - winhighlight = "", - - -- 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, - }, + 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 = "left", + + -- 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 = "cursor", + + -- 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 = true, + + -- 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, + }, }) diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua index 50886aa..d0630e3 100644 --- a/after/plugin/lualine.lua +++ b/after/plugin/lualine.lua @@ -12,11 +12,11 @@ lualine.setup({ extensions = { "quickfix", "fugitive" }, sections = { lualine_a = { { "mode", upper = true } }, - lualine_b = { { "branch", icon = "" }, { "db_ui#statusline" }, "diff" }, + lualine_b = { { "branch", icon = "" }, "db_ui#statusline" }, lualine_c = { { "filename", file_status = true, path = 1 } }, - lualine_x = { "diagnostics" }, - lualine_y = { "encoding", "fileformat" }, - lualine_z = { "filetype" }, + lualine_x = { "diagnostics", "diff" }, + lualine_y = { "filetype" }, + lualine_z = { "location" }, }, winbar = { lualine_a = {}, diff --git a/after/plugin/null-ls.lua b/after/plugin/null-ls.lua index f096baa..5770335 100644 --- a/after/plugin/null-ls.lua +++ b/after/plugin/null-ls.lua @@ -7,7 +7,6 @@ local composer = require("composer") local php_actions = require("php-code-actions") local laravel_actions = require("laravel.code-actions") - local sources = { -- null_ls.builtins.code_actions.gitsigns, null_ls.builtins.formatting.stylua, @@ -53,12 +52,19 @@ if composer.query({ "require", "symfony/framework-bundle" }) ~= nil then for _, source in ipairs(symonfy_sources) do table.insert(sources, source) end -end - -if composer.query({ "require", "laravel/framework" }) ~= nil then +elseif composer.query({ "require", "laravel/framework" }) ~= nil then for _, source in ipairs(laravel_sources) do table.insert(sources, source) end +else + table.insert( + sources, + null_ls.builtins.diagnostics.phpstan.with({ + command = "./vendor/bin/phpstan", + to_temp_file = false, + method = null_ls.methods.DIAGNOSTICS_ON_SAVE, + }) + ) end -- Only for development to reload sources diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index bb59623..6007fb9 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -128,7 +128,6 @@ return require("packer").startup(function(use) end, }) - -- use("feline-nvim/feline.nvim") use({ "nvim-lualine/lualine.nvim", requires = { "kyazdani42/nvim-web-devicons", opt = true }, @@ -172,6 +171,7 @@ return require("packer").startup(function(use) use("rcarriga/nvim-notify") + -- Themes use("EdenEast/nightfox.nvim") use("folke/tokyonight.nvim") use("wuelnerdotexe/vim-enfocado") @@ -188,6 +188,7 @@ return require("packer").startup(function(use) use("tpope/vim-commentary") use("tpope/vim-tbone") use("tpope/vim-dispatch") + use("junegunn/vim-easy-align") use("jwalton512/vim-blade") @@ -213,7 +214,7 @@ return require("packer").startup(function(use) requires = { "nvim-lua/plenary.nvim" }, }) - use({ "vimwiki/vimwiki", opt = true, cmd = { "VimwikiIndex" } }) + -- use({ "vimwiki/vimwiki", opt = true, cmd = { "VimwikiIndex" } }) -- use({ "hkupty/iron.nvim" }) @@ -225,8 +226,6 @@ return require("packer").startup(function(use) local_use("composer.nvim") local_use("neotest-phpunit") - use("habamax/vim-godot") - use({ "anuvyklack/hydra.nvim", requires = "anuvyklack/keymap-layer.nvim", -- needed only for pink hydras diff --git a/lua/alpha/scratchs/laravel.lua b/lua/alpha/scratchs/laravel.lua index f3ab843..3da2c69 100644 --- a/lua/alpha/scratchs/laravel.lua +++ b/lua/alpha/scratchs/laravel.lua @@ -14,3 +14,6 @@ -- -- Problem when I switch project sail is runnin in another one -- +local artisan = R("laravel.artisan") + +P(artisan.commands(true)) diff --git a/lua/alpha/scratchs/sample.lua b/lua/alpha/scratchs/sample.lua index a2d783e..80b0b77 100644 --- a/lua/alpha/scratchs/sample.lua +++ b/lua/alpha/scratchs/sample.lua @@ -1,12 +1,14 @@ -local scandir = require("plenary.scandir") - - +function reverse_current_word() + local line = vim.fn.getline('.') + local current_word = vim.fn.expand('<cword>') + local start_index = vim.fn.col('.') - #current_word + 1 + local reversed_word = current_word:reverse() + + local reversed_line = line:sub(1, start_index -1)..reversed_word..line:sub(start_index+#current_word) + P(reversed_line) + vim.fn.setline('.', reversed_line) +end -local dirs = scandir.scan_dir( - { "/home/alpha/code/php" }, - { depth = 1, only_dirs = true } -) +vim.api.nvim_command('command! -range=% ReverseWord :<line1>,<line2>lua reverse_current_word()') -for _, dir in ipairs(dirs) do - P(vim.fs.basename(dir)) -end +-- testing |