vim update
This commit is contained in:
parent
bcc5e8ce98
commit
f44e1cdc22
@ -26,9 +26,12 @@
|
||||
|
||||
- link:
|
||||
~/.config/zsh/.zshrc: zsh/zshrc
|
||||
~/.config/nvim/init.lua: nvim/init.lua
|
||||
~/.config/nvim/lua: nvim/lua
|
||||
~/.config/nvim/UltiSnips: nvim/ultisnips
|
||||
# ~/.config/nvim/init.lua: nvim/init.lua
|
||||
# ~/.config/nvim/lua: nvim/lua
|
||||
# ~/.config/nvim/UltiSnips: nvim/ultisnips
|
||||
~/.config/nvim/init.lua: nvim-lazy-profile/init.lua
|
||||
~/.config/nvim/lua: nvim-lazy-profile/lua
|
||||
~/.config/nvim/UltiSnips: nvim-lazy-profile/ultisnips
|
||||
~/.config/gtk-3.0/gtk.css: gtk/gtk.css
|
||||
~/.config/gtk-3.0/settings.ini: gtk/settings.ini
|
||||
~/.config/gtk-3.0/gnome-applications.css: gtk/gnome-applications.css
|
||||
|
||||
21
nvim-lazy-profile/init.lua
Normal file
21
nvim-lazy-profile/init.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- bootstrap lazy.nvim
|
||||
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",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("pre")
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
require("options")
|
||||
286
nvim-lazy-profile/lua/lsp.lua
Normal file
286
nvim-lazy-profile/lua/lsp.lua
Normal file
@ -0,0 +1,286 @@
|
||||
local lspconfig = vim.lsp.config
|
||||
local util = vim.lsp.config.util
|
||||
|
||||
local lspstatus = require('lsp-status')
|
||||
lspstatus.register_progress()
|
||||
|
||||
local function find_repo_root(names)
|
||||
local config = names.configfiles
|
||||
local function matcher(filename, _bufnr)
|
||||
local gitroot = util.root_pattern('.git')(filename)
|
||||
if gitroot then
|
||||
for _, file in ipairs(config) do
|
||||
if util.path.is_file(util.path.join(gitroot, file)) then
|
||||
return gitroot
|
||||
end
|
||||
end
|
||||
end
|
||||
return util.root_pattern(unpack(config))(filename)
|
||||
end
|
||||
|
||||
return matcher
|
||||
end
|
||||
|
||||
local lsp_confs = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
-- Settings for working with nvim (copied from https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#sumneko_lua)
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
solidity_ls = {},
|
||||
coq_lsp = {},
|
||||
racket_langserver = {},
|
||||
ocamllsp = {},
|
||||
rust_analyzer = {
|
||||
cmd_env = {
|
||||
CARGO_TARGET_DIR = "/tmp/rust-analyzer"
|
||||
},
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = true,
|
||||
-- checkOnSave = {
|
||||
-- command = "clippy",
|
||||
-- allTargets = false,
|
||||
-- },
|
||||
cargo = {
|
||||
features = "all",
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
ccls = {},
|
||||
jedi_language_server = {
|
||||
filetypes = { "python", "sage.python" },
|
||||
},
|
||||
gopls = {},
|
||||
dartls = {},
|
||||
ts_ls = {
|
||||
root_dir = find_repo_root({
|
||||
configfiles = { "tsconfig.json", "jsconfig.json", "package.json" }
|
||||
}),
|
||||
},
|
||||
denols = {
|
||||
root_dir = find_repo_root({
|
||||
configfiles = { "deno.json", "deno.jsonc" }
|
||||
}),
|
||||
},
|
||||
astro = {
|
||||
root_dir = find_repo_root({
|
||||
configfiles = { "astro.config.mjs" }
|
||||
}),
|
||||
},
|
||||
-- nargo = {
|
||||
-- root_dir = find_repo_root({
|
||||
-- configfiles = { "Nargo.toml" }
|
||||
-- }),
|
||||
-- },
|
||||
eslint = {
|
||||
root_dir = find_repo_root({
|
||||
configfiles = { ".eslintrc", ".eslintrc.js", "package.json" }
|
||||
}),
|
||||
on_new_config = function(config, new_root_dir)
|
||||
local default_config = vim.lsp.config.eslint.default_config
|
||||
default_config.on_new_config(config, new_root_dir)
|
||||
|
||||
local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs')
|
||||
local pnp_js = util.path.join(new_root_dir, '.pnp.js')
|
||||
if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then
|
||||
config.cmd = { 'yarn', 'exec', unpack(default_config.cmd) }
|
||||
end
|
||||
end
|
||||
},
|
||||
svelte = {},
|
||||
svls = {},
|
||||
}
|
||||
|
||||
local lsp_special_setup = {
|
||||
}
|
||||
|
||||
local function on_attach(client, _bufnr)
|
||||
lspstatus.on_attach(client)
|
||||
end
|
||||
|
||||
|
||||
for server, conf in pairs(lsp_confs) do
|
||||
local source_on_attach = conf.on_attach
|
||||
if source_on_attach == nil then
|
||||
conf.on_attach = on_attach
|
||||
else
|
||||
conf.on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
source_on_attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
conf.capabilities = vim.tbl_deep_extend(
|
||||
"keep",
|
||||
conf.capabilities or {},
|
||||
lspstatus.capabilities
|
||||
)
|
||||
|
||||
local final_config = coq.lsp_ensure_capabilities(conf)
|
||||
-- local final_config = conf
|
||||
|
||||
local special_setup = lsp_special_setup[server]
|
||||
if special_setup then
|
||||
special_setup(final_config)
|
||||
else
|
||||
-- lspconfig[server].setup(final_config)
|
||||
vim.lsp.config[server] = final_config
|
||||
vim.lsp.enable(server)
|
||||
-- lspconfig(server, final_config)
|
||||
-- vim.lsp.enable(server)
|
||||
end
|
||||
end
|
||||
|
||||
-- local null_ls = require('null-ls')
|
||||
-- null_ls.setup({
|
||||
-- sources = {
|
||||
-- -- null_ls.builtins.diagnostics.chktex,
|
||||
-- null_ls.builtins.diagnostics.cppcheck,
|
||||
-- null_ls.builtins.diagnostics.shellcheck,
|
||||
--
|
||||
-- null_ls.builtins.code_actions.gitsigns,
|
||||
-- },
|
||||
-- })
|
||||
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
update_in_insert = true,
|
||||
float = {
|
||||
source = true,
|
||||
},
|
||||
})
|
||||
|
||||
do -- signs
|
||||
local signs = {
|
||||
{ 'DiagnosticSignError', text = '×', texthl = 'DiagnosticSignError' },
|
||||
{ 'DiagnosticSignWarn', text = '>', texthl = 'DiagnosticSignWarn' },
|
||||
{ 'DiagnosticSignInfo', text = 'I', texthl = 'DiagnosticSignInfo' },
|
||||
{ 'DiagnosticSignHint', text = 'H', texthl = 'DiagnosticSignHint' },
|
||||
}
|
||||
for _, sign in pairs(signs) do
|
||||
local name = sign[1]
|
||||
local opts = sign
|
||||
opts[1] = nil
|
||||
vim.fn.sign_define(name, opts)
|
||||
end
|
||||
end
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
map(
|
||||
'n',
|
||||
'K',
|
||||
[[luaeval('next(vim.lsp.buf_get_clients()) == nil') ? 'K' : '<Cmd>lua vim.lsp.buf.hover()<CR>']],
|
||||
{ noremap = true, expr = true }
|
||||
)
|
||||
map(
|
||||
'n',
|
||||
'<C-]>',
|
||||
[[luaeval('next(vim.lsp.buf_get_clients()) == nil') ? '<C-]>' : '<Cmd>lua vim.lsp.buf.definition()<CR>']],
|
||||
{ noremap = true, expr = true }
|
||||
)
|
||||
|
||||
local M = {}
|
||||
|
||||
-- enables formatting on save
|
||||
M.format_on_save_hook = function()
|
||||
local enabled = vim.b.format_on_save
|
||||
if enabled == nil then
|
||||
enabled = true
|
||||
end
|
||||
if enabled ~= 0 and enabled ~= false then
|
||||
if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" and
|
||||
vim.bo.filetype ~= "qf" and vim.bo.filetype ~= "bib" and vim.bo.filetype ~= "" and vim.bo.filetype ~= "pdf"
|
||||
and vim.bo.filetype ~= "conf" and vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= "lazy" and vim.bo.filetype ~= "lazy_backdrop" and vim.bo.filetype ~= "TelescopeResults" then
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vim.cmd [[
|
||||
augroup hoverlspconfig
|
||||
au!
|
||||
" diagnostic on hover
|
||||
au BufWritePre * lua require'lsp'.format_on_save_hook()
|
||||
au CursorHold * lua vim.diagnostic.open_float({focus = false})
|
||||
augroup END
|
||||
]]
|
||||
|
||||
-- enables coq
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'FileType',
|
||||
}, {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" and
|
||||
vim.bo.filetype ~= "qf" and vim.bo.filetype ~= "bib" and vim.bo.filetype ~= "" and vim.bo.filetype ~= "pdf"
|
||||
and vim.bo.filetype ~= "conf" and vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= "lazy" and vim.bo.filetype ~= "lazy_backdrop" and vim.bo.filetype ~= "TelescopeResults" then
|
||||
vim.cmd([[ :COQnow -s ]])
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- toggles folds
|
||||
map('n', '<Leader>pc', 'za', { noremap = true })
|
||||
|
||||
-- folds and treesitter
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { '*' },
|
||||
callback = function()
|
||||
if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" and
|
||||
vim.bo.filetype ~= "qf" and vim.bo.filetype ~= "bib" and vim.bo.filetype ~= "" and vim.bo.filetype ~= "pdf"
|
||||
and vim.bo.filetype ~= "conf" and vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= "lazy" and vim.bo.filetype ~= "lazy_backdrop" and vim.bo.filetype ~= "TelescopeResults" then
|
||||
vim.treesitter.start()
|
||||
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo[0][0].foldmethod = 'expr'
|
||||
vim.wo[0][0].foldenable = true
|
||||
vim.wo[0][0].foldlevel = 99
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do
|
||||
local default_diagnostic_handler = vim.lsp.handlers[method]
|
||||
vim.lsp.handlers[method] = function(err, result, context, config)
|
||||
if err ~= nil and err.code == -32802 then
|
||||
return
|
||||
end
|
||||
return default_diagnostic_handler(err, result, context, config)
|
||||
end
|
||||
end
|
||||
|
||||
-- vim.api.nvim_create_autocmd({ 'FileType', 'BufRead', 'BufReadPre', 'BufReadPost', 'BufWrite', 'BufWritePre',
|
||||
-- 'BufWritePost' }, {
|
||||
-- pattern = "*",
|
||||
-- callback = function()
|
||||
-- if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" then
|
||||
-- vim.cmd [[ :COQnow -s ]]
|
||||
-- end
|
||||
-- end
|
||||
-- })
|
||||
|
||||
-- vim.cmd [[
|
||||
-- augroup disabletexlsp
|
||||
-- autocmd!
|
||||
-- autocmd FileType tex :COQstop
|
||||
-- augroup END
|
||||
-- ]]
|
||||
|
||||
return M
|
||||
417
nvim-lazy-profile/lua/markdownStyle.css
Normal file
417
nvim-lazy-profile/lua/markdownStyle.css
Normal file
@ -0,0 +1,417 @@
|
||||
/* weird look: plantuml, mermaid
|
||||
* flowchart looks ok ok
|
||||
* Code highlights (highlight.js / hljs) incorrect, not base16
|
||||
*/
|
||||
|
||||
body { background-color: var(--background); }
|
||||
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ul ol,
|
||||
.markdown-body ol ul,
|
||||
.markdown-body ul ul,
|
||||
.markdown-body ol ul ol,
|
||||
.markdown-body ul ul ol,
|
||||
.markdown-body ol ul ul,
|
||||
.markdown-body ul ul ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body {
|
||||
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 16px;
|
||||
color: var(--foreground);
|
||||
line-height: 1.6;
|
||||
word-wrap: break-word;
|
||||
padding: 45px;
|
||||
background: var(--background);
|
||||
border: 0px solid var(--foreground);
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.markdown-body > *:first-child {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
.markdown-body > *:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.markdown-body .table-of-contents ol {
|
||||
list-style: none;
|
||||
}
|
||||
.markdown-body .table-of-contents > ol {
|
||||
padding-left: 0;
|
||||
}
|
||||
.markdown-body * {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3,
|
||||
.markdown-body h4,
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 16px;
|
||||
font-weight: bold;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.markdown-body h1 .anchor,
|
||||
.markdown-body h2 .anchor,
|
||||
.markdown-body h3 .anchor,
|
||||
.markdown-body h4 .anchor,
|
||||
.markdown-body h5 .anchor,
|
||||
.markdown-body h6 .anchor {
|
||||
margin-left: -24px;
|
||||
visibility: hidden;
|
||||
}
|
||||
.markdown-body h1:hover .anchor,
|
||||
.markdown-body h2:hover .anchor,
|
||||
.markdown-body h3:hover .anchor,
|
||||
.markdown-body h4:hover .anchor,
|
||||
.markdown-body h5:hover .anchor,
|
||||
.markdown-body h6:hover .anchor {
|
||||
visibility: visible;
|
||||
}
|
||||
.markdown-body p,
|
||||
.markdown-body blockquote,
|
||||
.markdown-body ul,
|
||||
.markdown-body ol,
|
||||
.markdown-body dl,
|
||||
.markdown-body table,
|
||||
.markdown-body pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
background-color: var(--background) !important; /* Changes background of code block */
|
||||
}
|
||||
.markdown-body h1 {
|
||||
margin: 0.67em 0;
|
||||
padding-bottom: 0.3em;
|
||||
font-size: 2.25em;
|
||||
line-height: 1.2;
|
||||
border-bottom: 1px solid var(--color4);
|
||||
color: var(--color13) !important;
|
||||
}
|
||||
.markdown-body h2 {
|
||||
padding-bottom: 0.3em;
|
||||
font-size: 1.75em;
|
||||
line-height: 1.225;
|
||||
border-bottom: 1px solid var(--color4);
|
||||
color: var(--color12) !important;
|
||||
}
|
||||
.markdown-body h3 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.43;
|
||||
}
|
||||
.markdown-body h4 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h5 {
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h6 {
|
||||
font-size: 1em;
|
||||
color: var(--color8) !important;
|
||||
}
|
||||
.markdown-body hr {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
height: 0;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--color4);
|
||||
}
|
||||
.markdown-body ol,
|
||||
.markdown-body ul {
|
||||
padding-left: 2em;
|
||||
}
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ul ol {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
.markdown-body ol ul,
|
||||
.markdown-body ul ul {
|
||||
list-style-type: circle;
|
||||
}
|
||||
.markdown-body ol ul ul,
|
||||
.markdown-body ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
.markdown-body ol {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.markdown-body ul {
|
||||
list-style-type: disc;
|
||||
/* color: var(--color9) !important; */ /* changes color of all bullet lists */
|
||||
}
|
||||
li::marker {
|
||||
color: var(--color14) !important; /* changes color of bullet points */
|
||||
}
|
||||
.markdown-body dl {
|
||||
margin-bottom: 1.3em
|
||||
}
|
||||
.markdown-body dl dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
.markdown-body dl dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
.markdown-body dl dd p {
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
.markdown-body blockquote {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding: 0 15px;
|
||||
color: var(--color8) !important;
|
||||
border-left: 4px solid var(--color3) !important; /* border denoting block quote */
|
||||
}
|
||||
.markdown-body table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
word-break: normal;
|
||||
word-break: keep-all;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.markdown-body table tr {
|
||||
background-color: var(--background) !important; /* Changes bacground color of tables */
|
||||
border-top: 1px solid var(--color4);
|
||||
}
|
||||
.markdown-body table tr:nth-child(2n) {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.markdown-body table th,
|
||||
.markdown-body table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid var(--color4); /* color of table cells/border */
|
||||
}
|
||||
.markdown-body pre {
|
||||
word-wrap: normal;
|
||||
padding: 16px;
|
||||
overflow: auto;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
background-color: #f7f7f7;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.markdown-body pre code {
|
||||
display: inline;
|
||||
max-width: initial;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: initial;
|
||||
font-size: 100%;
|
||||
line-height: inherit;
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
background-color: transparent;
|
||||
}
|
||||
.markdown-body pre code:before,
|
||||
.markdown-body pre code:after {
|
||||
content: normal;
|
||||
}
|
||||
.markdown-body code {
|
||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
padding: 0;
|
||||
padding-top: 0.2em;
|
||||
padding-bottom: 0.2em;
|
||||
margin: 0;
|
||||
font-size: 85%;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.markdown-body code:before,
|
||||
.markdown-body code:after {
|
||||
letter-spacing: -0.2em;
|
||||
content: "\00a0";
|
||||
}
|
||||
.markdown-body a {
|
||||
color: var(--color2) !important; /* Change style of hyperlinks */
|
||||
text-decoration: underline;
|
||||
background: transparent;
|
||||
}
|
||||
.markdown-body img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
.markdown-body strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-body em {
|
||||
font-style: italic;
|
||||
}
|
||||
.markdown-body del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.task-list-item {
|
||||
list-style-type: none;
|
||||
}
|
||||
.task-list-item input {
|
||||
font: 13px/1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
margin: 0 0.35em 0.25em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.task-list-item input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
.task-list-item input[type="checkbox"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
.task-list-item input[type="radio"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/* Below are the page settings */
|
||||
|
||||
#page-ctn {
|
||||
margin: 0 auto;
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
#page-header {
|
||||
padding: 8px;
|
||||
background-color: var(--background) !important;
|
||||
border-color: var(--foreground) !important;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 0;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
#page-header svg {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
overflow: hidden;
|
||||
fill: var(--foreground) !important;
|
||||
}
|
||||
|
||||
#page-header h3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-right: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--foreground) !important;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Highlight settings */
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
/* color: #333; */
|
||||
color: var(--color7) !important;
|
||||
background: var(--background) !important;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: var(--color8) !important; /* color of comments */
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-subst {
|
||||
color: var(--color4) !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-literal,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-tag .hljs-attr {
|
||||
color: var(--color5) !important;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-doctag {
|
||||
color: var(--color1) !important;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-selector-id {
|
||||
color: var(--color3) !important; /* Color of function title */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-subst {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-type,
|
||||
.hljs-class .hljs-title {
|
||||
color: var(--color2) !important; /* Color of class title */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-tag,
|
||||
.hljs-name,
|
||||
.hljs-attribute {
|
||||
font-weight: normal;
|
||||
color: var(--color6) !important; /* Color of XML/HTML tags */
|
||||
}
|
||||
|
||||
.hljs-regexp,
|
||||
.hljs-link {
|
||||
/* color: #009926; */
|
||||
color: var(--color9) !important;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet {
|
||||
/* color: #990073; */
|
||||
color: var(--color10) !important;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name {
|
||||
/* color: #0086b3; */
|
||||
color: var(--color12) !important;
|
||||
}
|
||||
|
||||
.hljs-meta {
|
||||
color: var(--color8) !important; /* Color of meta tags */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: var(--color3);
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.katex-html {
|
||||
color: var(--color7);
|
||||
}
|
||||
73
nvim-lazy-profile/lua/options.lua
Normal file
73
nvim-lazy-profile/lua/options.lua
Normal file
@ -0,0 +1,73 @@
|
||||
local o = vim.opt
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
o.expandtab = true
|
||||
o.tabstop = 4
|
||||
o.shiftwidth = 0
|
||||
o.viminfo = ''
|
||||
vim.g.base16colorspace = 256
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
o.termguicolors = true
|
||||
|
||||
vim.b.coqtail_coq_prog = "coqidetop"
|
||||
|
||||
vim.cmd [[
|
||||
augroup spellcheck
|
||||
au!
|
||||
au FileType markdown setlocal spell
|
||||
au FileType plaintex setlocal spell
|
||||
au FileType tex setlocal spell
|
||||
au FileType latex setlocal spell
|
||||
au BufRead,BufNewFile *.md setlocal spell
|
||||
au BufRead,BufNewFile *.tex setlocal spell
|
||||
augroup END
|
||||
]]
|
||||
|
||||
o.spelllang = "en_us"
|
||||
map('i', '<C-L>', '<c-g>u<Esc>[s1z=`]a<c-g>u', { noremap = true })
|
||||
|
||||
vim.cmd('colorscheme theme-nvim')
|
||||
vim.g.airline_theme = 'theme'
|
||||
vim.cmd("AirlineTheme theme")
|
||||
|
||||
-- stupid fix for stupid problems i guess
|
||||
vim.g["airline#extensions#whitespace#enabled"] = false
|
||||
|
||||
local color = require('base16-colorscheme').colors.base02
|
||||
|
||||
vim.api.nvim_set_hl(0, 'LineNr', { fg = color, bg = "none" })
|
||||
|
||||
map('n', '<Leader>s', ':%s//g<Left><Left>', {})
|
||||
map('n', '<Leader>e', ':make!<CR>', { noremap = true })
|
||||
map('n', '<C-o>', ':cclose<CR>', { noremap = true })
|
||||
map('n', '<C-L>', ':nohlsearch<CR><C-L>', { noremap = true, silent = true })
|
||||
map('n', ';', ':', { noremap = true })
|
||||
map('v', ';', ':', { noremap = true })
|
||||
|
||||
for i = 1, 9, 1 do
|
||||
map('', '<Leader>' .. tostring(i), tostring(i) .. 'gt', { noremap = true })
|
||||
end
|
||||
|
||||
map('n', '<C-Left>', ':tabprevious<CR>', { noremap = true })
|
||||
map('n', '<C-Right>', ':tabnext<CR>', { noremap = true })
|
||||
map('', '<Leader>0', ':tablast<CR>', { noremap = true })
|
||||
map('n', 'ZX', '<Cmd>q<CR>', { noremap = true, silent = true })
|
||||
|
||||
map('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
|
||||
|
||||
o.list = true
|
||||
o.listchars = {
|
||||
tab = '▸ ',
|
||||
eol = '¬',
|
||||
trail = '·',
|
||||
extends = '›'
|
||||
}
|
||||
|
||||
|
||||
vim.cmd [[
|
||||
augroup options_guicursor
|
||||
au!
|
||||
" Reset to vertical cursor for terminal nvim (https://github.com/neovim/neovim/issues/4867#issuecomment-291249173)
|
||||
au VimLeave * set guicursor=a:ver90
|
||||
augroup END
|
||||
]]
|
||||
385
nvim-lazy-profile/lua/plugins/init.lua
Normal file
385
nvim-lazy-profile/lua/plugins/init.lua
Normal file
@ -0,0 +1,385 @@
|
||||
local function import(name)
|
||||
return function()
|
||||
require(name)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
{
|
||||
"RRethy/base16-nvim",
|
||||
},
|
||||
|
||||
{
|
||||
"vim-airline/vim-airline",
|
||||
dependencies = {
|
||||
"ryanoasis/vim-devicons",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"mustache/vim-mustache-handlebars",
|
||||
},
|
||||
|
||||
{
|
||||
"whonore/Coqtail",
|
||||
},
|
||||
|
||||
{
|
||||
"Julian/lean.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("lean").setup({
|
||||
opts = { mappings = true }
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"noir-lang/noir-nvim",
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
version = false,
|
||||
build = function()
|
||||
vim.cmd(":TSUpdate")
|
||||
end,
|
||||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "ipkg", "markdown", "md" }
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
disable = { "markdown", "md" }
|
||||
},
|
||||
ensure_installed = "all",
|
||||
ignore_install = { "ipkg", "markdown", "md" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"petRUShka/vim-sage",
|
||||
},
|
||||
|
||||
{
|
||||
"evanleck/vim-svelte",
|
||||
},
|
||||
|
||||
{
|
||||
"wuelnerdotexe/vim-astro",
|
||||
},
|
||||
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
config = function()
|
||||
local map = vim.api.nvim_set_keymap
|
||||
map('n', '<Leader>g', '<Cmd>Git<CR>', { noremap = true })
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
},
|
||||
|
||||
{
|
||||
"tpope/vim-repeat",
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = {
|
||||
text = '│',
|
||||
},
|
||||
change = {
|
||||
text = '│',
|
||||
},
|
||||
delete = {
|
||||
text = '_',
|
||||
},
|
||||
topdelete = {
|
||||
text = '‾',
|
||||
},
|
||||
changedelete = {
|
||||
text = '~',
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"akinsho/flutter-tools.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require('flutter-tools').setup {
|
||||
-- lsp = {
|
||||
-- color = {
|
||||
-- enabled = false
|
||||
-- }
|
||||
-- }
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
require('Comment').setup({})
|
||||
|
||||
map(
|
||||
'n',
|
||||
'<C-_>',
|
||||
'<Cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>',
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
},
|
||||
|
||||
"nvim-telescope/telescope-symbols.nvim",
|
||||
},
|
||||
config = import("tel"),
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
config = function()
|
||||
require('dressing').setup({
|
||||
input = {
|
||||
default_prompt = '❯',
|
||||
win_options = {
|
||||
winhighlight = 'NormalFloat:Normal',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd [[highlight link FloatTitle NonText]]
|
||||
vim.cmd [[highlight link DressingInputText Normal]]
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
config = function()
|
||||
vim.g.cursorhold_updatetime = 500
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"sirver/ultisnips",
|
||||
ft = { 'latex', 'plaintex', 'tex' },
|
||||
|
||||
config = function()
|
||||
vim.g.UltiSnipsExpandTrigger = '<tab>'
|
||||
vim.g.UltiSnipsJumpForwardTrigger = '<C-h>'
|
||||
vim.g.UltiSnipsJumpBackwardTrigger = '<C-b>'
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq.artifacts",
|
||||
branch = "artifacts",
|
||||
lazy = false
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq_nvim",
|
||||
branch = "coq",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{
|
||||
"ms-jpq/coq.artifacts",
|
||||
branch = "artifacts",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"ms-jpq/coq.thirdparty",
|
||||
branch = "3p",
|
||||
lazy = false,
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.g.coq_settings = {
|
||||
-- auto_start = 'shut-up',
|
||||
keymap = {
|
||||
eval_snips = "<Leader>se",
|
||||
},
|
||||
-- match = {
|
||||
-- look_ahead = 1,
|
||||
-- },
|
||||
clients = {
|
||||
snippets = {
|
||||
always_on_top = true,
|
||||
enabled = true,
|
||||
weight_adjust = 100,
|
||||
},
|
||||
buffers = {
|
||||
enabled = true,
|
||||
weight_adjust = -2.0,
|
||||
},
|
||||
tree_sitter = {
|
||||
enabled = true,
|
||||
weight_adjust = -1.5,
|
||||
},
|
||||
lsp = {
|
||||
enabled = true,
|
||||
weight_adjust = -100,
|
||||
},
|
||||
third_party = {
|
||||
enabled = true,
|
||||
weight_adjust = -1.5,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require('coq_3p') {
|
||||
{ src = 'vimtex', short_name = 'TEX' },
|
||||
{ src = 'nvimlua', short_name = 'NLUA', conf_only = true },
|
||||
{ src = 'bc', short_name = 'CALC', precision = 8 },
|
||||
}
|
||||
|
||||
end,
|
||||
build = function()
|
||||
require("coq")
|
||||
vim.cmd(":COQdeps")
|
||||
end,
|
||||
config = function()
|
||||
|
||||
require('coq_3p') {
|
||||
{ src = 'vimtex', short_name = 'TEX' },
|
||||
{ src = 'nvimlua', short_name = 'NLUA', conf_only = true },
|
||||
{ src = 'bc', short_name = 'CALC', precision = 8 },
|
||||
}
|
||||
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq.thirdparty",
|
||||
branch = "3p",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lua/lsp-status.nvim",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-lua/lsp-status.nvim",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq.thirdparty",
|
||||
branch = "3p",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq.artifacts",
|
||||
branch = "artifacts",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"ms-jpq/coq_nvim",
|
||||
branch = "coq",
|
||||
lazy = false,
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"ms-jpq/coq.artifacts",
|
||||
branch = "artifacts",
|
||||
lazy = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
config = function()
|
||||
local capabilities = require("coq").lsp_ensure_capabilities()
|
||||
-- extend coq completion capabilities all lsps
|
||||
vim.lsp.config('*', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.lsp.enable("lua_ls")
|
||||
require("lsp")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"lervag/vimtex",
|
||||
|
||||
config = function()
|
||||
vim.g.vimtex_view_general_viewer = 'zathura'
|
||||
vim.g.vimtex_compiler_method = "latexmk"
|
||||
|
||||
-- vim.g.vimtex_view_general_options = = '-x nvim -n -c "Vimtex'
|
||||
-- 'file:@pdf\\#src:@line@tex'
|
||||
-- vim.g.vimtex_quickfix_enabled = 0
|
||||
-- vim.g.Tex_GotoError = 0
|
||||
-- vim.g.Tex_ShowErrorContext = 0
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
|
||||
ft = { "markdown" },
|
||||
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
|
||||
build = function()
|
||||
vim.fn.system("cd app && npm install")
|
||||
end,
|
||||
|
||||
config = function()
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
map('n', '<C-m>', '<Plug>MarkdownPreviewToggle', {})
|
||||
map('n', '<Leader>m', '<Plug>MarkdownPreviewToggle', {})
|
||||
|
||||
vim.g.mkdp_markdown_css =
|
||||
os.getenv("HOME") .. "/.config/nvim/lua/markdownStyle.css"
|
||||
|
||||
vim.g.mkdp_highlight_css =
|
||||
os.getenv("HOME") .. "/.cache/wal/colors.css"
|
||||
end,
|
||||
},
|
||||
}
|
||||
11
nvim-lazy-profile/lua/pre.lua
Normal file
11
nvim-lazy-profile/lua/pre.lua
Normal file
@ -0,0 +1,11 @@
|
||||
local o = vim.opt
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
vim.g.mapleader = ","
|
||||
vim.g.maplocalleader = " "
|
||||
vim.g.coq_v1 = true
|
||||
o.modeline = true
|
||||
o.number = true
|
||||
o.relativenumber = true
|
||||
o.clipboard = "unnamedplus"
|
||||
o.viminfo = ""
|
||||
208
nvim-lazy-profile/lua/tel.lua
Normal file
208
nvim-lazy-profile/lua/tel.lua
Normal file
@ -0,0 +1,208 @@
|
||||
local telescope = require('telescope')
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { '.git' },
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-o>'] = { '<Esc>', type = 'command' },
|
||||
['<Esc>'] = 'close',
|
||||
['<C-s>'] = 'select_horizontal',
|
||||
},
|
||||
n = {
|
||||
q = 'close',
|
||||
['<C-o>'] = { '<Nop>', type = 'command' },
|
||||
['<C-s>'] = 'select_horizontal',
|
||||
},
|
||||
},
|
||||
sorting_strategy = 'ascending',
|
||||
layout_config = {
|
||||
prompt_position = 'top',
|
||||
},
|
||||
prompt_prefix = '❯ ',
|
||||
selection_caret = '❯ ',
|
||||
multi_icon = '●',
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
mappings = {
|
||||
n = {
|
||||
dd = 'delete_buffer',
|
||||
},
|
||||
},
|
||||
},
|
||||
find_files = {
|
||||
hidden = true,
|
||||
},
|
||||
lsp_code_actions = {
|
||||
initial_mode = 'normal',
|
||||
},
|
||||
lsp_range_code_actions = {
|
||||
initial_mode = 'normal',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension('fzf')
|
||||
|
||||
-- taken from https://github.com/nvim-telescope/telescope-ui-select.nvim for code actions
|
||||
telescope.register_extension {
|
||||
setup = function(topts)
|
||||
local specific_opts = vim.F.if_nil(topts.specific_opts, {})
|
||||
topts.specific_opts = nil
|
||||
|
||||
if #topts == 1 and topts[1] ~= nil then
|
||||
topts = topts[1]
|
||||
end
|
||||
|
||||
local pickers = require "telescope.pickers"
|
||||
local finders = require "telescope.finders"
|
||||
local conf = require("telescope.config").values
|
||||
local actions = require "telescope.actions"
|
||||
local action_state = require "telescope.actions.state"
|
||||
local strings = require "plenary.strings"
|
||||
local entry_display = require "telescope.pickers.entry_display"
|
||||
local utils = require "telescope.utils"
|
||||
|
||||
__TelescopeUISelectSpecificOpts = vim.F.if_nil(
|
||||
__TelescopeUISelectSpecificOpts,
|
||||
vim.tbl_extend("keep", specific_opts, {
|
||||
["codeaction"] = {
|
||||
make_indexed = function(items)
|
||||
local indexed_items = {}
|
||||
local widths = {
|
||||
idx = 0,
|
||||
command_title = 0,
|
||||
client_name = 0,
|
||||
}
|
||||
for idx, item in ipairs(items) do
|
||||
local client = vim.lsp.get_client_by_id(item[1])
|
||||
local entry = {
|
||||
idx = idx,
|
||||
["add"] = {
|
||||
command_title = item[2].title:gsub("\r\n", "\\r\\n"):gsub("\n", "\\n"),
|
||||
client_name = client and client.name or "",
|
||||
},
|
||||
text = item,
|
||||
}
|
||||
table.insert(indexed_items, entry)
|
||||
widths.idx = math.max(widths.idx, strings.strdisplaywidth(entry.idx))
|
||||
widths.command_title = math.max(widths.command_title,
|
||||
strings.strdisplaywidth(entry.add.command_title))
|
||||
widths.client_name = math.max(widths.client_name,
|
||||
strings.strdisplaywidth(entry.add.client_name))
|
||||
end
|
||||
return indexed_items, widths
|
||||
end,
|
||||
make_displayer = function(widths)
|
||||
return entry_display.create {
|
||||
separator = " ",
|
||||
items = {
|
||||
{ width = widths.idx + 1 }, -- +1 for ":" suffix
|
||||
{ width = widths.command_title },
|
||||
{ width = widths.client_name },
|
||||
},
|
||||
}
|
||||
end,
|
||||
make_display = function(displayer)
|
||||
return function(e)
|
||||
return displayer {
|
||||
{ e.value.idx .. ":", "TelescopePromptPrefix" },
|
||||
{ e.value.add.command_title },
|
||||
{ e.value.add.client_name, "TelescopeResultsComment" },
|
||||
}
|
||||
end
|
||||
end,
|
||||
make_ordinal = function(e)
|
||||
return e.idx .. e.add["command_title"]
|
||||
end,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
vim.ui.select = function(items, opts, on_choice)
|
||||
opts = opts or {}
|
||||
local prompt = vim.F.if_nil(opts.prompt, "Select one of")
|
||||
if prompt:sub(-1, -1) == ":" then
|
||||
prompt = prompt:sub(1, -2)
|
||||
end
|
||||
opts.format_item = vim.F.if_nil(opts.format_item, function(e)
|
||||
return tostring(e)
|
||||
end)
|
||||
|
||||
-- We want or here because __TelescopeUISelectSpecificOpts[x] can be either nil or even false -> {}
|
||||
local sopts = __TelescopeUISelectSpecificOpts[vim.F.if_nil(opts.kind, "")] or {}
|
||||
local indexed_items, widths = vim.F.if_nil(sopts.make_indexed, function(items_)
|
||||
local indexed_items = {}
|
||||
for idx, item in ipairs(items_) do
|
||||
table.insert(indexed_items, { idx = idx, text = item })
|
||||
end
|
||||
return indexed_items
|
||||
end)(items)
|
||||
local displayer = vim.F.if_nil(sopts.make_displayer, function()
|
||||
end)(widths)
|
||||
local make_display = vim.F.if_nil(sopts.make_display, function(_)
|
||||
return function(e)
|
||||
local x, _ = opts.format_item(e.value.text)
|
||||
return x
|
||||
end
|
||||
end)(displayer)
|
||||
local make_ordinal = vim.F.if_nil(sopts.make_ordinal, function(e)
|
||||
return opts.format_item(e.text)
|
||||
end)
|
||||
pickers.new(topts, {
|
||||
prompt_title = prompt,
|
||||
finder = finders.new_table {
|
||||
results = indexed_items,
|
||||
entry_maker = function(e)
|
||||
return {
|
||||
value = e,
|
||||
display = make_display,
|
||||
ordinal = make_ordinal(e),
|
||||
}
|
||||
end,
|
||||
},
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
actions.select_default:replace(function()
|
||||
local selection = action_state.get_selected_entry()
|
||||
if selection == nil then
|
||||
utils.__warn_no_selection "ui-select"
|
||||
return
|
||||
end
|
||||
actions.close(prompt_bufnr)
|
||||
on_choice(selection.value.text, selection.value.idx)
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
sorter = conf.generic_sorter(topts),
|
||||
}):find()
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
map('n', '<Leader>pf', '<Cmd>Telescope find_files<CR>', { noremap = true })
|
||||
map('n', '<Leader>pb', '<Cmd>Telescope buffers<CR>', { noremap = true })
|
||||
map('n', '<Leader>po', '<Cmd>Telescope lsp_document_symbols<CR>', { noremap = true })
|
||||
map('n', '<Leader>ps', '<Cmd>Telescope lsp_workspace_symbols<CR>', { noremap = true })
|
||||
map('n', '<Leader>pd', '<Cmd>Telescope lsp_definitions<CR>', { noremap = true })
|
||||
map('n', '<Leader>pr', '<Cmd>Telescope lsp_references<CR>', { noremap = true })
|
||||
map('n', '<Leader>pp', '<C-^>', { noremap = true })
|
||||
map('n', '<Leader>p', ':Telescope ', { noremap = true })
|
||||
map('n', '<Leader>p ', ':Telescope ', { noremap = true })
|
||||
|
||||
map('n', '<Leader>.', ':lua vim.lsp.buf.code_action()<CR>', { noremap = true })
|
||||
map('n', '<Leader>pn', '<Cmd>lua vim.lsp.buf.rename()<CR>', { noremap = true })
|
||||
|
||||
-- vim.cmd [[
|
||||
-- function! s:telescope_hlsetup() abort
|
||||
-- highlight link TelescopeBorder NonText
|
||||
-- highlight link TelescopeTitle NonText
|
||||
-- endfunction
|
||||
-- call s:telescope_hlsetup()
|
||||
-- augroup telescope_hlsetup
|
||||
-- au!
|
||||
-- au ColorScheme * call s:telescope_hlsetup()
|
||||
-- augroup END
|
||||
-- ]]
|
||||
873
nvim-lazy-profile/ultisnips/tex.snippets
Normal file
873
nvim-lazy-profile/ultisnips/tex.snippets
Normal file
@ -0,0 +1,873 @@
|
||||
global !p
|
||||
|
||||
# thanks to gilles castel
|
||||
|
||||
def math():
|
||||
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
|
||||
|
||||
def env(name):
|
||||
[x,y] = vim.eval("vimtex#env#is_inside('" + name + "')")
|
||||
return x != '0' and y != '0'
|
||||
endglobal
|
||||
|
||||
# General
|
||||
|
||||
snippet beg "Begin / End" bA
|
||||
\\begin{$1}
|
||||
$2
|
||||
\\end{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet pac "Package" b
|
||||
\usepackage[$1]{$2}$0
|
||||
endsnippet
|
||||
|
||||
snippet template "Basic template" b
|
||||
\documentclass[$1]{$2}
|
||||
|
||||
$3
|
||||
|
||||
\begin{document}
|
||||
$0
|
||||
\end{document}
|
||||
endsnippet
|
||||
|
||||
snippet item "Itemize" bA
|
||||
\begin{itemize}
|
||||
\item $0
|
||||
\end{itemize}
|
||||
endsnippet
|
||||
|
||||
snippet enum "Enumerate" bA
|
||||
\begin{enumerate}
|
||||
\item $0
|
||||
\end{enumerate}
|
||||
endsnippet
|
||||
|
||||
snippet alph "Alphabet Enumerate" bA
|
||||
\begin{enumerate}[label= (\alph*)]
|
||||
\item $1
|
||||
\end{enumerate} $0
|
||||
endsnippet
|
||||
|
||||
snippet desc "Description" bA
|
||||
\begin{description}
|
||||
\item[$1] $2
|
||||
\end{description} $0
|
||||
endsnippet
|
||||
|
||||
snippet table "Table" b
|
||||
\begin{table}[${1:htpb}]
|
||||
\centering
|
||||
\caption{$2}
|
||||
\label{tab:$3}
|
||||
\begin{tabular}{${5:c}}
|
||||
$6${5/((?<=.)c|l|r)|./(?1: & )/g}
|
||||
\end{tabular}
|
||||
\end{table} $0
|
||||
endsnippet
|
||||
|
||||
snippet algorithm "Algorithm" b
|
||||
\begin{algorithm}[${1:H}]
|
||||
\caption{$2}\label{tab:$3}
|
||||
\begin{algorithmic}[${4:1}]
|
||||
$5
|
||||
\end{algorithmic}
|
||||
\end{algorithm} $0
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
snippet ... "Ldots" iA
|
||||
\ldots
|
||||
endsnippet
|
||||
|
||||
snippet ~~ "Sim" iA
|
||||
\sim
|
||||
endsnippet
|
||||
|
||||
snippet section "Section" bA
|
||||
\sect{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet subsection "Subsection" bA
|
||||
\subsect{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet chapter "Chapter" bA
|
||||
\chapter{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet ppart "Part" bA
|
||||
\part{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet theorem "Theorem" bA
|
||||
\begin{theorem}[$1]
|
||||
$2
|
||||
\end{theorem} $0
|
||||
endsnippet
|
||||
|
||||
snippet definition "Definition" bA
|
||||
\begin{definition}[$1]
|
||||
$2
|
||||
\end{definition} $0
|
||||
endsnippet
|
||||
|
||||
snippet example "Example" bA
|
||||
\begin{eg}[$1]
|
||||
$2
|
||||
\end{eg} $0
|
||||
endsnippet
|
||||
|
||||
# Math
|
||||
|
||||
snippet sm "Math" wA
|
||||
$${1}$`!p
|
||||
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||
snip.rv = ' '
|
||||
else:
|
||||
snip.rv = ''
|
||||
`$2
|
||||
endsnippet
|
||||
|
||||
snippet dm "Display Math" wA
|
||||
|
||||
\[
|
||||
$1
|
||||
\] $0
|
||||
endsnippet
|
||||
|
||||
snippet ali "Align" bA
|
||||
\begin{align*}
|
||||
${1:${VISUAL}}
|
||||
\end{align*} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet => "Implies" Ai
|
||||
\implies
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet =< "Implied by" Ai
|
||||
\impliedby
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet iff "Iff" Ai
|
||||
\iff
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet `(?<!\\)bm` "Bm" rwAi
|
||||
\bm{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet `(?<!\\)emph` "Emphasize" rwAi
|
||||
\emph{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet `(?<!\\)sqrt` "Square root" rwAi
|
||||
\sqrt{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet `(?<!\\)box` "Boxed" rwAi
|
||||
\boxed{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lll "L" iA
|
||||
\ell
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xx "Cross" iA
|
||||
\times
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet ** "Cdot" iA
|
||||
\cdot
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet norm "Norm" iA
|
||||
\|$1\|$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet nrml "Normal Subgroup" iA
|
||||
\triangleleft
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet nabl "Nabla" iA
|
||||
\nabla
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet \\\ "Set minus" iA
|
||||
\setminus
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet mcal "mathcal" iA
|
||||
\mathcal{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet -> "To" iA
|
||||
\to
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet -< "Gets" iA
|
||||
\gets
|
||||
endsnippet
|
||||
|
||||
priority 200
|
||||
context "math()"
|
||||
snippet <-> "Leftrightarrow" iA
|
||||
\leftrightarrow
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet !> "Maps to" iA
|
||||
\mapsto
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet set "Set" wA
|
||||
\left\\{ $1 \right\\} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet || "Mid" iA
|
||||
\mid
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet cc "Subset" wA
|
||||
\subset
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet notin "Not in" iA
|
||||
\not\in
|
||||
endsnippet
|
||||
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet inn "In" iA
|
||||
\in
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet NN "Natural" iA
|
||||
\N
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet Nn "Cap" iA
|
||||
\cap
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet isect "Cap" iA
|
||||
\cap
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet UU "Cup" iA
|
||||
\cup
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet union "Cup" iA
|
||||
\cup
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet uuu "Big cup" iA
|
||||
\bigcup_{${1:i \in ${2: I}}} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet nnn "Big cap" iA
|
||||
\bigcap_{${1:i \in ${2: I}}} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet OO "Empty Set" iA
|
||||
\varnothing
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet RR "Real" iA
|
||||
\R
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet QQ "Rational" iA
|
||||
\Q
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ZZ "Integer" iA
|
||||
\Z
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet HH "H" iA
|
||||
\mathbb{H}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet DD "D" iA
|
||||
\mathbb{D}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet <! "Normal" iA
|
||||
\triangleleft
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet <> "Diamond" iA
|
||||
\diamond
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '(?<!i)sts' "Text Subscript" irA
|
||||
_\text{$1} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet tt "Text" iA
|
||||
\text{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet opn "Operator Name" iA
|
||||
\operatorname{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 200
|
||||
context "math()"
|
||||
snippet rowvec "Row Vector" iA
|
||||
\mqty[$1]$0
|
||||
endsnippet
|
||||
|
||||
priority 200
|
||||
context "math()"
|
||||
snippet cvec "Column Vector" iA
|
||||
\begin{pmatrix} ${1:x}_${2:1}\\\\ \vdots\\\\ $1_${2:n} \end{pmatrix}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet case "Cases" wA
|
||||
\begin{cases}
|
||||
$1
|
||||
\end{cases} $0
|
||||
endsnippet
|
||||
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet "bar" "Bar" riA
|
||||
\overline{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet "([a-zA-Z])bar" "Bar" riA
|
||||
\overline{`!p snip.rv = match.group(1)`}
|
||||
endsnippet
|
||||
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet "hat" "Hat" ri
|
||||
\hat{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet "([a-zA-Z])hat" "Hat" ri
|
||||
\hat{`!p snip.rv = match.group(1)`}
|
||||
endsnippet
|
||||
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet "vec" "Vec" riA
|
||||
\vec{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet "([a-zA-Z])vec" "Vec" riA
|
||||
\vec{`!p snip.rv = match.group(1)`}
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet '(?<!\\)(sin|cos|tan|arccot|cot|csc|ln|log|exp|star|perp|arcsin|arccos|arctan|arccot|arccsc|arcsec)' "Functions" rwA
|
||||
\\`!p snip.rv = match.group(1)`
|
||||
endsnippet
|
||||
|
||||
priority 1000
|
||||
context "math()"
|
||||
snippet `(?<!\\)epsi` "Epsilon" rwA
|
||||
\epsilon
|
||||
endsnippet
|
||||
|
||||
priority 500
|
||||
context "math()"
|
||||
snippet '(?<!\\)(alpha|beta|gamma|Delta|delta|epsilon|zeta|eta|Theta|theta|iota|kappa|Lambda|lambda|mu|nu|Xi|Pi|pi|varpi|Sigma|sigma|tau|Phi|phi|varphi|chi|Psi|psi|Omega|omega)' "Greek" rwA
|
||||
\\`!p snip.rv = match.group(1)`
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet 'emptyset' "Emptyset" rwA
|
||||
\varnothing
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '(?<!\\)xxi' "Xi" rwA
|
||||
\xi
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '(?<!\\)rho' "Rho" rwA
|
||||
\rho
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet // "Fraction" iA
|
||||
\\frac{${VISUAL}}{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet / "Fraction" i
|
||||
\\frac{${VISUAL}}{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Symbol Fraction" wrA
|
||||
\\frac{`!p snip.rv = match.group(1)`}{$1}$0
|
||||
endsnippet
|
||||
|
||||
priority 1000
|
||||
context "math()"
|
||||
snippet '^.*\)/' "() Frac" wrA
|
||||
`!p
|
||||
stripped = match.string[:-1]
|
||||
depth = 0
|
||||
i = len(stripped) - 1
|
||||
while True:
|
||||
if stripped[i] == ")":
|
||||
depth += 1
|
||||
if stripped[i] == "(":
|
||||
depth -= 1
|
||||
if depth == 0:
|
||||
break
|
||||
i -= 1
|
||||
snip.rv = stripped[0:i] + "\\frac{" + stripped[i+1:-1] + "}"
|
||||
`{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet __ "Full Subscript" iA
|
||||
_{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '([A-Za-z])(\d)' "Subscript" wrA
|
||||
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet '([A-Za-z])(\d\d)' "Subscript 2" wrA
|
||||
`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xnn "Subscript xn" iA
|
||||
x_{n}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ynn "Subscript yn" iA
|
||||
y_{n}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xii "Subscript xi" iA
|
||||
x_{i}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet yii "Subscript yi" iA
|
||||
y_{i}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xjj "Subscript xj" iA
|
||||
x_{j}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet yjj "Subscript yj" iA
|
||||
y_{j}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xp1 "Subscript x n+1" iA
|
||||
x_{n+1}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xp1 "Subscript y n+1" iA
|
||||
y_{n+1}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet xmm "Subscript xm" iA
|
||||
x_{m}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ymm "Subscript ym" iA
|
||||
y_{m}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet x_ "Subscript x" iA
|
||||
x_{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet y_ "Subscript y" iA
|
||||
y_{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet == "Equals" iA
|
||||
&= $1 \\\\$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet != "Not Equals" iA
|
||||
\neq
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ceil "Ceil" iA
|
||||
\left\lceil $1 \right\rceil $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet floor "Floor" iA
|
||||
\left\lfloor $1 \right\rfloor$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet pmat "Paren Matrix" iA
|
||||
\begin{pmatrix} $1 \end{pmatrix} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet matr "Bracket Matrix" iA
|
||||
\begin{bmatrix} $1 \end{bmatrix} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet Bmat "Brace Matrix" iA
|
||||
\begin{Bmatrix} $1 \end{Bmatrix} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet vmat "Vert Matrix" iA
|
||||
\begin{vmatrix} $1 \end{vmatrix} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet () "Parenthesis" iA
|
||||
\left( ${1:${VISUAL}} \right) $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lr "Parenthesis" i
|
||||
\left( ${1:${VISUAL}} \right) $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lr( "Parenthesis" i
|
||||
\left( ${1:${VISUAL}} \right) $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lr| "Verticals" i
|
||||
\left| ${1:${VISUAL}} \right| $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lr{ "Braces" i
|
||||
\left\\{ ${1:${VISUAL}} \right\\} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lrb "Braces" i
|
||||
\left\\{ ${1:${VISUAL}} \right\\} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lr[ "Brackets" i
|
||||
\left[ ${1:${VISUAL}} \right] $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lra "Angled" iA
|
||||
\left<${1:${VISUAL}} \right>$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet conj "Conjugate" iA
|
||||
\overline{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet sr "Square" iA
|
||||
^2
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet cb "Cube" iA
|
||||
^3
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet invs "Inverse" iA
|
||||
^{-1}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet compl "Complement" iA
|
||||
^{c}
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet tp "To the power" iA
|
||||
^{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet bp "Paren to the power" iA
|
||||
^{($1)}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet sum "Bounded Sum" w
|
||||
\sum_{${1:n=${2:1}}}^{${3:\infty}} $4
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet prod "Product" w
|
||||
\prod_{${1:n=${2:1}}}^{${3:\infty}} $4
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ssum "Sum Symbol" w
|
||||
\sum $1
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet lim "Limit" w
|
||||
\lim_{${1:n} \to ${2:\infty}} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet ooo "Infinity" iA
|
||||
\infty
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet limsup "Limit Supremum" w
|
||||
\limsup_{${1:n} \to ${2:\infty}} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet part "Partial Derivative" w
|
||||
\pdv[$1]{${2:v}}{${3:x}} $0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet `(?<!\\)dd` "Differential" rwA
|
||||
\dd{$1}$0
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet dv "Derivative" wA
|
||||
\dv{$1}{$2}$0
|
||||
endsnippet
|
||||
|
||||
priority 300
|
||||
context "math()"
|
||||
snippet int "Definite Integral" w
|
||||
\int_{${1:-\infty}}^{${2:\infty}} $3
|
||||
endsnippet
|
||||
|
||||
priority 300
|
||||
context "math()"
|
||||
snippet iint "Indefinite Integral" w
|
||||
\int $1
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet <= "Less than or equal" iA
|
||||
\le
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet >= "Greater than or equal" iA
|
||||
\ge
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet >> "Greater greater" iA
|
||||
\gg
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet << "Less less" iA
|
||||
\ll
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet EE "There exists" iA
|
||||
\exists
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet AA "For all" iA
|
||||
\forall
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet "such that" "Such that" iA
|
||||
\suchthat
|
||||
endsnippet
|
||||
|
||||
context "math()"
|
||||
snippet "suchthat" "Suchthat" iA
|
||||
\suchthat
|
||||
endsnippet
|
||||
|
||||
snippet image "Image" wA
|
||||
\begin{figure}[${1:h}]
|
||||
\includegraphics[width=${2:0.5}\textwidth]{$3}
|
||||
\end{figure} $0
|
||||
endsnippet
|
||||
|
||||
snippet tikzfig "Tikz Figure" wA
|
||||
\begin{figure}[${1:H}]
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
$2
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\end{figure} $0
|
||||
endsnippet
|
||||
|
||||
snippet plot "Plot" w
|
||||
\begin{figure}[$1]
|
||||
\centering
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
xmin= ${2:-10}, xmax= ${3:10},
|
||||
ymin= ${4:-10}, ymax = ${5:10},
|
||||
axis lines = middle,
|
||||
]
|
||||
\addplot[domain=$2:$3, samples=${6:100}]{$7};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\caption{$8}\label{plot:$9}
|
||||
\end{figure} $0
|
||||
endsnippet
|
||||
|
||||
snippet nn "Tikz node" w
|
||||
\node[$5] (${1/[^0-9a-zA-Z]//g}${2}) ${3:at (${4:0,0}) }{$${1}$};
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet problem "Problem" biA
|
||||
\pbl{$1}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# English
|
||||
|
||||
snippet ltable "Long table" b
|
||||
\begin{longtable}{${1:|p{5cm}|p{10cm}|}}
|
||||
\hline
|
||||
$2
|
||||
\hline
|
||||
\end{longtable} $0
|
||||
endsnippet
|
||||
|
||||
snippet '(?<!\\)---' "Hline" rwA
|
||||
\hline
|
||||
endsnippet
|
||||
|
||||
snippet '(?<!\\)--' "Dash" rw
|
||||
\---
|
||||
endsnippet
|
||||
|
||||
# Code
|
||||
|
||||
snippet bsc "Blank Inline Code" wA
|
||||
\texttt{${1}}`!p
|
||||
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||
snip.rv = ' '
|
||||
else:
|
||||
snip.rv = ''
|
||||
`$2
|
||||
endsnippet
|
||||
|
||||
snippet ssc "Inline Code" wA
|
||||
{\inlinecode{${1}}{${2}}}`!p
|
||||
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||
snip.rv = ' '
|
||||
else:
|
||||
snip.rv = ''
|
||||
`$3
|
||||
endsnippet
|
||||
|
||||
snippet dc "Block Code" wA
|
||||
\begin{listing}[${1:H}]
|
||||
\caption{$2}
|
||||
\label{lst:$3}
|
||||
\begin{code}{$4}
|
||||
$5
|
||||
\end{code} $0
|
||||
\end{listing}
|
||||
endsnippet
|
||||
|
||||
snippet impc "Import Code" wA
|
||||
\begin{listing}[${1:H}]
|
||||
\caption{$2}
|
||||
\label{lst:$3}
|
||||
\importcode{$4}{$5}$0
|
||||
\end{listing}
|
||||
endsnippet
|
||||
|
||||
# Pres
|
||||
|
||||
snippet frame "Frame" bA
|
||||
\begin{frame}{$1}
|
||||
$2
|
||||
\end{frame} $0
|
||||
endsnippet
|
||||
@ -71,14 +71,7 @@ local lsp_confs = {
|
||||
},
|
||||
},
|
||||
},
|
||||
solidity_ls = {
|
||||
|
||||
filetpes = { "solidity" },
|
||||
|
||||
root_dir = find_repo_root({
|
||||
configfiles = { "hardhat.config.js", "hardhat.config.ts", "foundry.toml", "remappings.txt", "truffle.js", "truffle-config.js", "ape-config.yaml", ".git", "package.json" }
|
||||
})
|
||||
},
|
||||
solidity_ls = {},
|
||||
coq_lsp = {},
|
||||
racket_langserver = {},
|
||||
ocamllsp = {},
|
||||
@ -171,7 +164,8 @@ for server, conf in pairs(lsp_confs) do
|
||||
lspstatus.capabilities
|
||||
)
|
||||
|
||||
local final_config = coq.lsp_ensure_capabilities(conf)
|
||||
-- local final_config = coq.lsp_ensure_capabilities(conf)
|
||||
local final_config = conf
|
||||
|
||||
local special_setup = lsp_special_setup[server]
|
||||
if special_setup then
|
||||
@ -263,7 +257,11 @@ vim.api.nvim_create_autocmd(
|
||||
if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" and
|
||||
vim.bo.filetype ~= "qf" and vim.bo.filetype ~= "bib" and vim.bo.filetype ~= "" and vim.bo.filetype ~= "pdf"
|
||||
and vim.bo.filetype ~= "conf" and vim.bo.filetype ~= "TelescopePrompt" then
|
||||
vim.cmd [[ :COQnow -s ]]
|
||||
vim.defer_fn(function()
|
||||
if vim.fn.exists(":COQnow") > 0 then
|
||||
vim.cmd([[ :COQnow -s ]])
|
||||
end
|
||||
end, 10)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
@ -6,23 +6,27 @@ end
|
||||
|
||||
return require('packer').startup({
|
||||
function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
'wbthomason/packer.nvim'
|
||||
}
|
||||
|
||||
use 'RRethy/base16-nvim'
|
||||
use {
|
||||
'RRethy/base16-nvim',
|
||||
}
|
||||
|
||||
use {
|
||||
'vim-airline/vim-airline',
|
||||
requires = {
|
||||
'ryanoasis/vim-devicons',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
use {
|
||||
'mustache/vim-mustache-handlebars'
|
||||
'mustache/vim-mustache-handlebars',
|
||||
}
|
||||
|
||||
use {
|
||||
'whonore/Coqtail'
|
||||
'whonore/Coqtail',
|
||||
}
|
||||
|
||||
use {
|
||||
@ -38,7 +42,7 @@ return require('packer').startup({
|
||||
}
|
||||
|
||||
use {
|
||||
'noir-lang/noir-nvim'
|
||||
'noir-lang/noir-nvim',
|
||||
}
|
||||
|
||||
use {
|
||||
@ -56,15 +60,15 @@ return require('packer').startup({
|
||||
}
|
||||
|
||||
use {
|
||||
'petRUShka/vim-sage'
|
||||
'petRUShka/vim-sage',
|
||||
}
|
||||
|
||||
use {
|
||||
'evanleck/vim-svelte'
|
||||
'evanleck/vim-svelte',
|
||||
}
|
||||
|
||||
use {
|
||||
'wuelnerdotexe/vim-astro'
|
||||
'wuelnerdotexe/vim-astro',
|
||||
}
|
||||
|
||||
use {
|
||||
@ -83,6 +87,10 @@ return require('packer').startup({
|
||||
'tpope/vim-repeat',
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-lua/plenary.nvim',
|
||||
}
|
||||
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
requires = {
|
||||
@ -118,11 +126,11 @@ return require('packer').startup({
|
||||
},
|
||||
config = function()
|
||||
require('flutter-tools').setup {
|
||||
lsp = {
|
||||
color = {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
-- lsp = {
|
||||
-- color = {
|
||||
-- enabled = false
|
||||
-- }
|
||||
-- }
|
||||
}
|
||||
end
|
||||
}
|
||||
@ -186,6 +194,7 @@ return require('packer').startup({
|
||||
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
disable = true,
|
||||
-- commit = "607ff48b970b89c3e4e3825b88d9cfd05b7aaea5",
|
||||
requires = {
|
||||
'nvim-lua/lsp-status.nvim',
|
||||
|
||||
17
themectl/schemes/durian.yaml
Normal file
17
themectl/schemes/durian.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
scheme: "Passionfruit"
|
||||
base00: "282828" # ----
|
||||
base01: "3c3836" # ---
|
||||
base02: "504945" # --
|
||||
base03: "665c54" # -
|
||||
base04: "bdae93" # +
|
||||
base05: "d5c4a1" # ++
|
||||
base06: "ebdbb2" # +++
|
||||
base07: "fbf1c7" # ++++
|
||||
base08: "f66655" # red
|
||||
base09: "e59e70" # orange
|
||||
base0A: "d4bb6f" # yellow
|
||||
base0B: "89b843" # green
|
||||
base0C: "8ec07c" # aqua/cyan
|
||||
base0D: "83a598" # blue
|
||||
base0E: "7f7d88" # purple
|
||||
base0F: "b5835a" # brown
|
||||
19
themectl/schemes/forest.yaml
Normal file
19
themectl/schemes/forest.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
scheme: "Everforest dark, medium"
|
||||
author: "Sainnhe Park (sainnhe@gmail.com)"
|
||||
|
||||
base00: "232a2e" # Default Background
|
||||
base01: "343f44" # Lighter Background (Used for status bars, line number and folding marks)
|
||||
base02: "3d484d" # Selection Background
|
||||
base03: "475258" # Comments, Invisibles, Line Highlighting
|
||||
base04: "4f585e" # Dark Foreground (Used for status bars)
|
||||
base05: "859289" # Default Foreground, Caret, Delimiters, Operators
|
||||
base06: "9da9a0" # Light Foreground (Not often used)
|
||||
base07: "d3c6aa" # Light Background (Not often used)
|
||||
base08: "e67e80" # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
|
||||
base09: "e69875" # Integers, Boolean, Constants, XML Attributes, Markup Link Url
|
||||
base0A: "dbbc7f" # Classes, Markup Bold, Search Text Background
|
||||
base0B: "a7c080" # Strings, Inherited Class, Markup Code, Diff Inserted
|
||||
base0C: "7fbbb3" # Support, Regular Expressions, Escape Characters, Markup Quotes
|
||||
base0D: "83c092" # Functions, Methods, Attribute IDs, Headings
|
||||
base0E: "d699b6" # Keywords, Storage, Selector, Markup Italic, Diff Changed
|
||||
base0F: "543a48" # Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
|
||||
19
themectl/schemes/monotone.yaml
Normal file
19
themectl/schemes/monotone.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
scheme: "Grayscale"
|
||||
author: "Chris Kempson"
|
||||
|
||||
base00: "101010"
|
||||
base01: "252525"
|
||||
base02: "464646"
|
||||
base03: "525252"
|
||||
base04: "ababab"
|
||||
base05: "b9b9b9"
|
||||
base06: "e3e3e3"
|
||||
base07: "f7f7f7"
|
||||
base08: "7c7c7c"
|
||||
base09: "999999"
|
||||
base0A: "a0a0a0"
|
||||
base0B: "8e8e8e"
|
||||
base0C: "868686"
|
||||
base0D: "686868"
|
||||
base0E: "747474"
|
||||
base0F: "5e5e5e"
|
||||
@ -50,35 +50,53 @@ else
|
||||
let s:cterm0F = "14"
|
||||
endif
|
||||
|
||||
let g:airline#themes#theme#palette.normal = airline#themes#generate_color_map(
|
||||
\ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ],
|
||||
\ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ],
|
||||
\ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ])
|
||||
let g:airline#themes#theme#palette.normal_modified = {
|
||||
\ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]}
|
||||
let s:N1 = [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ]
|
||||
let s:N2 = [ s:gui06, s:gui03, s:cterm06, s:cterm03 ]
|
||||
let s:N3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ]
|
||||
let g:airline#themes#theme#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#theme#palette.normal_modified = { 'airline_c': [ s:gui0A, '', s:cterm0A, '' ] }
|
||||
|
||||
let g:airline#themes#theme#palette.insert = airline#themes#generate_color_map(
|
||||
\ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ],
|
||||
\ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ],
|
||||
\ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ])
|
||||
let g:airline#themes#theme#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]}
|
||||
|
||||
let g:airline#themes#theme#palette.replace = airline#themes#generate_color_map(
|
||||
\ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ],
|
||||
\ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ],
|
||||
\ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ])
|
||||
let g:airline#themes#theme#palette.replace_modified = {
|
||||
\ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]}
|
||||
let s:I1 = [ s:gui01, s:gui0D, s:cterm01, s:cterm0D ]
|
||||
let s:I2 = [ s:gui06, s:gui03, s:cterm06, s:cterm03 ]
|
||||
let s:I3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ]
|
||||
let g:airline#themes#theme#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#theme#palette.insert_modified = g:airline#themes#theme#palette.normal_modified
|
||||
let g:airline#themes#theme#palette.insert_paste = { 'airline_a': s:I3 }
|
||||
|
||||
let g:airline#themes#theme#palette.visual = airline#themes#generate_color_map(
|
||||
\ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ],
|
||||
\ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ],
|
||||
\ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ])
|
||||
let g:airline#themes#theme#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]}
|
||||
|
||||
let g:airline#themes#theme#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ],
|
||||
\ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ],
|
||||
\ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ])
|
||||
let s:R1 = [ s:gui01, s:gui08, s:cterm01, s:cterm08 ]
|
||||
let s:R2 = [ s:gui06, s:gui03, s:cterm06, s:cterm03 ]
|
||||
let s:R3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ]
|
||||
let g:airline#themes#theme#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#theme#palette.replace_modified = g:airline#themes#theme#palette.normal_modified
|
||||
|
||||
|
||||
let s:V1 = [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ]
|
||||
let s:V2 = [ s:gui06, s:gui03, s:cterm06, s:cterm03 ]
|
||||
let s:V3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ]
|
||||
let g:airline#themes#theme#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#theme#palette.visual_modified = g:airline#themes#theme#palette.normal_modified
|
||||
|
||||
|
||||
let s:IA1 = [ s:gui05, s:gui02, s:cterm05, s:cterm02 ]
|
||||
let s:IA2 = [ s:gui05, s:gui02, s:cterm05, s:cterm02 ]
|
||||
let s:IA3 = [ s:gui05, s:gui02, s:cterm05, s:cterm02 ]
|
||||
let g:airline#themes#theme#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#theme#palette.inactive_modified = g:airline#themes#theme#palette.normal_modified
|
||||
|
||||
" g Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
|
||||
" variable so that related functionality is loaded iff the user is using
|
||||
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
|
||||
" they will be chosen automatically from the existing palette.
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#theme#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ s:gui07, s:gui02, s:cterm07, s:cterm02, '' ],
|
||||
\ [ s:gui07, s:gui04, s:cterm07, s:cterm04, '' ],
|
||||
\ [ s:gui05, s:gui01, s:cterm05, s:cterm01, 'bold' ])
|
||||
|
||||
" Remove color variables
|
||||
unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F
|
||||
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export PATH=$HOME/.config/bin/$(cat /etc/hostname):$HOME/.config/bin:$HOME/.local/bin:$HOME/.local/share/texlive/2025/bin/x86_64-linux:$HOME/.local/share/cargo/bin:/home/emh/.local/share/solana/install/active_release/bin:$HOME/.local/share/npm/bin:$HOME/.nargo:$PATH
|
||||
export MANPATH=$MANPATH:$HOME/.local/share/texlive/2025/texmf-dist/doc/man
|
||||
export INFOPATH=$INFOPATH:$HOME/.local/share/texlive/2025/texmf-dist/doc/info
|
||||
export PATH=$HOME/.config/bin/$(cat /etc/hostname):$HOME/.config/bin:$HOME/.local/bin:$HOME/.local/share/texlive/2026/bin/x86_64-linux:$HOME/.local/share/cargo/bin:/home/emh/.local/share/solana/install/active_release/bin:$HOME/.local/share/npm/bin:$HOME/.nargo:$PATH
|
||||
export MANPATH=$MANPATH:$HOME/.local/share/texlive/2026/texmf-dist/doc/man
|
||||
export INFOPATH=$INFOPATH:$HOME/.local/share/texlive/2026/texmf-dist/doc/info
|
||||
export PATH="$PATH:/home/emh/.config/.foundry/bin"
|
||||
|
||||
. "$HOME"/.cache/theme/colors.sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user