Skip to content

Commit 4d01962

Browse files
committed
New keybindings
1 parent d350f91 commit 4d01962

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

init.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ require('lazy').setup({
460460
pcall(require('telescope').load_extension, 'fzf')
461461
pcall(require('telescope').load_extension, 'zoxide')
462462
pcall(require('telescope').load_extension, 'ui-select')
463-
464463
-- See `:help telescope.builtin`
465464
local builtin = require 'telescope.builtin'
465+
local extensions = require 'telescope._extensions'
466466
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
467467
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
468468
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
@@ -772,8 +772,8 @@ require('lazy').setup({
772772
end,
773773
formatters_by_ft = {
774774
cmake = { 'cmakelang' },
775-
cpp = { 'clang-format' },
776-
json = { 'clang-format' },
775+
cpp = { 'clang-format-15' },
776+
json = { 'clang-format-15' },
777777
lua = { 'stylua' },
778778
-- Conform can also run multiple formatters sequentially
779779
python = { 'isort' },
@@ -899,7 +899,6 @@ require('lazy').setup({
899899
}
900900
end,
901901
},
902-
903902
{ -- You can easily change to a different colorscheme.
904903
-- Change the name of the colorscheme plugin below, and then
905904
-- change the command in the config to whatever the name of that colorscheme is.

lua/custom/keymap.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
-- See `:help vim.keymap.set()`
33

44
-- Set highlight on search, but clear on pressing <Esc> in normal mode
5-
vim.keymap.set('n', '<leader>fa', '<cmd>lua vim.lsp.buf.format()<CR>')
5+
66
vim.keymap.set('n', '<leader>mt', '<cmd>NvimTreeFocus<CR>')
7-
vim.keymap.set('n', '<C-o>', '<cmd>ClangdSwitchSourceHeader<CR>')
7+
vim.keymap.set('n', '<C-o>', '<cmd>ClangdSwitchSourceHeader<CR>', { desc = 'Swith to source/header file' })
88
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
99
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
1010
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
1111
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
1212
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
13-
vim.keymap.set('n', '<leader>z', require('telescope').extensions.zoxide.list)
13+
vim.keymap.set('n', '<leader>z', require('telescope').extensions.zoxide.list, { desc = '[Z]oxide to different dir' })
14+
vim.keymap.set('n', '<leader>jl', require('telescope.builtin').jumplist, { desc = '[J]ump [L]ist' })
1415
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
1516
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
1617
-- is not what someone will guess without a bit more experience.
@@ -33,3 +34,4 @@ vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left wind
3334
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
3435
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
3536
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
37+
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })

0 commit comments

Comments
 (0)