Adopt nvim config. Remove passwds from mail setup
This commit is contained in:
parent
f3a93169b4
commit
b4107ea0b5
@ -1,14 +1,14 @@
|
|||||||
{{- if eq .chezmoi.os "openbsd" }}
|
{{- if eq .chezmoi.os "openbsd" }}
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
@ -27,13 +27,15 @@ local o = vim.opt
|
|||||||
o.encoding = "utf-8"
|
o.encoding = "utf-8"
|
||||||
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
||||||
o.completeopt = { 'menu', 'menuone', 'noselect' }
|
o.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||||
|
o.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
||||||
o.history = 1000
|
o.history = 1000
|
||||||
o.startofline = true
|
o.startofline = true
|
||||||
o.title = true
|
o.title = true
|
||||||
o.clipboard = 'unnamedplus'
|
o.clipboard = 'unnamedplus'
|
||||||
|
o.mouse = "a" -- Enable mouse mode
|
||||||
|
|
||||||
-- Mapping waiting time
|
-- Mapping waiting time
|
||||||
o.timeoutlen = 200
|
o.timeoutlen = 300
|
||||||
o.ttimeoutlen = 0
|
o.ttimeoutlen = 0
|
||||||
|
|
||||||
-- Spellchecker
|
-- Spellchecker
|
||||||
@ -45,19 +47,22 @@ o.thesaurus = HOME .. '/.vim/thesaurus/english.txt'
|
|||||||
-- Display
|
-- Display
|
||||||
o.showmatch = true -- show matching brackets
|
o.showmatch = true -- show matching brackets
|
||||||
o.colorcolumn = '90'
|
o.colorcolumn = '90'
|
||||||
|
o.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||||
o.cursorline = true
|
o.cursorline = true
|
||||||
o.scrolloff = 8 -- always show 3 rows from edge of the screen
|
o.scrolloff = 4 -- always show 3 rows from edge of the screen
|
||||||
o.splitbelow = true
|
o.splitbelow = true
|
||||||
|
o.splitkeep = "screen"
|
||||||
o.splitright = true
|
o.splitright = true
|
||||||
o.virtualedit = 'block'
|
o.virtualedit = 'block'
|
||||||
o.synmaxcol = 300 -- stop syntax highlight after x lines for performance
|
o.synmaxcol = 300 -- stop syntax highlight after x lines for performance
|
||||||
o.laststatus = 2 -- always show status line
|
o.laststatus = 3 -- always show status line
|
||||||
o.list = false -- do not display white characters
|
o.list = true -- do not display white characters
|
||||||
o.termguicolors = true
|
o.termguicolors = true
|
||||||
o.background = "dark"
|
|
||||||
o.wrap = false --do not wrap lines even if very long
|
o.wrap = false --do not wrap lines even if very long
|
||||||
o.eol = false -- show if there's no eol char
|
o.eol = false -- show if there's no eol char
|
||||||
o.showbreak = '↪' -- character to show when line is broken
|
o.showbreak = '↪' -- character to show when line is broken
|
||||||
|
o.pumblend = 10 -- Popup blend
|
||||||
|
o.pumheight = 10 -- Maximum number of entries in a popup
|
||||||
|
|
||||||
-- Folding
|
-- Folding
|
||||||
-- o.foldenable = true
|
-- o.foldenable = true
|
||||||
@ -68,8 +73,8 @@ o.showbreak = '↪' -- character to show when line is broken
|
|||||||
|
|
||||||
-- workaround for Telescope bug
|
-- workaround for Telescope bug
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||||
pattern = { "*" },
|
pattern = { "*" },
|
||||||
command = "normal zx",
|
command = "normal zx",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Sidebar
|
-- Sidebar
|
||||||
@ -85,50 +90,68 @@ o.ruler = false
|
|||||||
o.showmode = false
|
o.showmode = false
|
||||||
|
|
||||||
-- Search
|
-- Search
|
||||||
|
o.grepformat = "%f:%l:%c:%m"
|
||||||
|
o.grepprg = "rg --vimgrep"
|
||||||
o.incsearch = true -- starts searching as soon as typing, without enter needed
|
o.incsearch = true -- starts searching as soon as typing, without enter needed
|
||||||
o.hlsearch = true -- highlighting of search matches
|
o.hlsearch = true -- highlighting of search matches
|
||||||
o.ignorecase = true -- ignore letter case when searching
|
o.ignorecase = true -- ignore letter case when searching
|
||||||
o.smartcase = true -- case insentive unless capitals used in search
|
o.smartcase = true -- case insentive unless capitals used in search
|
||||||
o.wildignorecase = true
|
o.wildignorecase = true
|
||||||
|
|
||||||
o.matchtime = 2 -- delay before showing matching paren
|
o.inccommand = "nosplit" -- preview incremental substitute
|
||||||
|
o.matchtime = 2 -- delay before showing matching paren
|
||||||
o.mps = vim.o.mps .. ",<:>"
|
o.mps = vim.o.mps .. ",<:>"
|
||||||
|
|
||||||
-- White characters
|
-- White characters
|
||||||
o.smartindent = true
|
o.smartindent = true
|
||||||
o.breakindent = true
|
o.breakindent = true
|
||||||
o.tabstop = 4
|
o.tabstop = 2
|
||||||
o.shiftwidth = 4 -- indentation rule
|
o.shiftwidth = 2 -- indentation rule
|
||||||
o.softtabstop = 4
|
o.softtabstop = 2
|
||||||
o.expandtab = true -- expand tab to spaces
|
o.expandtab = true -- expand tab to spaces
|
||||||
o.smarttab = true
|
o.smarttab = true
|
||||||
|
o.shiftround = true -- Round indent
|
||||||
|
|
||||||
-- Shortmess
|
-- Shortmess
|
||||||
o.shortmess = o.shortmess
|
o.shortmess = o.shortmess
|
||||||
+ {
|
+ {
|
||||||
A = true, -- don't give the "ATTENTION" message when an existing swap file is found.
|
-- A = true, -- don't give the "ATTENTION" message when an existing swap file is found.
|
||||||
I = true, -- don't give the intro message when starting Vim |:intro|.
|
I = true, -- don't give the intro message when starting Vim |:intro|.
|
||||||
W = true, -- don't give "written" or "[w]" when writing a file
|
W = true, -- don't give "written" or "[w]" when writing a file
|
||||||
c = true, -- don't give |ins-completion-menu| messages
|
c = true, -- don't give |ins-completion-menu| messages
|
||||||
m = true, -- use "[+]" instead of "[Modified]"
|
C = true, -- don't give |ins-completion-menu| messages
|
||||||
|
-- m = true, -- use "[+]" instead of "[Modified]"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Format options
|
-- Format options
|
||||||
o.formatoptions = o.formatoptions
|
o.formatoptions = o.formatoptions
|
||||||
+ {
|
+ {
|
||||||
c = false,
|
c = false,
|
||||||
o = false, -- O and o, don't continue comments
|
o = false, -- O and o, don't continue comments
|
||||||
r = true, -- Pressing Enter will continue comments
|
r = true, -- Pressing Enter will continue comments
|
||||||
}
|
}
|
||||||
|
|
||||||
|
o.fillchars = {
|
||||||
|
foldopen = "",
|
||||||
|
foldclose = "",
|
||||||
|
-- fold = "⸱",
|
||||||
|
fold = " ",
|
||||||
|
foldsep = " ",
|
||||||
|
diff = "╱",
|
||||||
|
eob = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
o.wildmode = "longest:full,full" -- Command-line completion mode
|
||||||
-- Backup files
|
-- Backup files
|
||||||
o.hidden = true
|
o.hidden = true
|
||||||
o.autowrite = true
|
o.autowrite = true
|
||||||
o.autoread = true
|
o.autoread = true
|
||||||
o.backup = true -- use backup files
|
o.backup = true -- use backup files
|
||||||
o.writebackup = false
|
o.writebackup = false
|
||||||
o.swapfile = false -- do not use swap file
|
o.swapfile = false -- do not use swap file
|
||||||
o.undofile = true
|
o.undofile = true
|
||||||
|
o.undolevels = 10000
|
||||||
|
o.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||||
o.undodir = HOME .. '/.local/share/nvim/dirs/undo//' -- undo files
|
o.undodir = HOME .. '/.local/share/nvim/dirs/undo//' -- undo files
|
||||||
o.backupdir = HOME .. '/.local/share/nvim/dirs/backup//' -- backups
|
o.backupdir = HOME .. '/.local/share/nvim/dirs/backup//' -- backups
|
||||||
|
|
||||||
@ -141,16 +164,17 @@ vim.cmd([[
|
|||||||
au BufRead,BufNewFile *.md set tw=80 syntax=markdown
|
au BufRead,BufNewFile *.md set tw=80 syntax=markdown
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
vim.g.markdown_recommended_style = 0
|
||||||
vim.api.nvim_create_user_command('ReloadConfig', 'source $MYVIMRC', {})
|
vim.api.nvim_create_user_command('ReloadConfig', 'source $MYVIMRC', {})
|
||||||
|
|
||||||
local group = vim.api.nvim_create_augroup('user_cmds', { clear = true })
|
local group = vim.api.nvim_create_augroup('user_cmds', { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight on yank',
|
desc = 'Highlight on yank',
|
||||||
group = group,
|
group = group,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank({ higroup = 'Visual', timeout = 200 })
|
vim.highlight.on_yank({ higroup = 'Visual', timeout = 200 })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
@ -206,12 +230,16 @@ map('n', '<leader>q', '<cmd>bdelete<CR>')
|
|||||||
-- Easier in-file navigation with Tab and S-Tab
|
-- Easier in-file navigation with Tab and S-Tab
|
||||||
map('n', '<S-Tab>', '<C-U>')
|
map('n', '<S-Tab>', '<C-U>')
|
||||||
map('n', '<Tab>', '<C-D>')
|
map('n', '<Tab>', '<C-D>')
|
||||||
|
map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
|
||||||
-- Easy buffer navigation
|
-- Easy buffer navigation
|
||||||
map('n', '<C-h>', '<C-w>h')
|
map('n', '<C-h>', '<C-w>h')
|
||||||
map('n', '<C-j>', '<C-w>j')
|
map('n', '<C-j>', '<C-w>j')
|
||||||
map('n', '<C-k>', '<C-w>k')
|
map('n', '<C-k>', '<C-w>k')
|
||||||
map('n', '<C-l>', '<C-w>l')
|
map('n', '<C-l>', '<C-w>l')
|
||||||
|
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||||
|
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||||
|
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||||
|
|
||||||
map('n', '<up>', '<cmd>resize -2<CR>')
|
map('n', '<up>', '<cmd>resize -2<CR>')
|
||||||
map('n', '<down>', '<cmd>resize +2<CR>')
|
map('n', '<down>', '<cmd>resize +2<CR>')
|
||||||
@ -224,6 +252,5 @@ map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
|||||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||||
{{ else }}
|
{{ else }}
|
||||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,169 +1,161 @@
|
|||||||
return {
|
return {
|
||||||
{{- if eq .chezmoi.os "openbsd" }}
|
{{- if eq .chezmoi.os "openbsd" }}
|
||||||
-- snippets
|
-- snippets
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
build = (not jit.os:find("Windows"))
|
build = (not jit.os:find("Windows"))
|
||||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||||
or nil,
|
or nil,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
config = function()
|
config = function()
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
end,
|
end,
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
history = true,
|
|
||||||
delete_check_events = "TextChanged",
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<tab>",
|
|
||||||
function()
|
|
||||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
|
||||||
end,
|
|
||||||
expr = true,
|
|
||||||
silent = true,
|
|
||||||
mode = "i",
|
|
||||||
},
|
|
||||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
|
||||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
opts = {
|
||||||
-- auto completion
|
history = true,
|
||||||
{
|
delete_check_events = "TextChanged",
|
||||||
"hrsh7th/nvim-cmp",
|
},
|
||||||
version = false, -- last release is way too old
|
-- stylua: ignore
|
||||||
event = "InsertEnter",
|
keys = {
|
||||||
dependencies = {
|
{
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"<tab>",
|
||||||
"hrsh7th/cmp-buffer",
|
function()
|
||||||
"hrsh7th/cmp-path",
|
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
},
|
|
||||||
opts = function()
|
|
||||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
|
||||||
local kind_icons = {
|
|
||||||
Text = " ",
|
|
||||||
Method = " ",
|
|
||||||
Function = " ",
|
|
||||||
Constructor = " ",
|
|
||||||
Field = " ",
|
|
||||||
Variable = " ",
|
|
||||||
Class = " ",
|
|
||||||
Interface = " ",
|
|
||||||
Module = " ",
|
|
||||||
Property = " ",
|
|
||||||
Unit = "",
|
|
||||||
Value = " ",
|
|
||||||
Enum = " ",
|
|
||||||
Keyword = " ",
|
|
||||||
Snippet = " ",
|
|
||||||
Color = " ",
|
|
||||||
File = " ",
|
|
||||||
Reference = " ",
|
|
||||||
Folder = " ",
|
|
||||||
EnumMember = " ",
|
|
||||||
Constant = " ",
|
|
||||||
Struct = " ",
|
|
||||||
Event = " ",
|
|
||||||
Operator = " ",
|
|
||||||
TypeParameter = "",
|
|
||||||
}
|
|
||||||
|
|
||||||
local luasnip = require('luasnip')
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local defaults = require("cmp.config.default")()
|
|
||||||
return {
|
|
||||||
completion = {
|
|
||||||
completeopt = "menu,menuone,noinsert",
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<S-CR>"] = cmp.mapping.confirm({
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<C-CR>"] = function(fallback)
|
|
||||||
cmp.abort()
|
|
||||||
fallback()
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp", keyword_length = 1 },
|
|
||||||
{ name = "luasnip", keyword_length = 2 },
|
|
||||||
{ name = "path" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer", keyword_length = 3 },
|
|
||||||
}),
|
|
||||||
formatting = {
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
-- Kind icons
|
|
||||||
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
|
||||||
-- Source
|
|
||||||
vim_item.menu = ({
|
|
||||||
buffer = "[Buffer]",
|
|
||||||
nvim_lsp = "[LSP]",
|
|
||||||
luasnip = "[LuaSnip]",
|
|
||||||
nvim_lua = "[Lua]",
|
|
||||||
latex_symbols = "[LaTeX]",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = {
|
|
||||||
hl_group = "CmpGhostText",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sorting = defaults.sorting,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
config = function(_, opts)
|
|
||||||
for _, source in ipairs(opts.sources) do
|
|
||||||
source.group_index = source.group_index or 1
|
|
||||||
end
|
|
||||||
require("cmp").setup(opts)
|
|
||||||
end,
|
end,
|
||||||
|
expr = true,
|
||||||
|
silent = true,
|
||||||
|
mode = "i",
|
||||||
|
},
|
||||||
|
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||||
|
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
-- auto completion
|
||||||
"kylechui/nvim-surround",
|
|
||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("nvim-surround").setup({
|
|
||||||
-- Configuration here, or leave empty to use defaults
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{{ else }}
|
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
opts = function(_, opts)
|
version = false, -- last release is way too old
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||||
|
local kind_icons = {
|
||||||
|
Text = " ",
|
||||||
|
Method = " ",
|
||||||
|
Function = " ",
|
||||||
|
Constructor = " ",
|
||||||
|
Field = " ",
|
||||||
|
Variable = " ",
|
||||||
|
Class = " ",
|
||||||
|
Interface = " ",
|
||||||
|
Module = " ",
|
||||||
|
Property = " ",
|
||||||
|
Unit = "",
|
||||||
|
Value = " ",
|
||||||
|
Enum = " ",
|
||||||
|
Keyword = " ",
|
||||||
|
Snippet = " ",
|
||||||
|
Color = " ",
|
||||||
|
File = " ",
|
||||||
|
Reference = " ",
|
||||||
|
Folder = " ",
|
||||||
|
EnumMember = " ",
|
||||||
|
Constant = " ",
|
||||||
|
Struct = " ",
|
||||||
|
Event = " ",
|
||||||
|
Operator = " ",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
|
||||||
|
local luasnip = require('luasnip')
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "neorg" } }))
|
local defaults = require("cmp.config.default")()
|
||||||
|
return {
|
||||||
|
completion = {
|
||||||
|
completeopt = "menu,menuone,noinsert",
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<S-CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<C-CR>"] = function(fallback)
|
||||||
|
cmp.abort()
|
||||||
|
fallback()
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp", keyword_length = 1 },
|
||||||
|
{ name = "luasnip", keyword_length = 2 },
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer", keyword_length = 3 },
|
||||||
|
}),
|
||||||
|
formatting = {
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
-- Kind icons
|
||||||
|
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||||
|
-- Source
|
||||||
|
vim_item.menu = ({
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[LuaSnip]",
|
||||||
|
nvim_lua = "[Lua]",
|
||||||
|
latex_symbols = "[LaTeX]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = {
|
||||||
|
hl_group = "CmpGhostText",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sorting = defaults.sorting,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
for _, source in ipairs(opts.sources) do
|
||||||
|
source.group_index = source.group_index or 1
|
||||||
|
end
|
||||||
|
require("cmp").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup({
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
opts = {
|
opts = {
|
||||||
fast_wrap = {},
|
fast_wrap = {},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
return {
|
return {
|
||||||
-- gruvbox
|
-- gruvbox
|
||||||
{
|
{
|
||||||
"ellisonleao/gruvbox.nvim",
|
"ellisonleao/gruvbox.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = { contrast = "hard" },
|
opts = { contrast = "hard" },
|
||||||
},
|
},
|
||||||
-- kanagawa
|
-- kanagawa
|
||||||
{
|
{
|
||||||
"rebelot/kanagawa.nvim",
|
"rebelot/kanagawa.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
},
|
},
|
||||||
{{- if eq .chezmoi.os "openbsd" }}
|
{{- if eq .chezmoi.os "openbsd" }}
|
||||||
{
|
{
|
||||||
"gbprod/nord.nvim",
|
"gbprod/nord.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
opts = {
|
opts = {
|
||||||
styles = {
|
styles = {
|
||||||
comments = { italic = true },
|
comments = { italic = true },
|
||||||
keywords = { bold = true },
|
keywords = { bold = true },
|
||||||
functions = { bold = true },
|
functions = { bold = true },
|
||||||
variables = {},
|
variables = {},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[colorscheme nord]])
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
config = function()
|
||||||
|
vim.cmd([[colorscheme nord]])
|
||||||
|
end,
|
||||||
|
},
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{
|
{
|
||||||
"gbprod/nord.nvim",
|
"gbprod/nord.nvim",
|
||||||
@ -40,7 +40,7 @@ return {
|
|||||||
variables = {},
|
variables = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LazyVim/LazyVim",
|
"LazyVim/LazyVim",
|
||||||
opts = {
|
opts = {
|
||||||
|
@ -1,264 +1,264 @@
|
|||||||
return {
|
return {
|
||||||
-- Fuzzy finder.
|
-- Fuzzy finder.
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
version = false, -- telescope did only one release, so use HEAD for now
|
version = false, -- telescope did only one release, so use HEAD for now
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
build = "gmake",
|
build = "gmake",
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("fzf")
|
require("telescope").load_extension("fzf")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader><space>", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
{ "<leader><space>", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
||||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||||
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
||||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
||||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||||
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
|
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
|
||||||
{ "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Goto Symbol" },
|
{ "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Goto Symbol" },
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
|
|
||||||
local open_with_trouble = function(...)
|
local open_with_trouble = function(...)
|
||||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||||
end
|
end
|
||||||
local open_selected_with_trouble = function(...)
|
local open_selected_with_trouble = function(...)
|
||||||
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
defaults = {
|
defaults = {
|
||||||
prompt_prefix = " ",
|
prompt_prefix = " ",
|
||||||
selection_caret = " ",
|
selection_caret = " ",
|
||||||
layout_config = { horizontal = { preview_width = 0.5 } },
|
layout_config = { horizontal = { preview_width = 0.5 } },
|
||||||
file_ignore_patterns = { 'node_modules/.*' },
|
file_ignore_patterns = { 'node_modules/.*' },
|
||||||
extensions = {
|
extensions = {
|
||||||
fzf = {
|
fzf = {
|
||||||
fuzzy = true, -- false will only do exact matching
|
fuzzy = true, -- false will only do exact matching
|
||||||
override_generic_sorter = true, -- override the generic sorter
|
override_generic_sorter = true, -- override the generic sorter
|
||||||
override_file_sorter = true, -- override the file sorter
|
override_file_sorter = true, -- override the file sorter
|
||||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||||
}
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<c-t>"] = open_with_trouble,
|
|
||||||
["<a-t>"] = open_selected_with_trouble,
|
|
||||||
["<C-Down>"] = actions.cycle_history_next,
|
|
||||||
["<C-Up>"] = actions.cycle_history_prev,
|
|
||||||
["<C-f>"] = actions.preview_scrolling_down,
|
|
||||||
["<C-b>"] = actions.preview_scrolling_up,
|
|
||||||
},
|
|
||||||
n = {
|
|
||||||
["q"] = actions.close,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end,
|
},
|
||||||
},
|
mappings = {
|
||||||
{
|
i = {
|
||||||
"nvim-telescope/telescope-bibtex.nvim",
|
["<c-t>"] = open_with_trouble,
|
||||||
config = function()
|
["<a-t>"] = open_selected_with_trouble,
|
||||||
require "telescope".load_extension("bibtex")
|
["<C-Down>"] = actions.cycle_history_next,
|
||||||
end,
|
["<C-Up>"] = actions.cycle_history_prev,
|
||||||
},
|
["<C-f>"] = actions.preview_scrolling_down,
|
||||||
{
|
["<C-b>"] = actions.preview_scrolling_up,
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
opts = {
|
|
||||||
-- add any options here
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
event = "InsertEnter",
|
|
||||||
opts = {
|
|
||||||
fast_wrap = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- which-key helps you remember key bindings by showing a popup
|
|
||||||
-- with the active keybindings of the command you started typing.
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {
|
|
||||||
plugins = { spelling = true },
|
|
||||||
defaults = {
|
|
||||||
mode = { "n", "v" },
|
|
||||||
["g"] = { name = "+goto" },
|
|
||||||
["gs"] = { name = "+surround" },
|
|
||||||
["]"] = { name = "+next" },
|
|
||||||
["["] = { name = "+prev" },
|
|
||||||
["<leader><tab>"] = { name = "+tabs" },
|
|
||||||
["<leader>b"] = { name = "+buffer" },
|
|
||||||
["<leader>c"] = { name = "+code" },
|
|
||||||
["<leader>f"] = { name = "+file/find" },
|
|
||||||
["<leader>g"] = { name = "+git" },
|
|
||||||
["<leader>gh"] = { name = "+hunks" },
|
|
||||||
["<leader>q"] = { name = "+quit/session" },
|
|
||||||
["<leader>s"] = { name = "+search" },
|
|
||||||
["<leader>u"] = { name = "+ui" },
|
|
||||||
["<leader>w"] = { name = "+windows" },
|
|
||||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
|
||||||
},
|
},
|
||||||
|
n = {
|
||||||
|
["q"] = actions.close,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
}
|
||||||
local wk = require("which-key")
|
end,
|
||||||
wk.setup(opts)
|
},
|
||||||
wk.register(opts.defaults)
|
{
|
||||||
|
"nvim-telescope/telescope-bibtex.nvim",
|
||||||
|
config = function()
|
||||||
|
require "telescope".load_extension("bibtex")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
|
opts = {
|
||||||
|
-- add any options here
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {
|
||||||
|
fast_wrap = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- which-key helps you remember key bindings by showing a popup
|
||||||
|
-- with the active keybindings of the command you started typing.
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
plugins = { spelling = true },
|
||||||
|
defaults = {
|
||||||
|
mode = { "n", "v" },
|
||||||
|
["g"] = { name = "+goto" },
|
||||||
|
["gs"] = { name = "+surround" },
|
||||||
|
["]"] = { name = "+next" },
|
||||||
|
["["] = { name = "+prev" },
|
||||||
|
["<leader><tab>"] = { name = "+tabs" },
|
||||||
|
["<leader>b"] = { name = "+buffer" },
|
||||||
|
["<leader>c"] = { name = "+code" },
|
||||||
|
["<leader>f"] = { name = "+file/find" },
|
||||||
|
["<leader>g"] = { name = "+git" },
|
||||||
|
["<leader>gh"] = { name = "+hunks" },
|
||||||
|
["<leader>q"] = { name = "+quit/session" },
|
||||||
|
["<leader>s"] = { name = "+search" },
|
||||||
|
["<leader>u"] = { name = "+ui" },
|
||||||
|
["<leader>w"] = { name = "+windows" },
|
||||||
|
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.setup(opts)
|
||||||
|
wk.register(opts.defaults)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- git signs highlights text that has changed since the list
|
||||||
|
-- git commit, and also lets you interactively stage & unstage
|
||||||
|
-- hunks in a commit.
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
signs = {
|
||||||
|
add = { text = "▎" },
|
||||||
|
change = { text = "▎" },
|
||||||
|
delete = { text = "" },
|
||||||
|
topdelete = { text = "" },
|
||||||
|
changedelete = { text = "▎" },
|
||||||
|
untracked = { text = "▎" },
|
||||||
|
},
|
||||||
|
on_attach = function(buffer)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function map(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- stylua: ignore start
|
||||||
|
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||||
|
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||||
|
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||||
|
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||||
|
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||||
|
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
|
||||||
|
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||||
|
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||||
|
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||||
|
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Automatically highlights other instances of the word under your cursor.
|
||||||
|
-- This works with LSP, Treesitter, and regexp matching to find the other
|
||||||
|
-- instances.
|
||||||
|
{
|
||||||
|
"RRethy/vim-illuminate",
|
||||||
|
opts = {
|
||||||
|
delay = 200,
|
||||||
|
large_file_cutoff = 2000,
|
||||||
|
large_file_overrides = {
|
||||||
|
providers = { "lsp" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("illuminate").configure(opts)
|
||||||
|
|
||||||
|
local function map(key, dir, buffer)
|
||||||
|
vim.keymap.set("n", key, function()
|
||||||
|
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||||
|
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||||
|
end
|
||||||
|
|
||||||
|
map("]]", "next")
|
||||||
|
map("[[", "prev")
|
||||||
|
|
||||||
|
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function()
|
||||||
|
local buffer = vim.api.nvim_get_current_buf()
|
||||||
|
map("]]", "next", buffer)
|
||||||
|
map("[[", "prev", buffer)
|
||||||
end,
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "]]", desc = "Next Reference" },
|
||||||
|
{ "[[", desc = "Prev Reference" },
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- git signs highlights text that has changed since the list
|
-- better diagnostics list and others
|
||||||
-- git commit, and also lets you interactively stage & unstage
|
{
|
||||||
-- hunks in a commit.
|
"folke/trouble.nvim",
|
||||||
{
|
cmd = { "TroubleToggle", "Trouble" },
|
||||||
"lewis6991/gitsigns.nvim",
|
opts = { use_diagnostic_signs = true },
|
||||||
opts = {
|
keys = {
|
||||||
signs = {
|
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||||
add = { text = "▎" },
|
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||||
change = { text = "▎" },
|
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||||
delete = { text = "" },
|
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||||
topdelete = { text = "" },
|
{
|
||||||
changedelete = { text = "▎" },
|
"[q",
|
||||||
untracked = { text = "▎" },
|
function()
|
||||||
},
|
if require("trouble").is_open() then
|
||||||
on_attach = function(buffer)
|
require("trouble").previous({ skip_groups = true, jump = true })
|
||||||
local gs = package.loaded.gitsigns
|
else
|
||||||
|
local ok, err = pcall(vim.cmd.cprev)
|
||||||
local function map(mode, l, r, desc)
|
if not ok then
|
||||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
vim.notify(err, vim.log.levels.ERROR)
|
||||||
end
|
|
||||||
|
|
||||||
-- stylua: ignore start
|
|
||||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
|
||||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
|
||||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
|
||||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
|
||||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
|
||||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
|
||||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
|
||||||
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
|
|
||||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
|
||||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
|
||||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
|
||||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Automatically highlights other instances of the word under your cursor.
|
|
||||||
-- This works with LSP, Treesitter, and regexp matching to find the other
|
|
||||||
-- instances.
|
|
||||||
{
|
|
||||||
"RRethy/vim-illuminate",
|
|
||||||
opts = {
|
|
||||||
delay = 200,
|
|
||||||
large_file_cutoff = 2000,
|
|
||||||
large_file_overrides = {
|
|
||||||
providers = { "lsp" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("illuminate").configure(opts)
|
|
||||||
|
|
||||||
local function map(key, dir, buffer)
|
|
||||||
vim.keymap.set("n", key, function()
|
|
||||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
|
||||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
map("]]", "next")
|
|
||||||
map("[[", "prev")
|
|
||||||
|
|
||||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
callback = function()
|
|
||||||
local buffer = vim.api.nvim_get_current_buf()
|
|
||||||
map("]]", "next", buffer)
|
|
||||||
map("[[", "prev", buffer)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
keys = {
|
desc = "Previous trouble/quickfix item",
|
||||||
{ "]]", desc = "Next Reference" },
|
},
|
||||||
{ "[[", desc = "Prev Reference" },
|
{
|
||||||
},
|
"]q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").next({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
local ok, err = pcall(vim.cmd.cnext)
|
||||||
|
if not ok then
|
||||||
|
vim.notify(err, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Next trouble/quickfix item",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- better diagnostics list and others
|
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||||
{
|
-- in your project and loads them into a browsable list.
|
||||||
"folke/trouble.nvim",
|
{
|
||||||
cmd = { "TroubleToggle", "Trouble" },
|
"folke/todo-comments.nvim",
|
||||||
opts = { use_diagnostic_signs = true },
|
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||||
keys = {
|
config = true,
|
||||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
-- stylua: ignore
|
||||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
keys = {
|
||||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||||
{
|
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||||
"[q",
|
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||||
function()
|
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||||
if require("trouble").is_open() then
|
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||||
require("trouble").previous({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
local ok, err = pcall(vim.cmd.cprev)
|
|
||||||
if not ok then
|
|
||||||
vim.notify(err, vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
desc = "Previous trouble/quickfix item",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"]q",
|
|
||||||
function()
|
|
||||||
if require("trouble").is_open() then
|
|
||||||
require("trouble").next({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
local ok, err = pcall(vim.cmd.cnext)
|
|
||||||
if not ok then
|
|
||||||
vim.notify(err, vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
desc = "Next trouble/quickfix item",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
{
|
||||||
-- in your project and loads them into a browsable list.
|
"folke/flash.nvim",
|
||||||
{
|
event = "VeryLazy",
|
||||||
"folke/todo-comments.nvim",
|
opts = {},
|
||||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
keys = {
|
||||||
config = true,
|
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||||
-- stylua: ignore
|
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||||
keys = {
|
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
|
||||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
|
||||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
|
||||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
}
|
||||||
"folke/flash.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {},
|
|
||||||
keys = {
|
|
||||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
|
||||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
|
||||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
|
||||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
|
||||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,199 +1,199 @@
|
|||||||
return {
|
return {
|
||||||
-- lspconfig
|
-- lspconfig
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
-- options for vim.diagnostic.config()
|
-- options for vim.diagnostic.config()
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
underline = true,
|
underline = true,
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
spacing = 4,
|
spacing = 4,
|
||||||
source = "if_many",
|
source = "if_many",
|
||||||
prefix = "●",
|
prefix = "●",
|
||||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
||||||
-- prefix = "icons",
|
-- prefix = "icons",
|
||||||
},
|
|
||||||
severity_sort = true,
|
|
||||||
float = {
|
|
||||||
border = 'rounded',
|
|
||||||
source = 'always',
|
|
||||||
header = '',
|
|
||||||
prefix = '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
|
||||||
-- provide the inlay hints.
|
|
||||||
inlay_hints = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
severity_sort = true,
|
||||||
local lsp = require('lspconfig')
|
float = {
|
||||||
local lsp_defaults = lsp.util.default_config
|
border = 'rounded',
|
||||||
|
source = 'always',
|
||||||
|
header = '',
|
||||||
|
prefix = '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||||
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
|
-- provide the inlay hints.
|
||||||
|
inlay_hints = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local lsp = require('lspconfig')
|
||||||
|
local lsp_defaults = lsp.util.default_config
|
||||||
|
|
||||||
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
||||||
'force',
|
'force',
|
||||||
lsp_defaults.capabilities,
|
lsp_defaults.capabilities,
|
||||||
require('cmp_nvim_lsp').default_capabilities()
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
)
|
)
|
||||||
|
|
||||||
local sign = function(o)
|
local sign = function(o)
|
||||||
-- See :help sign_define()
|
-- See :help sign_define()
|
||||||
vim.fn.sign_define(o.name, {
|
vim.fn.sign_define(o.name, {
|
||||||
texthl = o.name,
|
texthl = o.name,
|
||||||
text = o.text,
|
text = o.text,
|
||||||
numhl = ''
|
numhl = ''
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
sign({ name = 'DiagnosticSignError', text = '✘' })
|
sign({ name = 'DiagnosticSignError', text = '✘' })
|
||||||
sign({ name = 'DiagnosticSignWarn', text = '▲' })
|
sign({ name = 'DiagnosticSignWarn', text = '▲' })
|
||||||
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
||||||
sign({ name = 'DiagnosticSignInfo', text = '' })
|
sign({ name = 'DiagnosticSignInfo', text = '' })
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
float = {
|
float = {
|
||||||
border = 'rounded',
|
border = 'rounded',
|
||||||
source = 'always',
|
source = 'always',
|
||||||
header = '',
|
header = '',
|
||||||
prefix = '',
|
prefix = '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||||
vim.lsp.handlers.hover,
|
vim.lsp.handlers.hover,
|
||||||
{ border = 'rounded' }
|
{ border = 'rounded' }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||||
vim.lsp.handlers.signature_help,
|
vim.lsp.handlers.signature_help,
|
||||||
{ border = 'rounded' }
|
{ border = 'rounded' }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
|
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
|
||||||
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
|
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
|
||||||
pcall(vim.diagnostic.reset, ns)
|
pcall(vim.diagnostic.reset, ns)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
pattern = '*.go',
|
pattern = '*.go',
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
|
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
local on_attach = function(client)
|
|
||||||
local bufmap = function(mode, lhs, rhs)
|
|
||||||
local opts = { buffer = true }
|
|
||||||
vim.keymap.set(mode, lhs, rhs, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
|
||||||
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
|
||||||
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
|
||||||
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
|
||||||
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
|
||||||
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
|
||||||
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
|
||||||
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
|
||||||
bufmap('n', '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
|
||||||
bufmap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
|
||||||
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
|
||||||
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
|
||||||
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
|
||||||
end
|
|
||||||
|
|
||||||
lsp.gopls.setup {
|
|
||||||
settings = {
|
|
||||||
gopls = {
|
|
||||||
gofumpt = true,
|
|
||||||
codelenses = {
|
|
||||||
gc_details = false,
|
|
||||||
generate = true,
|
|
||||||
regenerate_cgo = true,
|
|
||||||
run_govulncheck = true,
|
|
||||||
test = true,
|
|
||||||
tidy = true,
|
|
||||||
upgrade_dependency = true,
|
|
||||||
vendor = true,
|
|
||||||
},
|
|
||||||
hints = {
|
|
||||||
assignVariableTypes = true,
|
|
||||||
compositeLiteralFields = true,
|
|
||||||
compositeLiteralTypes = true,
|
|
||||||
constantValues = true,
|
|
||||||
functionTypeParameters = true,
|
|
||||||
parameterNames = true,
|
|
||||||
rangeVariableTypes = true,
|
|
||||||
},
|
|
||||||
analyses = {
|
|
||||||
fieldalignment = true,
|
|
||||||
shadow = true,
|
|
||||||
unusedvariable = true,
|
|
||||||
unusedwrite = true,
|
|
||||||
useany = true,
|
|
||||||
},
|
|
||||||
usePlaceholders = true,
|
|
||||||
completeUnimported = true,
|
|
||||||
staticcheck = true,
|
|
||||||
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
|
||||||
semanticTokens = true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
on_attach = on_attach
|
|
||||||
}
|
|
||||||
lsp.clangd.setup {
|
|
||||||
settings = {
|
|
||||||
clangd = {
|
|
||||||
cmd = {
|
|
||||||
"clangd",
|
|
||||||
"--background-index",
|
|
||||||
"--clang-tidy",
|
|
||||||
"--header-insertion=iwyu",
|
|
||||||
"--completion-style=detailed",
|
|
||||||
"--function-arg-placeholders",
|
|
||||||
"--fallback-style=llvm",
|
|
||||||
},
|
|
||||||
init_options = {
|
|
||||||
usePlaceholders = true,
|
|
||||||
completeUnimported = true,
|
|
||||||
clangdFileStatus = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
on_attach = on_attach
|
|
||||||
}
|
|
||||||
lsp.ltex.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" },
|
|
||||||
}
|
|
||||||
lsp.svelte.setup { on_attach = on_attach }
|
|
||||||
lsp.tsserver.setup { on_attach = on_attach }
|
|
||||||
lsp.lua_ls.setup {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
},
|
|
||||||
codeLens = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
callSnippet = "Replace",
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' }
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_attach = on_attach
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
}
|
})
|
||||||
|
|
||||||
|
local on_attach = function(client)
|
||||||
|
local bufmap = function(mode, lhs, rhs)
|
||||||
|
local opts = { buffer = true }
|
||||||
|
vim.keymap.set(mode, lhs, rhs, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||||
|
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||||
|
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||||
|
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||||
|
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||||
|
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
||||||
|
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
||||||
|
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
||||||
|
bufmap('n', '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||||
|
bufmap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||||
|
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||||
|
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||||
|
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp.gopls.setup {
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
gofumpt = true,
|
||||||
|
codelenses = {
|
||||||
|
gc_details = false,
|
||||||
|
generate = true,
|
||||||
|
regenerate_cgo = true,
|
||||||
|
run_govulncheck = true,
|
||||||
|
test = true,
|
||||||
|
tidy = true,
|
||||||
|
upgrade_dependency = true,
|
||||||
|
vendor = true,
|
||||||
|
},
|
||||||
|
hints = {
|
||||||
|
assignVariableTypes = true,
|
||||||
|
compositeLiteralFields = true,
|
||||||
|
compositeLiteralTypes = true,
|
||||||
|
constantValues = true,
|
||||||
|
functionTypeParameters = true,
|
||||||
|
parameterNames = true,
|
||||||
|
rangeVariableTypes = true,
|
||||||
|
},
|
||||||
|
analyses = {
|
||||||
|
fieldalignment = true,
|
||||||
|
shadow = true,
|
||||||
|
unusedvariable = true,
|
||||||
|
unusedwrite = true,
|
||||||
|
useany = true,
|
||||||
|
},
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
|
staticcheck = true,
|
||||||
|
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||||
|
semanticTokens = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
lsp.clangd.setup {
|
||||||
|
settings = {
|
||||||
|
clangd = {
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--background-index",
|
||||||
|
"--clang-tidy",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
|
"--completion-style=detailed",
|
||||||
|
"--function-arg-placeholders",
|
||||||
|
"--fallback-style=llvm",
|
||||||
|
},
|
||||||
|
init_options = {
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
|
clangdFileStatus = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
lsp.ltex.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" },
|
||||||
|
}
|
||||||
|
lsp.svelte.setup { on_attach = on_attach }
|
||||||
|
lsp.tsserver.setup { on_attach = on_attach }
|
||||||
|
lsp.lua_ls.setup {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
codeLens = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Replace",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,103 +1,113 @@
|
|||||||
return {
|
return {
|
||||||
-- Treesitter is a new parser generator tool that we can
|
-- Treesitter is a new parser generator tool that we can
|
||||||
-- use in Neovim to power faster and more accurate
|
-- use in Neovim to power faster and more accurate
|
||||||
-- syntax highlighting.
|
-- syntax highlighting.
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = { "VeryLazy" },
|
event = { "VeryLazy" },
|
||||||
dependencies = {
|
init = function(plugin)
|
||||||
{
|
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||||
config = function()
|
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
|
||||||
-- When in diff mode, we want to use the default
|
-- Luckily, the only things that those plugins need are the custom queries, which we make available
|
||||||
-- vim text objects c & C instead of the treesitter ones.
|
-- during startup.
|
||||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
require("lazy.core.loader").add_to_rtp(plugin)
|
||||||
local configs = require("nvim-treesitter.configs")
|
require("nvim-treesitter.query_predicates")
|
||||||
for name, fn in pairs(move) do
|
end,
|
||||||
if name:find("goto") == 1 then
|
dependencies = {
|
||||||
move[name] = function(q, ...)
|
{
|
||||||
if vim.wo.diff then
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
local config = configs.get_module("textobjects.move")
|
config = function()
|
||||||
[name] ---@type table<string,string>
|
-- When in diff mode, we want to use the default
|
||||||
for key, query in pairs(config or {}) do
|
-- vim text objects c & C instead of the treesitter ones.
|
||||||
if q == query and key:find("[%]%[][cC]") then
|
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||||
vim.cmd("normal! " .. key)
|
local configs = require("nvim-treesitter.configs")
|
||||||
return
|
for name, fn in pairs(move) do
|
||||||
end
|
if name:find("goto") == 1 then
|
||||||
end
|
move[name] = function(q, ...)
|
||||||
end
|
if vim.wo.diff then
|
||||||
return fn(q, ...)
|
local config = configs.get_module("textobjects.move")
|
||||||
end
|
[name] ---@type table<string,string>
|
||||||
end
|
for key, query in pairs(config or {}) do
|
||||||
|
if q == query and key:find("[%]%[][cC]") then
|
||||||
|
vim.cmd("normal! " .. key)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
},
|
end
|
||||||
},
|
return fn(q, ...)
|
||||||
cmd = { "TSUpdateSync" },
|
end
|
||||||
keys = {
|
|
||||||
{ "<c-space>", desc = "Increment selection" },
|
|
||||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"diff",
|
|
||||||
"html",
|
|
||||||
"javascript",
|
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"jsonc",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"luap",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"python",
|
|
||||||
"query",
|
|
||||||
"regex",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>",
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = false,
|
|
||||||
node_decremental = "<bs>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
textobjects = {
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
|
|
||||||
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
|
|
||||||
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
|
|
||||||
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
if type(opts.ensure_installed) == "table" then
|
|
||||||
local added = {}
|
|
||||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
|
||||||
if added[lang] then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
added[lang] = true
|
|
||||||
return true
|
|
||||||
end, opts.ensure_installed)
|
|
||||||
end
|
end
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
end
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||||
|
keys = {
|
||||||
|
{ "<c-space>", desc = "Increment selection" },
|
||||||
|
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"c",
|
||||||
|
"diff",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"jsdoc",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
"lua",
|
||||||
|
"luadoc",
|
||||||
|
"luap",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"svelte",
|
||||||
|
"toml",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "<C-space>",
|
||||||
|
node_incremental = "<C-space>",
|
||||||
|
scope_incremental = false,
|
||||||
|
node_decremental = "<bs>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
|
||||||
|
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
|
||||||
|
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
|
||||||
|
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
local added = {}
|
||||||
|
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||||
|
if added[lang] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
added[lang] = true
|
||||||
|
return true
|
||||||
|
end, opts.ensure_installed)
|
||||||
|
end
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
5
dot_config/openbox/autostart
Normal file
5
dot_config/openbox/autostart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
syncthing -no-browser -home="/home/jan/.config/syncthing" &
|
||||||
|
unclutter -root -idle 2 -noevents &
|
||||||
|
xidle -timeout 300 -program "/usr/local/bin/slock" &
|
||||||
|
feh --no-fehbg --bg-center '/home/jan/.config/background.png'
|
||||||
|
tint2&
|
64
dot_mbsyncrc
Normal file
64
dot_mbsyncrc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#################################
|
||||||
|
###### Account moebius ##########
|
||||||
|
#################################
|
||||||
|
|
||||||
|
IMAPAccount moebius
|
||||||
|
Host mail.moebiusband.org
|
||||||
|
User jan
|
||||||
|
PassCmd "keepassxc-cli show /home/jan/doc/private/Passwords.kdbx server/moebiusband.org -a password"
|
||||||
|
SSLType IMAPS
|
||||||
|
SSLVersions TLSv1.2
|
||||||
|
CertificateFile /etc/ssl/cert.pem
|
||||||
|
|
||||||
|
# Remote storage
|
||||||
|
IMAPStore moebius-remote
|
||||||
|
Account moebius
|
||||||
|
|
||||||
|
# Local storage
|
||||||
|
MaildirStore moebius-local
|
||||||
|
Path ~/.mail/moebius/
|
||||||
|
Inbox ~/.mail/moebius/INBOX
|
||||||
|
|
||||||
|
Channel moebius-inbox
|
||||||
|
Far :moebius-remote:"INBOX"
|
||||||
|
Near :moebius-local:INBOX
|
||||||
|
Create Both
|
||||||
|
Expunge Both
|
||||||
|
|
||||||
|
Channel moebius-archive
|
||||||
|
Far :moebius-remote:"Archive"
|
||||||
|
Near :moebius-local:archive
|
||||||
|
Create Both
|
||||||
|
Expunge Both
|
||||||
|
|
||||||
|
Channel moebius-drafts
|
||||||
|
Far :moebius-remote:"Drafts"
|
||||||
|
Near :moebius-local:drafts
|
||||||
|
Create Both
|
||||||
|
Expunge Both
|
||||||
|
|
||||||
|
Channel moebius-sent
|
||||||
|
Far :moebius-remote:"Sent"
|
||||||
|
Near :moebius-local:sent
|
||||||
|
Create Both
|
||||||
|
Expunge Both
|
||||||
|
|
||||||
|
Channel moebius-trash
|
||||||
|
Far :moebius-remote:"Trash"
|
||||||
|
Near :moebius-local:trash
|
||||||
|
Create Both
|
||||||
|
Expunge Both
|
||||||
|
|
||||||
|
#Channel moebius-junk
|
||||||
|
#Master :moebius-remote:"Junk"
|
||||||
|
#Slave :moebius-local:junk
|
||||||
|
#Create Both
|
||||||
|
#Expunge Both
|
||||||
|
|
||||||
|
Group moebius
|
||||||
|
Channel moebius-inbox
|
||||||
|
Channel moebius-archive
|
||||||
|
Channel moebius-drafts
|
||||||
|
Channel moebius-sent
|
||||||
|
Channel moebius-trash
|
||||||
|
#Channel moebius-junk
|
14
dot_msmtprc
Normal file
14
dot_msmtprc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
defaults
|
||||||
|
auth on
|
||||||
|
tls on
|
||||||
|
tls_trust_file /etc/ssl/cert.pem
|
||||||
|
logfile ~/.local/state/msmtp/msmtp.log
|
||||||
|
|
||||||
|
account moebius
|
||||||
|
host mail.moebiusband.org
|
||||||
|
port 587
|
||||||
|
user jan
|
||||||
|
passwordeval "keepassxc-cli show /home/jan/doc/private/Passwords.kdbx server/moebiusband.org -a password"
|
||||||
|
from jan@moebiusband.org
|
||||||
|
|
||||||
|
account default : moebius
|
@ -3,6 +3,7 @@ set -g prefix C-a
|
|||||||
bind C-a send-prefix
|
bind C-a send-prefix
|
||||||
|
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
|
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m' # undercurl support
|
||||||
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
||||||
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
|
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
|
||||||
|
|
||||||
|
@ -69,5 +69,5 @@ export XDG_CONFIG_HOME="$HOME/.config"
|
|||||||
export PATH=/opt/homebrew/bin:$PATH
|
export PATH=/opt/homebrew/bin:$PATH
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
eval "$(atuin init zsh)"
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
eval "$(atuin init zsh)"
|
||||||
|
@ -26,13 +26,6 @@ xinput set-prop /dev/wsmouse 'WS Pointer Wheel Emulation Timeout' 500
|
|||||||
export LC_CTYPE="en_US.UTF-8"
|
export LC_CTYPE="en_US.UTF-8"
|
||||||
export HOME=/home/jan
|
export HOME=/home/jan
|
||||||
export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/go/bin:$PATH
|
export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/go/bin:$PATH
|
||||||
|
|
||||||
{{- if eq .chezmoi.os "openbsd" }}
|
|
||||||
syncthing -no-browser -home="/home/jan/.config/syncthing" &
|
|
||||||
unclutter -root -idle 2 -noevents &
|
|
||||||
xidle -timeout 300 -program "/usr/local/bin/slock" &
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
xrdb -merge $HOME/.Xresources
|
xrdb -merge $HOME/.Xresources
|
||||||
/home/jan/.fehbg&
|
|
||||||
exec openbox-session
|
exec openbox-session
|
||||||
|
@ -1,142 +0,0 @@
|
|||||||
#################################
|
|
||||||
###### Account moebius ##########
|
|
||||||
#################################
|
|
||||||
|
|
||||||
IMAPAccount moebius
|
|
||||||
Host mail.moebiusband.org
|
|
||||||
User jan
|
|
||||||
Pass {{ (keepassxc "moebiusband.org").Password }}
|
|
||||||
SSLType IMAPS
|
|
||||||
SSLVersions TLSv1.2
|
|
||||||
CertificateFile /etc/ssl/cert.pem
|
|
||||||
|
|
||||||
# Remote storage
|
|
||||||
IMAPStore moebius-remote
|
|
||||||
Account moebius
|
|
||||||
|
|
||||||
# Local storage
|
|
||||||
MaildirStore moebius-local
|
|
||||||
Path ~/.mail/moebius/
|
|
||||||
Inbox ~/.mail/moebius/INBOX
|
|
||||||
|
|
||||||
Channel moebius-inbox
|
|
||||||
Master :moebius-remote:"INBOX"
|
|
||||||
Slave :moebius-local:INBOX
|
|
||||||
Create Both
|
|
||||||
Expunge Both
|
|
||||||
|
|
||||||
Channel moebius-archive
|
|
||||||
Master :moebius-remote:"Archive"
|
|
||||||
Slave :moebius-local:archive
|
|
||||||
Create Both
|
|
||||||
Expunge Both
|
|
||||||
|
|
||||||
Channel moebius-drafts
|
|
||||||
Master :moebius-remote:"Drafts"
|
|
||||||
Slave :moebius-local:drafts
|
|
||||||
Create Both
|
|
||||||
Expunge Both
|
|
||||||
|
|
||||||
Channel moebius-sent
|
|
||||||
Master :moebius-remote:"Sent"
|
|
||||||
Slave :moebius-local:sent
|
|
||||||
Create Both
|
|
||||||
Expunge Both
|
|
||||||
|
|
||||||
Channel moebius-trash
|
|
||||||
Master :moebius-remote:"Trash"
|
|
||||||
Slave :moebius-local:trash
|
|
||||||
Create Both
|
|
||||||
Expunge Both
|
|
||||||
|
|
||||||
#Channel moebius-junk
|
|
||||||
#Master :moebius-remote:"Junk"
|
|
||||||
#Slave :moebius-local:junk
|
|
||||||
#Create Both
|
|
||||||
#Expunge Both
|
|
||||||
|
|
||||||
Group moebius
|
|
||||||
Channel moebius-inbox
|
|
||||||
Channel moebius-archive
|
|
||||||
Channel moebius-drafts
|
|
||||||
Channel moebius-sent
|
|
||||||
Channel moebius-trash
|
|
||||||
#Channel moebius-junk
|
|
||||||
|
|
||||||
|
|
||||||
#################################
|
|
||||||
######## Account fau ############
|
|
||||||
#################################
|
|
||||||
|
|
||||||
IMAPAccount fau
|
|
||||||
Host groupware.fau.de
|
|
||||||
User fauad\\unrz254
|
|
||||||
Pass {{ (keepassxc "IDM FAU").Password }}
|
|
||||||
SSLType STARTTLS
|
|
||||||
SSLVersions TLSv1.2
|
|
||||||
CertificateFile /etc/ssl/cert.pem
|
|
||||||
|
|
||||||
# Remote storage
|
|
||||||
IMAPStore fau-remote
|
|
||||||
Account fau
|
|
||||||
|
|
||||||
# Local storage
|
|
||||||
MaildirStore fau-local
|
|
||||||
Path ~/.mail/fau/
|
|
||||||
Inbox ~/.mail/fau/INBOX
|
|
||||||
|
|
||||||
Channel fau
|
|
||||||
Master :fau-remote:
|
|
||||||
Slave :fau-local:
|
|
||||||
Patterns * !Calendar !Contacts "!Suggested Contacts"
|
|
||||||
Create Both
|
|
||||||
SyncState *
|
|
||||||
|
|
||||||
#################################
|
|
||||||
####### Account gmail ###########
|
|
||||||
#################################
|
|
||||||
|
|
||||||
IMAPAccount gmail
|
|
||||||
Host imap.gmail.com
|
|
||||||
User jan.treibig@gmail.com
|
|
||||||
PassCmd "keepassxc-cli show /home/jan/doc/private/Passwords.kdbx sso/Google -a password"
|
|
||||||
SSLType IMAPS
|
|
||||||
CertificateFile /etc/ssl/cert.pem
|
|
||||||
|
|
||||||
IMAPStore gmail-remote
|
|
||||||
Account gmail
|
|
||||||
|
|
||||||
MaildirStore gmail-local
|
|
||||||
Subfolders Verbatim
|
|
||||||
Path ~/.mail/gmail/
|
|
||||||
Inbox ~/.mail/gmail/INBOX
|
|
||||||
|
|
||||||
Channel sync-googlemail-default
|
|
||||||
Master :gmail-remote:
|
|
||||||
Slave :gmail-local:
|
|
||||||
Patterns "INBOX"
|
|
||||||
Create Slave
|
|
||||||
|
|
||||||
Channel sync-googlemail-sent
|
|
||||||
Master :gmail-remote:"[Gmail]/Sent Mail"
|
|
||||||
Slave :gmail-local:sent
|
|
||||||
Create Slave
|
|
||||||
|
|
||||||
Channel sync-googlemail-archive
|
|
||||||
Master :gmail-remote:"[Gmail]/All Mail"
|
|
||||||
Slave :gmail-local:archive
|
|
||||||
Create Slave
|
|
||||||
|
|
||||||
# Get all the channels together into a group.
|
|
||||||
Group gmail
|
|
||||||
Channel sync-googlemail-default
|
|
||||||
Channel sync-googlemail-sent
|
|
||||||
Channel sync-googlemail-archive
|
|
||||||
|
|
||||||
#Channel gmail
|
|
||||||
#Master :gmail-remote:
|
|
||||||
#Slave :gmail-local:
|
|
||||||
#Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"
|
|
||||||
#Sync Pull
|
|
||||||
#Create Slave
|
|
||||||
#SyncState *
|
|
@ -1,21 +0,0 @@
|
|||||||
defaults
|
|
||||||
auth on
|
|
||||||
tls on
|
|
||||||
tls_trust_file /etc/ssl/cert.pem
|
|
||||||
logfile ~/.msmtp.log
|
|
||||||
|
|
||||||
account moebius
|
|
||||||
host mail.moebiusband.org
|
|
||||||
port 587
|
|
||||||
user jan
|
|
||||||
password {{ (keepassxc "moebiusband.org").Password }}
|
|
||||||
from jan@moebiusband.org
|
|
||||||
|
|
||||||
account fau
|
|
||||||
host groupware.fau.de
|
|
||||||
port 587
|
|
||||||
user unrz254
|
|
||||||
password {{ (keepassxc "IDM FAU").Password }}
|
|
||||||
from jan.eitzinger@fau.de
|
|
||||||
|
|
||||||
account default : moebius
|
|
Loading…
Reference in New Issue
Block a user