This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
Packs #2
pechorin
started this conversation in
Show and tell
Replies: 2 comments
-
Telescope packtelescope = {
vim_plug_bundle = {
{ 'nvim-telescope/telescope.nvim', { branch = '0.1.x' }},
'andrew-george/telescope-themes',
'otavioschwanck/telescope-alternate',
'isak102/telescope-git-file-history.nvim',
'FabianWirth/search.nvim',
},
keymaps = {
{ 'n', '<Leader>gS', ":lua require('search').open()<CR>", { desc = "Run search window", noremap = true }},
{ 'n', '<leader>gT', '<cmd>Telescope<cr>', { noremap = true, desc = "Telescope" }},
{ 'n', '<leader>gf', '<cmd>Telescope find_files<cr>', { noremap = true, desc = "Files" }},
{ 'n', '<leader>gb', '<cmd>Telescope buffers<cr>', { noremap = true, desc = "Buffers" }},
{ 'n', '<leader>gl', '<cmd>Telescope oldfiles<cr>', { noremap = true, desc = "Old files" }},
{ 'n', '<leader>gc', '<cmd>Telescope themes<cr>', { noremap = true, desc = "Themes" }},
{ 'n', '<leader>gk', '<cmd>Telescope keymaps<cr>', { noremap = true, desc = "Keys" }},
{ 'n', '<leader>gh', '<cmd>Telescope git_commits<cr>', { noremap = true, desc = "Git commits" }},
{ 'n', '<leader>gs', '<cmd>Telescope git_status<cr>', { noremap = true, desc = "Git status" }},
{ 'n', '<leader>gr', '<cmd>Telescope registers<cr>', { noremap = true, desc = "Keys" }},
{ 'n', '<leader>gd', '<cmd>Telescope diagnostics<cr>', { noremap = true, desc = "Keys" }},
{ 'n', '<leader>ga', '<cmd>Telescope telescope-alternate alternate_file<cr>', { noremap = true, desc = "Keys" }},
},
setup = function(self)
local telescope = require('telescope')
local actions = require("telescope.actions")
local action_layout = require("telescope.actions.layout")
require('search').setup({})
telescope.setup({
defaults = {
layout_config = { vertical = { width = 0.6 }, horizontal = { width = 0.5 } },
mappings = {
i = {
["<esc>"] = actions.close,
},
},
},
pickers = {
buffers = { theme = "dropdown" }, find_files = { theme = "dropdown" }
},
extensions = {
themes = {
enable_previewer = false, enable_live_preview = true, persist = { enabled = false }, ignore = {},
layout_config = { horizontal = { width = 0.3, height = 0.5 } },
},
-- TODO: setup: https://github.com/otavioschwanck/telescope-alternate.nvim
["telescope-alternate"] = {
presets = { 'rails', 'rspec' },
mappings = {
{ 'app/models/(.*).rb', {
{ 'app/admin/**/*[1].rb', 'Admin' },
{ 'app/interactions/[1:pluralize]*/*.rb', 'Interactions' },
{ 'app/interactors/[1:pluralize]*/*.rb', 'Interactors' },
-- { 'app/**/[1:pluralize]/*.rb', 'Modules' },
-- { 'app/**/**/[1]*.rb', '~*' },
}
},
-- { 'app/services/(.*)/(.*).rb', { -- alternate from services to contracts / models
-- -- -- { 'app/contracts/[1]_contracts/[2].rb', 'Contract' }, -- Adding label to switch
-- { 'app/models/**/*[1].rb', 'Model' },
-- { 'app/interactions/**/*[1].rb', 'Interactions' },
-- { 'app/interactors/**/*[1].rb', 'Interactors' },
-- } },
-- { 'app/contracts/(.*)_contracts/(.*).rb', { { 'app/services/[1]_services/[2].rb', 'Service' } } }, -- from contracts to services
-- -- Search anything on helper folder that contains pluralize version of model.
-- --Example: app/models/user.rb -> app/helpers/foo/bar/my_users_helper.rb
-- { 'app/models/(.*).rb', { { 'db/helpers/**/*[1:pluralize]*.rb', 'Helper' } } },
-- { 'app/**/*.rb', { { 'spec/[1].rb', 'Test' } } }, -- Alternate between file and test
},
},
}
})
telescope.load_extension('themes')
telescope.load_extension('telescope-alternate')
telescope.load_extension('git_file_history')
end
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Alpha start dashboard pack Full example: require('nvim-config-loader').setup {
alpha_start_dashboard = {
title = 'Hello world!',
buttons = {
{"e", " > New File", "<cmd>ene<CR>"},
{"n", " > Toggle file explorer", "<cmd>Neotree<CR>"},
{"f", " > Find File", "<cmd>Telescope find_files<CR>"},
{"F", " > Find Word", "<cmd>Telescope live_grep<CR>"},
{"m", " > Keymaps", "<cmd>Telescope keymaps<CR>"},
{"g", " > Git status", "<cmd>Git<CR>"},
{"u", " > Update plugins", "<cmd>PlugUpdate<CR>"},
{"H", " > Edit .vimrc", "<cmd>e ~/.vimrc<CR>"},
{"c", " > Change colorscheme", "<cmd>Telescope themes<CR>"},
}
},
packs = {
alpha_start_dashboard = {
vim_plug_bundle = {
'goolord/alpha-nvim'
},
autocommands = {
-- Disable folding on alpha buffer
{ event = { 'FileType' }, pattern = 'alpha', command = 'setlocal nofoldenable' },
},
setup = function(self)
local alpha = require("alpha")
local startify = require("alpha.themes.startify")
local title = self.settings.alpha_start_dashboard.title or 'Hello world'
startify.section.header.val = { title }
startify.opts.layout[1].val = 2
startify.opts.opts.margin = 3
-- disable MRU
startify.section.mru.val = { { type = "padding", val = 0 } }
local buttons = {}
for _, data in pairs(self.settings.alpha_start_dashboard.buttons or {}) do
local btn = startify.button(unpack(data))
table.insert(buttons, btn)
end
startify.section.top_buttons.val = buttons
-- Send config to alpha
alpha.setup(startify.config)
end
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Showcase of packs
Beta Was this translation helpful? Give feedback.
All reactions