update telescope, add neogit, add emacs movement commands in insert mode

This commit is contained in:
Taylor Prost 2026-01-19 13:20:44 -05:00
parent e667abf5ee
commit 2b5101486c
1 changed files with 31 additions and 26 deletions

View File

@ -190,6 +190,14 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- Emacs-style movement in insert mode
vim.keymap.set('i', '<C-a>', '<Home>', { desc = 'Beginning of line' })
vim.keymap.set('i', '<C-e>', '<End>', { desc = 'End of line' })
vim.keymap.set('i', '<C-n>', '<Down>', { desc = 'Next line' })
vim.keymap.set('i', '<C-p>', '<Up>', { desc = 'Previous line' })
vim.keymap.set('i', '<C-f>', '<Right>', { desc = 'Forward char' })
vim.keymap.set('i', '<C-b>', '<Left>', { desc = 'Back char' })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
@ -256,6 +264,20 @@ require('lazy').setup({
},
},
{ -- Git interface like magit
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim',
'sindrets/diffview.nvim',
'nvim-telescope/telescope.nvim',
},
cmd = 'Neogit',
keys = {
{ '<leader>g', '<cmd>Neogit<cr>', desc = 'Neogit' },
},
opts = {},
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
@ -281,6 +303,7 @@ require('lazy').setup({
require('which-key').add {
{ '<leader>c', group = '[C]ode' },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>p', group = '[P]roject' },
{ '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' },
@ -300,7 +323,7 @@ require('lazy').setup({
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
branch = '0.1.x',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
@ -366,6 +389,8 @@ require('lazy').setup({
-- See `:help telescope.builtin`
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>f', builtin.find_files, { desc = 'Find files' })
vim.keymap.set('n', '<leader>pf', builtin.git_files, { desc = 'Project files (git)' })
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
@ -843,31 +868,11 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'clojure', 'python' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup(opts)
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
config = function()
require('nvim-treesitter').setup {}
-- Install parsers if missing
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'clojure', 'python' }
require('nvim-treesitter').install(parsers)
end,
},