Skip to content

Commit a3a218e

Browse files
renamed keymap gen functions to make them more descriptive
1 parent 3aacd5d commit a3a218e

File tree

7 files changed

+12
-19
lines changed

7 files changed

+12
-19
lines changed

init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require('options')
1616

1717
require('lsp-cfg')
1818

19-
require('keymaps').basic()
19+
require('keymaps').map_basic()
2020

2121
-- The line beneath this is called `modeline`. See `:help modeline`
2222
-- vim: ts=2 sts=2 sw=2 et

lua/keymaps.lua

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
local keymaps = {
22

3-
basic = function()
4-
-- [[ Basic Keymaps ]]
3+
map_basic = function()
54
-- Keymaps for better default experience
65
-- See `:help vim.keymap.set()`
76
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
@@ -25,8 +24,7 @@ local keymaps = {
2524
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Window up' })
2625
end,
2726

28-
telescope = function()
29-
-- [[ Telescope Keymaps ]]
27+
map_telescope = function()
3028
-- See `:help telescope.builtin`
3129
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
3230
vim.keymap.set('n', '<leader>sk', require('telescope.builtin').keymaps, { desc = '[S]earch [K]eymaps' })
@@ -57,9 +55,7 @@ local keymaps = {
5755
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
5856
end,
5957

60-
debug = function()
61-
-- [[ Debug Keymaps ]]
62-
-- Basic debugging keymaps, feel free to change to your liking!
58+
map_debug = function()
6359
vim.keymap.set('n', '<F5>', require('dap').continue, { desc = 'Debug: Start/Continue' })
6460
vim.keymap.set('n', '<F6>', require('dap').pause, { desc = 'Debug: Pause' })
6561
vim.keymap.set('n', '<F10>', function()
@@ -80,19 +76,16 @@ local keymaps = {
8076
vim.keymap.set('n', '<F7>', require('dapui').toggle, { desc = 'Debug: See last session result.' })
8177
end,
8278

83-
neogen = function()
84-
-- [[ Neogen Keymaps ]]
79+
map_neogen = function()
8580
vim.keymap.set('n', '<leader>dc', require('neogen').generate,
8681
{ desc = '[D]ocument [C]ode' })
8782
end,
8883

89-
filetree = function()
90-
-- [[ Filetree Keymaps ]]
84+
map_filetree = function()
9185
vim.keymap.set('n', '<C-n>', '<cmd>NvimTreeToggle<CR>', { desc = 'Toggle Filetree' })
9286
end,
9387

94-
tabline = function()
95-
-- [[ Tabline Keymaps ]]
88+
map_tabline = function()
9689
vim.keymap.set('n', '<Tab>', function() require('bufferline').cycle(1) end,
9790
{ desc = 'Move to next buffer on bufferline' })
9891
vim.keymap.set('n', '<S-Tab>', function() require('bufferline').cycle(-1) end,

lua/plugins/debug.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ return {
8585
-- Load Launch JS
8686
require('dap.ext.vscode').load_launchjs(nil, { cppdbg = { 'c', 'cpp' } })
8787

88-
require('keymaps').debug()
88+
require('keymaps').map_debug()
8989
end,
9090
}

lua/plugins/file-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ return {
8686
-- indent_width = 1,
8787
-- },
8888
})
89-
require('keymaps').filetree()
89+
require('keymaps').map_filetree()
9090
end,
9191
}

lua/plugins/neogen.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ return {
33
config = function()
44
local ng = require('neogen')
55
ng.setup({ snippet_engine = "luasnip" })
6-
require('keymaps').neogen()
6+
require('keymaps').map_neogen()
77
end,
88
-- Uncomment next line if you want to follow only stable versions
99
-- version = "*"

lua/plugins/tab-line.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ return {
55
config = function()
66
local b = require("bufferline")
77
b.setup()
8-
require('keymaps').tabline()
8+
require('keymaps').map_tabline()
99
end
1010
}

lua/plugins/telescope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ return {
9494

9595
vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {})
9696

97-
require('keymaps').telescope()
97+
require('keymaps').map_telescope()
9898
end,
9999
}

0 commit comments

Comments
 (0)