|
|
@ -15,13 +15,16 @@ vim.g.have_nerd_font = true
|
|
|
|
-- Make line numbers default and set relativenumbers
|
|
|
|
-- Make line numbers default and set relativenumbers
|
|
|
|
vim.opt.number = true
|
|
|
|
vim.opt.number = true
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
|
|
|
|
|
|
|
|
-- Don't show the mode, since it's already in the status line
|
|
|
|
-- Don't show the mode, since it's already in the status line
|
|
|
|
vim.opt.showmode = false
|
|
|
|
vim.opt.showmode = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Disable search count/select count etc. in bottom right corner
|
|
|
|
|
|
|
|
vim.opt.showcmd = false
|
|
|
|
|
|
|
|
|
|
|
|
-- Sync clipboard between OS and Neovim.
|
|
|
|
-- Sync clipboard between OS and Neovim.
|
|
|
|
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
|
|
|
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
|
|
|
-- Remove this option if you want your OS clipboard to remain independent.
|
|
|
|
-- Remove this option if you want your OS clipboard to remain independent.
|
|
|
@ -146,74 +149,6 @@ vim.opt.rtp:prepend(lazypath)
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- NOTE: Here is where you install your plugins.
|
|
|
|
-- NOTE: Here is where you install your plugins.
|
|
|
|
require('lazy').setup({
|
|
|
|
require('lazy').setup({
|
|
|
|
{
|
|
|
|
|
|
|
|
'krivahtoo/silicon.nvim',
|
|
|
|
|
|
|
|
build = 'install.sh | silicon',
|
|
|
|
|
|
|
|
init = function()
|
|
|
|
|
|
|
|
os.execute 'silicon --build-cache'
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
config = function()
|
|
|
|
|
|
|
|
local silicon = require 'silicon'
|
|
|
|
|
|
|
|
silicon.setup {
|
|
|
|
|
|
|
|
font = 'FiraCode Nerd Font Mono',
|
|
|
|
|
|
|
|
theme = 'Catppuccin-Macchiato',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'folke/trouble.nvim',
|
|
|
|
|
|
|
|
opts = {},
|
|
|
|
|
|
|
|
cmd = 'Trouble',
|
|
|
|
|
|
|
|
keys = {
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>xx',
|
|
|
|
|
|
|
|
'<cmd>Trouble diagnostics toggle<cr>',
|
|
|
|
|
|
|
|
desc = 'Diagnostics (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>xX',
|
|
|
|
|
|
|
|
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
|
|
|
|
|
|
|
|
desc = 'Buffer Diagnostics (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>cs',
|
|
|
|
|
|
|
|
'<cmd>Trouble symbols toggle focus=false<cr>',
|
|
|
|
|
|
|
|
desc = 'Symbols (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>cl',
|
|
|
|
|
|
|
|
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
|
|
|
|
|
|
|
|
desc = 'LSP Definitions / references / ... (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>xL',
|
|
|
|
|
|
|
|
'<cmd>Trouble loclist toggle<cr>',
|
|
|
|
|
|
|
|
desc = 'Location List (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'<leader>xQ',
|
|
|
|
|
|
|
|
'<cmd>Trouble qflist toggle<cr>',
|
|
|
|
|
|
|
|
desc = 'Quickfix List (Trouble)',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'christoomey/vim-tmux-navigator',
|
|
|
|
|
|
|
|
cmd = {
|
|
|
|
|
|
|
|
'TmuxNavigateLeft',
|
|
|
|
|
|
|
|
'TmuxNavigateDown',
|
|
|
|
|
|
|
|
'TmuxNavigateUp',
|
|
|
|
|
|
|
|
'TmuxNavigateRight',
|
|
|
|
|
|
|
|
'TmuxNavigatePrevious',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
keys = {
|
|
|
|
|
|
|
|
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
|
|
|
|
|
|
|
|
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
|
|
|
|
|
|
|
|
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
|
|
|
|
|
|
|
|
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
|
|
|
|
|
|
|
|
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
|
|
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
|
|
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
|
|
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
|
|
|
|
|
|
|
|
|
|
@ -257,7 +192,7 @@ require('lazy').setup({
|
|
|
|
-- after the plugin has been loaded:
|
|
|
|
-- after the plugin has been loaded:
|
|
|
|
-- config = function() ... end
|
|
|
|
-- config = function() ... end
|
|
|
|
|
|
|
|
|
|
|
|
{ -- Useful plugin to show you pending keybinds.
|
|
|
|
{ -- Useful plugin to show you pending keybinds.
|
|
|
|
'folke/which-key.nvim',
|
|
|
|
'folke/which-key.nvim',
|
|
|
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
|
|
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
|
|
|
opts = {
|
|
|
|
opts = {
|
|
|
@ -297,10 +232,9 @@ require('lazy').setup({
|
|
|
|
F12 = '<F12>',
|
|
|
|
F12 = '<F12>',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- Document existing key chains
|
|
|
|
-- Document existing key chains
|
|
|
|
spec = {
|
|
|
|
spec = {
|
|
|
|
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
|
|
|
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' }, },
|
|
|
|
{ '<leader>d', group = '[D]ocument' },
|
|
|
|
{ '<leader>d', group = '[D]ocument' },
|
|
|
|
{ '<leader>r', group = '[R]ename' },
|
|
|
|
{ '<leader>r', group = '[R]ename' },
|
|
|
|
{ '<leader>s', group = '[S]earch' },
|
|
|
|
{ '<leader>s', group = '[S]earch' },
|
|
|
@ -340,7 +274,7 @@ require('lazy').setup({
|
|
|
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
|
|
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
|
|
|
{ 'debugloop/telescope-undo.nvim' },
|
|
|
|
{ 'debugloop/telescope-undo.nvim' },
|
|
|
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
|
|
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
|
|
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
|
|
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
config = function()
|
|
|
|
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
|
|
|
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
|
|
@ -396,12 +330,12 @@ require('lazy').setup({
|
|
|
|
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
|
|
|
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>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>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>sp', builtin.live_grep, { desc = '[S]earch by gre[p]' })
|
|
|
|
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
|
|
|
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>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>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
|
|
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
|
vim.keymap.set('n', '<leader>sp', builtin.git_files, { desc = '[S]earch [P]roject' })
|
|
|
|
vim.keymap.set('n', '<leader>sg', builtin.git_files, { desc = '[S]earch [P]roject' })
|
|
|
|
vim.keymap.set('n', '<leader>u', '<cmd> Telescope undo<cr>', { desc = '[u]ndo' })
|
|
|
|
vim.keymap.set('n', '<leader>u', '<cmd> Telescope undo<cr>', { desc = '[u]ndo' })
|
|
|
|
|
|
|
|
|
|
|
|
-- Slightly advanced example of overriding default behavior and theme
|
|
|
|
-- Slightly advanced example of overriding default behavior and theme
|
|
|
@ -442,7 +376,7 @@ require('lazy').setup({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ 'Bilal2453/luvit-meta', lazy = true },
|
|
|
|
{ 'Bilal2453/luvit-meta', lazy = true },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
-- Main LSP Configuration
|
|
|
|
-- Main LSP Configuration
|
|
|
|
'neovim/nvim-lspconfig',
|
|
|
|
'neovim/nvim-lspconfig',
|
|
|
@ -454,7 +388,7 @@ require('lazy').setup({
|
|
|
|
|
|
|
|
|
|
|
|
-- Useful status updates for LSP.
|
|
|
|
-- Useful status updates for LSP.
|
|
|
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
|
|
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
|
|
|
{ 'j-hui/fidget.nvim', opts = {} },
|
|
|
|
{ 'j-hui/fidget.nvim', opts = {} },
|
|
|
|
|
|
|
|
|
|
|
|
-- Allows extra capabilities provided by nvim-cmp
|
|
|
|
-- Allows extra capabilities provided by nvim-cmp
|
|
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
|
@ -779,12 +713,6 @@ require('lazy').setup({
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
|
['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
|
|
|
|
|
|
|
-- If you prefer more traditional completion keymaps,
|
|
|
|
|
|
|
|
-- you can uncomment the following lines
|
|
|
|
|
|
|
|
--['<CR>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
|
|
|
--['<Tab>'] = cmp.mapping.select_next_item(),
|
|
|
|
|
|
|
|
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Manually trigger a completion from nvim-cmp.
|
|
|
|
-- Manually trigger a completion from nvim-cmp.
|
|
|
|
-- Generally you don't need this, because nvim-cmp will display
|
|
|
|
-- Generally you don't need this, because nvim-cmp will display
|
|
|
|
-- completions whenever it has completion options available.
|
|
|
|
-- completions whenever it has completion options available.
|
|
|
@ -844,7 +772,7 @@ require('lazy').setup({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- Highlight todo, notes, etc in comments
|
|
|
|
-- Highlight todo, notes, etc in comments
|
|
|
|
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
|
|
|
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = true } },
|
|
|
|
|
|
|
|
|
|
|
|
{ -- Collection of various small independent plugins/modules
|
|
|
|
{ -- Collection of various small independent plugins/modules
|
|
|
|
'echasnovski/mini.nvim',
|
|
|
|
'echasnovski/mini.nvim',
|
|
|
@ -863,24 +791,6 @@ require('lazy').setup({
|
|
|
|
-- - sd' - [S]urround [D]elete [']quotes
|
|
|
|
-- - sd' - [S]urround [D]elete [']quotes
|
|
|
|
-- - sr)' - [S]urround [R]eplace [)] [']
|
|
|
|
-- - sr)' - [S]urround [R]eplace [)] [']
|
|
|
|
require('mini.surround').setup()
|
|
|
|
require('mini.surround').setup()
|
|
|
|
|
|
|
|
|
|
|
|
-- Simple and easy statusline.
|
|
|
|
|
|
|
|
-- You could remove this setup call if you don't like it,
|
|
|
|
|
|
|
|
-- and try some other statusline plugin
|
|
|
|
|
|
|
|
local statusline = require 'mini.statusline'
|
|
|
|
|
|
|
|
-- set use_icons to true if you have a Nerd Font
|
|
|
|
|
|
|
|
statusline.setup { use_icons = vim.g.have_nerd_font }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- You can configure sections in the statusline by overriding their
|
|
|
|
|
|
|
|
-- default behavior. For example, here we set the section for
|
|
|
|
|
|
|
|
-- cursor location to LINE:COLUMN
|
|
|
|
|
|
|
|
---@diagnostic disable-next-line: duplicate-set-field
|
|
|
|
|
|
|
|
statusline.section_location = function()
|
|
|
|
|
|
|
|
return '%2l:%-2v'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ... and there is more!
|
|
|
|
|
|
|
|
-- Check out: https://github.com/echasnovski/mini.nvim
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ -- Highlight, edit, and navigate code
|
|
|
|
{ -- Highlight, edit, and navigate code
|
|
|
@ -926,28 +836,22 @@ require('lazy').setup({
|
|
|
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
|
|
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
|
|
|
|
|
|
|
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
|
|
|
|
|
|
|
-- place them in the correct locations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
-- Here are some example plugins that I've included in the Kickstart repository.
|
|
|
|
-- 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).
|
|
|
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
require 'kickstart.plugins.debug',
|
|
|
|
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
|
|
|
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
-- 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`
|
|
|
|
-- 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.
|
|
|
|
-- 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.
|
|
|
|
-- 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`
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
ui = {
|
|
|
|
ui = {
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|