From 2b5101486c13831732722572ea603fd80dab56cc Mon Sep 17 00:00:00 2001 From: Taylor Prost Date: Mon, 19 Jan 2026 13:20:44 -0500 Subject: [PATCH] update telescope, add neogit, add emacs movement commands in insert mode --- init.lua | 57 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/init.lua b/init.lua index 60b74079..f1c93425 100644 --- a/init.lua +++ b/init.lua @@ -190,6 +190,14 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Emacs-style movement in insert mode +vim.keymap.set('i', '', '', { desc = 'Beginning of line' }) +vim.keymap.set('i', '', '', { desc = 'End of line' }) +vim.keymap.set('i', '', '', { desc = 'Next line' }) +vim.keymap.set('i', '', '', { desc = 'Previous line' }) +vim.keymap.set('i', '', '', { desc = 'Forward char' }) +vim.keymap.set('i', '', '', { 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 = { + { 'g', 'Neogit', 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 { { 'c', group = '[C]ode' }, { 'd', group = '[D]ocument' }, + { 'p', group = '[P]roject' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { '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', 'f', builtin.find_files, { desc = 'Find files' }) + vim.keymap.set('n', 'pf', builtin.git_files, { desc = 'Project files (git)' }) vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', '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, },