Skip to content

Commit 9ab43d6

Browse files
author
Anish Moorthy
committed
Make neogit open in buffer directory (or maybe that was last change)
1 parent 4fc303a commit 9ab43d6

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

init.lua

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ What is Kickstart?
88
The goal is that you can read every line of code, top-to-bottom, understand
99
what your configuration is doing, and modify it to suit your needs.
1010
11-
Once you've done that, you can start exploring, configuring and tinkering to
12-
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
13-
or immediately breaking it into modular pieces. It's up to you!
14-
1511
If you don't know anything about Lua, I recommend taking some time to read through
1612
a guide. One possible example which will only take 10-15 minutes:
1713
- https://learnxinyminutes.com/docs/lua/
@@ -42,15 +38,8 @@ Kickstart Guide:
4238
These are hints about where to find more information about the relevant settings,
4339
plugins or Neovim features used in Kickstart.
4440
45-
Throughout the file. These are for you, the reader, to help you understand what is happening.
46-
Feel free to delete them once you know what you're doing, but they should serve as a guide
47-
for when you are first encountering a few different constructs in your Neovim config.
48-
4941
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
5042
51-
I hope you enjoy your Neovim journey,
52-
- TJ
53-
5443
P.S. You can delete this when you're done too. It's your config now! :)
5544
--]]
5645

@@ -169,7 +158,6 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
169158
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
170159
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
171160

172-
-- TODO: Anish
173161
vim.keymap.set('n', '<leader>fs', '<cmd>:w<CR>', { desc = '[F]ile [S]ave' })
174162

175163
-- clangd is set up differently than all of the other LSPs due to
@@ -219,8 +207,6 @@ rtp:prepend(lazypath)
219207
--
220208
-- To update plugins you can run
221209
-- :Lazy update
222-
--
223-
-- NOTE: Here is where you install your plugins.
224210
require('lazy').setup({
225211
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
226212
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
@@ -248,7 +234,9 @@ require('lazy').setup({
248234
},
249235
},
250236
}
251-
vim.keymap.set('n', '<leader>gg', '<cmd>:Neogit<CR>', { desc = '[G]it [G]atus' })
237+
vim.keymap.set('n', '<leader>gg', function()
238+
require('neogit').open { cwd = vim.fn.expand '%:p:h' }
239+
end, { desc = '[G]it [G]atus' })
252240
end,
253241
},
254242
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
@@ -296,7 +284,7 @@ require('lazy').setup({
296284
-- Then, because we use the `opts` key (recommended), the configuration runs
297285
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
298286

299-
{ -- Useful plugin to show you pending keybinds.
287+
{
300288
'folke/which-key.nvim',
301289
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
302290
opts = {
@@ -456,9 +444,9 @@ require('lazy').setup({
456444
end, { desc = '[S]earch [/] in Open Files' })
457445

458446
-- Shortcut for searching your Neovim configuration files
459-
vim.keymap.set('n', '<leader>sn', function()
447+
vim.keymap.set('n', '<leader>fp', function()
460448
builtin.find_files { cwd = vim.fn.stdpath 'config' }
461-
end, { desc = '[S]earch [N]eovim files' })
449+
end, { desc = '[F]ile [P]init' })
462450
end,
463451
},
464452

0 commit comments

Comments
 (0)