Sketch out tempest neovim runtime
This commit is contained in:
parent
a456fe3781
commit
659fb33ca7
18 changed files with 783 additions and 390 deletions
home/features/neovim/config/lua/my/plugins
|
@ -1,42 +0,0 @@
|
|||
local M = {
|
||||
"postfen/clipboard-image.nvim",
|
||||
cmd = "PasteImg",
|
||||
}
|
||||
|
||||
local function img_name()
|
||||
vim.fn.inputsave()
|
||||
local name = vim.fn.input("Name: ")
|
||||
vim.fn.inputrestore()
|
||||
|
||||
if name == nil or name == "" then
|
||||
return os.date("%y-%m-%d-%H-%M-%S")
|
||||
end
|
||||
return name
|
||||
end
|
||||
|
||||
function M.init()
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>p",
|
||||
":PasteImg<cr>",
|
||||
{ desc = "[P]aste image from clipboard" }
|
||||
)
|
||||
end
|
||||
|
||||
function M.config()
|
||||
require("clipboard-image").setup({
|
||||
default = {
|
||||
img_name = img_name,
|
||||
},
|
||||
tex = {
|
||||
img_dir = { "%:p:h", "img" },
|
||||
affix = "\\includegraphics[width=\\textwidth]{%s}",
|
||||
},
|
||||
typst = {
|
||||
img_dir = { "%:p:h", "img" },
|
||||
affix = '#image("%s", width: 100)',
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
|
@ -117,7 +117,6 @@ function M.config()
|
|||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
local K = require("my.keymaps")
|
||||
local M = {
|
||||
"saecki/crates.nvim",
|
||||
event = "BufReadPost Cargo.toml",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local crates = require("crates")
|
||||
|
||||
crates.setup({
|
||||
null_ls = {
|
||||
enabled = true,
|
||||
name = "crates.nvim",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
group = vim.api.nvim_create_augroup("CmpSourceCargo", {}),
|
||||
pattern = "Cargo.toml",
|
||||
callback = function()
|
||||
require("cmp").setup.buffer({ sources = { { name = "crates" } } })
|
||||
end,
|
||||
})
|
||||
|
||||
local function nmap(from, to, desc)
|
||||
K.nmap(from, to, desc, true, true)
|
||||
end
|
||||
|
||||
nmap("<leader>lct", crates.toggle, "[c]rates [t]oggle")
|
||||
nmap("<leader>lcr", crates.reload, "[c]rates [r]efresh")
|
||||
|
||||
nmap("<leader>lcH", crates.open_homepage, "[c]rates [H]omepage")
|
||||
nmap("<leader>lcR", crates.open_repository, "[c]rates [R]repository")
|
||||
nmap("<leader>lcD", crates.open_documentation, "[c]rates [D]ocumentation")
|
||||
nmap("<leader>lcC", crates.open_crates_io, "[c]rates [C]rates.io")
|
||||
|
||||
nmap("<leader>lcv", crates.show_versions_popup, "[c]rates [v]ersions")
|
||||
nmap("<leader>lcf", crates.show_features_popup, "[c]rates [f]eatures")
|
||||
nmap("<leader>lcd", crates.show_dependencies_popup, "[c]rates [d]eps")
|
||||
nmap("K", crates.show_popup, "crates popup")
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.register({
|
||||
["<leader>lc"] = {
|
||||
name = "[l]ocal [c]rates",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
return M
|
|
@ -1,32 +0,0 @@
|
|||
local lspconfig = require("my.plugins.lspconfig")
|
||||
local M = {
|
||||
"mrcjkb/haskell-tools.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
version = "^2",
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
}
|
||||
|
||||
function M.config()
|
||||
vim.g.haskell_tools = {
|
||||
hls = {
|
||||
on_attach = lspconfig.on_attach,
|
||||
settings = {
|
||||
haskell = {
|
||||
formattingProvider = "fourmolu",
|
||||
-- This seems to work better with custom preludes
|
||||
-- See this issue https://github.com/fourmolu/fourmolu/issues/357
|
||||
plugin = { fourmolu = { config = { external = true } } },
|
||||
},
|
||||
},
|
||||
},
|
||||
tools = {
|
||||
hover = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
|
@ -30,27 +30,13 @@ local M = {
|
|||
function M.on_attach(client, bufnr)
|
||||
-- {{{ Keymap helpers
|
||||
local opts = function(desc)
|
||||
return { noremap = true, silent = true, desc = desc, buffer = bufnr }
|
||||
return { silent = true, desc = desc, buffer = bufnr }
|
||||
end
|
||||
|
||||
local nmap = function(from, to, desc)
|
||||
vim.keymap.set("n", from, to, opts(desc))
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Auto format
|
||||
local function format()
|
||||
vim.lsp.buf.format({ async = false, bufnr = bufnr })
|
||||
end
|
||||
|
||||
-- if client.supports_method("textDocument/formatting") then
|
||||
-- nmap("<leader>F", format, "[F]ormat")
|
||||
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- group = vim.api.nvim_create_augroup("LspFormatting", { clear = false }),
|
||||
-- buffer = bufnr,
|
||||
-- callback = format,
|
||||
-- })
|
||||
-- end
|
||||
-- }}}
|
||||
-- {{{ Go to declaration / references / implementation
|
||||
nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition")
|
||||
nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation")
|
||||
|
@ -131,7 +117,7 @@ local servers = {
|
|||
Lua = {
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
format = {
|
||||
enable = true
|
||||
enable = true,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
|
@ -215,9 +201,9 @@ function lspconfig.config()
|
|||
diagnostics_icons()
|
||||
-- -- {{{ Change on-hover borders
|
||||
vim.lsp.handlers["textDocument/hover"] =
|
||||
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
|
||||
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] =
|
||||
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
|
||||
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
|
||||
-- -- }}}
|
||||
|
||||
local capabilities = M.capabilities()
|
||||
|
@ -230,7 +216,7 @@ function lspconfig.config()
|
|||
|
||||
require("lspconfig")[lsp].setup({
|
||||
on_attach = details.on_attach,
|
||||
settings = details.settings, -- Specific per-language settings
|
||||
settings = details.settings, -- Specific per-language settings
|
||||
flags = {
|
||||
debounce_text_changes = 150, -- This will be the default in neovim 0.7+
|
||||
},
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
local K = require("my.keymaps")
|
||||
local lspconfig = require("my.plugins.lspconfig")
|
||||
|
||||
local M = {
|
||||
"simrat39/rust-tools.nvim",
|
||||
config = function()
|
||||
require("rust-tools").setup({
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
K.nmap(
|
||||
"<leader>lc",
|
||||
"<cmd>RustOpenCargo<cr>",
|
||||
"Open [c]argo.toml",
|
||||
true,
|
||||
true
|
||||
)
|
||||
|
||||
lspconfig.on_attach(client, bufnr)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
return M
|
|
@ -1,26 +0,0 @@
|
|||
local M = {
|
||||
"lervag/vimtex", -- latex support
|
||||
ft = "tex",
|
||||
enabled = false
|
||||
}
|
||||
|
||||
function M.config()
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
vim.g.Tex_DefaultTargetFormat = "pdf"
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
options = {
|
||||
"-pdf",
|
||||
"-shell-escape",
|
||||
"-verbose",
|
||||
"-file-line-error",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
},
|
||||
}
|
||||
|
||||
vim.g.vimtex_fold_enabled = 0
|
||||
vim.g.vimtex_imaps_enabled = 0
|
||||
vim.g.vimtex_syntax_conceal_disable = 1
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue