OpenBSD config changes

This commit is contained in:
Jan Eitzinger 2024-02-15 09:53:19 +01:00
parent 46097994ca
commit 0c8e3d6444
18 changed files with 1174 additions and 674 deletions

View File

@ -10,6 +10,8 @@ LICENSE
.config/openbox/* .config/openbox/*
.config/nvim/after .config/nvim/after
{{ else }} {{ else }}
lazyvim.json .config/nvim/lazyvim.json
stylua.toml .config/nvim/stylua.toml
.config/nvim/lua/config
.config/nvim/lua/plugins/core.lua
{{ end }} {{ end }}

View File

@ -1,26 +0,0 @@
vim.g.tex_flavor = "latex"
vim.opt_local.conceallevel = 2
-- vim.opt_local.spell = true
vim.opt_local.wrap = true
require("nvim-surround").buffer_setup({
surrounds = {
['"'] = {
add = { "``", "''" },
find = "``.-''",
delete = "^(``)().-('')()$",
},
["$"] = {
add = { "\\(", "\\)" },
find = "\\%(.-\\%)",
delete = "^(\\%()().-(\\%))()$",
change = {
target = "^\\(%()().-(\\%))()$",
replacement = function()
return { { "[", "\t" }, { "", "\\]" } }
end,
},
},
},
})

View File

@ -1,85 +0,0 @@
local ok, cmp = pcall(require, 'cmp')
if not ok then
return
end
require('luasnip.loaders.from_vscode').lazy_load()
local luasnip = require('luasnip')
local lspkind = require('lspkind')
local select_opts = {behavior = cmp.SelectBehavior.Select}
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
sources = {
{name = 'path'},
{name = 'nvim_lsp', keyword_length = 1},
{name = 'buffer', keyword_length = 3},
{name = 'luasnip', keyword_length = 2},
},
window = {
documentation = cmp.config.window.bordered()
},
formatting = {
format = lspkind.cmp_format({
mode = 'symbol_text', -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
})
},
mapping = {
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
['<Down>'] = cmp.mapping.select_next_item(select_opts),
['<C-p>'] = cmp.mapping.select_prev_item(select_opts),
['<C-n>'] = cmp.mapping.select_next_item(select_opts),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-e>'] = cmp.mapping.abort(),
['<C-y>'] = cmp.mapping.confirm({select = true}),
['<CR>'] = cmp.mapping.confirm({select = false}),
['<C-f>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, {'i', 's'}),
['<C-b>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {'i', 's'}),
['<Tab>'] = cmp.mapping(function(fallback)
local col = vim.fn.col('.') - 1
if cmp.visible() then
cmp.select_next_item(select_opts)
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
fallback()
else
cmp.complete()
end
end, {'i', 's'}),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item(select_opts)
else
fallback()
end
end, {'i', 's'}),
},
})

View File

@ -1,220 +0,0 @@
local ok, lsp = pcall(require, 'lspconfig')
if not ok then
return
end
{{- if ne .chezmoi.os "openbsd" }}
-- See :help mason-settings
require('mason').setup({
ui = { border = 'rounded' }
})
-- See :help mason-lspconfig-settings
require('mason-lspconfig').setup({
ensure_installed = {
'clangd',
'gopls',
'ltex',
'marksman',
'svelte',
'tsserver',
'eslint',
'html',
'cssls',
'lua_ls'
}
})
{{- end }}
local lsp_defaults = lsp.util.default_config
lsp_defaults.capabilities = vim.tbl_deep_extend(
'force',
lsp_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
local sign = function(opts)
-- See :help sign_define()
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({ name = 'DiagnosticSignError', text = '✘' })
sign({ name = 'DiagnosticSignWarn', text = '▲' })
sign({ name = 'DiagnosticSignHint', text = '⚑' })
sign({ name = 'DiagnosticSignInfo', text = '' })
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover,
{ border = 'rounded' }
)
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = 'rounded' }
)
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
pcall(vim.diagnostic.reset, ns)
return true
end
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = '*.go',
callback = function()
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
end
})
require("lsp-format").setup {
html = {
exclude = { "html" }
},
svelte = {
exclude = { "svelte" }
}
}
{{- if ne .chezmoi.os "openbsd" }}
local group = vim.api.nvim_create_augroup('lsp_cmds', { clear = true })
vim.api.nvim_create_autocmd('LspAttach', {
group = group,
desc = 'LSP actions',
callback = function(args)
local bufmap = function(mode, lhs, rhs)
local opts = { buffer = true }
vim.keymap.set(mode, lhs, rhs, opts)
end
local client = vim.lsp.get_client_by_id(args.data.client_id)
require("lsp-format").on_attach(client)
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', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_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
})
require('mason-lspconfig').setup_handlers({
function(server)
lsp[server].setup({})
end,
['tsserver'] = function()
lsp.tsserver.setup({
settings = {
completions = {
completeFunctionCalls = true
}
}
})
end,
['lua_ls'] = function()
lsp.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
},
}
}
})
end,
['gopls'] = function()
lsp.gopls.setup({
settings = {
gopls = {
analyses = {
unusedparams = true,
unusedvariable = true,
shadow = true
},
staticcheck = true,
},
}
})
end,
})
{{- else }}
local on_attach = function(client)
local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts)
end
require("lsp-format").on_attach(client)
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', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_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 = {
analyses = {
unusedparams = true,
unusedvariable = true,
shadow = true
},
staticcheck = true,
},
},
on_attach = on_attach
}
lsp.clangd.setup { 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 = {
diagnostics = {
globals = { 'vim' }
},
}
},
on_attach = on_attach
}
{{- end }}

View File

@ -1,76 +0,0 @@
local ok, telekasten = pcall(require, 'telekasten')
local home = vim.fn.expand("~/doc/zettelkasten")
telekasten.setup {
home = home,
take_over_my_home = true,
auto_set_filetype = true,
dailies = home .. '/' .. 'daily',
weeklies = home .. '/' .. 'weekly',
templates = home .. '/' .. 'templates',
image_subdir = "img",
extension = ".md",
new_note_filename = "uuid-title",
uuid_type = "%Y%m%d%H%M",
uuid_sep = "-",
follow_creates_nonexisting = true,
dailies_create_nonexisting = true,
weeklies_create_nonexisting = true,
journal_auto_open = false,
-- template for new notes (new_note, follow_link)
-- set to `nil` or do not specify if you do not want a template
template_new_note = home .. '/' .. 'templates/new_note.md',
-- template for newly created daily notes (goto_today)
-- set to `nil` or do not specify if you do not want a template
template_new_daily = home .. '/' .. 'templates/daily.md',
-- template for newly created weekly notes (goto_thisweek)
-- set to `nil` or do not specify if you do not want a template
template_new_weekly= home .. '/' .. 'templates/weekly.md',
-- image link style
-- wiki: ![[image name]]
-- markdown: ![](image_subdir/xxxxx.png)
image_link_style = "wiki",
-- default sort option: 'filename', 'modified'
sort = "filename",
-- integrate with calendar-vim
plug_into_calendar = true,
calendar_opts = {
weeknm = 4,
calendar_monday = 1,
calendar_mark = 'left-fit',
},
close_after_yanking = false,
insert_after_inserting = true,
tag_notation = "#tag",
command_palette_theme = "dropdown",
show_tags_theme = "ivy",
subdirs_in_links = true,
template_handling = "smart",
new_note_location = "smart",
rename_update_links = true,
follow_url_fallback = nil,
}
local map = vim.keymap.set
map('n',"<leader>zf", "<cmd>Telekasten find_notes<cr>")
map('n',"<leader>zd", "<cmd>Telekasten find_daily_notes<cr>")
map('n',"<leader>zg", "<cmd>Telekasten search_notes<cr>")
map('n',"<leader>zz", "<cmd>Telekasten follow_link<cr>")
map('n',"<leader>zn", "<cmd>Telekasten new_note<cr>")
map('n',"<leader>zr", "<cmd>Telekasten rename_note<cr>")
map('n',"<leader>zc", "<cmd>Telekasten show_calendar<cr>")
map('n',"<leader>#", "<cmd>Telekasten show_tags<cr>")
map('n',"<leader>z", "<cmd>Telekasten panel<cr>")
vim.api.nvim_set_hl(0, "tklink", { fg = "#689d6a", bg = "" })
vim.api.nvim_set_hl(0, "tkBrackets", { fg = "gray", bg = "gray" })

View File

@ -1,34 +0,0 @@
local ok, telescope = pcall(require, 'telescope')
if not ok then
return
end
telescope.setup {
defaults = {
prompt_prefix = ' ',
selection_caret = ' ',
layout_config = { horizontal = { preview_width = 0.5 } },
file_ignore_patterns = { 'node_modules/.*' },
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
}
}
}
telescope.load_extension('fzf')
telescope.load_extension('file_browser')
local map = vim.keymap.set
map('n', "<C-n>", "<cmd>Telescope file_browser<cr>")
map('n', "<C-t>", "<cmd>Telescope current_buffer_tags<cr>")
map('n', "<leader>e", "<cmd>Telescope find_files<cr>")
map('n', "<leader>f", "<cmd>Telescope live_grep<cr>")
map('n', "<leader>b", "<cmd>Telescope buffers<cr>")
map('n', "<leader>h", "<cmd>Telescope help_tags<cr>")
map('n', "z=", "<cmd>Telescope spell_suggest<cr>")

View File

@ -1,94 +0,0 @@
local ok, treesitter = pcall(require, 'nvim-treesitter.configs')
if not ok then
return
end
treesitter.setup {
incremental_selection = {
enable = true,
keymaps = {
-- mappings for incremental selection (visual mappings)
init_selection = "gnn", -- maps in normal mode to init the node/scope selection
node_incremental = "grn", -- increment to the upper named parent
scope_incremental = "grc", -- increment to the upper scope (as defined in locals.scm)
node_decremental = "grm" -- decrement to the previous node
}
},
textobjects = {
-- syntax-aware textobjects
enable = true,
lsp_interop = {
enable = true,
peek_definition_code = {
["DF"] = "@function.outer",
}
},
keymaps = {
["iL"] = {
-- you can define your own textobjects directly here
go = "(function_definition) @function",
},
-- or you use the queries from supported languages with textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["aC"] = "@class.outer",
["iC"] = "@class.inner",
["ac"] = "@conditional.outer",
["ic"] = "@conditional.inner",
["ae"] = "@block.outer",
["ie"] = "@block.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["is"] = "@statement.inner",
["as"] = "@statement.outer",
["ad"] = "@comment.outer",
["am"] = "@call.outer",
["im"] = "@call.inner"
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]]"] = "@function.outer",
["]c"] = { query = "@class.outer", desc = "Next class start" },
--
-- You can use regex matching and/or pass a list in a "query" key to group multiple queires.
["]o"] = "@loop.*",
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } }
--
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
},
goto_next_end = {
["]["] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
["[c"] = "@class.outer",
},
goto_previous_end = {
["[]"] = "@function.outer",
["[C"] = "@class.outer",
}
}
},
ensure_installed = {
'javascript',
'typescript',
'css',
'json',
'c',
'lua',
'go'
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}

View File

@ -1,114 +1,24 @@
{{- if eq .chezmoi.os "openbsd" }} {{- if eq .chezmoi.os "openbsd" }}
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)
HOME = os.getenv("HOME") HOME = os.getenv("HOME")
vim.cmd([[colorscheme gruvbox]])
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = '\\' vim.g.maplocalleader = '\\'
-- Plugins -- Plugins
require "paq" { require("lazy").setup("plugins")
"savq/paq-nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",
-- Theming
"ellisonleao/gruvbox.nvim",
"nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons",
"lukas-reineke/indent-blankline.nvim",
-- LSP support
"onsails/lspkind.nvim",
"lukas-reineke/lsp-format.nvim",
"neovim/nvim-lspconfig",
-- Autocomplete
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
-- Snippets
"L3MON4D3/LuaSnip",
"rafamadriz/friendly-snippets",
-- Programming support
"kylechui/nvim-surround",
"windwp/nvim-autopairs",
"numToStr/Comment.nvim",
"ggandor/leap.nvim",
-- Fuzzy search
{ "nvim-telescope/telescope-fzf-native.nvim", run = "gmake" },
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope.nvim",
"folke/trouble.nvim",
"mfussenegger/nvim-dap",
"theHamsta/nvim-dap-virtual-text",
"rcarriga/nvim-dap-ui",
"norcalli/nvim-colorizer.lua",
"lewis6991/gitsigns.nvim",
"tpope/vim-fugitive",
"renerocksai/telekasten.nvim",
"renerocksai/calendar-vim",
"nvim-lua/plenary.nvim",
"akinsho/toggleterm.nvim",
}
require('nvim-web-devicons').setup {}
require('nvim-surround').setup()
require('Comment').setup()
require('dapui').setup()
require('gitsigns').setup()
require("trouble").setup {}
require('nvim-autopairs').setup({
fast_wrap = {},
check_ts = true
})
require('leap').add_default_mappings()
require 'colorizer'.setup {
filetypes = {
'css',
'javascript',
scss = { rgb_fn = true, },
html = { mode = 'foreground', }
},
}
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'gruvbox',
component_separators = '|',
section_separators = '',
}
}
require('indent_blankline').setup({
char = '▏',
show_trailing_blankline_indent = false,
show_first_indent_level = false,
use_treesitter = true,
show_current_context = false
})
require('toggleterm').setup({
open_mapping = '<C-g>',
direction = 'horizontal',
shade_terminals = true
})
require("gruvbox").setup {
contrast = "hard"
}
-- Options -- Options
local o = vim.opt local o = vim.opt
@ -290,12 +200,6 @@ map('n', '<down>', '<cmd>resize +2<CR>')
map('n', '<left>', '<cmd>vertical resize -2<CR>') map('n', '<left>', '<cmd>vertical resize -2<CR>')
map('n', '<right>', '<cmd>vertical resize +2<CR>') map('n', '<right>', '<cmd>vertical resize +2<CR>')
-- Trouble keymap
map('n', '<leader>xx', '<cmd>TroubleToggle<cr>', { noremap = true, silent = true })
map('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>', { noremap = true, silent = true })
map('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>', { noremap = true, silent = true })
map('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', { noremap = true, silent = true })
map('n', '<leader>g', '<cmd>vertical rightbelow Git<cr>', { noremap = true, silent = true }) map('n', '<leader>g', '<cmd>vertical rightbelow Git<cr>', { noremap = true, silent = true })
{{ else }} {{ else }}
-- bootstrap lazy.nvim, LazyVim and your plugins -- bootstrap lazy.nvim, LazyVim and your plugins

View File

@ -0,0 +1,213 @@
return {
-- snippets
{
"L3MON4D3/LuaSnip",
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"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
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" } },
},
},
-- auto completion
{
"hrsh7th/nvim-cmp",
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 luasnip = require('luasnip')
local lspkind = require('lspkind')
local cmp = require("cmp")
local defaults = require("cmp.config.default")()
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("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 = lspkind.cmp_format({
mode = 'symbol_text', -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
})
},
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,
},
-- auto pairs
{
"echasnovski/mini.pairs",
event = "VeryLazy",
opts = {},
keys = {
{
"<leader>up",
function()
local Util = require("lazy.core.util")
vim.g.minipairs_disable = not vim.g.minipairs_disable
if vim.g.minipairs_disable then
Util.warn("Disabled auto pairs", { title = "Option" })
else
Util.info("Enabled auto pairs", { title = "Option" })
end
end,
desc = "Toggle auto pairs",
},
},
},
-- Fast and feature-rich surround actions. For text that includes
-- surrounding characters like brackets or quotes, this allows you
-- to select the text inside, change or modify the surrounding characters,
-- and more.
{
"echasnovski/mini.surround",
keys = function(_, keys)
-- Populate the keys based on the user's options
local plugin = require("lazy.core.config").spec.plugins["mini.surround"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
local mappings = {
{ opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } },
{ opts.mappings.delete, desc = "Delete surrounding" },
{ opts.mappings.find, desc = "Find right surrounding" },
{ opts.mappings.find_left, desc = "Find left surrounding" },
{ opts.mappings.highlight, desc = "Highlight surrounding" },
{ opts.mappings.replace, desc = "Replace surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
return m[1] and #m[1] > 0
end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
mappings = {
add = "gsa", -- Add surrounding in Normal and Visual modes
delete = "gsd", -- Delete surrounding
find = "gsf", -- Find surrounding (to the right)
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
replace = "gsr", -- Replace surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
},
},
-- comments
{
"JoosepAlviste/nvim-ts-context-commentstring",
lazy = true,
opts = {
enable_autocmd = false,
},
},
{
"echasnovski/mini.comment",
event = "VeryLazy",
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo
.commentstring
end,
},
},
},
-- Better text-objects
{
"echasnovski/mini.ai",
-- keys = {
-- { "a", mode = { "x", "o" } },
-- { "i", mode = { "x", "o" } },
-- },
opts = function()
local ai = require("mini.ai")
return {
n_lines = 500,
custom_textobjects = {
o = ai.gen_spec.treesitter({
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
}, {}),
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
},
}
end,
config = function(_, opts)
require("mini.ai").setup(opts)
end,
},
}

View File

@ -1,20 +0,0 @@
return {
-- gruvbox
{
"ellisonleao/gruvbox.nvim",
opts = { contrast = "hard" },
},
-- kanagawa
{
"rebelot/kanagawa.nvim",
},
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "kanagawa",
},
},
}

View File

@ -0,0 +1,28 @@
return {
-- gruvbox
{
"ellisonleao/gruvbox.nvim",
opts = { contrast = "hard" },
},
{{- if eq .chezmoi.os "openbsd" }}
-- kanagawa
{
"rebelot/kanagawa.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
vim.cmd([[colorscheme kanagawa]])
end,
},
{{- else }}
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "kanagawa",
},
},
{{- end }}
}

View File

@ -0,0 +1,270 @@
return {
-- Fuzzy finder.
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
"nvim-telescope/telescope-file-browser.nvim",
},
keys = {
{ "<C-n>", "<cmd>Telescope file_browser<cr>", desc = "File browser" },
{ "<leader>e", "<cmd>Telescope find_files<cr>", desc = "Find file" },
{ "<leader>b", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>f", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
{ "<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
},
opts = function()
local actions = require("telescope.actions")
local open_with_trouble = function(...)
return require("trouble.providers.telescope").open_with_trouble(...)
end
local open_selected_with_trouble = function(...)
return require("trouble.providers.telescope").open_selected_with_trouble(...)
end
return {
defaults = {
prompt_prefix = "",
selection_caret = "",
layout_config = { horizontal = { preview_width = 0.5 } },
file_ignore_patterns = { 'node_modules/.*' },
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
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,
},
-- add telescope-fzf-native
{
"telescope.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "gmake",
config = function()
require("telescope").load_extension("fzf")
end,
},
},
-- 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,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
-- buffer remove
{
"echasnovski/mini.bufremove",
keys = {
{
"<leader>bd",
function()
local bd = require("mini.bufremove").delete
if vim.bo.modified then
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()),
"&Yes\n&No\n&Cancel")
if choice == 1 then -- Yes
vim.cmd.write()
bd(0)
elseif choice == 2 then -- No
bd(0, true)
end
else
bd(0)
end
end,
desc = "Delete Buffer",
},
-- stylua: ignore
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
},
},
-- better diagnostics list and others
{
"folke/trouble.nvim",
cmd = { "TroubleToggle", "Trouble" },
opts = { use_diagnostic_signs = true },
keys = {
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
{
"[q",
function()
if require("trouble").is_open() then
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/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
config = true,
-- stylua: ignore
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
{ "<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" },
},
},
}

View File

@ -0,0 +1,157 @@
return {
-- lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"onsails/lspkind.nvim",
"lukas-reineke/lsp-format.nvim",
},
opts = {
-- options for vim.diagnostic.config()
diagnostics = {
underline = true,
update_in_insert = false,
virtual_text = {
spacing = 4,
source = "if_many",
prefix = "",
-- 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
-- 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)
local lsp= require('lspconfig')
local lsp_defaults = lsp.util.default_config
lsp_defaults.capabilities = vim.tbl_deep_extend(
'force',
lsp_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
local sign = function(o)
-- See :help sign_define()
vim.fn.sign_define(o.name, {
texthl = o.name,
text = o.text,
numhl = ''
})
end
sign({ name = 'DiagnosticSignError', text = '' })
sign({ name = 'DiagnosticSignWarn', text = '' })
sign({ name = 'DiagnosticSignHint', text = '' })
sign({ name = 'DiagnosticSignInfo', text = '' })
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover,
{ border = 'rounded' }
)
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = 'rounded' }
)
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
pcall(vim.diagnostic.reset, ns)
return true
end
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = '*.go',
callback = function()
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
end
})
require("lsp-format").setup {
html = {
exclude = { "html" }
}
}
local on_attach = function(client)
local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts)
end
require("lsp-format").on_attach(client)
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', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_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 = {
analyses = {
unusedparams = true,
unusedvariable = true,
shadow = true
},
staticcheck = true,
},
},
on_attach = on_attach
}
lsp.clangd.setup { 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 = {
diagnostics = {
globals = { 'vim' }
},
}
},
on_attach = on_attach
}
end
}
}

View File

@ -9,10 +9,10 @@ return {
opts = { opts = {
take_over_my_home = true, take_over_my_home = true,
auto_set_filetype = true, auto_set_filetype = true,
home = "/Users/jan/doc/zettelkasten", home = "{{ .home }}/doc/zettelkasten",
dailies = "/Users/jan/doc/zettelkasten/daily", dailies = "{{ .home }}/doc/zettelkasten/daily",
weeklies = "/Users/jan/doc/zettelkasten/weekly", weeklies = "{{ .home }}/doc/zettelkasten/weekly",
templates = "/Users/jan/doc/zettelkasten/templates", templates = "{{ .home }}/doc/zettelkasten/templates",
image_subdir = "img", image_subdir = "img",
extension = ".md", extension = ".md",
new_note_filename = "uuid-title", new_note_filename = "uuid-title",
@ -25,15 +25,15 @@ return {
-- template for new notes (new_note, follow_link) -- template for new notes (new_note, follow_link)
-- set to `nil` or do not specify if you do not want a template -- set to `nil` or do not specify if you do not want a template
template_new_note = "/Users/jan/doc/zettelkasten/templates/new_note.md", template_new_note = "{{ .home }}/doc/zettelkasten/templates/new_note.md",
-- template for newly created daily notes (goto_today) -- template for newly created daily notes (goto_today)
-- set to `nil` or do not specify if you do not want a template -- set to `nil` or do not specify if you do not want a template
template_new_daily = "/Users/jan/doc/zettelkasten/templates/daily.md", template_new_daily = "{{ .home }}/doc/zettelkasten/templates/daily.md",
-- template for newly created weekly notes (goto_thisweek) -- template for newly created weekly notes (goto_thisweek)
-- set to `nil` or do not specify if you do not want a template -- set to `nil` or do not specify if you do not want a template
template_new_weekly = "/Users/jan/doc/zettelkasten/templates/weekly.md", template_new_weekly = "{{ .home }}/doc/zettelkasten/templates/weekly.md",
-- image link style -- image link style
-- wiki: ![[image name]] -- wiki: ![[image name]]

View File

@ -0,0 +1,103 @@
return {
-- Treesitter is a new parser generator tool that we can
-- use in Neovim to power faster and more accurate
-- syntax highlighting.
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = { "VeryLazy" },
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
config = function()
-- When in diff mode, we want to use the default
-- vim text objects c & C instead of the treesitter ones.
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
local configs = require("nvim-treesitter.configs")
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(q, ...)
if vim.wo.diff then
local config = configs.get_module("textobjects.move")
[name] ---@type table<string,string>
for key, query in pairs(config or {}) do
if q == query and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
return
end
end
end
return fn(q, ...)
end
end
end
end,
},
},
cmd = { "TSUpdateSync" },
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
require("nvim-treesitter.configs").setup(opts)
end,
},
}

View File

@ -0,0 +1,235 @@
return {
-- Better `vim.notify()`
{
"rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Dismiss all Notifications",
},
},
opts = {
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
},
},
-- better vim.ui
{
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
-- statusline
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
init = function()
vim.g.lualine_laststatus = vim.o.laststatus
vim.o.laststatus = 0
end,
opts = {
icons_enabled = true,
theme = 'auto',
component_separators = '|',
section_separators = '',
},
},
-- indent guides for Neovim
-- {
-- "lukas-reineke/indent-blankline.nvim",
-- opts = {
-- indent = {
-- char = "│",
-- tab_char = "│",
-- },
-- scope = { enabled = false },
-- exclude = {
-- filetypes = {
-- "help",
-- "alpha",
-- "dashboard",
-- "neo-tree",
-- "Trouble",
-- "lazy",
-- "mason",
-- "notify",
-- "toggleterm",
-- "lazyterm",
-- },
-- },
-- },
-- main = "ibl",
-- },
-- Active indent guide and indent text objects. When you're browsing
-- code, this highlights the current level of indentation, and animates
-- the highlighting.
{
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
opts = {
-- symbol = "▏",
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
-- Displays a popup with possible key bindings of the command you started typing
{
"folke/which-key.nvim",
opts = function(_, opts)
opts.defaults["<leader>sn"] = { name = "+noice" }
end,
},
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = true,
},
},
-- stylua: ignore
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{
"<leader>snl",
function() require("noice").cmd("last") end,
desc =
"Noice Last Message"
},
{
"<leader>snh",
function() require("noice").cmd("history") end,
desc =
"Noice History"
},
{
"<leader>sna",
function() require("noice").cmd("all") end,
desc =
"Noice All"
},
{
"<leader>snd",
function() require("noice").cmd("dismiss") end,
desc =
"Dismiss All"
},
{
"<c-f>",
function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end,
silent = true,
expr = true,
desc =
"Scroll forward",
mode = {
"i", "n", "s" }
},
{
"<c-b>",
function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end,
silent = true,
expr = true,
desc =
"Scroll backward",
mode = {
"i", "n", "s" }
},
},
},
-- -- lsp symbol navigation for lualine. This shows where
-- in the code structure you are - within functions, classes,
-- etc - in the statusline.
{
"SmiteshP/nvim-navic",
lazy = true,
opts = function()
return {
separator = " ",
highlight = true,
depth_limit = 5,
lazy_update_context = true,
}
end,
},
-- icons
{ "nvim-tree/nvim-web-devicons", lazy = true },
-- ui components
{ "MunifTanjim/nui.nvim", lazy = true },
}

142
dot_mbsyncrc Normal file
View File

@ -0,0 +1,142 @@
#################################
###### 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
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
PassCmd "gopass show sso/rrze"
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 *

View File

@ -40,5 +40,6 @@ xidle -timeout 300 -program "/usr/local/bin/slock" &
xrdb -merge $HOME/.Xresources xrdb -merge $HOME/.Xresources
xsetroot -solid "#282828" xsetroot -solid "#282828"
urxvtd -q -f -o urxvtd -q -f -o
tint2&
exec openbox exec openbox