From b6a05b9ad79d5cfafecc50b819f3457f7b2300eb Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Apr 2024 08:50:09 +0900 Subject: [PATCH 01/88] new: nvim: pluto_nvim prototype --- dotfiles/neovim/init.lua | 10 ++ dotfiles/neovim/lua/pluto_nvim.lua | 230 +++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+) create mode 100644 dotfiles/neovim/lua/pluto_nvim.lua diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 2b1b6b7..b82c0ce 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -28,6 +28,16 @@ require('lazy').setup({ } end }, + { + dir = "./lua/pluto_nvim.lua", + config = function() + -- temp global for dev + pluto_nvim = require("pluto_nvim") + require("pluto_nvim").setup {} + end, + lazy = true, + ft = { 'julia' }, + }, { 'folke/which-key.nvim', config = function() diff --git a/dotfiles/neovim/lua/pluto_nvim.lua b/dotfiles/neovim/lua/pluto_nvim.lua new file mode 100644 index 0000000..e42edbf --- /dev/null +++ b/dotfiles/neovim/lua/pluto_nvim.lua @@ -0,0 +1,230 @@ +local job = require('plenary.job') +local M = {} + +local NOTEBOOK_HEADER = "### A Pluto.jl notebook ###" +local BLOCK_START = "# ╔═╡ " +local CELLORDER_START = "# ╔═╡ Cell order:" +local CELLORDER_VISIBLE_BODY = "# ╠═" +local CELLORDER_HIDDEN_BODY = "# ╟─" + +local function node_is_pluto_prefix(node) + if node:type() ~= "line_comment" then + return false + end + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("TEXT: ", comment_text[1]) + return nil ~= string.match(comment_text[1], BLOCK_START) and nil == string.match(comment_text[1], CELLORDER_START) +end + +---Get iterator of TSnodes of cell prefix comments +---@return function +function M.get_cell_prefix_nodes() + local curnode = vim.treesitter.get_node() + local top_nodes = curnode:root():iter_children() + return function() + while true do + local node = top_nodes() + if node == nil then + return nil + end + if node_is_pluto_prefix(node) then + return node + end + end + end +end + +local function node_is_cell_order(node) + if node:type() ~= "line_comment" then + return false + end + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("TEXT: ", comment_text[1]) + return nil ~= string.match(comment_text[1], CELLORDER_START) or + nil ~= string.match(comment_text[1], CELLORDER_VISIBLE_BODY) or + nil ~= string.match(comment_text[1], CELLORDER_HIDDEN_BODY) +end + +function M.get_cell_order_nodes() + local curnode = vim.treesitter.get_node() + local top_nodes = curnode:root():iter_children() + return function() + while true do + local node = top_nodes() + if node == nil then + return nil + end + if node_is_cell_order(node) then + return node + end + end + end +end + +---Get prefix TSNode of current cell +---@return TSNode? +local function get_current_cell_prefix_node() + local curnode = vim.treesitter.get_node() + if curnode == nil then + print("Not in a cell") + return nil + end + while curnode:parent():type() ~= "source_file" do + print("curnode", curnode:range()) + curnode = curnode:parent() + end + local prefix_node + if node_is_pluto_prefix(curnode) then + prefix_node = curnode + elseif curnode:prev_sibling() ~= nil and node_is_pluto_prefix(curnode:prev_sibling()) then + prefix_node = curnode:prev_sibling() + else + print("Not a valid cell") + print("current node", curnode:type(), curnode:range()) + return nil + end + return prefix_node +end + +local function get_uuid(node) + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("text", comment_text[1]) + local _, _, uuid = string.find(comment_text[1], "(%x+-%x+-%x+-%x+-%x+)") + return uuid +end + +---Get uuid of the current cell. +---@return string? +function M.get_current_cell_uuid() + local prefix_node = get_current_cell_prefix_node() + if prefix_node == nil then return nil end + return get_uuid(prefix_node) +end + +local function get_cellbody_node(uuid) + for node in M.get_cell_prefix_nodes() do + if uuid == get_uuid(node) then + return node + end + end +end + +---Generate uuid1 using Julia. +---@return string +local function uuid1() + local generated + job:new({ + command = "julia", + args = { "-e", "using UUIDs; print(uuid1())" }, + on_exit = function(j, return_val) + if return_val ~= 0 then + print("error processing UUID", return_val, vim.inspect(j:result())) + end + generated = j:result()[1] + end, + }):sync() + return generated +end + +---Get row number of the cell order entry which corresponds to the current cell +---@param curuuid string +---@return integer? +local function get_cell_order_node(curuuid) + local ordernode_row + for ordernode in M.get_cell_order_nodes() do + local srow, scol, erow, ecol = ordernode:range() + local str = vim.api.nvim_buf_get_text(0, srow, scol, erow, ecol, {}) + local _, _, ordernode_uuid = string.find(str[1], "(%x+-%x+-%x+-%x+-%x+)") + if ordernode_uuid == curuuid then + -- print("Matched: ", curuuid, srow, erow) + ordernode_row = srow + end + end + return ordernode_row +end + +function M.insert_cell_below() + local curuuid = M.get_current_cell_uuid() + if curuuid == nil then + return nil + end + local newuuid = uuid1() + local ordernode_row = get_cell_order_node(curuuid) + vim.api.nvim_buf_set_lines(0, ordernode_row + 1, ordernode_row + 1, true, { + CELLORDER_VISIBLE_BODY .. newuuid + }) + local prefix_node = get_current_cell_prefix_node() + if prefix_node == nil then + return nil + end + local _, _, end_row, _ = prefix_node:next_sibling():range() + vim.api.nvim_buf_set_lines(0, end_row + 1, end_row + 1, true, { + "", + BLOCK_START .. newuuid, + "", + }) + vim.api.nvim_win_set_cursor(0, { end_row + 4, 0 }) +end + +function M.goto_cellorder_entry() + local curuuid = M.get_current_cell_uuid() + if not curuuid then return nil end + local ordernode_row = get_cell_order_node(curuuid) + vim.cmd("norm! m`") + vim.api.nvim_win_set_cursor(0, { ordernode_row + 1, 0 }) +end + +function M.goto_cell_body() + local line_str = vim.api.nvim_get_current_line() + local _, _, uuid = string.find(line_str, "(%x+-%x+-%x+-%x+-%x+)") + if uuid == nil then + print("This line doesn't have valid id") + return nil + end + local body_node = get_cellbody_node(uuid) + local start_row, _, _, _ = body_node:range() + vim.cmd("norm! m`") + vim.api.nvim_win_set_cursor(0, { start_row + 2, 0 }) +end + +function M.toggle_visibility() + local curuuid = M.get_current_cell_uuid() + if not curuuid then return nil end + local ordernode_row = get_cell_order_node(curuuid) + local ordernode_text = vim.api.nvim_buf_get_lines(0, ordernode_row, ordernode_row + 1, true)[1] + if string.find(ordernode_text, CELLORDER_VISIBLE_BODY) then + vim.api.nvim_buf_set_text(0, ordernode_row, 0, ordernode_row, 4, { CELLORDER_HIDDEN_BODY }) + elseif string.find(ordernode_text, CELLORDER_HIDDEN_BODY) then + vim.api.nvim_buf_set_text(0, ordernode_row, 0, ordernode_row, 4, { CELLORDER_VISIBLE_BODY }) + end +end + +function M.setup(opts) + vim.api.nvim_create_user_command('PlutoGoToCellOrder', M.goto_cellorder_entry, { + nargs = 0, + desc = "Go to the cell order entry which corresponds to the current cell", + }) + vim.api.nvim_create_user_command('PlutoGoToCellBody', M.goto_cell_body, { + nargs = 0, + desc = "Go to the cell body which corresponds to the current order entry", + }) + vim.api.nvim_create_user_command('PlutoToggleVisibility', M.toggle_visibility, { + nargs = 0, + desc = "Toggle visiblity of the current cell", + }) + -- require('nvim-treesitter.configs').setup { + -- textobjects = { + -- select = { + -- enable = true, + -- keymaps = { + -- ["ac"] = "@cell.outer", + -- }, + -- }, + -- }, + -- } +end + +return M From 3efaba313560152a01291a8b602b6db72dcbf8dc Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Apr 2024 08:50:09 +0900 Subject: [PATCH 02/88] new: nvim: pluto_nvim prototype --- dotfiles/neovim/init.lua | 10 ++ dotfiles/neovim/lua/pluto_nvim.lua | 230 +++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+) create mode 100644 dotfiles/neovim/lua/pluto_nvim.lua diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 8308575..d478482 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -28,6 +28,16 @@ require('lazy').setup({ } end }, + { + dir = "./lua/pluto_nvim.lua", + config = function() + -- temp global for dev + pluto_nvim = require("pluto_nvim") + require("pluto_nvim").setup {} + end, + lazy = true, + ft = { 'julia' }, + }, { 'folke/which-key.nvim', config = function() diff --git a/dotfiles/neovim/lua/pluto_nvim.lua b/dotfiles/neovim/lua/pluto_nvim.lua new file mode 100644 index 0000000..e42edbf --- /dev/null +++ b/dotfiles/neovim/lua/pluto_nvim.lua @@ -0,0 +1,230 @@ +local job = require('plenary.job') +local M = {} + +local NOTEBOOK_HEADER = "### A Pluto.jl notebook ###" +local BLOCK_START = "# ╔═╡ " +local CELLORDER_START = "# ╔═╡ Cell order:" +local CELLORDER_VISIBLE_BODY = "# ╠═" +local CELLORDER_HIDDEN_BODY = "# ╟─" + +local function node_is_pluto_prefix(node) + if node:type() ~= "line_comment" then + return false + end + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("TEXT: ", comment_text[1]) + return nil ~= string.match(comment_text[1], BLOCK_START) and nil == string.match(comment_text[1], CELLORDER_START) +end + +---Get iterator of TSnodes of cell prefix comments +---@return function +function M.get_cell_prefix_nodes() + local curnode = vim.treesitter.get_node() + local top_nodes = curnode:root():iter_children() + return function() + while true do + local node = top_nodes() + if node == nil then + return nil + end + if node_is_pluto_prefix(node) then + return node + end + end + end +end + +local function node_is_cell_order(node) + if node:type() ~= "line_comment" then + return false + end + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("TEXT: ", comment_text[1]) + return nil ~= string.match(comment_text[1], CELLORDER_START) or + nil ~= string.match(comment_text[1], CELLORDER_VISIBLE_BODY) or + nil ~= string.match(comment_text[1], CELLORDER_HIDDEN_BODY) +end + +function M.get_cell_order_nodes() + local curnode = vim.treesitter.get_node() + local top_nodes = curnode:root():iter_children() + return function() + while true do + local node = top_nodes() + if node == nil then + return nil + end + if node_is_cell_order(node) then + return node + end + end + end +end + +---Get prefix TSNode of current cell +---@return TSNode? +local function get_current_cell_prefix_node() + local curnode = vim.treesitter.get_node() + if curnode == nil then + print("Not in a cell") + return nil + end + while curnode:parent():type() ~= "source_file" do + print("curnode", curnode:range()) + curnode = curnode:parent() + end + local prefix_node + if node_is_pluto_prefix(curnode) then + prefix_node = curnode + elseif curnode:prev_sibling() ~= nil and node_is_pluto_prefix(curnode:prev_sibling()) then + prefix_node = curnode:prev_sibling() + else + print("Not a valid cell") + print("current node", curnode:type(), curnode:range()) + return nil + end + return prefix_node +end + +local function get_uuid(node) + local row, col, _ = node:start() + local comment_text = vim.api.nvim_buf_get_lines(0, row, row + 1, true) + -- print("text", comment_text[1]) + local _, _, uuid = string.find(comment_text[1], "(%x+-%x+-%x+-%x+-%x+)") + return uuid +end + +---Get uuid of the current cell. +---@return string? +function M.get_current_cell_uuid() + local prefix_node = get_current_cell_prefix_node() + if prefix_node == nil then return nil end + return get_uuid(prefix_node) +end + +local function get_cellbody_node(uuid) + for node in M.get_cell_prefix_nodes() do + if uuid == get_uuid(node) then + return node + end + end +end + +---Generate uuid1 using Julia. +---@return string +local function uuid1() + local generated + job:new({ + command = "julia", + args = { "-e", "using UUIDs; print(uuid1())" }, + on_exit = function(j, return_val) + if return_val ~= 0 then + print("error processing UUID", return_val, vim.inspect(j:result())) + end + generated = j:result()[1] + end, + }):sync() + return generated +end + +---Get row number of the cell order entry which corresponds to the current cell +---@param curuuid string +---@return integer? +local function get_cell_order_node(curuuid) + local ordernode_row + for ordernode in M.get_cell_order_nodes() do + local srow, scol, erow, ecol = ordernode:range() + local str = vim.api.nvim_buf_get_text(0, srow, scol, erow, ecol, {}) + local _, _, ordernode_uuid = string.find(str[1], "(%x+-%x+-%x+-%x+-%x+)") + if ordernode_uuid == curuuid then + -- print("Matched: ", curuuid, srow, erow) + ordernode_row = srow + end + end + return ordernode_row +end + +function M.insert_cell_below() + local curuuid = M.get_current_cell_uuid() + if curuuid == nil then + return nil + end + local newuuid = uuid1() + local ordernode_row = get_cell_order_node(curuuid) + vim.api.nvim_buf_set_lines(0, ordernode_row + 1, ordernode_row + 1, true, { + CELLORDER_VISIBLE_BODY .. newuuid + }) + local prefix_node = get_current_cell_prefix_node() + if prefix_node == nil then + return nil + end + local _, _, end_row, _ = prefix_node:next_sibling():range() + vim.api.nvim_buf_set_lines(0, end_row + 1, end_row + 1, true, { + "", + BLOCK_START .. newuuid, + "", + }) + vim.api.nvim_win_set_cursor(0, { end_row + 4, 0 }) +end + +function M.goto_cellorder_entry() + local curuuid = M.get_current_cell_uuid() + if not curuuid then return nil end + local ordernode_row = get_cell_order_node(curuuid) + vim.cmd("norm! m`") + vim.api.nvim_win_set_cursor(0, { ordernode_row + 1, 0 }) +end + +function M.goto_cell_body() + local line_str = vim.api.nvim_get_current_line() + local _, _, uuid = string.find(line_str, "(%x+-%x+-%x+-%x+-%x+)") + if uuid == nil then + print("This line doesn't have valid id") + return nil + end + local body_node = get_cellbody_node(uuid) + local start_row, _, _, _ = body_node:range() + vim.cmd("norm! m`") + vim.api.nvim_win_set_cursor(0, { start_row + 2, 0 }) +end + +function M.toggle_visibility() + local curuuid = M.get_current_cell_uuid() + if not curuuid then return nil end + local ordernode_row = get_cell_order_node(curuuid) + local ordernode_text = vim.api.nvim_buf_get_lines(0, ordernode_row, ordernode_row + 1, true)[1] + if string.find(ordernode_text, CELLORDER_VISIBLE_BODY) then + vim.api.nvim_buf_set_text(0, ordernode_row, 0, ordernode_row, 4, { CELLORDER_HIDDEN_BODY }) + elseif string.find(ordernode_text, CELLORDER_HIDDEN_BODY) then + vim.api.nvim_buf_set_text(0, ordernode_row, 0, ordernode_row, 4, { CELLORDER_VISIBLE_BODY }) + end +end + +function M.setup(opts) + vim.api.nvim_create_user_command('PlutoGoToCellOrder', M.goto_cellorder_entry, { + nargs = 0, + desc = "Go to the cell order entry which corresponds to the current cell", + }) + vim.api.nvim_create_user_command('PlutoGoToCellBody', M.goto_cell_body, { + nargs = 0, + desc = "Go to the cell body which corresponds to the current order entry", + }) + vim.api.nvim_create_user_command('PlutoToggleVisibility', M.toggle_visibility, { + nargs = 0, + desc = "Toggle visiblity of the current cell", + }) + -- require('nvim-treesitter.configs').setup { + -- textobjects = { + -- select = { + -- enable = true, + -- keymaps = { + -- ["ac"] = "@cell.outer", + -- }, + -- }, + -- }, + -- } +end + +return M From 0340b930ea3c7e8963a70aa24c17ddde602e60ec Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 15 Apr 2024 18:00:06 +0900 Subject: [PATCH 03/88] update: nvim: remove auto appended setup script by PDM --- dotfiles/pwsh/powershell_profile.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index d7e9a0f..b9e0ae5 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -231,7 +231,3 @@ Import-Module WSLTabCompletion Get-ChildItem ~\.config\powershell\completions\ | % { . $_ } -# Automatically appended by pdm scoop package -Get-ChildItem "$PROFILE\..\Completions\" | ForEach-Object { - . $_.FullName -} From 6490787142c3b9b21f3ab0111058bd67399c3ca0 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 1 May 2024 18:32:06 +0900 Subject: [PATCH 04/88] nvim: add support for powershell_es on linux --- dotfiles/neovim/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 8308575..d37aed4 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -597,8 +597,10 @@ lspconfig.bashls.setup { capabilities = capabilities, } -- pwsh +local win_pwsh_es_path = '~/scoop/apps/powershell-editorservice/current' +local arch_pwsh_es_path = "/opt/powershell-editor-services/" lspconfig.powershell_es.setup { - bundle_path = '~/scoop/apps/powershell-editorservice/current', + bundle_path = vim.fn.has('win32') == 1 and win_pwsh_es_path or arch_pwsh_es_path, capabilities = capabilities, } -- ccls From 26a0008b64320677fc4be860f9efd04aa5aaf09e Mon Sep 17 00:00:00 2001 From: qwjyh Date: Thu, 6 Jun 2024 23:41:18 +0900 Subject: [PATCH 05/88] new: add qpdfview config --- extra_configs/qpdfview/update_config.py | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 extra_configs/qpdfview/update_config.py diff --git a/extra_configs/qpdfview/update_config.py b/extra_configs/qpdfview/update_config.py new file mode 100755 index 0000000..ddebd60 --- /dev/null +++ b/extra_configs/qpdfview/update_config.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +""" +Modify qpdfview config. +""" + +import configparser +import os +import shutil + +# ======================================================================================= + +QPDFVIEW_CONFIGDIR = os.path.expanduser("~/.config/qpdfview/") +QPDFVIEW_CONFIG_CONFIG = QPDFVIEW_CONFIGDIR + "qpdfview.conf" +print(f"{QPDFVIEW_CONFIG_CONFIG=}") + +shutil.copyfile(QPDFVIEW_CONFIG_CONFIG, QPDFVIEW_CONFIG_CONFIG + ".orig") + +config = configparser.RawConfigParser() +config.optionxform = lambda optionstr: optionstr +config.read(QPDFVIEW_CONFIG_CONFIG) + +config["documentView"]["autoRefresh"] = "true" +config["documentView"]["highlightAll"] = "true" +config["documentView"]["highlightCurrentThumbnail"] = "true" +config["documentView"]["highlightDuration"] = "5000" +config["documentView"]["prefetch"] = "true" +config["documentView"]["prefetchDistance"] = "5" +config["documentView"]["relativeJumps"] = "true" + +config["mainWindow"]["restorePerFileSettings"] = "true" +config["mainWindow"]["restoreTabs"] = "true" +config["mainWindow"]["tabVisibility"] = "0" +config["mainWindow"]["trackRecentlyUsed"] = "true" +config["mainWindow"]["viewToolBar"] = "scaleFactor, zoomIn, zoomOut, fitToPageWidthMode" + +config["pageItem"]["cacheSize"] = "131072K" + +with open(QPDFVIEW_CONFIG_CONFIG, "w") as file: + config.write(file, space_around_delimiters=False) + +# ======================================================================================= + +QPDFVIEW_CONFIG_SHORTCUTS = QPDFVIEW_CONFIGDIR + "shortcuts.conf" + +shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig") + +config = configparser.RawConfigParser() +config.optionxform = lambda optionstr: optionstr +config.read(QPDFVIEW_CONFIG_SHORTCUTS) + +config["General"]["nextPage"] = "Space, N" +config["General"]["previousPage"] = "Backspace, P" + +with open(QPDFVIEW_CONFIG_SHORTCUTS, "w") as file: + config.write(file, space_around_delimiters=False) From 955fd55ff0fe4dfd89f6b8d947b95f9f629878d9 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Jun 2024 19:49:16 +0900 Subject: [PATCH 06/88] fish: new: add qpdfview abbr --- dotfiles/fish/config.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index ebdacbf..37148a4 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -18,6 +18,7 @@ if status is-interactive # abbr (from 3.6, --universal is removed) abbr -a -- l less abbr -a -- ll 'eza -la --icons --git' + abbr -a -- qpv 'qpdfview --unique' zoxide init fish | source From 4fefdd20b230a381d39d888aa13260cd157f15db Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Jun 2024 19:49:36 +0900 Subject: [PATCH 07/88] nvim: update: lazy installation for nvim 0.10 --- dotfiles/neovim/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index d37aed4..bee781b 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -1,7 +1,7 @@ ----------------------------------------------------------- -- Installing plugin manager 'lazy.nvim' local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", From 372040d1d77617f2fc14463f75c4ef71ee504737 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Jun 2024 20:34:25 +0900 Subject: [PATCH 08/88] nvim: update: setting up trouble.nvim v3 - just using default configs --- dotfiles/neovim/init.lua | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index bee781b..6445df9 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -131,7 +131,40 @@ require('lazy').setup({ }, { 'folke/trouble.nvim', - -- config = function + opts = {}, + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=bottom", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, }, { 'Julian/lean.nvim', From 0d16da2b3170c3c5f6a461953052823f3783aa63 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Jun 2024 20:34:54 +0900 Subject: [PATCH 09/88] nvim: fix: replace deprecated function --- dotfiles/neovim/lua/lualine_setup.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/lua/lualine_setup.lua b/dotfiles/neovim/lua/lualine_setup.lua index 7f412d4..ce01287 100644 --- a/dotfiles/neovim/lua/lualine_setup.lua +++ b/dotfiles/neovim/lua/lualine_setup.lua @@ -1,7 +1,7 @@ -- https://qiita.com/uhooi/items/99aeff822d4870a8e269 local lsp_names = function () local clients = {} - for _, client in ipairs(vim.lsp.get_active_clients({ bufnr = 0})) do + for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0})) do table.insert(clients, client.name) end return ' ' .. table.concat(clients, ', ') From a26aa2cd02a1a6d2256e9bce0c0db473acc1aa85 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 24 Jun 2024 18:15:24 +0900 Subject: [PATCH 10/88] nvim: update: use tinymist instead of typst-lsp --- dotfiles/neovim/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 6445df9..fb19edc 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -642,7 +642,13 @@ lspconfig.powershell_es.setup { -- cmd = {'omnisharp'}, -- } -lspconfig.typst_lsp.setup { +-- lspconfig.typst_lsp.setup { +-- on_attach = on_attach, +-- capabilities = capabilities, +-- single_file_support = true, +-- } + +lspconfig.tinymist.setup { on_attach = on_attach, capabilities = capabilities, single_file_support = true, From ae5a5a502f343ede72675ea6854228a1d1f9c034 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 24 Jun 2024 21:53:46 +0900 Subject: [PATCH 11/88] nvim: update: org config --- dotfiles/neovim/init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index fb19edc..6880513 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -230,6 +230,32 @@ require('lazy').setup({ require('orgmode').setup({ org_agenda_files = '~/orgfiles/**/*', org_default_notes_file = '~/orgfiles/refile.org', + org_todo_keywords = { + "TODO(t)", + "PLAN(p)", + "NEXT(n)", + "|", + "DONE(d)", + "CANCELED(c)", + }, + org_todo_keyword_faces = { + -- TODO = ":foreground red", + PLAN = ":foreground #F0BB61", + NEXT = ":background #663333 :foreground #E0A0A0", + CANCELED = ":foreground #99AA99", + }, + org_archive_location = '~/orgfiles/archives/%s_archive::', + org_capture_templates = { + t = { + description = "Task", + template = '* TODO %?\n %u' + }, + l = { + description = "Log", + template = '* %?\n %U' + } + }, + org_id_link_to_org_use_id = true, }) end, }, From bb5a54144ad56f2963018936c189446ca4cffb51 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 13:16:49 +0900 Subject: [PATCH 12/88] nvim: update: [org] use uuid & add Journal capture template --- dotfiles/neovim/init.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 6880513..a20dc73 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -245,17 +245,23 @@ require('lazy').setup({ CANCELED = ":foreground #99AA99", }, org_archive_location = '~/orgfiles/archives/%s_archive::', + org_adapt_indentation = false, + org_id_link_to_org_use_id = true, org_capture_templates = { t = { description = "Task", - template = '* TODO %?\n %u' + template = '* TODO %?\n%u' }, l = { description = "Log", - template = '* %?\n %U' - } + template = '* %?\n%U' + }, + j = { + description = "Journal", + template = '* %?\n%U', + target = '~/orgfiles/journal.org', + }, }, - org_id_link_to_org_use_id = true, }) end, }, From a7be3b1f49e92556ad77721d7ae891c21d40d685 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 13:18:12 +0900 Subject: [PATCH 13/88] tmux: update: reduce cache size --- dotfiles/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 13b5f85..106c2a4 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -2,7 +2,7 @@ source ~/.local.tmux.conf # ----------------------------------------------- -set -g history-limit 500000 +set -g history-limit 50000 set-option -g default-command fish From ceef4b03b0a0973fb42786a07bb98155a813c64a Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 19:19:33 +0900 Subject: [PATCH 14/88] qpdfview: fix: check file existence before operation --- extra_configs/qpdfview/update_config.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/extra_configs/qpdfview/update_config.py b/extra_configs/qpdfview/update_config.py index ddebd60..9498674 100755 --- a/extra_configs/qpdfview/update_config.py +++ b/extra_configs/qpdfview/update_config.py @@ -10,10 +10,19 @@ import shutil # ======================================================================================= QPDFVIEW_CONFIGDIR = os.path.expanduser("~/.config/qpdfview/") +if not os.path.exists(QPDFVIEW_CONFIGDIR): + print("qpdfview config directory not found.") + print("Install qpdfview first and rerun this script.") + print("Exiting...") + exit(1) + +# ======================================================================================= + QPDFVIEW_CONFIG_CONFIG = QPDFVIEW_CONFIGDIR + "qpdfview.conf" print(f"{QPDFVIEW_CONFIG_CONFIG=}") -shutil.copyfile(QPDFVIEW_CONFIG_CONFIG, QPDFVIEW_CONFIG_CONFIG + ".orig") +if os.path.exists(QPDFVIEW_CONFIG_CONFIG): + shutil.copyfile(QPDFVIEW_CONFIG_CONFIG, QPDFVIEW_CONFIG_CONFIG + ".orig") config = configparser.RawConfigParser() config.optionxform = lambda optionstr: optionstr @@ -42,7 +51,8 @@ with open(QPDFVIEW_CONFIG_CONFIG, "w") as file: QPDFVIEW_CONFIG_SHORTCUTS = QPDFVIEW_CONFIGDIR + "shortcuts.conf" -shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig") +if os.path.exists(QPDFVIEW_CONFIG_SHORTCUTS): + shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig") config = configparser.RawConfigParser() config.optionxform = lambda optionstr: optionstr From ca78c94e71b36393ab3458375f359ab272d41b70 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 19:20:08 +0900 Subject: [PATCH 15/88] qpdfview: update configs --- extra_configs/qpdfview/update_config.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/extra_configs/qpdfview/update_config.py b/extra_configs/qpdfview/update_config.py index 9498674..0b7e347 100755 --- a/extra_configs/qpdfview/update_config.py +++ b/extra_configs/qpdfview/update_config.py @@ -32,12 +32,16 @@ config["documentView"]["autoRefresh"] = "true" config["documentView"]["highlightAll"] = "true" config["documentView"]["highlightCurrentThumbnail"] = "true" config["documentView"]["highlightDuration"] = "5000" +config["documentView"]["limitThumbnailsToResults"] = "true" config["documentView"]["prefetch"] = "true" config["documentView"]["prefetchDistance"] = "5" config["documentView"]["relativeJumps"] = "true" +config["mainWindow"]["recentlyClosedCount"] = "20" +config["mainWindow"]["recentlyUsedCount"] = "40" config["mainWindow"]["restorePerFileSettings"] = "true" config["mainWindow"]["restoreTabs"] = "true" +config["mainWindow"]["searchableMenus"] = "true" config["mainWindow"]["tabVisibility"] = "0" config["mainWindow"]["trackRecentlyUsed"] = "true" config["mainWindow"]["viewToolBar"] = "scaleFactor, zoomIn, zoomOut, fitToPageWidthMode" @@ -54,12 +58,15 @@ QPDFVIEW_CONFIG_SHORTCUTS = QPDFVIEW_CONFIGDIR + "shortcuts.conf" if os.path.exists(QPDFVIEW_CONFIG_SHORTCUTS): shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig") -config = configparser.RawConfigParser() -config.optionxform = lambda optionstr: optionstr -config.read(QPDFVIEW_CONFIG_SHORTCUTS) +shortcut_config = configparser.RawConfigParser() +shortcut_config.optionxform = lambda optionstr: optionstr +shortcut_config.read(QPDFVIEW_CONFIG_SHORTCUTS) -config["General"]["nextPage"] = "Space, N" -config["General"]["previousPage"] = "Backspace, P" +shortcut_config["General"]["continuousMode"] = "Ctrl+7, C" +shortcut_config["General"]["findNext"] = "Ctrl+G, Return" +shortcut_config["General"]["findPrevious"] = "Ctrl+Shift+G, Shift+Return" +shortcut_config["General"]["nextPage"] = "Space, N" +shortcut_config["General"]["previousPage"] = "Backspace, P" with open(QPDFVIEW_CONFIG_SHORTCUTS, "w") as file: config.write(file, space_around_delimiters=False) From 6fb7a8f54435c79c00c51c811c93f5ecb66b699f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 19:36:59 +0900 Subject: [PATCH 16/88] update README --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cfe1850..2bf618a 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,18 @@ my dotfiles - AHK macro - wezterm - etc -- Ubuntu 20.04 on WSL - - fish -- Arch/Manjaro +- Arch - fish - tmux - neovim - keyboard config(xremap) - wezterm +- Ubuntu 22.04 on WSL + - fish +- Termux ## extra +- qpdfview - okular # Installing @@ -29,11 +31,20 @@ my dotfiles 6. run `bin/install.ps1` ### note -* manual install lean +* manually install lean ## Linux -1. install fish -2. run install.sh +1. run install.sh + +# Neovim + +## Julia +### Initial setup +- `./bin/neovim/setup_julials.jl` to set up environment with LanguageServer.jl + +- `./bin/neovim/update_julials.jl` to generate sysimage for faster startup time + +Edit `init.lua` to change arguments for julials. # TODO - Iron.nvim doesn't work for julia on Windows From d104726b73cf788a73400f1b171acc4d118a4a68 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 19:37:11 +0900 Subject: [PATCH 17/88] update: julials: automatically create tracecompile.jl file at setup --- bin/neovim/setup_julials.jl | 1 + bin/neovim/update_julials.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/neovim/setup_julials.jl b/bin/neovim/setup_julials.jl index 5c28658..f357963 100644 --- a/bin/neovim/setup_julials.jl +++ b/bin/neovim/setup_julials.jl @@ -4,6 +4,7 @@ if !ispath(project_path) try mkdir(project_path) @info "Created $(project_path)" + touch(joinpath(project_path, "tracecompile.jl")) catch e @error e @error dump(e) diff --git a/bin/neovim/update_julials.jl b/bin/neovim/update_julials.jl index 935848c..f2c81c4 100644 --- a/bin/neovim/update_julials.jl +++ b/bin/neovim/update_julials.jl @@ -4,6 +4,7 @@ cd(project_path) @info "now at " pwd() run(`julia --project=. -e 'using Pkg; Pkg.update()'`) compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line + # Remove anonymous functions from compile trace !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) end |> join read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) From 7b0e53318d6ff2b8dab4b60956ff1673725acff4 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 21:10:20 +0900 Subject: [PATCH 18/88] qpdfview: update: Add G as jump shortcut --- extra_configs/qpdfview/update_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/extra_configs/qpdfview/update_config.py b/extra_configs/qpdfview/update_config.py index 0b7e347..e69d853 100755 --- a/extra_configs/qpdfview/update_config.py +++ b/extra_configs/qpdfview/update_config.py @@ -65,6 +65,7 @@ shortcut_config.read(QPDFVIEW_CONFIG_SHORTCUTS) shortcut_config["General"]["continuousMode"] = "Ctrl+7, C" shortcut_config["General"]["findNext"] = "Ctrl+G, Return" shortcut_config["General"]["findPrevious"] = "Ctrl+Shift+G, Shift+Return" +shortcut_config["General"]["jumpToPage"] = "Ctrl+J, G" shortcut_config["General"]["nextPage"] = "Space, N" shortcut_config["General"]["previousPage"] = "Backspace, P" From fef6bc9836ca5b524713a4648ca0456d3aab7c3b Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 25 Jun 2024 21:25:24 +0900 Subject: [PATCH 19/88] pdfview: fix: bug which overrides shortcut config * wrong variable name --- extra_configs/qpdfview/update_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra_configs/qpdfview/update_config.py b/extra_configs/qpdfview/update_config.py index e69d853..d6593e4 100755 --- a/extra_configs/qpdfview/update_config.py +++ b/extra_configs/qpdfview/update_config.py @@ -70,4 +70,4 @@ shortcut_config["General"]["nextPage"] = "Space, N" shortcut_config["General"]["previousPage"] = "Backspace, P" with open(QPDFVIEW_CONFIG_SHORTCUTS, "w") as file: - config.write(file, space_around_delimiters=False) + shortcut_config.write(file, space_around_delimiters=False) From 438823541a4e640207e4acc8b076e0c2ee21a7ab Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 26 Jun 2024 00:13:12 +0900 Subject: [PATCH 20/88] wezterm: update: font family regarding juisee update v0.2.0 --- dotfiles/wezterm/wezterm.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/wezterm/wezterm.lua b/dotfiles/wezterm/wezterm.lua index f26495e..fbb315d 100644 --- a/dotfiles/wezterm/wezterm.lua +++ b/dotfiles/wezterm/wezterm.lua @@ -51,7 +51,7 @@ return { -- font = wezterm.font 'FirgeNerd Console' font = wezterm.font_with_fallback { { - family = 'JuiseeHW Nerd Font', + family = 'Juisee HWNF', weight = 'Bold', harfbuzz_features = { 'calt=0', -- disables ligature From 64ce6479cb32e85b144c45a100569a244af87c71 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Jul 2024 00:29:19 +0900 Subject: [PATCH 21/88] nvim: add: hlchunk & update dependency path --- dotfiles/neovim/init.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index a20dc73..defba8a 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -56,7 +56,21 @@ require('lazy').setup({ }, { -- lualine(statusline) 'nvim-lualine/lualine.nvim', - dependencies = { 'kyazdani42/nvim-web-devicons', lazy = true } + dependencies = { 'nvim-tree/nvim-web-devicons', lazy = true } + }, + { + 'shellRaining/hlchunk.nvim', + event = { "BufReadPre", "BufNewFile" }, + config = function() + require('hlchunk').setup { + chunk = { + enable = true, + }, + line_num = { + enable = true, + }, + } + end }, { 'lervag/vimtex', From b560911ad415092d18b0072ccf5e3ddf3afdccfa Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Jul 2024 00:29:41 +0900 Subject: [PATCH 22/88] nvim: change: use 4 threads for julials --- dotfiles/neovim/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index defba8a..bd48ca9 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -629,6 +629,7 @@ lspconfig.julials.setup { -- use below 2 lines to collect script to be included in sysimage -- '--trace-compile', -- vim.env.HOME .. "/.julia/environments/nvim-lspconfig/tracecompile.jl", + "-t4", "-e", [[ # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig From 603c10544bdd4dc4310db328c64397b15c4dacb9 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 31 Jul 2024 14:09:31 +0900 Subject: [PATCH 23/88] update: nvim: replace ruff lsp with ruff --- dotfiles/neovim/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index bd48ca9..c0333ec 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -714,7 +714,7 @@ lspconfig.rust_analyzer.setup { } local lss = { "pyright", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", - "csharp_ls", "html", "r_language_server", "ruff_lsp", "cssls", "jsonls", "sqls" } + "csharp_ls", "html", "r_language_server", "cssls", "jsonls", "sqls", "vhdl_ls", "ruff" } for _, ls in pairs(lss) do lspconfig[ls].setup { on_attach = on_attach, From 386410bc6ca4572c76b012120b2931d7491601e0 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 5 Aug 2024 22:33:33 +0200 Subject: [PATCH 24/88] new: xremap: add mouse config --- extra_configs/xremap_mouse_config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extra_configs/xremap_mouse_config.yml diff --git a/extra_configs/xremap_mouse_config.yml b/extra_configs/xremap_mouse_config.yml new file mode 100644 index 0000000..31dbff8 --- /dev/null +++ b/extra_configs/xremap_mouse_config.yml @@ -0,0 +1,15 @@ +keymap: + - name: Wheel Tilt + remap: + # Side forward + Btn_Side: Left + # Side back + Btn_Extra: Right + XRIGHTSCROLL: + remap: + XHIRES_RIGHTSCROLL: Ctrl-Tab + XLEFTSCROLL: + remap: + XHIRES_LEFTSCROLL: Ctrl-Shift-Tab + device: + only: 'Logi M750 Mouse' From 7efd53759a46c36222791d4ff0597cdc0d17f59b Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 2 Oct 2024 19:15:34 +0900 Subject: [PATCH 25/88] (WIP) new: nvim: tree-sitter injection for julia sql string --- .../neovim/after/queries/julia/injections.scm | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dotfiles/neovim/after/queries/julia/injections.scm b/dotfiles/neovim/after/queries/julia/injections.scm index 60d3f24..964cc3b 100644 --- a/dotfiles/neovim/after/queries/julia/injections.scm +++ b/dotfiles/neovim/after/queries/julia/injections.scm @@ -5,3 +5,42 @@ (#eq? @_prefix "md") (#set! injection.language "markdown") (#offset! @injection.content 0 2 0 -1)) + +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "sql") +; (#set! injection.language "sql") +; (#offset! @injection.content 0 4 0 -1)) +; +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "s") +; (#set! injection.language "sql") +; (#offset! @injection.content 0 3 0 -1)) +; +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "t") +; (#set! injection.language "regex") +; (#offset! @injection.content 0 2 0 -1)) +; +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "ts") +; (#set! injection.language "regex") +; (#offset! @injection.content 0 2 0 -1)) +; +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "tu") +; (#set! injection.language "regex") +; (#offset! @injection.content 0 3 0 -1)) +; +; ((prefixed_string_literal +; prefix: (identifier) @_prefix) @injection.content +; (#eq? @_prefix "sql") +; ; (#offset! @injection.content 0 2 0 -1) +; ; (#offset! @injection.content 0 6 0 -3) +; (#gsub! @injection.content "^\"%\"" "%1") +; (#set! injection.language "sql") +; ) From 686a6f13329138e5fdf8b255dafef755e4010cdf Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 12:00:19 +0900 Subject: [PATCH 26/88] fix(neovim install): install ftplugin for typst --- bin/install.ps1 | 1 + bin/install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/install.ps1 b/bin/install.ps1 index bcc5fce..2991261 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -58,6 +58,7 @@ New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lspconfig\server_ mkdir $env:LOCALAPPDATA\nvim\after\ftplugin New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\satysfi.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\satysfi.lua) New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\tex.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\tex.lua) +New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\typst.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\typst.lua) mkdir $env:LOCALAPPDATA\nvim\after\queries\satysfi Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/highlights.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\highlights.scm Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/indents.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\indents.scm diff --git a/bin/install.sh b/bin/install.sh index 09fca0c..905daea 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -31,6 +31,7 @@ ln -sf $(pwd)/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua mkdir -p ~/.config/nvim/after/ftplugin ln -sf $(pwd)/dotfiles/neovim/after/ftplugin/satysfi.lua ~/.config/nvim/after/ftplugin/satysfi.lua ln -sf $(pwd)/dotfiles/neovim/after/ftplugin/tex.lua ~/.config/nvim/after/ftplugin/tex.lua +ln -sf $(pwd)/dotfiles/neovim/after/ftplugin/typst.lua ~/.config/nvim/after/ftplugin/typst.lua mkdir -p ~/.config/nvim/after/queries/satysfi curl -o ~/.config/nvim/after/queries/satysfi/highlights.scm https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/highlights.scm curl -o ~/.config/nvim/after/queries/satysfi/indents.scm https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/indents.scm From 2b0329474ca4fe73992783bd964b3628975dddc0 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 12:03:23 +0900 Subject: [PATCH 27/88] update(nvim): update julials dependency(add TOML) --- bin/neovim/add_dependencies.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/neovim/add_dependencies.jl b/bin/neovim/add_dependencies.jl index 82a99d6..19e6963 100644 --- a/bin/neovim/add_dependencies.jl +++ b/bin/neovim/add_dependencies.jl @@ -13,7 +13,7 @@ foreach(Pkg.add, pkg_ls_deps) # add extra dependencies # these packages are manually collected -pkg_extra = ["Logging", "Sockets", "DataStructures", "Tar", "ArgTools", "Dates", "Downloads"] +pkg_extra = ["Logging", "Sockets", "DataStructures", "Tar", "ArgTools", "Dates", "Downloads", "TOML"] foreach(Pkg.add, pkg_extra) @info "dependency added" From 49321cb4ff023d1ed7116598fa9ae118d8f742dd Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 12:04:33 +0900 Subject: [PATCH 28/88] fix(xremap): config for M750(remove keymap for side buttons) --- extra_configs/xremap_mouse_config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra_configs/xremap_mouse_config.yml b/extra_configs/xremap_mouse_config.yml index 31dbff8..1487f83 100644 --- a/extra_configs/xremap_mouse_config.yml +++ b/extra_configs/xremap_mouse_config.yml @@ -2,9 +2,9 @@ keymap: - name: Wheel Tilt remap: # Side forward - Btn_Side: Left + # Btn_Side: Left # Side back - Btn_Extra: Right + # Btn_Extra: Right XRIGHTSCROLL: remap: XHIRES_RIGHTSCROLL: Ctrl-Tab From d8158947e51270008422b0e76fba1673b68a1550 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 14:26:09 +0900 Subject: [PATCH 29/88] update(nvim): update satysfi_ls config and its loading --- dotfiles/neovim/init.lua | 1 + .../server_configurations/satysfi_ls.lua | 31 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index c0333ec..faf7622 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -666,6 +666,7 @@ lspconfig.julials.setup { ]] } } -- SATySFi +require 'lspconfig.server_configurations.satysfi_ls' lspconfig.satysfi_ls.setup { on_attach = on_attach, capabilities = capabilities, diff --git a/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua b/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua index 1301c06..8659f2e 100644 --- a/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua +++ b/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua @@ -1,21 +1,20 @@ -- https://zenn.dev/monaqa/articles/2021-12-10-satysfi-language-server -local util = require 'lspconfig.util' +local configs = require 'lspconfig.configs' -return { - default_config = { - cmd = { 'satysfi-language-server' }, - filetypes = { 'satysfi' }, - root_dir = util.root_pattern('.git'), - single_file_support = true, - }, - docs = { - description = [[ - https://github.com/monaqa/satysfi-language-server - Language server for SATySFi. - ]], +configs.satysfi_ls = { default_config = { - root_dir = [[root_pattern(".git")]], + cmd = { 'satysfi-language-server' }, + filetypes = { 'satysfi' }, + root_dir = vim.fs.root(0, ".git"), + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/monaqa/satysfi-language-server + Language server for SATySFi. + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, }, - }, } - From 3ea290ea587c925358097417eca5b33e1f168fde Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 14:26:47 +0900 Subject: [PATCH 30/88] fix(nvim): replace tsserver -> ts_ls since it's deprecated - according to lspconfig --- dotfiles/neovim/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index faf7622..24b870f 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -714,7 +714,7 @@ lspconfig.rust_analyzer.setup { } } -local lss = { "pyright", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", +local lss = { "pyright", "texlab", "ccls", "clangd", "ts_ls", --[["tailwindcss"]] "hls", "cmake", "csharp_ls", "html", "r_language_server", "cssls", "jsonls", "sqls", "vhdl_ls", "ruff" } for _, ls in pairs(lss) do lspconfig[ls].setup { From 616a13b1b0c19ff8dc1b1e707914d907055f257f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 11 Oct 2024 14:27:24 +0900 Subject: [PATCH 31/88] update: julia-sysimages --- julia-sysimages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-sysimages b/julia-sysimages index 21f32a2..98581ab 160000 --- a/julia-sysimages +++ b/julia-sysimages @@ -1 +1 @@ -Subproject commit 21f32a2032614d2e923be436ca4a4f0f07a8cdc5 +Subproject commit 98581abe7cb2baecd63e95c337da08778fec60ae From ad4a9f53a1d716f282f1dc3cf74898eff6c910c6 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 22 Oct 2024 18:15:48 +0900 Subject: [PATCH 32/88] fix(julials): fix sysimage update (remove func calls for printstyled in tracecompile) --- bin/neovim/update_julials.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/neovim/update_julials.jl b/bin/neovim/update_julials.jl index f2c81c4..08e1f36 100644 --- a/bin/neovim/update_julials.jl +++ b/bin/neovim/update_julials.jl @@ -5,7 +5,7 @@ cd(project_path) run(`julia --project=. -e 'using Pkg; Pkg.update()'`) compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line # Remove anonymous functions from compile trace - !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) + !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line) end |> join read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) @info "compiling sysimage..." From f5efb7cb66ff81acfb87e7b16f658f1b877f1637 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 22 Oct 2024 18:27:36 +0900 Subject: [PATCH 33/88] refactor(julials): update docs & remove unused shell scripts --- bin/neovim/readme.md | 17 +++++++---------- bin/neovim/setup_julials.jl | 12 +++--------- bin/neovim/setup_julials.sh | 2 -- bin/neovim/update_julials.jl | 25 +++++++++++++------------ bin/neovim/update_julials.sh | 7 ------- 5 files changed, 23 insertions(+), 40 deletions(-) delete mode 100755 bin/neovim/setup_julials.sh delete mode 100755 bin/neovim/update_julials.sh diff --git a/bin/neovim/readme.md b/bin/neovim/readme.md index b94f686..ba69a49 100644 --- a/bin/neovim/readme.md +++ b/bin/neovim/readme.md @@ -1,27 +1,24 @@ # How to manage Julia Language Server -This config use sysimage built with PackageCompiler to make language server startup faster. -Scripts in this directory is for management of sysimage. +This config use sysimage built with PackageCompiler to make language server starts faster. +Scripts in this directory are for management of the sysimage. # description all related process is done in project at `~/.julia/environments/nvim-lspconfig/`. -## startup +## install (or minor update of Julia) ```sh -$ ./setup_julials.sh +julia ./setup_julials.jl ``` -which executes `add_dependencies.jl` internally. +Run Language Server with `--tracecompile` option from any editor. ## update ```sh -$ ./update_julials.sh +julia ./update_julials.sh ``` which updates project, compile sysimage, then do precompile. +To use the sysimage, run Language Server with `-J ~/.julia/environments/nvim-lspconfig/` option. # effect Start up got about x3 - x4 faster. It still takes some time to load packages though. -# TODO -- [ ] Not sure all necessary packages are listed in add_dependencies.jl -- [ ] Maybe it's better to set up different sysimages for each projects - diff --git a/bin/neovim/setup_julials.jl b/bin/neovim/setup_julials.jl index f357963..f6107bd 100644 --- a/bin/neovim/setup_julials.jl +++ b/bin/neovim/setup_julials.jl @@ -1,15 +1,9 @@ #!/usr/bin/julia project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig") if !ispath(project_path) - try - mkdir(project_path) - @info "Created $(project_path)" - touch(joinpath(project_path, "tracecompile.jl")) - catch e - @error e - @error dump(e) - throw(e) - end + mkdir(project_path) + @info "Created $(project_path)" + touch(joinpath(project_path, "tracecompile.jl")) end cmd = `julia --project=$(project_path) $(@__DIR__)/add_dependencies.jl` @info cmd diff --git a/bin/neovim/setup_julials.sh b/bin/neovim/setup_julials.sh deleted file mode 100755 index f1aa150..0000000 --- a/bin/neovim/setup_julials.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -x -julia --project=~/.julia/environments/nvim-lspconfig ./add_dependencies.jl diff --git a/bin/neovim/update_julials.jl b/bin/neovim/update_julials.jl index 08e1f36..713c00b 100644 --- a/bin/neovim/update_julials.jl +++ b/bin/neovim/update_julials.jl @@ -1,15 +1,16 @@ #!/usr/bin/julia project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig") -cd(project_path) -@info "now at " pwd() -run(`julia --project=. -e 'using Pkg; Pkg.update()'`) -compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line - # Remove anonymous functions from compile trace - !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line) -end |> join -read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) -@info "compiling sysimage..." -run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`) -@info "post precompile" -run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`) +cd(project_path) do + @info "now at " pwd() + run(`julia --project=. -e 'using Pkg; Pkg.update()'`) + compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line + # Remove anonymous functions from compile trace + !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line) + end |> join + read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) + @info "compiling sysimage..." + run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`) + @info "post precompile" + run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`) +end diff --git a/bin/neovim/update_julials.sh b/bin/neovim/update_julials.sh deleted file mode 100755 index 8dd5a78..0000000 --- a/bin/neovim/update_julials.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/bash -x -cd ~/.julia/environments/nvim-lspconfig/ || return 1 -julia --project=. -e 'using Pkg; Pkg.update()' -cat precompile_exec_head.jl tracecompile.jl > precompile_exec.jl -julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path="sys-ls.so", precompile_execution_file=["precompile_exec.jl"])' -julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()' - From 1f600a970a28733bcbdbff068b855358d07ad863 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sat, 26 Oct 2024 02:53:56 +0900 Subject: [PATCH 34/88] fix(julials): import FileWatching on Windows --- bin/neovim/add_dependencies.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/neovim/add_dependencies.jl b/bin/neovim/add_dependencies.jl index 19e6963..f4560c5 100644 --- a/bin/neovim/add_dependencies.jl +++ b/bin/neovim/add_dependencies.jl @@ -24,6 +24,9 @@ open(out_path, "w") do io println(io, "using LanguageServer") println(io, "using " * join(pkg_ls_deps, ", ")) println(io, "using " * join(pkg_extra, ", ")) + if Sys.iswindows() + println(io, "import FileWatching") + end end @info "finished writing precompile head file" From 2a7d1d80c0a71895185e58a9e1f0a7e58c70ac1c Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 28 Oct 2024 17:20:55 +0900 Subject: [PATCH 35/88] new(lf): lfrc --- bin/install.ps1 | 3 +++ dotfiles/lf/lfrc | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 dotfiles/lf/lfrc diff --git a/bin/install.ps1 b/bin/install.ps1 index 2991261..be17a41 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -77,4 +77,7 @@ New-Item -ItemType SymbolicLink -Path ~\.config\wezterm\wezterm.lua -Target (Res # julia mkdir ~\.config\julia\config New-Item -ItemType SymbolicLink -Path ~\.julia\config\startup.jl -Target (Resolve-Path .\dotfiles\startup_windows.jl) -Force +# lf +mkdir $env:LOCALAPPDATA\lf +New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\lf\lfrc -Target (Resolve-Path .\dotfiles\lf\lfrc) -Force diff --git a/dotfiles/lf/lfrc b/dotfiles/lf/lfrc new file mode 100644 index 0000000..15b8558 --- /dev/null +++ b/dotfiles/lf/lfrc @@ -0,0 +1,23 @@ +cmap cmd-menu-complete +cmap cmd-menu-complete-back + +## https://github.com/gokcehan/lf/wiki/Integrations#eza +#cmd on-select &{{ +# lf -remote "send $id set statfmt \"$(eza -ld --color=always "$f" | sed 's/\\/\\\\/g;s/"/\\"/g')\"" +#}} +# +#cmd git_branch ${{ +# git branch | fzf | xargs git checkout +# pwd_shell="$(pwd | sed 's/\\/\\\\/g;s/"/\\"/g')" +# lf -remote "send $id updir; cd \"$pwd_shell\"" +#}} +#map gb :git_branch +#map gp $clear; git pull --rebase || true; echo "press ENTER"; read ENTER +#map gs $clear; git status; echo "press ENTER"; read ENTER +#map gl $clear; git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit +# +#cmd on-cd &{{ +# fmt="$(STARSHIP_SHELL= starship prompt | sed 's/\\/\\\\/g;s/"/\\"/g')" +# lf -remote "send $id set promptfmt \"$fmt\"" +#}} + From df46ec74534de8491fea854fe448000c27f927bc Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 28 Oct 2024 22:12:42 +0900 Subject: [PATCH 36/88] new(lf): config installation for linux --- bin/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/install.sh b/bin/install.sh index 905daea..2b12256 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -45,3 +45,6 @@ ln -sf $(pwd)/dotfiles/neovim/luasnippets/satysfi/math.lua ~/.config/nvim/luasni mkdir -p ~/.julia/config ln -sf $(pwd)/dotfiles/startup_linux.jl ~/.julia/config/startup.jl + +mkdir -p ~/.config/lf +ln -sf $(pwd)/dotfiles/lf/lfrc ~/.config/lf/lfrc From c67a385937a00745ed3a00deea73b0460ad35709 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Thu, 31 Oct 2024 21:17:34 +0900 Subject: [PATCH 37/88] new(nix): Experimental nix config --- nix/README.md | 14 ++++++++++++++ nix/flake.nix | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 nix/README.md create mode 100644 nix/flake.nix diff --git a/nix/README.md b/nix/README.md new file mode 100644 index 0000000..78b8257 --- /dev/null +++ b/nix/README.md @@ -0,0 +1,14 @@ +# Experimental Nix flake for general cli environment +- Basically for servers, not for my laptops. + +# How to Install +```sh +$ nix flake build +$ nix profile install .#my-packages +``` + +# How to upgrade +```sh +$ nix flake upgrade +$ nix profile upgrade my-packages +``` diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..b43071e --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: { + + packages.x86_64-linux.my-packages = nixpkgs.legacyPackages.x86_64-linux.buildEnv { + name = "my-packages-list"; + paths = [ + nixpkgs.legacyPackages.x86_64-linux.fish + nixpkgs.legacyPackages.x86_64-linux.git + nixpkgs.legacyPackages.x86_64-linux.curl + nixpkgs.legacyPackages.x86_64-linux.neovim + nixpkgs.legacyPackages.x86_64-linux.ripgrep + nixpkgs.legacyPackages.x86_64-linux.fzf + + nixpkgs.legacyPackages.x86_64-linux.clang-tools + ]; + }; + }; +} + From 0da729ce7eda7211b14b7d8d00c1b5ea90075f12 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 12 Nov 2024 10:23:30 +0900 Subject: [PATCH 38/88] update(nix): add starship & reevaluate --- nix/flake.lock | 27 +++++++++++++++++++++++++++ nix/flake.nix | 1 + 2 files changed, 28 insertions(+) create mode 100644 nix/flake.lock diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..e3a64e1 --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix index b43071e..c6dcf63 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -16,6 +16,7 @@ nixpkgs.legacyPackages.x86_64-linux.neovim nixpkgs.legacyPackages.x86_64-linux.ripgrep nixpkgs.legacyPackages.x86_64-linux.fzf + nixpkgs.legacyPackages.x86_64-linux.starship nixpkgs.legacyPackages.x86_64-linux.clang-tools ]; From 7d8b8e3f14b19ed193f32083d706d1a8e2d09cb5 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 12 Nov 2024 11:06:56 +0900 Subject: [PATCH 39/88] udpate(nix): add bat --- nix/flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/flake.nix b/nix/flake.nix index c6dcf63..b82ede3 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -15,6 +15,7 @@ nixpkgs.legacyPackages.x86_64-linux.curl nixpkgs.legacyPackages.x86_64-linux.neovim nixpkgs.legacyPackages.x86_64-linux.ripgrep + nixpkgs.legacyPackages.x86_64-linux.bat nixpkgs.legacyPackages.x86_64-linux.fzf nixpkgs.legacyPackages.x86_64-linux.starship From 297445343d79a324972cd786d120f1fd5ce465f6 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 15 Nov 2024 20:33:25 +0900 Subject: [PATCH 40/88] new(nvim): add typst-preview.nvim with customization to modify --root for typst --- dotfiles/neovim/init.lua | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 24b870f..daf7440 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -279,6 +279,65 @@ require('lazy').setup({ }) end, }, + { + 'chomosuke/typst-preview.nvim', + ft = 'typst', + version = 'v1.*', + build = function() + require 'typst-preview'.update() + end, + config = function() + require 'typst-preview'.setup { + -- Setting this true will enable printing debug information with print() + debug = false, + + -- Custom format string to open the output link provided with %s + -- Example: open_cmd = 'firefox %s -P typst-preview --class typst-preview' + open_cmd = nil, + + -- Setting this to 'always' will invert black and white in the preview + -- Setting this to 'auto' will invert depending if the browser has enable + -- dark mode + -- Setting this to '{"rest": "