mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
Compare commits
26 Commits
bebfb5808f
...
faca7b63ce
Author | SHA1 | Date | |
---|---|---|---|
faca7b63ce | |||
d45de7ce83 | |||
cbb6693cbf | |||
f19ae0487b | |||
5febea0f8a | |||
5795aa73ef | |||
444b87fd8b | |||
|
c0a254f0b8 | ||
|
4120893b8a | ||
|
1695a1d3fc | ||
|
7201dc4801 | ||
|
3a01797417 | ||
|
a22976111e | ||
|
7e11e8a26b | ||
|
24d368f9ff | ||
|
7d83a27e60 | ||
|
c76c323a7c | ||
|
e4a5300bdb | ||
|
f49cc6c935 | ||
|
06929799f0 | ||
|
d452633b35 | ||
|
e9213469ba | ||
|
ac78e7d9e7 | ||
|
ce0c7340ff | ||
|
554a054bf9 | ||
|
c1ae9092cb |
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,4 +4,3 @@ test.sh
|
||||
nvim
|
||||
|
||||
spell/
|
||||
lazy-lock.json
|
||||
|
@ -58,13 +58,13 @@ git clone https://github.com/Baipyrus/nvim-config.git "${XDG_CONFIG_HOME:-$HOME/
|
||||
If you're using `cmd.exe`:
|
||||
|
||||
```bat
|
||||
git clone https://github.com/Baipyrus/nvim-config.git %localappdata%\nvim\
|
||||
git clone https://github.com/Baipyrus/nvim-config.git "%localappdata%\nvim\"
|
||||
```
|
||||
|
||||
If you're using `powershell.exe`
|
||||
|
||||
```pwsh
|
||||
git clone https://github.com/Baipyrus/nvim-config.git $env:LOCALAPPDATA\nvim\
|
||||
git clone https://github.com/Baipyrus/nvim-config.git "${env:LOCALAPPDATA}\nvim"
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -103,7 +103,7 @@ current plugin status. Hit `q` to close the window.
|
||||
You can apply both of these approaches to any Neovim
|
||||
distribution that you would like to try out.
|
||||
* What if I want to "uninstall" this configuration:
|
||||
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
|
||||
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
|
||||
|
||||
### Install Recipes
|
||||
|
||||
|
44
lazy-lock.json
Normal file
44
lazy-lock.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conflict-marker.vim": { "branch": "master", "commit": "62742b2ffe7a433988759c67b5c5a22eff74a14b" },
|
||||
"conform.nvim": { "branch": "master", "commit": "f5bd8419f8a29451e20bdb1061a54fe13d5c8de3" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "d4ce7d025f9c7bb4d55ebc4fd88987651e632893" },
|
||||
"nvim": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-lint": { "branch": "master", "commit": "b3ab4ba88845893663d0b7122ee82921adf28358" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "541f3a2781de481bb84883889e4d9f0904250a56" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "03452942dfbd998701d4123ccad2090e1bc7e9f1" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "78a81c7494e7d1a08dd1200b556933e513fd9f29" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "0d79d169fcd45a8da464727ac893044728f121d4" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||
"oil.nvim": { "branch": "master", "commit": "39dbf875861449cf09e936fa80073f3413e9439c" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "6f8bc37eb729a00e185cdf38b1ed3309a05bfeef" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
|
||||
"vim-merginal": { "branch": "develop", "commit": "3dca10fd8bce10edbc2024651db4ffb6dd2d89de" },
|
||||
"vim-processing": { "branch": "master", "commit": "91aaa18a54f8e507e48353ba87b1eb4ecd82a17c" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||
}
|
@ -24,23 +24,19 @@ return {
|
||||
local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin)
|
||||
local ending = vim.fn.match(lines, vim.g.conflict_marker_end)
|
||||
local enabled = vim.diagnostic.is_enabled()
|
||||
if (beginning > -1 or ending > -1) and enabled then
|
||||
local conflict = beginning > -1 or ending > -1
|
||||
if conflict and enabled then
|
||||
vim.diagnostic.enable(false)
|
||||
elseif not enabled then
|
||||
elseif not conflict and not enabled then
|
||||
vim.diagnostic.enable(true)
|
||||
end
|
||||
end
|
||||
|
||||
-- Autocommand to disable diagnostics on buffer enter
|
||||
vim.api.nvim_create_autocmd('BufRead', {
|
||||
vim.api.nvim_create_autocmd({ 'BufRead', 'BufWritePre' }, {
|
||||
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }),
|
||||
callback = git_conflict_detection,
|
||||
})
|
||||
-- Autocommand to disable diagnostics on save
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }),
|
||||
callback = git_conflict_detection,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ vim.keymap.set('n', '<leader>bd', function()
|
||||
-- Get current buffer
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
-- Switch to different buffer
|
||||
vim.cmd 'bp'
|
||||
vim.cmd 'silent! :exe "norm \\<C-6>"'
|
||||
-- Delete saved buffer
|
||||
vim.api.nvim_buf_delete(buf, {})
|
||||
end, { desc = '[B]uffer [D]elete' })
|
||||
|
@ -7,7 +7,7 @@ return {
|
||||
{
|
||||
'<leader>fb',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
require('conform').format { async = true, lsp_format = 'fallback' }
|
||||
end,
|
||||
mode = '',
|
||||
desc = '[F]ormat [B]uffer',
|
||||
@ -20,9 +20,15 @@ return {
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true, php = true }
|
||||
local lsp_format_opt
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
lsp_format_opt = 'never'
|
||||
else
|
||||
lsp_format_opt = 'fallback'
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
lsp_format = lsp_format_opt,
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
|
@ -67,8 +67,9 @@ return {
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or 'n'
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
@ -105,7 +106,7 @@ return {
|
||||
|
||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||
-- or a suggestion from your LSP for this to activate.
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
||||
|
||||
-- Opens a popup that displays documentation about the word under your cursor
|
||||
-- See `:help K` for why this keymap.
|
||||
@ -179,9 +180,9 @@ return {
|
||||
rust_analyzer = {},
|
||||
tailwindcss = {},
|
||||
omnisharp = {},
|
||||
tsserver = {},
|
||||
pyright = {},
|
||||
svelte = {},
|
||||
ts_ls = {},
|
||||
gopls = {},
|
||||
intelephense = {},
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
@ -233,7 +234,7 @@ return {
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
end,
|
||||
|
@ -111,8 +111,12 @@ return {
|
||||
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>sr', function()
|
||||
builtin.oldfiles {
|
||||
only_cwd = true,
|
||||
}
|
||||
end, { desc = '[S]earch [R]ecent Files in CWD' })
|
||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Global Files' })
|
||||
vim.keymap.set('n', '<leader>sc', builtin.command_history, { desc = '[S]earch [C]ommand History' })
|
||||
vim.keymap.set('n', '<leader><leader>', function()
|
||||
builtin.buffers {
|
||||
|
@ -6,6 +6,8 @@ return {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- kickstart
|
||||
@ -103,12 +105,6 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require('nvim-treesitter.configs').setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
@ -17,11 +17,48 @@ return {
|
||||
{ -- Useful plugin to show you pending keybinds.
|
||||
'folke/which-key.nvim',
|
||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||
config = function() -- This is the function that runs, AFTER loading
|
||||
require('which-key').setup()
|
||||
opts = {
|
||||
icons = {
|
||||
-- set icon mappings to true if you have a Nerd Font
|
||||
mappings = vim.g.have_nerd_font,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = '<Up> ',
|
||||
Down = '<Down> ',
|
||||
Left = '<Left> ',
|
||||
Right = '<Right> ',
|
||||
C = '<C-…> ',
|
||||
M = '<M-…> ',
|
||||
D = '<D-…> ',
|
||||
S = '<S-…> ',
|
||||
CR = '<CR> ',
|
||||
Esc = '<Esc> ',
|
||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||
NL = '<NL> ',
|
||||
BS = '<BS> ',
|
||||
Space = '<Space> ',
|
||||
Tab = '<Tab> ',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
require('which-key').add {
|
||||
spec = {
|
||||
{ '<leader>c', group = '[C]ode-/[C]hange' },
|
||||
{ '<leader>c', group = '[C]ode', mode = { 'x' } },
|
||||
{ '<leader>d', group = '[D]ocument' },
|
||||
{ '<leader>r', group = '[R]ename' },
|
||||
{ '<leader>s', group = '[S]earch' },
|
||||
@ -34,8 +71,8 @@ return {
|
||||
{ '<leader>l', group = '[L]ist', mode = { 'n', 'v' } },
|
||||
{ '<leader>f', group = '[F]ormat/[F]ile', mode = { 'n', 'v' } },
|
||||
{ '<leader>o', group = '[O]verseer', mode = { 'n', 'v' } },
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- [[ 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'
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system {
|
||||
'git',
|
||||
|
Loading…
Reference in New Issue
Block a user