[NeoVim] Add diffview
This commit is contained in:
@@ -38,7 +38,8 @@ require('feline').setup {
|
||||
'^fugitive$',
|
||||
'^fugitiveblame$',
|
||||
'^qf$',
|
||||
'^help$'
|
||||
'^help$',
|
||||
'^DiffviewFileHistory'
|
||||
},
|
||||
buftypes = {
|
||||
'^terminal$'
|
||||
@@ -80,13 +81,16 @@ require('neo-tree').setup({
|
||||
filtered_items = {
|
||||
visible = true
|
||||
},
|
||||
follow_current_file = true,window = {
|
||||
follow_current_file = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["/"] = "noop",
|
||||
["g/"] = "fuzzy_finder",
|
||||
["f"] = "noop",
|
||||
["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.expandtab = true
|
||||
vim.o.fileencoding = 'utf-8'
|
||||
@@ -230,7 +251,7 @@ vim.o.spelllang = 'en'
|
||||
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())
|
||||
else
|
||||
require("neo-tree.command")._command("show", vim.fn.getcwd())
|
||||
|
||||
Reference in New Issue
Block a user