[NeoVim] Add diffview
This commit is contained in:
@@ -38,7 +38,8 @@ require('feline').setup {
|
|||||||
'^fugitive$',
|
'^fugitive$',
|
||||||
'^fugitiveblame$',
|
'^fugitiveblame$',
|
||||||
'^qf$',
|
'^qf$',
|
||||||
'^help$'
|
'^help$',
|
||||||
|
'^DiffviewFileHistory'
|
||||||
},
|
},
|
||||||
buftypes = {
|
buftypes = {
|
||||||
'^terminal$'
|
'^terminal$'
|
||||||
@@ -80,13 +81,16 @@ require('neo-tree').setup({
|
|||||||
filtered_items = {
|
filtered_items = {
|
||||||
visible = true
|
visible = true
|
||||||
},
|
},
|
||||||
follow_current_file = true,window = {
|
follow_current_file = true,
|
||||||
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
["/"] = "noop",
|
["/"] = "noop",
|
||||||
["g/"] = "fuzzy_finder",
|
["g/"] = "fuzzy_finder",
|
||||||
["f"] = "noop",
|
["f"] = "noop",
|
||||||
["ff"] = function() vim.cmd([[Telescope find_files]]) end,
|
["ff"] = function() vim.cmd([[Telescope find_files]]) end,
|
||||||
["fg"] = function() vim.cmd([[Telescope live_grep]]) end
|
["fg"] = function() vim.cmd([[Telescope live_grep]]) end,
|
||||||
|
["<S-Right>"] = function() end,
|
||||||
|
["<S-Left>"] = function() end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -216,6 +220,23 @@ require('telescope').setup({
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
require('diffview').setup({
|
||||||
|
keymaps = {
|
||||||
|
view = {
|
||||||
|
["q"] = "<cmd>tabc<CR>"
|
||||||
|
},
|
||||||
|
file_panel = {
|
||||||
|
["q"] = "<cmd>tabc<CR>"
|
||||||
|
},
|
||||||
|
file_history_panel = {
|
||||||
|
["q"] = "<cmd>tabc<CR>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.keymap.set("n", "r", "<cmd>DiffviewOpen<CR>")
|
||||||
|
vim.keymap.set("n", "R", "<cmd>DiffviewFileHistory %<CR>")
|
||||||
|
|
||||||
|
|
||||||
vim.o.clipboard = 'unnamedplus'
|
vim.o.clipboard = 'unnamedplus'
|
||||||
vim.o.expandtab = true
|
vim.o.expandtab = true
|
||||||
vim.o.fileencoding = 'utf-8'
|
vim.o.fileencoding = 'utf-8'
|
||||||
@@ -230,7 +251,7 @@ vim.o.spelllang = 'en'
|
|||||||
vim.o.tabstop = 2
|
vim.o.tabstop = 2
|
||||||
|
|
||||||
|
|
||||||
if vim.fn.expand('%') == '' then
|
if vim.fn.expand('%') == '' or vim.fn.isdirectory(vim.fn.expand('%')) ~= 0 then
|
||||||
require("neo-tree.command")._command(vim.fn.getcwd())
|
require("neo-tree.command")._command(vim.fn.getcwd())
|
||||||
else
|
else
|
||||||
require("neo-tree.command")._command("show", vim.fn.getcwd())
|
require("neo-tree.command")._command("show", vim.fn.getcwd())
|
||||||
|
|||||||
@@ -44,4 +44,6 @@ return require('packer').startup(function()
|
|||||||
|
|
||||||
use {'nvim-telescope/telescope.nvim', requires = 'nvim-lua/plenary.nvim'}
|
use {'nvim-telescope/telescope.nvim', requires = 'nvim-lua/plenary.nvim'}
|
||||||
|
|
||||||
|
use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' }
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user