feat: make nvim Neovide compatible
This commit is contained in:
parent
f3186bce02
commit
f8661477fc
21 changed files with 4837 additions and 75 deletions
|
|
@ -10,7 +10,6 @@
|
|||
-- vim.cmd("set norelativenumber")
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- nvim-tree is also there in modified buffers so this function filter it out
|
||||
local modifiedBufs = function(bufs)
|
||||
local t = 0
|
||||
|
|
@ -25,16 +24,17 @@ end
|
|||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
nested = true,
|
||||
callback = function()
|
||||
if #vim.api.nvim_list_wins() == 1 and
|
||||
vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil and
|
||||
modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0 then
|
||||
vim.cmd "quit"
|
||||
if
|
||||
#vim.api.nvim_list_wins() == 1
|
||||
and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil
|
||||
and modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0
|
||||
then
|
||||
vim.cmd("quit")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ local term_opts = { silent = true }
|
|||
|
||||
-- crimes against humanity, but I don't care
|
||||
map("n", "j", 'h', opts)
|
||||
map("n", "k", 'j', opts)
|
||||
map("n", "l", 'k', opts)
|
||||
map("n", "k", 'j', opts)
|
||||
map("n", ";", 'l', opts)
|
||||
map("v", "j", 'h', opts)
|
||||
map("v", "k", 'j', opts)
|
||||
|
|
@ -72,8 +72,8 @@ function _G.set_terminal_maps()
|
|||
vim.keymap.set("t", "jk", [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set("t", "<A-h>", [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set("t", "<A-j>", [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set("t", "<A-k>", [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set("t", "<A-l>", [[<Cmd>wincmd l<CR>]], opts)
|
||||
-- vim.keymap.set("t", "<A-k>", [[<Cmd>wincmd k<CR>]], opts)
|
||||
-- vim.keymap.set("t", "<A-l>", [[<Cmd>wincmd l<CR>]], opts)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
|
|
|
|||
|
|
@ -46,3 +46,4 @@ require("lazy").setup({
|
|||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
local options = {
|
||||
clipboard = "unnamedplus",
|
||||
clipboard = "",
|
||||
mouse = "n",
|
||||
fileencoding = "utf-8",
|
||||
number = true,
|
||||
|
|
@ -12,8 +12,13 @@ local options = {
|
|||
shell = "/usr/bin/zsh",
|
||||
autochdir = true,
|
||||
relativenumber = true,
|
||||
scrolloff = 5,
|
||||
scrolljump = 5,
|
||||
}
|
||||
|
||||
vim.o.guifont = "JetBrainsMono Nerd Font:h14"
|
||||
vim.g.neovide_refresh_rate_idle = 180
|
||||
vim.g.neovide_refresh_rate_idle = 5
|
||||
vim.g.neovide_hide_mouse_when_typing = true
|
||||
vim.g.mkdp_browser = "/usr/bin/firefox"
|
||||
vim.g.mkdp_auto_start = 1
|
||||
for k, v in pairs(options) do
|
||||
|
|
|
|||
|
|
@ -2,4 +2,8 @@ return {
|
|||
{
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
},
|
||||
{
|
||||
{ "rcarriga/nvim-notify", enabled = false },
|
||||
},
|
||||
{ { "folke/noice.nvim", enabled = false } },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,4 +140,22 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"karb94/neoscroll.nvim",
|
||||
config = function()
|
||||
require("neoscroll").setup()
|
||||
local t = {}
|
||||
t["<A-l>"] = { "scroll", { "-vim.wo.scroll", "true", "250" } }
|
||||
t["<A-k>"] = { "scroll", { "vim.wo.scroll", "true", "250" } }
|
||||
t["<C-b>"] = { "scroll", { "-vim.api.nvim_win_get_height(0)", "true", "450" } }
|
||||
t["<C-f>"] = { "scroll", { "vim.api.nvim_win_get_height(0)", "true", "450" } }
|
||||
t["<C-y>"] = { "scroll", { "-0.10", "false", "100" } }
|
||||
t["<C-e>"] = { "scroll", { "0.10", "false", "100" } }
|
||||
t["zt"] = { "zt", { "250" } }
|
||||
t["zz"] = { "zz", { "250" } }
|
||||
t["zb"] = { "zb", { "250" } }
|
||||
|
||||
require("neoscroll.config").set_mappings(t)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue