dotvim/lua/config/plugins.lua

173 lines
4.9 KiB
Lua
Raw Normal View History

-- argonaut.nvim
2024-04-27 04:06:40 +00:00
vim.keymap.set('n', '<leader>a', function()
2024-04-30 04:28:50 +00:00
vim.cmd.ArgonautReload()
require('argonaut').setup({
c = {brace_last_wrap = false},
cpp = {brace_last_wrap = false},
})
vim.cmd.ArgonautReflow()
end)
2022-12-23 03:05:51 +00:00
-- comment.nvim
require('Comment').setup()
2024-04-16 19:25:52 +00:00
-- fzf-lua
2023-11-05 02:39:21 +00:00
if vim.fn.executable('fzf') == 1 then
2024-04-17 01:32:28 +00:00
local fzf_lua = require('fzf-lua')
fzf_lua.setup({
winopts = {
preview = {
winopts = {
cursorline = false,
},
},
},
})
2024-04-24 19:52:52 +00:00
local grep_opts = nil
if vim.fn.has('win32') == 1 then
grep_opts = {
cmd = 'git grep --line-number --column --color=always'
}
end
local live_grep = function()
fzf_lua.live_grep(grep_opts)
end
local grep = function()
fzf_lua.grep(grep_opts)
end
2024-04-17 01:32:28 +00:00
vim.keymap.set('n', '<leader>fb', fzf_lua.buffers)
vim.keymap.set('n', '<leader>fg', fzf_lua.git_files)
vim.keymap.set('n', '<leader>fh', fzf_lua.oldfiles)
vim.keymap.set('n', '<leader>fl', fzf_lua.lines)
2024-04-24 19:52:52 +00:00
vim.keymap.set('n', '<leader>fp', grep)
vim.keymap.set('n', '<leader>fs', live_grep)
2022-11-16 04:20:48 +00:00
end
2022-10-22 16:53:29 +00:00
2024-10-01 16:34:25 +00:00
-- gitsigns.nvim
require('gitsigns').setup({
on_attach = function(bufnr)
local gitsigns = require('gitsigns')
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal({']c', bang = true})
else
gitsigns.nav_hunk('next')
end
end)
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal({'[c', bang = true})
else
gitsigns.nav_hunk('prev')
end
end)
map('n', '<leader>hs', gitsigns.stage_hunk)
map('n', '<leader>hr', gitsigns.reset_hunk)
map('v', '<leader>hs', function() gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('v', '<leader>hr', function() gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('n', '<leader>hS', gitsigns.stage_buffer)
map('n', '<leader>hu', gitsigns.undo_stage_hunk)
map('n', '<leader>hR', gitsigns.reset_buffer)
map('n', '<leader>hp', gitsigns.preview_hunk)
map('n', '<leader>hb', function() gitsigns.blame_line{full=true} end)
map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
map('n', '<leader>hd', gitsigns.diffthis)
map('n', '<leader>hD', function() gitsigns.diffthis('~') end)
map('n', '<leader>td', gitsigns.toggle_deleted)
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
})
2023-01-03 04:41:30 +00:00
-- guid.nvim
2023-04-22 18:51:19 +00:00
require('guid').setup({
comma_space = true
})
2023-01-03 04:41:30 +00:00
2022-12-22 23:51:53 +00:00
-- lualine.nvim
require('lualine').setup {
options = {
always_divide_middle = true,
component_separators = {left = '', right = ''},
disabled_filetypes = {statusline = {}, winbar = {}},
globalstatus = false,
2023-01-18 01:45:44 +00:00
icons_enabled = false,
2022-12-22 23:51:53 +00:00
ignore_focus = {},
refresh = {statusline = 1000, tabline = 1000, winbar = 1000},
section_separators = {left = '', right = ''},
theme = 'auto',
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
winbar = {},
inactive_winbar = {},
extensions = {}
}
2022-10-22 05:45:38 +00:00
2023-01-26 03:58:14 +00:00
-- revolver.nvim
2023-01-28 06:47:53 +00:00
require('revolver').setup({'.c', '.cpp', '.h', '.hpp', '.inl'})
2023-01-26 03:58:14 +00:00
vim.keymap.set('n', 'gfs', vim.cmd.Revolver)
2022-10-22 05:45:38 +00:00
-- vim-better-whitespace
2022-12-22 23:51:53 +00:00
vim.api.nvim_set_hl(0, 'ExtraWhitespace', {link = 'Search'})
2022-10-22 05:45:38 +00:00
-- vim-dirvish
vim.g.dirvish_mode = ':sort ,^.*[\\/],'
-- vim-easy-align
vim.g.easy_align_ignore_groups = {}
vim.keymap.set('n', 'ga', '<plug>(EasyAlign)')
vim.keymap.set('v', '<cr>', '<plug>(EasyAlign)')
-- vim-go
vim.g.go_diagnostics_enabled = 0
2023-11-25 03:38:47 +00:00
vim.g.go_imports_autosave = 1
2022-10-22 05:45:38 +00:00
vim.g.go_metalinter_enabled = {}
vim.g.go_null_module_warning = 0
vim.g.go_version_warning = 0
-- vim-polyglot
vim.g.rustfmt_autosave = 1
2024-05-21 16:22:27 +00:00
vim.g.polyglot_disabled = {'autoindent', 'sensible'}
2023-04-22 18:48:57 +00:00
-- vim-quickhl
vim.keymap.set('n', '<leader>K', '<Plug>(quickhl-manual-reset)')
2024-10-03 04:14:24 +00:00
vim.keymap.set('n', '<leader>k', '<Plug>(quickhl-manual-this-whole-word)')
2023-04-22 18:48:57 +00:00
vim.keymap.set('x', '<leader>K', '<Plug>(quickhl-manual-reset)')
2024-10-03 04:14:24 +00:00
vim.keymap.set('x', '<leader>k', '<Plug>(quickhl-manual-this-whole-word)')