Compare commits

...

6 commits

Author SHA1 Message Date
bd29839910
qutebrowser: Fix visual selection errors, typehints 2024-08-12 21:26:29 +02:00
9750e943b9
nvim: Update plugins 2024-08-12 21:25:41 +02:00
ca0e08fab5
nvim: Fix python venv utility function 2024-08-12 21:25:31 +02:00
bfbe4c36cd
nvim: Update dial version and changed key maps
Changed maps to increment on <C-S> (instead of the usual <C-A>) and
decrement on the typical <C-X>. This makes it work much better with
wezterm leader key (<C-A>) and as far as I can see does not directly
clash with any other binds.
2024-08-12 21:16:50 +02:00
d4727a3402
nvim: Fix newly linted errors 2024-08-12 21:16:49 +02:00
61d34e49c7
nvim: Switch to lazydev lua lsp setup
Much easier lua development setup.
2024-08-12 21:16:48 +02:00
13 changed files with 151 additions and 66 deletions

View file

@ -1,4 +1,3 @@
local default_buffer_session = function()
local buffer_path = vim.api.nvim_buf_get_name(0) or vim.fn.tempname()
local temp_path = vim.fn.stdpath("run") .. "/molten-sessions" .. buffer_path .. ".json"
@ -51,7 +50,9 @@ if vim.g.quarto_auto_init_molten_session then
if vim.b["sessionfile"] == nil then
local path = default_buffer_session()
vim.b["sessionfile"] = path
vim.schedule_wrap(startsession(path))
vim.schedule_wrap(function()
startsession(path)
end)
end
end,
})

View file

@ -1,10 +1,9 @@
{
"Arduino.nvim": { "branch": "main", "commit": "7fd0f58c6f7a460ef180ef3bc9715baa37e9dd36" },
"BetterLua.vim": { "branch": "master", "commit": "d2d6c115575d09258a794a6f20ac60233eee59d5" },
"Arduino.nvim": { "branch": "main", "commit": "5988e7b08d8d6dc0a2d37e805cbed57dc13d869a" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"aerial.nvim": { "branch": "master", "commit": "7e2615991cf110f6688112abcb45cf338248d1f6" },
"aerial.nvim": { "branch": "master", "commit": "d5ba0e3cfede432cec7e6ab28724c4a554ea0f09" },
"bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" },
"cmp-beancount": { "branch": "main", "commit": "29e23297c06b9d69771e4b14e0fb3b9d583a150e" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@ -14,7 +13,6 @@
"cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-pandoc-references": { "branch": "master", "commit": "2c808dff631a783ddd2c554c4c6033907589baf6" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-rg": { "branch": "master", "commit": "677a7874ee8f1afc648c2e7d63a97bc21a7663c5" },
@ -24,7 +22,7 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" },
"conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" },
"dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" },
"dial.nvim": { "branch": "master", "commit": "ed4d6a5bbd5e479b4c4a3019d148561a2e6c1490" },
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" },
@ -37,31 +35,33 @@
"img-clip.nvim": { "branch": "main", "commit": "fc30500c35663aa1762697f5aba31d43b86028f0" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
"lsp-setup.nvim": { "branch": "main", "commit": "6e4e977512ce426d8b52c27f3b6e6aefc73e1452" },
"ltex_extra.nvim": { "branch": "dev", "commit": "57192d7ae5ba8cef3c10e90f2cd62d4a7cdaab69" },
"lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
"markmap.nvim": { "branch": "main", "commit": "5fb6755cf5434511cc23a4936c9eb76b9142fba5" },
"mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" },
"mason-nvim-lint": { "branch": "main", "commit": "b579a00ee39dcd590b1023028dc8fb3d203a67b0" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"mdeval.nvim": { "branch": "master", "commit": "2c32e2f3e7d8f222e7a4724989f218d036e1081d" },
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
"molten-nvim": { "branch": "main", "commit": "eb6d0fe33e14989b0f1fbe25d9732889ee57bd1a" },
"neogen": { "branch": "main", "commit": "7545cdc8cdfa46b17040968e5aaa3e49e29fdf3f" },
"neogen": { "branch": "main", "commit": "88698b12c3c7db6fcc38e0fa28df5e4ab52c5be6" },
"neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" },
"neotest-python": { "branch": "master", "commit": "81d2265efac717bb567bc15cc652ae10801286b3" },
"nvim-FeMaco.lua": { "branch": "main", "commit": "96bbf843595dbe865838b3f2484b73557f34700c" },
"nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" },
"nvim-coverage": { "branch": "main", "commit": "aa4b4400588e2259e87e372b1e4e90ae13cf5a39" },
"nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" },
"nvim-lspconfig": { "branch": "master", "commit": "f95d371c1a274f60392edfd8ea5121b42dca736e" },
"nvim-lint": { "branch": "master", "commit": "ad0fe35e80f5cd31a0f19176d7b30e5c3011119d" },
"nvim-lspconfig": { "branch": "master", "commit": "ff97d376b1d22b2eaf9274605531babf0cd0cf21" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-toggleterm.lua": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" },
"nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" },
"nvim-tree.lua": { "branch": "master", "commit": "ad0b95dee55955817af635fa121f6e2486b10583" },
"nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" },
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
@ -75,7 +75,7 @@
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"quarto-nvim": { "branch": "main", "commit": "09fabb62d414e56ee3245c558aaedbdc662b6493" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
"render-markdown": { "branch": "main", "commit": "35f8bd24809e21219c66e2a58f1b9f5d547cc2c3" },
"render-markdown": { "branch": "main", "commit": "ced4a66f9bc38580f4797a789d2d5575fcd809fd" },
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },

View file

@ -51,32 +51,37 @@ function T.get_python_venv_bin(workspace)
return path_join(pyenv, "bin", "python")
end
-- cache path so we can call it multiple times
local venv_path = ""
local venv_path_cached = ""
-- return the current python environment path
function T.get_python_venv_basefolder(workspace)
if venv_path and venv_path ~= "" then
return venv_path
if venv_path_cached and venv_path_cached ~= "" then
return venv_path_cached
end
-- Use activated virtualenv.
if vim.env.VIRTUAL_ENV then
venv_path = vim.env.VIRTUAL_ENV
return venv_path
venv_path_cached = vim.env.VIRTUAL_ENV
return venv_path_cached
end
-- Find and use virtualenv in workspace directory.
for _, pattern in ipairs({ "*", ".*" }) do
local match = vim.fn.glob(path_join(workspace, pattern, "pyvenv.cfg"))
if match ~= "" then
match = string.gsub(match, "pyvenv.cfg", "")
venv_path = match
return venv_path
end
match = vim.fn.glob(path_join(workspace, pattern, "poetry.lock"))
if match ~= "" then
local venv_base_folder = vim.fn.trim(vim.fn.system("poetry env info -p"))
venv_path = venv_base_folder
return venv_path
local match
-- Look downwards for file, can be nested. Limit to 1 depth for speed rn
-- TODO: Maybe not hardcode 1-depth but allow choice.
match = vim.fn.findfile("pyvenv.cfg", "**1")
if match ~= "" then
match = string.gsub(match, "/pyvenv.cfg", "")
venv_path_cached = match
return venv_path_cached
end
-- Look upwards for file, it is only ever in proj root dir
match = vim.fn.findfile("poetry.lock", (workspace or ".") .. ";")
if match ~= "" then
local obj = vim.system({ "poetry", "env", "info", "-p" }, { text = true }):wait()
if obj.code ~= 0 then
return
end
local venv_base_folder = obj.stdout:match("^%s*(.-)%s*$")
venv_path_cached = venv_base_folder
return venv_path_cached
end
end

View file

@ -13,7 +13,6 @@ return {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp-signature-help",
"dmitmel/cmp-digraphs",
"jc-doyle/cmp-pandoc-references",
@ -93,7 +92,6 @@ return {
end,
},
sources = {
{ name = "nvim_lua" },
{
name = "beancount",
option = {
@ -157,6 +155,7 @@ return {
end, { "i", "s" }),
}),
formatting = {
expandable_indicator = true,
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons, removing kind text leaving only icon

View file

@ -185,14 +185,14 @@ return {
unmap("<localleader>ci")
unmap("<localleader>cV")
local map = vim.keymap.set
map("n", "<localleader>cI", ":MoltenInit<cr>", { desc = "init molten", silent = true })
map("n", "<localleader>cJ", ":JupyterStart<cr>", { desc = "start jupyter", silent = true })
end,
})
end,
ft = { "norg", "quarto", "python" },
keys = {
{ "<leader>vn", ":MoltenInfo<cr>" },
{ "<localleader>ci", ":MoltenInit<cr>" },
{ "<localleader>cJ", ":JupyterStart<cr>", desc = "start jupyter", silent = true },
},
cmd = {
"MoltenInfo",

View file

@ -1,10 +1,12 @@
return {
-- surround things with other things using ys/cs/ds
{ "kylechui/nvim-surround", config = true, event = "VeryLazy" },
{ "kylechui/nvim-surround", config = true, event = { "CursorHold", "InsertEnter" } },
-- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers
-- extend the ^x / ^a possibilities to dates, hex, alphabets, markdown headers
-- REMAPPED TO C-X / C-S for decrement/increment
{
"monaqa/dial.nvim",
version = false,
config = function()
local augend = require("dial.augend")
require("dial.config").augends:register_group({
@ -12,6 +14,7 @@ return {
default = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.hexcolor.new({ case = "lower" }),
augend.date.alias["%Y/%m/%d"],
augend.date.alias["%Y-%m-%d"],
augend.date.alias["%m/%d"],
@ -19,11 +22,10 @@ return {
augend.date.alias["%H:%M"],
augend.constant.alias.de_weekday_full,
augend.constant.alias.de_weekday,
augend.constant.alias.bool,
augend.semver.alias.semver,
augend.constant.alias.Alpha,
augend.constant.alias.alpha,
augend.hexcolor.new({ case = "lower" }),
augend.constant.alias.bool,
augend.constant.new({
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
@ -37,14 +39,64 @@ return {
},
})
end,
event = "InsertEnter",
event = { "CursorHold", "InsertEnter" },
keys = {
{ "<C-a>", "<Plug>(dial-increment)", mode = "n" },
{ "<C-x>", "<Plug>(dial-decrement)", mode = "n" },
{ "<C-a>", "<Plug>(dial-increment)", mode = "v" },
{ "<C-x>", "<Plug>(dial-increment)", mode = "v" },
{ "g<C-a>", "g<Plug>(dial-increment)", mode = "v" },
{ "g<C-x>", "g<Plug>(dial-increment)", mode = "v" },
{
"<C-s>",
function()
require("dial.map").manipulate("increment", "normal")
end,
mode = "n",
},
{
"<C-x>",
function()
require("dial.map").manipulate("decrement", "normal")
end,
mode = "n",
},
{
"<C-s>",
function()
require("dial.map").manipulate("increment", "visual")
end,
mode = "v",
},
{
"<C-x>",
function()
require("dial.map").manipulate("decrement", "visual")
end,
mode = "v",
},
{
"g<C-s>",
function()
require("dial.map").manipulate("increment", "gnormal")
end,
mode = "n",
},
{
"g<C-x>",
function()
require("dial.map").manipulate("decrement", "gnormal")
end,
mode = "n",
},
{
"g<C-s>",
function()
require("dial.map").manipulate("increment", "gvisual")
end,
mode = "v",
},
{
"g<C-x>",
function()
require("dial.map").manipulate("decrement", "gvisual")
end,
mode = "v",
},
},
},
}

View file

@ -25,7 +25,6 @@ local formatters = {
}
return {
-- formatting setup
{
"zapling/mason-conform.nvim",

View file

@ -1,5 +1,28 @@
return {
{ "edKotinsky/Arduino.nvim", ft = "arduino", config = true }, -- statusline
{ "euclidianAce/BetterLua.vim", ft = "lua" }, -- better syntax highlighting for lua
{ "aliou/bats.vim", ft = { "bash", "sh", "zsh", "bats" } }, -- enable syntax for bats shell-code testing library
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
dependencies = {
{ "Bilal2453/luvit-meta" }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations
"hrsh7th/nvim-cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = "lazydev",
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
optional = true,
},
},
},
}

View file

@ -204,11 +204,7 @@ return {
{ buffer = bufnr, desc = "Signature help" }
)
map("n", "<localleader>lo", function()
if vim.diagnostic.is_disabled(0) then
vim.diagnostic.enable(0)
else
vim.diagnostic.disable(0)
end
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, { buffer = bufnr, desc = "Toggle Diagnostics" })
end

View file

@ -103,7 +103,7 @@ return {
},
},
},
-- TODO needs to pick up poetry env for python,
-- TODO: needs to pick up poetry env for python,
-- currently just hard-codes running through poetry
{
"andythigpen/nvim-coverage",

View file

@ -21,8 +21,8 @@ return {
return ""
-- we don't know if we have python yet, start a check
else
vim.system({ "poetry", "env", "info", "-p" }, { text = true }, function(_, exitcode)
if exitcode == 0 then
vim.system({ "poetry", "env", "info", "-p" }, { text = true }, function(obj)
if obj.code == 0 then
has_pynvim = 1
else
has_pynvim = 0

View file

@ -1,15 +1,27 @@
import os
from typing import cast
# pylint: disable=C0111
from qutebrowser.config.config import ConfigContainer # noqa: F401
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
config: ConfigAPI = cast(ConfigAPI, config) # noqa: F821 pylint: disable=E0602,C0103
c: ConfigContainer = cast(ConfigContainer, c) # noqa: F821 pylint: disable=E0602,C0103
# Autogenerated config.py
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# load additional settings configured via autoconfig.yml
config.load_autoconfig()
_ = config.load_autoconfig()
c.content.javascript.log_message.excludes = {
"userscript:_qute_stylesheet": [
"*Refused to apply inline style because it violates the following Content Security Policy directive: *"
],
"userscript:_qute_js": ["*TrustedHTML*"],
}
term = os.getenv("TERMINAL", "xterm")
@ -73,8 +85,8 @@ c.hints.selectors["code"] = [
]
# give the browser nice theme colors
state_dir=os.environ.get('XDG_STATE_HOME', f"{os.environ['HOME']}/.local/state")
colorscheme=f"{state_dir}/qutebrowser/colorscheme.py"
state_dir = os.environ.get("XDG_STATE_HOME", f"{os.environ['HOME']}/.local/state")
colorscheme = f"{state_dir}/qutebrowser/colorscheme.py"
if os.path.isfile(colorscheme):
config.source(colorscheme)

View file

@ -48,11 +48,9 @@ config.bind(leader + "tV", "set tabs.position left")
# [M]edia shortcuts - watch, queue, download media
# bind mpv to play the current page/links, using a single instance which queues the next link passed
config.bind(lleader + "M", "spawn umpv {url}")
config.bind(lleader + "m", "hint links spawn umpv {hint-url}")
config.bind(lleader + "I", "spawn uoeia -v imv {url}")
config.bind(lleader + "i", "hint links spawn uoeia -v imv {hint-url}")
config.bind(lleader + "<Ctrl-i>", "hint images spawn uoeia -v imv {hint-url}")
config.bind(lleader + "I", "hint images spawn uoeia -v imv {hint-url}") # for images directly
# [G]emini shortcuts
# the full power of qutebrowser at your fingertips for any gemini page!
@ -73,9 +71,9 @@ config.bind(lleader + "dp", "save-to-pdf", mode="normal")
config.bind("gD", "recent-downloads", mode="normal")
config.bind('"w', "add-wallabag", mode="normal") # add current page to wallabag
config.bind(';w', "hint links userscript wallabag_add.sh") # add link to wallabag
config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallabag
config.bind('"s', "add-shaarli", mode="normal")
config.bind(';s', "hint links userscript shaarli_add.sh")
config.bind(";s", "hint links userscript shaarli_add.sh")
config.bind('"a', "send-to-archive", mode="normal")