|
|
|
@ -163,7 +163,8 @@ vim.opt.confirm = true
|
|
|
|
|
|
|
|
|
|
-- [[ Basic Keymaps ]]
|
|
|
|
|
-- See `:help vim.keymap.set()`
|
|
|
|
|
|
|
|
|
|
vim.opt.foldmethod = 'indent'
|
|
|
|
|
vim.opt.foldlevel = 99
|
|
|
|
|
-- Clear highlights on search when pressing <Esc> in normal mode
|
|
|
|
|
-- See `:help hlsearch`
|
|
|
|
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
|
|
@ -171,6 +172,7 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
|
|
|
-- Diagnostic keymaps
|
|
|
|
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
|
|
|
|
|
|
|
|
|
vim.keymap.set('n', 'gn', '<cmd>tab split | lua vim.lsp.buf.definition()<CR>', {})
|
|
|
|
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
|
|
|
|
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
|
|
|
|
-- is not what someone will guess without a bit more experience.
|
|
|
|
@ -208,6 +210,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|
|
|
|
end,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
-- Write the last file closed and its cursor position to a temporary file
|
|
|
|
|
vim.api.nvim_create_autocmd('VimLeavePre', {
|
|
|
|
|
callback = function()
|
|
|
|
|
local filepath = vim.fn.expand '%:p'
|
|
|
|
|
local line = vim.fn.line '.'
|
|
|
|
|
if filepath ~= '' then
|
|
|
|
|
vim.fn.writefile({ filepath, tostring(line) }, '/tmp/nvim_last_closed')
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
})
|
|
|
|
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
|
|
|
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
|
|
|
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|
|
|
@ -231,6 +243,7 @@ vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
-- :Lazy update
|
|
|
|
|
--
|
|
|
|
|
-- NOTE: Here is where you install your plugins.
|
|
|
|
|
|
|
|
|
|
require('lazy').setup({
|
|
|
|
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
|
|
|
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
|
|
|
@ -254,7 +267,8 @@ require('lazy').setup({
|
|
|
|
|
-- }
|
|
|
|
|
--
|
|
|
|
|
-- Here is a more advanced example where we pass configuration
|
|
|
|
|
-- options to `gitsigns.nvim`.
|
|
|
|
|
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
|
|
|
|
-- require('gitsigns').setup { ... }
|
|
|
|
|
--
|
|
|
|
|
-- See `:help gitsigns` to understand what the configuration keys do
|
|
|
|
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
|
|
|
@ -270,6 +284,17 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
'joshuavial/aider.nvim',
|
|
|
|
|
opts = {
|
|
|
|
|
-- your configuration comes here
|
|
|
|
|
-- if you don't want to use the default settings
|
|
|
|
|
auto_manage_context = true, -- automatically manage buffer context
|
|
|
|
|
default_bindings = true, -- use default <leader>A keybindings
|
|
|
|
|
debug = false, -- enable debug logging
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
-- 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
|
|
|
|
@ -663,9 +688,9 @@ require('lazy').setup({
|
|
|
|
|
-- - settings (table): Override the default settings passed when initializing the server.
|
|
|
|
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
|
|
|
|
local servers = {
|
|
|
|
|
-- clangd = {},
|
|
|
|
|
clangd = {},
|
|
|
|
|
-- gopls = {},
|
|
|
|
|
-- pyright = {},
|
|
|
|
|
pyright = {},
|
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
|
|
|
|
--
|
|
|
|
@ -673,7 +698,7 @@ require('lazy').setup({
|
|
|
|
|
-- https://github.com/pmizio/typescript-tools.nvim
|
|
|
|
|
--
|
|
|
|
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
|
|
|
|
-- ts_ls = {},
|
|
|
|
|
ts_ls = {},
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
lua_ls = {
|
|
|
|
@ -990,14 +1015,14 @@ require('lazy').setup({
|
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
|
-- require 'kickstart.plugins.neo-tree',
|
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
|
|
|
|
|
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
|
|
|
|
-- This is the easiest way to modularize your config.
|
|
|
|
|
--
|
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
|
--
|
|
|
|
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
|
|
|
|
-- Or use telescope!
|
|
|
|
|