Compare commits
1 Commits
b8c3f439ca
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0604433942 |
@@ -164,7 +164,7 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
vim.keymap.set('n', '<leader>z', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
|
||||||
vim.keymap.set('n', ';', ':', { desc = 'CMD enter command mode' })
|
vim.keymap.set('n', ';', ':', { desc = 'CMD enter command mode' })
|
||||||
@@ -209,6 +209,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
|
-- replace with vim.uv.fs_stat eventually
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||||
@@ -279,22 +280,22 @@ require('lazy').setup({
|
|||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
require('which-key').setup()
|
local wk = require 'which-key'
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
require('which-key').register {
|
wk.add {
|
||||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
{ '<leader>c', desc = '[C]ode' },
|
||||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
{ '<leader>d', desc = '[D]ocument' },
|
||||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
{ '<leader>r', desc = '[R]ename' },
|
||||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
{ '<leader>s', desc = '[S]earch' },
|
||||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
{ '<leader>w', desc = '[W]orkspace' },
|
||||||
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
{ '<leader>t', desc = '[T]oggle' },
|
||||||
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
{ '<leader>h', desc = 'Git [H]unk' },
|
||||||
['<leader>g'] = { name = '[G]it Search', _ = 'which_key_ignore' },
|
{ '<leader>g', desc = '[G]it Search' },
|
||||||
}
|
}
|
||||||
-- visual mode
|
-- visual mode
|
||||||
require('which-key').register({
|
wk.add({
|
||||||
['<leader>h'] = { 'Git [H]unk' },
|
{ '<leader>h', 'Git [H]unk' },
|
||||||
}, { mode = 'v' })
|
}, { mode = 'v' })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@@ -573,17 +574,17 @@ require('lazy').setup({
|
|||||||
-- - settings (table): Override the default settings passed when initializing the server.
|
-- - 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/
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
clangd = {},
|
||||||
-- gopls = {},
|
gopls = {},
|
||||||
-- pyright = {},
|
pyright = {},
|
||||||
-- rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
--
|
--
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||||
-- tsserver = {},
|
ts_ls = {},
|
||||||
--
|
--
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
@@ -596,7 +597,7 @@ require('lazy').setup({
|
|||||||
callSnippet = 'Replace',
|
callSnippet = 'Replace',
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
diagnostics = { disable = { 'missing-fields' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -633,9 +634,12 @@ require('lazy').setup({
|
|||||||
-- json
|
-- json
|
||||||
'json-lsp',
|
'json-lsp',
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
|
ensure_installed = servers,
|
||||||
|
automatic_installation = true,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
@@ -683,7 +687,7 @@ require('lazy').setup({
|
|||||||
--
|
--
|
||||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||||
-- is found.
|
-- is found.
|
||||||
markdown = { 'markdownlint', 'marksman' },
|
markdown = { 'markdownlint' },
|
||||||
javascript = { 'prettierd', 'prettier' },
|
javascript = { 'prettierd', 'prettier' },
|
||||||
typescript = { 'prettierd', 'prettier', stop_after_first = true, lsp_fallback = false },
|
typescript = { 'prettierd', 'prettier', stop_after_first = true, lsp_fallback = false },
|
||||||
typescriptreact = { 'prettierd', 'prettier' },
|
typescriptreact = { 'prettierd', 'prettier' },
|
||||||
@@ -711,12 +715,14 @@ require('lazy').setup({
|
|||||||
-- `friendly-snippets` contains a variety of premade snippets.
|
-- `friendly-snippets` contains a variety of premade snippets.
|
||||||
-- See the README about individual language/framework/plugin snippets:
|
-- See the README about individual language/framework/plugin snippets:
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
-- https://github.com/rafamadriz/friendly-snippets
|
||||||
-- {
|
{
|
||||||
-- 'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').load {
|
||||||
-- end,
|
exclude = { 'javascript' },
|
||||||
-- },
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'saadparwaiz1/cmp_luasnip',
|
||||||
@@ -934,6 +940,133 @@ require('lazy').setup({
|
|||||||
-- 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' },
|
||||||
}, {
|
}, {
|
||||||
|
root = vim.fn.stdpath 'data' .. '/lazy',
|
||||||
|
defaults = {},
|
||||||
|
spec = nil,
|
||||||
|
debug = false,
|
||||||
|
local_spec = false,
|
||||||
|
lockfile = vim.fn.stdpath 'config' .. '/lazy-lock.json',
|
||||||
|
concurrency = jit.os:find 'Windows' and (vim.uv.available_parallelism() * 2) or nil,
|
||||||
|
headless = {
|
||||||
|
-- show the output from process commands like git
|
||||||
|
process = true,
|
||||||
|
-- show log messages
|
||||||
|
log = true,
|
||||||
|
-- show task start/end
|
||||||
|
task = true,
|
||||||
|
-- use ansi colors
|
||||||
|
colors = true,
|
||||||
|
},
|
||||||
|
diff = {
|
||||||
|
-- diff command <d> can be one of:
|
||||||
|
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
|
||||||
|
-- so you can have a different command for diff <d>
|
||||||
|
-- * git: will run git diff and open a buffer with filetype git
|
||||||
|
-- * terminal_git: will open a pseudo terminal with git diff
|
||||||
|
-- * diffview.nvim: will open Diffview to show the diff
|
||||||
|
cmd = 'git',
|
||||||
|
},
|
||||||
|
checker = {
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
enabled = false,
|
||||||
|
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
||||||
|
notify = true, -- get a notification when new updates are found
|
||||||
|
frequency = 3600, -- check for updates every hour
|
||||||
|
check_pinned = false, -- check for pinned packages that can't be updated
|
||||||
|
},
|
||||||
|
change_detection = {
|
||||||
|
-- automatically check for config file changes and reload the ui
|
||||||
|
enabled = true,
|
||||||
|
notify = true, -- get a notification when changes are found
|
||||||
|
},
|
||||||
|
performance = {
|
||||||
|
cache = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
reset_packpath = true, -- reset the package path to improve startup time
|
||||||
|
rtp = {
|
||||||
|
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
|
||||||
|
---@type string[]
|
||||||
|
paths = {}, -- add any custom paths here that you want to includes in the rtp
|
||||||
|
---@type string[] list any plugins you want to disable here
|
||||||
|
disabled_plugins = {
|
||||||
|
-- "gzip",
|
||||||
|
-- "matchit",
|
||||||
|
-- "matchparen",
|
||||||
|
-- "netrwPlugin",
|
||||||
|
-- "tarPlugin",
|
||||||
|
-- "tohtml",
|
||||||
|
-- "tutor",
|
||||||
|
-- "zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- lazy can generate helptags from the headings in markdown readme files,
|
||||||
|
-- so :help works even for plugins that don't have vim docs.
|
||||||
|
-- when the readme opens with :help it will be correctly displayed as markdown
|
||||||
|
readme = {
|
||||||
|
enabled = true,
|
||||||
|
root = vim.fn.stdpath 'state' .. '/lazy/readme',
|
||||||
|
files = { 'README.md', 'lua/**/README.md' },
|
||||||
|
-- only generate markdown helptags for plugins that don't have docs
|
||||||
|
skip_if_doc_exists = true,
|
||||||
|
},
|
||||||
|
state = vim.fn.stdpath 'state' .. '/lazy/state.json', -- state info for checker and other things
|
||||||
|
-- Enable profiling of lazy.nvim. This will add some overhead,
|
||||||
|
-- so only enable this when you are debugging lazy.nvim
|
||||||
|
profiling = {
|
||||||
|
-- Enables extra stats on the debug tab related to the loader cache.
|
||||||
|
-- Additionally gathers stats about all package.loaders
|
||||||
|
loader = false,
|
||||||
|
-- Track each new require in the Lazy profiling tab
|
||||||
|
require = false,
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
log = { '-8' },
|
||||||
|
timeout = 120,
|
||||||
|
filter = true,
|
||||||
|
throttle = {
|
||||||
|
enabled = false,
|
||||||
|
rate = 2,
|
||||||
|
duration = 5 * 1000, -- in ms
|
||||||
|
},
|
||||||
|
cooldown = 0,
|
||||||
|
},
|
||||||
|
pkg = {
|
||||||
|
enabled = true,
|
||||||
|
cache = vim.fn.stdpath 'state' .. '/lazy/pkg-cache.lua',
|
||||||
|
-- the first package source that is found for a plugin will be used.
|
||||||
|
sources = {
|
||||||
|
'lazy',
|
||||||
|
'rockspec', -- will only be used when rocks.enabled is true
|
||||||
|
'packspec',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rocks = {
|
||||||
|
enabled = false,
|
||||||
|
root = vim.fn.stdpath 'data' .. '/lazy-rocks',
|
||||||
|
server = 'https://nvim-neorocks.github.io/rocks-binaries/',
|
||||||
|
-- use hererocks to install luarocks?
|
||||||
|
-- set to `nil` to use hererocks when luarocks is not found
|
||||||
|
-- set to `true` to always use hererocks
|
||||||
|
-- set to `false` to always use luarocks
|
||||||
|
hererocks = nil,
|
||||||
|
},
|
||||||
|
dev = {
|
||||||
|
-- Directory where you store your local plugin projects. If a function is used,
|
||||||
|
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
||||||
|
---@type string | fun(plugin: LazyPlugin): string
|
||||||
|
path = '~/projects',
|
||||||
|
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||||
|
patterns = {}, -- For example {"folke"}
|
||||||
|
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||||
|
},
|
||||||
|
install = {
|
||||||
|
-- install missing plugins on startup. This doesn't increase startup time.
|
||||||
|
missing = true,
|
||||||
|
-- try to load one of these colorschemes when starting an installation during startup
|
||||||
|
colorscheme = { 'habamax' },
|
||||||
|
},
|
||||||
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
|
||||||
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
||||||
|
|||||||
Reference in New Issue
Block a user