nvim/lua/setup/my_command_center.lua

171 lines
3.9 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',
cmd = '<CMD>Telescope command_center<CR>',
keybindings = {
{ 'n', '<Leader>p', noremap },
{ 'v', '<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', 'F5', 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 file (with gitignore)',
cmd = '<CMD>lua require("telescope.builtin").find_files({no_ignore=false})<CR>',
keybindings = {
{ 'n', '<C-p>', silent_noremap },
},
},
{
description = 'Find git files',
cmd = '<CMD>Telescope git_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 = '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 = '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 },
},
},
})