|
|
|
@ -72,7 +72,7 @@ Kickstart Guide:
|
|
|
|
|
|
|
|
|
|
NOTE: Look for lines like this
|
|
|
|
|
|
|
|
|
|
Throughout the file. These are for you, the reader, to help you understand what is happening.
|
|
|
|
|
|
|
|
|
|
Feel free to delete them once you know what you're doing, but they should serve as a guide
|
|
|
|
|
for when you are first encountering a few different constructs in your Neovim config.
|
|
|
|
|
|
|
|
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
|
|
|
|
|
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
|
|
|
|
vim.g.have_nerd_font = false
|
|
|
|
|
vim.g.have_nerd_font = true
|
|
|
|
|
|
|
|
|
|
-- [[ Setting options ]]
|
|
|
|
|
-- See `:help vim.opt`
|
|
|
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
|
|
|
|
vim.opt.number = true
|
|
|
|
|
-- You can also add relative line numbers, to help with jumping.
|
|
|
|
|
-- Experiment for yourself to see if you like it!
|
|
|
|
|
-- vim.opt.relativenumber = true
|
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
|
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
@ -139,6 +139,9 @@ vim.opt.timeoutlen = 300
|
|
|
|
|
vim.opt.splitright = true
|
|
|
|
|
vim.opt.splitbelow = true
|
|
|
|
|
|
|
|
|
|
-- Use terminal colours
|
|
|
|
|
vim.opt.termguicolors = true
|
|
|
|
|
|
|
|
|
|
-- Sets how neovim will display certain whitespace characters in the editor.
|
|
|
|
|
-- See `:help 'list'`
|
|
|
|
|
-- and `:help 'listchars'`
|
|
|
|
@ -224,6 +227,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
|
|
|
|
@ -258,6 +262,8 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{ 'tiagovla/scope.nvim' },
|
|
|
|
|
|
|
|
|
|
-- 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
|
|
|
|
@ -284,10 +290,11 @@ require('lazy').setup({
|
|
|
|
|
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>f'] = { name = '[F]ind', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
|
|
|
|
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
|
|
|
|
--['<leader>e'] = { name = '[E]xplore files', _ = 'which_key_ignore' },
|
|
|
|
|
}
|
|
|
|
|
-- visual mode
|
|
|
|
|
require('which-key').register({
|
|
|
|
@ -366,45 +373,48 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- Scope
|
|
|
|
|
require('scope').setup {}
|
|
|
|
|
|
|
|
|
|
-- Enable Telescope extensions if they are installed
|
|
|
|
|
pcall(require('telescope').load_extension, 'fzf')
|
|
|
|
|
pcall(require('telescope').load_extension, 'ui-select')
|
|
|
|
|
|
|
|
|
|
-- See `:help telescope.builtin`
|
|
|
|
|
local builtin = require 'telescope.builtin'
|
|
|
|
|
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' })
|
|
|
|
|
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
|
|
|
|
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
|
|
|
|
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
|
|
|
|
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
|
|
|
|
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
|
|
|
|
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = '[F]ind [H]elp' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fk', builtin.keymaps, { desc = '[F]ind [K]eymaps' })
|
|
|
|
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = '[F]ind [F]iles' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fs', builtin.builtin, { desc = '[F]ind [S]elect Telescope' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = '[F]ind current [W]ord' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = '[F]ind by [G]rep' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' })
|
|
|
|
|
vim.keymap.set('n', '<leader>fr', builtin.resume, { desc = '[F]ind [R]esume' })
|
|
|
|
|
vim.keymap.set('n', '<leader>f.', builtin.oldfiles, { desc = '[F]ind Recent Files ("." for repeat)' })
|
|
|
|
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
|
|
|
|
|
|
|
-- Slightly advanced example of overriding default behavior and theme
|
|
|
|
|
vim.keymap.set('n', '<leader>/', function()
|
|
|
|
|
vim.keymap.set('n', '<leader>s', function()
|
|
|
|
|
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
|
|
|
|
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
|
|
|
|
winblend = 10,
|
|
|
|
|
previewer = false,
|
|
|
|
|
})
|
|
|
|
|
end, { desc = '[/] Fuzzily search in current buffer' })
|
|
|
|
|
end, { desc = '[S] Fuzzily search in current buffer' })
|
|
|
|
|
|
|
|
|
|
-- It's also possible to pass additional configuration options.
|
|
|
|
|
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
|
|
|
|
vim.keymap.set('n', '<leader>s/', function()
|
|
|
|
|
vim.keymap.set('n', '<leader>f/', function()
|
|
|
|
|
builtin.live_grep {
|
|
|
|
|
grep_open_files = true,
|
|
|
|
|
prompt_title = 'Live Grep in Open Files',
|
|
|
|
|
}
|
|
|
|
|
end, { desc = '[S]earch [/] in Open Files' })
|
|
|
|
|
end, { desc = '[F]ind [/] in Open Files' })
|
|
|
|
|
|
|
|
|
|
-- Shortcut for searching your Neovim configuration files
|
|
|
|
|
vim.keymap.set('n', '<leader>sn', function()
|
|
|
|
|
vim.keymap.set('n', '<leader>fn', function()
|
|
|
|
|
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
|
|
|
|
end, { desc = '[S]earch [N]eovim files' })
|
|
|
|
|
end, { desc = '[F]ind [N]eovim files' })
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -469,7 +479,7 @@ require('lazy').setup({
|
|
|
|
|
-- Jump to the definition of the word under your cursor.
|
|
|
|
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
|
|
|
|
-- To jump back, press <C-t>.
|
|
|
|
|
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
|
|
|
map('gd', require('telescope.builtin').lsp_definitions, '[g]oto [d]efinition')
|
|
|
|
|
|
|
|
|
|
-- Find references for the word under your cursor.
|
|
|
|
|
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
|
|
@ -619,7 +629,7 @@ require('lazy').setup({
|
|
|
|
|
lazy = false,
|
|
|
|
|
keys = {
|
|
|
|
|
{
|
|
|
|
|
'<leader>f',
|
|
|
|
|
'<leader>F',
|
|
|
|
|
function()
|
|
|
|
|
require('conform').format { async = true, lsp_fallback = true }
|
|
|
|
|
end,
|
|
|
|
@ -714,7 +724,6 @@ require('lazy').setup({
|
|
|
|
|
-- Scroll the documentation window [b]ack / [f]orward
|
|
|
|
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
|
|
|
|
|
|
|
-- Accept ([y]es) the completion.
|
|
|
|
|
-- This will auto-import if your LSP supports it.
|
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
@ -862,11 +871,13 @@ require('lazy').setup({
|
|
|
|
|
-- Here are some example plugins that I've included in the Kickstart repository.
|
|
|
|
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
|
|
|
|
--
|
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
|
require 'kickstart.plugins.debug',
|
|
|
|
|
require 'kickstart.plugins.indent_line',
|
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
|
-- require 'kickstart.plugins.neo-tree',
|
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
|
require 'custom.plugins.barbar',
|
|
|
|
|
require 'custom.plugins.copilot',
|
|
|
|
|
-- 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`
|
|
|
|
@ -874,7 +885,6 @@ require('lazy').setup({
|
|
|
|
|
--
|
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
|
}, {
|
|
|
|
|
ui = {
|
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
@ -897,5 +907,6 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
require 'custom'
|
|
|
|
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|
|
|
|
|
-- vim: ts=2 sts=2 sw=2 t
|
|
|
|
|