nvim/lua/setup/my_command_center.lua

164 lines
3.6 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 }
command_center.add({
{
description = 'Open command_center',
command = 'Telescope command_center',
keybindings = {
{ 'n', '<Leader>p', noremap },
{ 'v', '<Leader>p', noremap },
},
},
{
description = 'Open a new tab',
command = 'tabnew .',
keybindings = {
{ 'n', 'F2', silent_noremap },
},
},
{
description = 'Open a new vertical split',
command = 'vsplit .',
keybindings = {
{ 'n', '<C-F2>', silent_noremap },
},
},
{
description = 'Open a new horizontal split',
command = 'split .',
keybindings = {
{ 'n', '<S-F2>', silent_noremap },
},
},
{
description = 'CMake build all',
command = 'CMake build_all',
},
{
description = 'CMake build selected target',
command = 'CMake build',
keybindings = {
{ 'n', 'F5', silent_noremap },
},
},
{
description = 'CMake configure',
command = 'CMake configure',
},
{
description = 'CMake select target',
command = 'CMake select_target',
},
{
description = 'CMake clear cache',
command = 'CMake clear_cache',
},
{
description = 'List snippets',
command = 'LuaSnipListAvailable',
},
{
description = 'Add comment',
command = 'Neogen',
keybindings = {
{ 'n', '<leader>n', silent_noremap },
},
},
{
description = 'Select project',
command = 'Telescope projects',
keybindings = {
{ 'n', '<space>p', silent_noremap },
},
},
{
description = 'Find file',
command = 'lua require("telescope.builtin").find_files({no_ignore=true})',
keybindings = {
{ 'n', '<leader>f', silent_noremap },
},
},
{
description = 'Find file (with gitignore)',
command = 'lua require("telescope.builtin").find_files({no_ignore=false})',
keybindings = {
{ 'n', '<C-p>', silent_noremap },
},
},
{
description = 'Find git files',
command = 'Telescope git_files',
keybindings = {
{ 'n', '<leader>g', silent_noremap },
},
},
{
description = 'Find old files',
command = 'Telescope oldfiles',
keybindings = {
{ 'n', '<leader>o', silent_noremap },
},
},
{
description = 'Open command history',
command = 'Telescope command_history',
keybindings = {
{ 'n', '<leader>h', silent_noremap },
},
},
{
description = 'Select buffer',
command = 'Telescope buffers',
keybindings = {
{ 'n', '<leader>b', silent_noremap },
},
},
{
description = 'Quickfix list with telescope',
command = 'Telescope quickfix',
keybindings = {
{ 'n', '<leader>q', silent_noremap },
},
},
{
description = 'Search in project',
command = 'Telescope live_grep',
keybindings = {
{ 'n', '<leader>l', silent_noremap },
{ 'n', '<c-s-f>', silent_noremap },
},
},
{
description = 'Open clipboard history',
command = 'Telescope neoclip',
keybindings = {
{ 'n', '<C-y>', silent_noremap },
},
},
{
description = 'Open jumplist',
command = 'Telescope jumplist',
keybindings = {
{ 'n', '<leader>j', silent_noremap },
},
},
{
description = 'Find in buffer',
command = 'Telescope current_buffer_fuzzy_find',
keybindings = {
{ 'n', '<c-f>', silent_noremap },
},
},
{
description = 'Open lazygit',
command = 'lua _lazygit_toggle()',
keybindings = {
{ 'n', '<Space>g', silent_noremap },
},
},
})