From f42ac2a6a305ec8ead81f5a77ad87f331daf3ac4 Mon Sep 17 00:00:00 2001 From: js0ny Date: Thu, 9 Jan 2025 06:45:00 +0000 Subject: [PATCH] Minor fixes --- .gitignore | 17 +---- Justfile | 9 +++ common/ideavimrc | 1 + platforms/win/glzr/readme.md | 21 +++--- readme.md | 4 +- tools/browser/surfingkeys.js | 4 - tools/fish/conf.d/0init.fish | 1 + tools/fish/conf.d/prompt.fish | 2 +- tools/nvim/.gitignore | 3 +- tools/nvim/lua/config/options.lua | 7 +- tools/nvim/lua/plugins/fileutils.lua | 4 +- tools/nvim/lua/plugins/lsp.lua | 36 ++++++--- tools/nvim/lua/plugins/mod/markview.lua | 30 ++++++++ .../nvim/lua/plugins/mod/nvim-treesitter.lua | 2 +- tools/nvim/lua/plugins/mod/obsidian-nvim.lua | 5 +- .../nvim/lua/plugins/mod/render-markdown.lua | 74 +++++++++++++++++++ tools/nvim/lua/plugins/mod/telescope.lua | 21 ++++++ 17 files changed, 191 insertions(+), 50 deletions(-) create mode 100644 Justfile create mode 100644 tools/nvim/lua/plugins/mod/markview.lua create mode 100644 tools/nvim/lua/plugins/mod/render-markdown.lua create mode 100644 tools/nvim/lua/plugins/mod/telescope.lua diff --git a/.gitignore b/.gitignore index e9a0e0c..725742f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,24 +18,9 @@ test.* # Utils xdg-ninja/ -# nvim config cache -tools/nvim/tt.* -tools/nvim/.tests -tools/nvim/doc/tags -tools/nvim/debug -tools/nvim/.repro -tools/nvim/foo.* -tools/nvim/*.log -tools/nvim/data -tools/nvim/lazy-lock.json -tools/nvim/lazyvim.json -tools/nvim/lua/plugins/obsidian.lua - # Undone # Windows PowerToys PowerToys/ -# Just Script -Justfile # Nushell tools/nushell/ # fzf @@ -50,4 +35,4 @@ platforms/win/komorebi/applications.json gitconfig -*.exe \ No newline at end of file +*.exe diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..271933b --- /dev/null +++ b/Justfile @@ -0,0 +1,9 @@ +set shell := ["pwsh", "-c"] + +pull: + git pull github master + git pull codeberg master + +push: + git push github master + git push codeberg master diff --git a/common/ideavimrc b/common/ideavimrc index 9e0505c..f1236ac 100644 --- a/common/ideavimrc +++ b/common/ideavimrc @@ -84,6 +84,7 @@ nmap F (sneak-S) "" Miscs "" nnoremap : :action GotoAction +nnoremap :action GotoFile "" AI Related a + "" nnoremap ac :action copilot.chat.show diff --git a/platforms/win/glzr/readme.md b/platforms/win/glzr/readme.md index dfb7471..0409c2a 100644 --- a/platforms/win/glzr/readme.md +++ b/platforms/win/glzr/readme.md @@ -24,14 +24,15 @@ just build Or use the minimal setup, by changing `glzr\zebar\settings.json`: `startupConfigs.path` to `minimal/bar.zebar.json`. -```json -{ - "$schema": "https://github.com/glzr-io/zebar/raw/v2.4.0/resources/settings-schema.json", - "startupConfigs": [ - { - "path": "minimal/bar.zebar.json", - "preset": "default" - } - ] -} +```diff + { + "$schema": "https://github.com/glzr-io/zebar/raw/v2.4.0/resources/settings-schema.json", + "startupConfigs": [ + { +- "path": "neobrutal/bar.zebar.json", ++ "path": "minimal/bar.zebar.json", + "preset": "default" + } + ] + } ``` diff --git a/readme.md b/readme.md index 6a4f444..c31c24b 100644 --- a/readme.md +++ b/readme.md @@ -24,8 +24,8 @@ Works for Windows, Linux and MacOS. ``` ^ - n - < h i > e + < h i > + n v ``` diff --git a/tools/browser/surfingkeys.js b/tools/browser/surfingkeys.js index 1070ff0..604a63e 100644 --- a/tools/browser/surfingkeys.js +++ b/tools/browser/surfingkeys.js @@ -246,9 +246,6 @@ api.mapkey('S', 'Start/Stop Generating', function () { var btn = document.querySelector('button.h-8:nth-child(2)'); btn.click(); }, { domain: /chatgpt.com/ }); -<<<<<<< HEAD - -======= api.mapkey('an', 'New Chat', function () { var btn = document.querySelector('div.no-draggable:nth-child(3) > span:nth-child(1) > button:nth-child(1)') btn.click(); @@ -265,7 +262,6 @@ api.mapkey('as', 'Start/Stop Generating', function () { // var btn = document.querySelector('#radix -\: r2i\:'); // btn.click(); //}, { domain: /chatgpt.com/ }); ->>>>>>> 9557dcb023a49b72674bff74180d1d4224b959e0 // perplexity.ai api.unmap('', /perplexity.ai/); diff --git a/tools/fish/conf.d/0init.fish b/tools/fish/conf.d/0init.fish index 8fc4908..d9c9a3f 100644 --- a/tools/fish/conf.d/0init.fish +++ b/tools/fish/conf.d/0init.fish @@ -102,6 +102,7 @@ if command -v gem > /dev/null set -gx PATH $dir $PATH end end + set -gx PATH $HOME/.local/share/gem/ruby/3.3.0/bin $PATH end # Spacemacs if command -v emacs > /dev/null diff --git a/tools/fish/conf.d/prompt.fish b/tools/fish/conf.d/prompt.fish index 447b919..890325e 100644 --- a/tools/fish/conf.d/prompt.fish +++ b/tools/fish/conf.d/prompt.fish @@ -8,6 +8,6 @@ # ln -sf $DOTFILES/tools/fish ~/.config/fish if command -v starship > /dev/null - set STARSHIP_CONFIG "~/.dotfiles/tools/starship/starship_fish.toml" + set -gx STARSHIP_CONFIG "~/.dotfiles/tools/starship/starship_fish.toml" starship init fish | source end diff --git a/tools/nvim/.gitignore b/tools/nvim/.gitignore index 2fcefc7..7051991 100644 --- a/tools/nvim/.gitignore +++ b/tools/nvim/.gitignore @@ -1 +1,2 @@ -lazy-lock.json \ No newline at end of file +lazy-lock.json +./lua/config/keymaps/obsidian-nvim.lua diff --git a/tools/nvim/lua/config/options.lua b/tools/nvim/lua/config/options.lua index de77bff..dea8357 100644 --- a/tools/nvim/lua/config/options.lua +++ b/tools/nvim/lua/config/options.lua @@ -36,8 +36,10 @@ opt.cursorline = true opt.termguicolors = true -- Fold -opt.foldlevel = 99 opt.foldmethod = "expr" +opt.foldexpr = "nvim_treesitter#foldexpr()" +opt.foldlevel = 99 +opt.foldlevelstart = 1 -- Statusline opt.laststatus = 0 @@ -50,3 +52,6 @@ opt.scrolloff = 5 opt.sidescrolloff = 10 opt.conceallevel = 2 + +vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" + diff --git a/tools/nvim/lua/plugins/fileutils.lua b/tools/nvim/lua/plugins/fileutils.lua index f2d4577..1744739 100644 --- a/tools/nvim/lua/plugins/fileutils.lua +++ b/tools/nvim/lua/plugins/fileutils.lua @@ -1,6 +1,6 @@ return { { import = "plugins.mod.auto-session" }, { import = "plugins.mod.nvim-tree" }, - { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, - { import = "plugins.mod.projects" } + { import = "plugins.mod.telescope" }, + { import = "plugins.mod.projects" } } diff --git a/tools/nvim/lua/plugins/lsp.lua b/tools/nvim/lua/plugins/lsp.lua index 514a3c4..67931fe 100644 --- a/tools/nvim/lua/plugins/lsp.lua +++ b/tools/nvim/lua/plugins/lsp.lua @@ -1,17 +1,31 @@ return { { import = "plugins.mod.lspconfig" }, - { "MeanderingProgrammer/render-markdown.nvim" }, - -- { - -- "OXY2DEV/markview.nvim", - -- lazy = false, -- Recommended - -- -- ft = "markdown" -- If you decide to lazy-load anyway - -- - -- dependencies = { - -- "nvim-treesitter/nvim-treesitter", - -- "nvim-tree/nvim-web-devicons" - -- } - -- }, + { + "NoahTheDuke/vim-just", + ft = { "just" } + }, + { import = "plugins.mod.render-markdown" }, + -- { import = "plugins.mod.markview" }, + { + "lervag/vimtex", + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + -- VimTeX configuration goes here, e.g. + vim.g.vimtex_view_method = "sioyek" + end + }, + { + "iurimateus/luasnip-latex-snippets.nvim", + -- vimtex isn't required if using treesitter + requires = { "L3MON4D3/LuaSnip", "lervag/vimtex" }, + config = function() + require'luasnip-latex-snippets'.setup() + -- or setup({ use_treesitter = true }) + require("luasnip").config.setup { enable_autosnippets = true } + end, + }, { "williamboman/mason.nvim", config = true }, { "williamboman/mason-lspconfig.nvim", diff --git a/tools/nvim/lua/plugins/mod/markview.lua b/tools/nvim/lua/plugins/mod/markview.lua new file mode 100644 index 0000000..98e7261 --- /dev/null +++ b/tools/nvim/lua/plugins/mod/markview.lua @@ -0,0 +1,30 @@ +return { + { + "OXY2DEV/markview.nvim", + lazy = false, + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + config = function() + local presets = require("markview.presets") + require("markview").setup({ + checkboxes = presets.checkboxes.nerd, + headings = { + enable = true, + shift_width = 1, + heading_1 = { + style = "label", + hl = "MarkviewH1" + } + }, + code_blocks = { + style = "language", + language_direction = "right", + hl = "MarkviewCode", + info_hl = "MarkviewCodeInfo" + } + }) + end + } +} diff --git a/tools/nvim/lua/plugins/mod/nvim-treesitter.lua b/tools/nvim/lua/plugins/mod/nvim-treesitter.lua index 2a627f3..f4366fc 100644 --- a/tools/nvim/lua/plugins/mod/nvim-treesitter.lua +++ b/tools/nvim/lua/plugins/mod/nvim-treesitter.lua @@ -3,7 +3,7 @@ return { run = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({ - ensure_installed = { "markdown", "markdown_inline" }, + ensure_installed = { "markdown", "markdown_inline", "latex", "python"}, highlight = { enable = true }, indent = { enable = true }, }) diff --git a/tools/nvim/lua/plugins/mod/obsidian-nvim.lua b/tools/nvim/lua/plugins/mod/obsidian-nvim.lua index 48ed3a7..f20b8e8 100644 --- a/tools/nvim/lua/plugins/mod/obsidian-nvim.lua +++ b/tools/nvim/lua/plugins/mod/obsidian-nvim.lua @@ -21,12 +21,15 @@ return { workspaces = { { name = "personal", - path = "~/Obsidian", + path = "~/winhome/Obsidian", }, }, completion = { nvim_cmp = true, min_chars = 2 + }, + ui = { + enable = false } -- see below for full list of options 👇 }, diff --git a/tools/nvim/lua/plugins/mod/render-markdown.lua b/tools/nvim/lua/plugins/mod/render-markdown.lua new file mode 100644 index 0000000..8f6f15a --- /dev/null +++ b/tools/nvim/lua/plugins/mod/render-markdown.lua @@ -0,0 +1,74 @@ +return { + { + "MeanderingProgrammer/render-markdown.nvim", + lazy = false, + config = function() + require("render-markdown").setup({ + render_modes = { "n", "c", "t" }, + latex = { + enabled = true, + converter = "latex2text", + highlight = "RenderMarkdownMath", + top_pad = 0, + bottom_pad = 0, + }, + heading = { + sign = false, + position = "inline", + width = "block", + left_margin = 0.5, + left_pad = 0.2, + right_pad = 0.2, + }, + link = { + custom = { + python = { pattern = "%.py", icon = " " }, + lua = { pattern = "%.lua", icon = " " }, + markdown = { pattern = "%.md", icon = " " }, + }, + }, + bullet = { + icons = { "󰮯 ", "●", "○", "◆", "◇" }, + }, + checkbox = { + checked = { scope_highlight = "@markup.strikethrough" }, + unchecked = { scope_highlight = "@comment.todo" }, + }, + code = { + position = "right", + width = "block", + right_pad = 10, + }, + callout = { + note = { raw = "[!NOTE]", rendered = "󰋽 Note", highlight = "RenderMarkdownInfo" }, + tip = { raw = "[!TIP]", rendered = "󰌶 Tip", highlight = "RenderMarkdownSuccess" }, + important = { raw = "[!IMPORTANT]", rendered = "󰅾 Important", highlight = "RenderMarkdownHint" }, + warning = { raw = "[!WARNING]", rendered = "󰀪 Warning", highlight = "RenderMarkdownWarn" }, + caution = { raw = "[!CAUTION]", rendered = "󰳦 Caution", highlight = "RenderMarkdownError" }, + abstract = { raw = "[!ABSTRACT]", rendered = "󰨸 Abstract", highlight = "RenderMarkdownInfo" }, + summary = { raw = "[!SUMMARY]", rendered = "󰨸 Summary", highlight = "RenderMarkdownInfo" }, + tldr = { raw = "[!TLDR]", rendered = "󰨸 Tldr", highlight = "RenderMarkdownInfo" }, + info = { raw = "[!INFO]", rendered = "󰋽 Info", highlight = "RenderMarkdownInfo" }, + todo = { raw = "[!TODO]", rendered = "󰗡 Todo", highlight = "RenderMarkdownInfo" }, + hint = { raw = "[!HINT]", rendered = "󰌶 Hint", highlight = "RenderMarkdownSuccess" }, + success = { raw = "[!SUCCESS]", rendered = "󰄬 Success", highlight = "RenderMarkdownSuccess" }, + check = { raw = "[!CHECK]", rendered = "󰄬 Check", highlight = "RenderMarkdownSuccess" }, + done = { raw = "[!DONE]", rendered = "󰄬 Done", highlight = "RenderMarkdownSuccess" }, + question = { raw = "[!QUESTION]", rendered = "󰘥 Question", highlight = "RenderMarkdownWarn" }, + help = { raw = "[!HELP]", rendered = "󰘥 Help", highlight = "RenderMarkdownWarn" }, + faq = { raw = "[!FAQ]", rendered = "󰘥 Faq", highlight = "RenderMarkdownWarn" }, + attention = { raw = "[!ATTENTION]", rendered = "󰀪 Attention", highlight = "RenderMarkdownWarn" }, + failure = { raw = "[!FAILURE]", rendered = "󰅖 Failure", highlight = "RenderMarkdownError" }, + fail = { raw = "[!FAIL]", rendered = "󰅖 Fail", highlight = "RenderMarkdownError" }, + missing = { raw = "[!MISSING]", rendered = "󰅖 Missing", highlight = "RenderMarkdownError" }, + danger = { raw = "[!DANGER]", rendered = "󱐌 Danger", highlight = "RenderMarkdownError" }, + error = { raw = "[!ERROR]", rendered = "󱐌 Error", highlight = "RenderMarkdownError" }, + bug = { raw = "[!BUG]", rendered = "󰨰 Bug", highlight = "RenderMarkdownError" }, + example = { raw = "[!EXAMPLE]", rendered = "󰉹 Example", highlight = "RenderMarkdownHint" }, + quote = { raw = "[!QUOTE]", rendered = "󱆨 Quote", highlight = "RenderMarkdownQuote" }, + cite = { raw = "[!CITE]", rendered = "󱆨 Cite", highlight = "RenderMarkdownQuote" }, + }, + }) + end, + }, +} diff --git a/tools/nvim/lua/plugins/mod/telescope.lua b/tools/nvim/lua/plugins/mod/telescope.lua new file mode 100644 index 0000000..b5dba1e --- /dev/null +++ b/tools/nvim/lua/plugins/mod/telescope.lua @@ -0,0 +1,21 @@ +return { + "nvim-telescope/telescope.nvim", + config = function () + require("telescope").setup { + defaults = { + mappings = { + n = { + ["n"] = "move_selection_next", + ["e"] = "move_selection_previous", + ["w"] = "preview_scrolling_up", + ["r"] = "preview_scrolling_down", + ["a"] = "preview_scrolling_left", + ["s"] = "preview_scrolling_right", + } + } + } + } + end, + dependencies = { "nvim-lua/plenary.nvim" }, +} +