mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
No commits in common. "3bb8b224e76d5690b36ca6eb18dc9ad8f69d8c7a" and "a39befff93a33bb41c5320024d4970147f3d1878" have entirely different histories.
3bb8b224e7
...
a39befff93
@ -1,44 +0,0 @@
|
||||
local gs = require "gitsigns"
|
||||
|
||||
gs.setup {
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "+", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
word_diff = true, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
on_attach = function(bufnr)
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map("n", "]c", function()
|
||||
if vim.wo.diff then
|
||||
return "]c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, desc = 'next hunk' })
|
||||
|
||||
map("n", "[c", function()
|
||||
if vim.wo.diff then
|
||||
return "[c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, desc = 'previous hunk' })
|
||||
|
||||
-- Actions
|
||||
map("n", "<leader>hp", gs.preview_hunk)
|
||||
map("n", "<leader>hb", function() gs.blame_line { full = true } end)
|
||||
end,
|
||||
}
|
||||
@ -41,9 +41,12 @@ packer.startup({
|
||||
|
||||
-- nvim-cmp completion sources
|
||||
use {"hrsh7th/cmp-nvim-lsp", after = "nvim-cmp"}
|
||||
-- use {"hrsh7th/cmp-nvim-lua", after = "nvim-cmp"}
|
||||
use {"hrsh7th/cmp-path", after = "nvim-cmp"}
|
||||
use {"hrsh7th/cmp-buffer", after = "nvim-cmp"}
|
||||
use { "hrsh7th/cmp-omni", after = "nvim-cmp" }
|
||||
|
||||
-- use {"hrsh7th/cmp-cmdline", after = "nvim-cmp"}
|
||||
use {"quangnguyen30192/cmp-nvim-ultisnips", after = {'nvim-cmp', 'ultisnips'}}
|
||||
if vim.g.is_mac then
|
||||
use {"hrsh7th/cmp-emoji", after = 'nvim-cmp'}
|
||||
@ -53,8 +56,7 @@ packer.startup({
|
||||
use({ "neovim/nvim-lspconfig", after = "cmp-nvim-lsp", config = [[require('config.lsp')]] })
|
||||
|
||||
if vim.g.is_mac then
|
||||
use({ "nvim-treesitter/nvim-treesitter", event = 'BufEnter', run = ":TSUpdate",
|
||||
config = [[require('config.treesitter')]] })
|
||||
use({ "nvim-treesitter/nvim-treesitter", event = 'BufEnter', run = ":TSUpdate", config = [[require('config.treesitter')]] })
|
||||
end
|
||||
|
||||
-- Python indent (follows the PEP8 style)
|
||||
@ -80,6 +82,9 @@ packer.startup({
|
||||
end
|
||||
}
|
||||
|
||||
-- Clear highlight search automatically for you
|
||||
-- use({"romainl/vim-cool", event = "VimEnter"})
|
||||
|
||||
-- Show match number and index for searching
|
||||
use {
|
||||
'kevinhwang91/nvim-hlslens',
|
||||
@ -105,6 +110,15 @@ packer.startup({
|
||||
-- search emoji and other symbols
|
||||
use {'nvim-telescope/telescope-symbols.nvim', after = 'telescope.nvim'}
|
||||
|
||||
-- Another similar plugin is command-t
|
||||
-- use 'wincent/command-t'
|
||||
|
||||
-- Another grep tool (similar to Sublime Text Ctrl+Shift+F)
|
||||
-- use 'dyng/ctrlsf.vim'
|
||||
|
||||
-- A grepping tool
|
||||
-- use {'mhinz/vim-grepper', cmd = {'Grepper', '<plug>(GrepperOperator)'}}
|
||||
|
||||
-- A list of colorscheme plugin you may want to try. Find what suits you.
|
||||
use({"lifepillar/vim-gruvbox8", opt = true})
|
||||
use({"navarasu/onedark.nvim", opt = true})
|
||||
@ -118,6 +132,11 @@ packer.startup({
|
||||
use({"rebelot/kanagawa.nvim", opt = true})
|
||||
use({"catppuccin/nvim", as = "catppuccin", opt = true})
|
||||
|
||||
-- Show git change (change, delete, add) signs in vim sign column
|
||||
use({"mhinz/vim-signify", event = 'BufEnter'})
|
||||
-- Another similar plugin
|
||||
-- use 'airblade/vim-gitgutter'
|
||||
|
||||
use {'kyazdani42/nvim-web-devicons', event = 'VimEnter'}
|
||||
|
||||
use {
|
||||
@ -192,6 +211,8 @@ packer.startup({
|
||||
-- Repeat vim motions
|
||||
use({"tpope/vim-repeat", event = "VimEnter"})
|
||||
|
||||
-- Show the content of register in preview window
|
||||
-- Plug 'junegunn/vim-peekaboo'
|
||||
use({ "nvim-zh/better-escape.vim", event = { "InsertEnter" } })
|
||||
|
||||
if vim.g.is_mac then
|
||||
@ -200,8 +221,12 @@ packer.startup({
|
||||
use({ "Neur1n/neuims", event = { "InsertEnter" } })
|
||||
end
|
||||
|
||||
-- Syntax check and make
|
||||
-- use 'neomake/neomake'
|
||||
|
||||
-- Auto format tools
|
||||
use({ "sbdchd/neoformat", cmd = { "Neoformat" } })
|
||||
-- use 'Chiel92/vim-autoformat'
|
||||
|
||||
-- Git command inside vim
|
||||
use({ "tpope/vim-fugitive", event = "User InGitRepo", config = [[require('config.fugitive')]]})
|
||||
@ -218,14 +243,11 @@ packer.startup({
|
||||
config = [[require('config.git-linker')]]
|
||||
}
|
||||
|
||||
-- Show git change (change, delete, add) signs in vim sign column
|
||||
use({ 'lewis6991/gitsigns.nvim', config = [[require('config.gitsigns')]] })
|
||||
use({ "kevinhwang91/nvim-bqf", ft = "qf", config = [[require('config.bqf')]] })
|
||||
|
||||
-- Better git commit experience
|
||||
use({"rhysd/committia.vim", opt = true, setup = [[vim.cmd('packadd committia.vim')]]})
|
||||
|
||||
use({ "kevinhwang91/nvim-bqf", ft = "qf", config = [[require('config.bqf')]] })
|
||||
|
||||
-- Another markdown plugin
|
||||
use({ "plasticboy/vim-markdown", ft = { "markdown" } })
|
||||
|
||||
@ -262,6 +284,7 @@ packer.startup({
|
||||
use({"wellle/targets.vim", event = "VimEnter"})
|
||||
|
||||
-- Plugin to manipulate character pairs quickly
|
||||
-- use 'tpope/vim-surround'
|
||||
use({"machakann/vim-sandwich", event = "VimEnter"})
|
||||
|
||||
-- Add indent object for vim (useful for languages like Python)
|
||||
@ -270,6 +293,9 @@ packer.startup({
|
||||
-- Only use these plugin on Windows and Mac and when LaTeX is installed
|
||||
if vim.g.is_win or vim.g.is_mac and utils.executable("latex") then
|
||||
use({ "lervag/vimtex", ft = { "tex" } })
|
||||
|
||||
-- use {'matze/vim-tex-fold', ft = {'tex', }}
|
||||
-- use 'Konfekt/FastFold'
|
||||
end
|
||||
|
||||
-- Since tmux is only available on Linux and Mac, we only enable these plugins
|
||||
@ -283,6 +309,7 @@ packer.startup({
|
||||
use({"andymass/vim-matchup", event = "VimEnter"})
|
||||
|
||||
-- Smoothie motions
|
||||
-- use 'psliwka/vim-smoothie'
|
||||
use({
|
||||
"karb94/neoscroll.nvim",
|
||||
event = "VimEnter",
|
||||
@ -295,6 +322,8 @@ packer.startup({
|
||||
|
||||
-- Asynchronous command execution
|
||||
use({ "skywind3000/asyncrun.vim", opt = true, cmd = { "AsyncRun" } })
|
||||
-- Another asynchronous plugin
|
||||
-- Plug 'tpope/vim-dispatch'
|
||||
|
||||
use({ "cespare/vim-toml", ft = { "toml" }, branch = "main" })
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user