250 lines
5.7 KiB
Lua
250 lines
5.7 KiB
Lua
require('telescope').load_extension('command_center')
|
|
|
|
local command_center = require('command_center')
|
|
local noremap = { noremap = true }
|
|
local silent_noremap = { noremap = true, silent = true }
|
|
|
|
project_files = function()
|
|
local opts = {} -- define here if you want to define something
|
|
local ok = pcall(require"telescope.builtin".git_files, opts)
|
|
if not ok then require"telescope.builtin".find_files(opts) end
|
|
end
|
|
|
|
command_center.add({
|
|
{
|
|
description = 'Open command_center',
|
|
cmd = '<CMD>Telescope command_center<CR>',
|
|
keybindings = {
|
|
{ 'n', '<Leader>p', noremap },
|
|
{ 'x', '<Leader>p', noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open a new tab',
|
|
cmd = '<CMD>tabnew .<CR>',
|
|
keybindings = {
|
|
{ 'n', 'F2', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open a new vertical split',
|
|
cmd = '<CMD>vsplit .<CR>',
|
|
keybindings = {
|
|
{ 'n', '<C-F2>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open a new horizontal split',
|
|
cmd = '<CMD>split .<CR>',
|
|
keybindings = {
|
|
{ 'n', '<S-F2>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'CMake build all',
|
|
cmd = '<CMD>CMake build_all<CR>',
|
|
},
|
|
{
|
|
description = 'CMake build selected target',
|
|
cmd = '<CMD>CMake build<CR>',
|
|
keybindings = {
|
|
{ 'n', '<F4>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'CMake configure',
|
|
cmd = '<CMD>CMake configure<CR>',
|
|
},
|
|
{
|
|
description = 'CMake select target',
|
|
cmd = '<CMD>CMake select_target<CR>',
|
|
},
|
|
{
|
|
description = 'CMake clear cache',
|
|
cmd = '<CMD>CMake clear_cache<CR>',
|
|
},
|
|
{
|
|
description = 'List snippets',
|
|
cmd = '<CMD>LuaSnipListAvailable<CR>',
|
|
},
|
|
{
|
|
description = 'Add comment',
|
|
cmd = '<CMD>Neogen<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>n', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Select project',
|
|
cmd = '<CMD>Telescope projects<CR>',
|
|
keybindings = {
|
|
{ 'n', '<space>p', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Find file',
|
|
cmd = '<CMD>lua require("telescope.builtin").find_files({no_ignore=true})<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>f', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Find git files',
|
|
cmd = '<CMD>lua project_files()<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>g', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Find old files',
|
|
cmd = '<CMD>Telescope oldfiles<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>o', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open command history',
|
|
cmd = '<CMD>Telescope command_history<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>h', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Select buffer',
|
|
cmd = '<CMD>Telescope buffers<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>b', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Quickfix list with telescope',
|
|
cmd = '<CMD>Telescope quickfix<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>q', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Search in project',
|
|
cmd = '<CMD>Telescope live_grep<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>l', silent_noremap },
|
|
{ 'n', '<c-s-f>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Search in open files',
|
|
cmd = "<CMD>lua require('telescope.builtin').live_grep({ prompt_title = 'find string in open buffers...', grep_open_files = true })<CR>",
|
|
},
|
|
{
|
|
description = 'Open clipboard history',
|
|
cmd = '<CMD>Telescope neoclip<CR>',
|
|
keybindings = {
|
|
{ 'n', '<C-y>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open jumplist',
|
|
cmd = '<CMD>Telescope jumplist<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>j', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Find in buffer',
|
|
cmd = '<CMD>Telescope current_buffer_fuzzy_find<CR>',
|
|
keybindings = {
|
|
{ 'n', '<c-f>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Find in workspace',
|
|
cmd = '<CMD>Telescope grep_string<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>d', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Open lazygit',
|
|
cmd = '<CMD>lua _lazygit_toggle()<CR>',
|
|
keybindings = {
|
|
{ 'n', '<Space>g', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Word under cursor into register a',
|
|
cmd = '"ayiw',
|
|
keybindings = {
|
|
{ 'n', '<leader>a', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Toggle fold',
|
|
cmd = 'za',
|
|
keybindings = {
|
|
{ 'n', '<space>x', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Yanky cycle forward',
|
|
cmd = '<Plug>(YankyCycleForward)',
|
|
keybindings = {
|
|
{ 'n', '<c-n>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Yanky cycle backward',
|
|
cmd = '<Plug>(YankyCycleBackward)',
|
|
keybindings = {
|
|
{ 'n', '<c-p>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Github list PRs',
|
|
cmd = '<CMD>Octo pr list<CR>',
|
|
},
|
|
{
|
|
description = 'Github checkout PR',
|
|
cmd = '<CMD>Octo pr checkout<CR>',
|
|
},
|
|
{
|
|
description = 'Github open PR in browser',
|
|
cmd = '<CMD>Octo pr browser<CR>',
|
|
},
|
|
{
|
|
description = 'Comment line',
|
|
cmd = '<Plug>(comment_toggle_current_linewise)',
|
|
keybindings = {
|
|
{ 'n', '<c-_>', silent_noremap },
|
|
{ 'n', '<c-c>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Comment line',
|
|
cmd = '<Plug>(comment_toggle_linewise_visual)gv',
|
|
keybindings = {
|
|
{ 'x', '<c-_>', silent_noremap },
|
|
{ 'x', '<c-c>', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Symbols outline',
|
|
cmd = '<CMD>AerialToggle<CR>',
|
|
keybindings = {
|
|
{ 'n', '<leader>s', silent_noremap },
|
|
{ 'n', '<Space>s', silent_noremap },
|
|
},
|
|
},
|
|
{
|
|
description = 'Big font size',
|
|
cmd = '<CMD>set guifont=JetBrainsMonoNL\\ NF:h12<CR>',
|
|
},
|
|
{
|
|
description = 'Reset font size',
|
|
cmd = '<CMD>set guifont=JetBrainsMonoNL\\ NF:h9<CR>',
|
|
},
|
|
})
|
|
|
|
|
|
|
|
|