homes/common/.config/nvim/init.lua

245 lines
7.9 KiB
Lua
Raw Normal View History

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"EdenEast/nightfox.nvim",
lazy=false,
priority=1000
},
2023-10-24 03:54:53 +02:00
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "",
color = "error",
alt = {"FIXME", "BUG", "FIXIT", "ISSUE"},
},
TODO = {
icon = "",
color = "info"
},
HACK = {
icon = "",
color = "hack"
},
WARN = {
icon = "",
color = "warning",
alt = {"WARNING", "XXX"}
},
PERF = {
icon = "󰓅 ",
color = "perf",
alt = {"OPTIM", "PERFORMANCE", "OPTIMIZE"}
},
NOTE = {
icon = "󱞂 ",
color = "hint",
alt = {"INFO", "HINT"}
},
TEST = {
icon = "",
color = "test",
alt = {"TESTING", "PASSED"}
},
FAILED = {
icon = "",
color = "fail"
},
},
merge_keywords = true,
highlight = {
multiline = true,
multiline_pattern = "^.",
multiline_context = 10,
before = "",
keyword = "wide",
after = "fg",
pattern = [[.*<(KEYWORDS)\s*:]],
comments_only = true,
max_line_len = 400,
exclude = {},
},
colors = {
error = {"DiagnosticError", "ErrorMsg", "#c94f6d"},
warning = {"DiagnosticWarn", "WarningMsg", "#dbc074"},
info = {"DiagnosticInfo", "#719cd6"},
perf = {"Keyword", "#9d79d6"},
hint = {"DiagnosticHint", "#81b29a"},
default = {"Identifier", "#63cdcf"},
test = {"Func", "#97c2fc"},
fail = {"Builtin3", "#ef7593"},
hack = {"Number", "#f4a261"}
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
pattern = [[\b(KEYWORDS):]],
},
}
},
{
'saecki/crates.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('crates').setup()
end,
},
{
"axieax/urlview.nvim",
config = function()
require('urlview').setup({
default_picker = "telescope"
})
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {"nvim-lua/plenary.nvim"},
},
{"nvim-telescope/telescope-ui-select.nvim"},
{"preservim/vim-pencil"},
{"pocco81/high-str.nvim"},
{"dhruvasagar/vim-table-mode"},
{"salkin-mada/openscad.nvim", event="BufRead"},
{"ChiliConSql/neovim-stylus", event="BufRead"},
{"digitaltoad/vim-pug", event="BufRead"},
{"pirmd/gemini.vim", event="BufRead"},
2023-10-18 02:50:18 +02:00
{"vmchale/ion-vim", event="BufRead"},
{"dpelle/vim-Grammalecte"},
{"vigoux/LanguageTool.nvim"},
2023-10-02 00:57:35 +02:00
{"chaimleib/vim-renpy", event="BufRead"},
{"meatballs/vim-xonsh", event="BufRead"}
})
vim.opt.clipboard = 'unnamedplus'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.number = false
vim.opt.cursorline = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.termguicolors = true
vim.opt.showmode = false
vim.opt.textwidth=78
vim.opt.colorcolumn = "29,30,71,72,79,80,119,120,139,140"
vim.opt.incsearch = true
vim.opt.hlsearch = false
vim.opt.ignorecase = true
vim.opt.smartcase = true
2023-12-23 02:25:04 +01:00
vim.opt.wrap = true
vim.opt.fdm = 'indent'
2023-12-23 02:25:04 +01:00
vim.opt.listchars = {eol = '', tab = '⁝‧' , extends = '', precedes= '', trail = '˽', nbsp = '' }
vim.opt.showbreak = "……"
vim.opt.list = true
vim.opt.spelllang = 'fr'
vim.g.grammalecte_cli_py = '/usr/bin/grammalecte-cli'
vim.g.languagetool_jar = 'REPLACEHOME/.bin/languagetool-commandline.jar'
2023-10-24 03:54:53 +02:00
local opts = {noremap=true, silent=true}
local crates = require('crates')
vim.keymap.set('n', '<tab>', "gt", opts)
vim.keymap.set('n', '<S-tab>', "gT", opts)
vim.keymap.set('v', 'gle', ":'<,'>!lou_translate en-us-brf.dis,braille-patterns.cti<CR>", opts)
vim.keymap.set('v', 'gLe', ":'<,'>!lou_translate --backward en-us-brf.dis,braille-patterns.cti<CR>", opts)
vim.keymap.set('v', 'glf', ":'<,'>!lou_translate fr-bfu-comp6.utb,braille-patterns.cti<CR>", opts)
vim.keymap.set('v', 'gLf', ":'<,'>!lou_translate --backward fr-bfu-comp6.utb,braille-patterns.cti<CR>", opts)
2023-10-24 03:54:53 +02:00
vim.keymap.set("n", "\\u", "<Cmd>UrlView<CR>", { desc = "View buffer URLs" })
vim.keymap.set("n", "\\U", "<Cmd>UrlView lazy<CR>", { desc = "View Packer plugin URLs" })
vim.keymap.set("v", "\\1", ":<c-u>HSHighlight 1<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\2", ":<c-u>HSHighlight 2<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\3", ":<c-u>HSHighlight 3<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\4", ":<c-u>HSHighlight 4<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\5", ":<c-u>HSHighlight 5<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\6", ":<c-u>HSHighlight 6<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\7", ":<c-u>HSHighlight 7<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\8", ":<c-u>HSHighlight 8<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\9", ":<c-u>HSHighlight 9<CR>", { desc = "Highlight"})
vim.keymap.set("v", "\\0", ":<c-u>HSHighlight 0<CR>", { desc = "Highlight"})
vim.keymap.set("n", "\\r", ":<c-u>HSRmHighlight rm_all<CR>", { desc = "Remove highlight"})
vim.keymap.set("v", "\\r", ":<c-u>HSRmHighlight<CR>", { desc = "Remove highlight"})
vim.keymap.set('n', '<leader>ct', crates.toggle, opts)
vim.keymap.set('n', '<leader>cr', crates.reload, opts)
vim.keymap.set('n', '<leader>cv', crates.show_versions_popup, opts)
vim.keymap.set('n', '<leader>cf', crates.show_features_popup, opts)
vim.keymap.set('n', '<leader>cd', crates.show_dependencies_popup, opts)
vim.keymap.set('n', '<leader>cu', crates.update_crate, opts)
vim.keymap.set('v', '<leader>cu', crates.update_crates, opts)
vim.keymap.set('n', '<leader>ca', crates.update_all_crates, opts)
vim.keymap.set('n', '<leader>cU', crates.upgrade_crate, opts)
vim.keymap.set('v', '<leader>cU', crates.upgrade_crates, opts)
vim.keymap.set('n', '<leader>cA', crates.upgrade_all_crates, opts)
vim.keymap.set('n', '<leader>ce', crates.expand_plain_crate_to_inline_table, opts)
vim.keymap.set('n', '<leader>cE', crates.extract_crate_into_table, opts)
vim.keymap.set('n', '<leader>cH', crates.open_homepage, opts)
vim.keymap.set('n', '<leader>cR', crates.open_repository, opts)
vim.keymap.set('n', '<leader>cD', crates.open_documentation, opts)
vim.keymap.set('n', '<leader>cC', crates.open_crates_io, opts)
vim.cmd 'colorscheme nightfox'
vim.transparent_window = true
2023-09-03 18:26:58 +02:00
vim.cmd 'highlight Normal ctermbg=none guibg=none'
vim.diagnostic.config({
virtual_text = false
})
vim.o.updatetime = 2500
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
2023-10-24 03:54:53 +02:00
local high_str = require("high-str")
high_str.setup({
verbosity = 0,
saving_path = "REPLACEHOME/.local/share/lvim/highstr/",
2023-10-24 03:54:53 +02:00
highlight_colors = {
-- color_id = {"bg_hex_code",<"fg_hex_code"/"smart">}
color_0 = {"#9d79d6", "smart"}, -- Cosmic charcoal
color_1 = {"#719cd6", "smart"}, -- Pastel yellow
color_2 = {"#81b29a", "smart"}, -- Aqua menthe
color_3 = {"#dbc074", "smart"}, -- Proton purple
color_4 = {"#f4a261", "smart"}, -- Orange red
color_5 = {"#c94f6d", "smart"}, -- Office green
color_6 = {"#d67ad2", "smart"}, -- Just blue
color_7 = {"#dfdfe0", "smart"}, -- Blush pink
color_8 = {"#63cdcf", "smart"}, -- Cosmic latte
color_9 = {"#71839b", "smart"}, -- Fallow brown
}
})