Added gitea support
This commit is contained in:
@@ -0,0 +1,313 @@
|
||||
local vim = vim or {}
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Options
|
||||
local o = vim.opt
|
||||
vim.g.mapleader = " "
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
vim.g.clipboard = 'osc52'
|
||||
o.number = true
|
||||
o.expandtab = true
|
||||
o.shiftwidth = 2
|
||||
o.tabstop = 4
|
||||
o.softtabstop = 4
|
||||
o.completeopt = { "menuone", "noselect", "noinsert" }
|
||||
o.updatetime = 100
|
||||
o.timeoutlen = 300
|
||||
o.clipboard = "unnamedplus"
|
||||
o.shell = "/usr/bin/fish"
|
||||
o.foldenable = false
|
||||
o.list = true
|
||||
o.listchars = {
|
||||
tab = "→ ",
|
||||
eol = " ",
|
||||
space = " ",
|
||||
nbsp = "␣",
|
||||
trail = "·",
|
||||
lead = "·",
|
||||
}
|
||||
o.scroll = 5
|
||||
o.smoothscroll = true
|
||||
o.termguicolors = true
|
||||
o.laststatus = 3
|
||||
o.mousescroll = "ver:0,hor:0"
|
||||
|
||||
vim.lsp.semantic_tokens.enable = false
|
||||
|
||||
vim.lsp.handlers.hover = function(_, result, ctx, config)
|
||||
config = config or {}
|
||||
config.border = "rounded"
|
||||
return vim.lsp.handlers.hover(_, result, ctx, config)
|
||||
end
|
||||
|
||||
vim.lsp.handlers.signature_help = function(_, result, ctx, config)
|
||||
config = config or {}
|
||||
config.border = "rounded"
|
||||
return vim.lsp.handlers.signature_help(_, result, ctx, config)
|
||||
end
|
||||
|
||||
vim.g.rainbow_delimiters = {
|
||||
highlight = {
|
||||
"RainbowDelimiterYellow",
|
||||
"RainbowDelimiterBlue",
|
||||
"RainbowDelimiterOrange",
|
||||
"RainbowDelimiterGreen",
|
||||
"RainbowDelimiterViolet",
|
||||
"RainbowDelimiterCyan",
|
||||
"RainbowDelimiterRed",
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
},
|
||||
underline = true,
|
||||
update_in_insert = true,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
-- Plugin List
|
||||
require("lazy").setup({
|
||||
{ "rcarriga/nvim-notify", lazy = false },
|
||||
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
{ "neovim/nvim-lspconfig", lazy = false },
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
lazy = false,
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = { visible = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{ "HiPhish/rainbow-delimiters.nvim" },
|
||||
{ "ya2s/nvim-cursorline" },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
},
|
||||
{ "karb94/neoscroll.nvim" },
|
||||
{
|
||||
"SyedM-dev/PicVim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("picvim").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
config = function()
|
||||
require("mini.pairs").setup({})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Plugin's setup
|
||||
require("lualine").setup({
|
||||
options = { theme = "auto" },
|
||||
sections = {
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
diff_color = {
|
||||
added = { fg = "#a6e3a1" },
|
||||
modified = { fg = "#f9e2af" },
|
||||
removed = { fg = "#f38ba8" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("nvim-cursorline").setup({
|
||||
cursorline = {
|
||||
enable = true,
|
||||
timeout = 0,
|
||||
number = false,
|
||||
},
|
||||
cursorword = {
|
||||
enable = true,
|
||||
min_length = 1,
|
||||
hl = { underline = true },
|
||||
},
|
||||
})
|
||||
|
||||
local neoscroll = require("neoscroll")
|
||||
neoscroll.setup({
|
||||
mappings = {
|
||||
"<C-u>",
|
||||
"<C-d>",
|
||||
"<C-b>",
|
||||
"<C-f>",
|
||||
"<C-y>",
|
||||
"<C-e>",
|
||||
"zt",
|
||||
"zz",
|
||||
"zb",
|
||||
},
|
||||
})
|
||||
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({
|
||||
border = "rounded",
|
||||
}),
|
||||
documentation = cmp.config.window.bordered({
|
||||
border = "rounded",
|
||||
}),
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping.select_next_item(),
|
||||
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
||||
}),
|
||||
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "clangd" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
local map = vim.keymap.set
|
||||
map({ "n", "i", "v" }, "<C-s>", "<cmd>w<CR>")
|
||||
map("n", ";", ":")
|
||||
map("n", "<A-Up>", ":move-2<CR>")
|
||||
map("n", "<A-Down>", ":move+1<CR>")
|
||||
map("x", "<A-Up>", ":move '<-2<CR>gv")
|
||||
map("x", "<A-Down>", ":move '>+1<CR>gv")
|
||||
map("i", "<A-Up>", "<C-o>:move-2<CR>")
|
||||
map("i", "<A-Down>", "<C-o>:move+1<CR>")
|
||||
map("n", ">", ">>")
|
||||
map("v", ">", ">gv")
|
||||
map("n", "<", "<<")
|
||||
map("v", "<", "<gv")
|
||||
map("n", ".", ">>")
|
||||
map("v", ".", ">gv")
|
||||
map("n", ",", "<<")
|
||||
map("v", ",", "<gv")
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<CR><Esc>")
|
||||
map("n", "u", "ggVG")
|
||||
map("n", "z", "<cmd>u<CR>")
|
||||
map("n", "d", "<cmd>red<CR>")
|
||||
map("n", "q", "<cmd>Neotree<CR>")
|
||||
map("n", "<A-a>", "<cmd>Minuet virtualtext toggle<CR>")
|
||||
map("x", "p", '"_dP')
|
||||
map("x", "P", '"_dP')
|
||||
map("n", "\\", function()
|
||||
vim.cmd([[
|
||||
Neotree close
|
||||
mksession! p.vim
|
||||
echo "saved session"
|
||||
]])
|
||||
end)
|
||||
map("n", "<ScrollWheelUp>", function()
|
||||
neoscroll.scroll(-0.05, { move_cursor = false, duration = 20 })
|
||||
end)
|
||||
map("n", "<ScrollWheelDown>", function()
|
||||
neoscroll.scroll(0.05, { move_cursor = false, duration = 20 })
|
||||
end)
|
||||
|
||||
-- Vimscript stuff
|
||||
vim.cmd([[
|
||||
aunmenu PopUp
|
||||
colorscheme tokyonight-night
|
||||
]])
|
||||
|
||||
-- AutoCMD's
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd("CursorHold", {
|
||||
callback = function()
|
||||
vim.diagnostic.open_float(nil, {
|
||||
focusable = false,
|
||||
border = "rounded",
|
||||
source = "if_many",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"PicVim": { "branch": "main", "commit": "5114853ed8f24661e48b726135bf78860d9339d5" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"mini.pairs": { "branch": "main", "commit": "db0fac0a25884183650352ccf92b362a41ed2e9c" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||
"nvim-cursorline": { "branch": "main", "commit": "d4425a9ba73a66fca8a34fda9254eb8949b1784d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "292f44408498103c47996ff5c18fd366293840d8" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }
|
||||
}
|
||||
Reference in New Issue
Block a user