nvim org updates

This commit is contained in:
Tiago Sousa 2025-12-14 18:11:49 +00:00
parent 8d74ee5071
commit 7e2f543d95
Signed by: tiago
SSH key fingerprint: SHA256:rOmjD81ZIhKdCkFWS9UIKdBi4UByF5x3hRH/0YeXsPI
6 changed files with 122 additions and 110 deletions

View file

@ -226,6 +226,7 @@ gaps top 32
assign [class="tidal-hifi"] 4
assign [class="discord"] 5
assign [class="vesktop"] 5
assign [class="Ferdium"] 5
assign [class="Element"] 6
assign [class="Signal"] 6
assign [class="thunderbird"] 7
@ -234,7 +235,7 @@ for_window [instance="^copyq$" class="^copyq$"] floating enable, resize set 600
# startup programs
# sets up monitors and picom
exec_always --no-startup-id $monitor_script
exec --no-startup-id nextcloud
exec --no-startup-id opencloud
exec --no-startup-id copyq

View file

@ -16,7 +16,7 @@ return {
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
statusline = 100,
tabline = 1000,
winbar = 1000,
}

View file

@ -1,17 +1,17 @@
return {
"nvim-orgmode/orgmode",
ft = { 'org' },
dependencies = {
"nvim-treesitter/nvim-treesitter",
"akinsho/org-bullets.nvim",
-- "akinsho/org-bullets.nvim",
},
config = function()
-- -- Load custom treesitter grammar for org filetype
require("org-bullets").setup({
symbols = {
headlines = { "", "", "", "" },
checkboxes = false,
},
})
-- require("org-bullets").setup({
-- symbols = {
-- headlines = { "◉", "○", "●", "✸" },
-- checkboxes = false,
-- },
-- })
-- require('orgmode').setup_ts_grammar()
-- -- Treesitter configuration
-- require('nvim-treesitter.configs').setup {
@ -26,8 +26,8 @@ return {
-- ensure_installed = { 'org' }, -- Or run :TSUpdate org
-- }
require('orgmode').setup({
org_agenda_files = { '~/Nextcloud/org/**/*', '~/Nextcloud/Documents/uni/**/*' },
org_default_notes_file = '~/Nextcloud/org/refile.org',
org_agenda_files = { '~/org/**/*' },
org_default_notes_file = '~/org/refile.org',
})
end
}

View file

@ -1,101 +1,110 @@
return {
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
-- during startup.
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end,
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"diff",
"html",
"javascript",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"toml",
"vim",
"vimdoc",
"yaml",
"dockerfile",
"go",
"haskell",
"rust",
},
textobjects = {
move = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
},
},
},
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
end,
},
{
"romgrk/nvim-treesitter-context",
config = function()
require("treesitter-context").setup({
throttle = true, -- Throttles plugin updates (may improve performance)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
show_all_context = false,
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
-- For all filetypes
-- Note that setting an entry here replaces all other patterns for this entry.
-- By setting the 'default' entry below, you can control which nodes you want to
-- appear in the context window.
default = {
"function",
"method",
"for",
"while",
"if",
"switch",
"case",
},
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
-- during startup.
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end,
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"diff",
"html",
"javascript",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"toml",
"vim",
"vimdoc",
"yaml",
"dockerfile",
"go",
"haskell",
"rust",
},
textobjects = {
move = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
},
},
},
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.org = {
install_info = {
url = "https://github.com/milisims/tree-sitter-org",
revision = "main",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "org",
}
end,
},
{
"romgrk/nvim-treesitter-context",
config = function()
require("treesitter-context").setup({
throttle = true, -- Throttles plugin updates (may improve performance)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
show_all_context = false,
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
-- For all filetypes
-- Note that setting an entry here replaces all other patterns for this entry.
-- By setting the 'default' entry below, you can control which nodes you want to
-- appear in the context window.
default = {
"function",
"method",
"for",
"while",
"if",
"switch",
"case",
},
rust = {
"loop_expression",
"impl_item",
},
rust = {
"loop_expression",
"impl_item",
},
typescript = {
"class_declaration",
"abstract_class_declaration",
"else_clause",
},
},
})
end
}
typescript = {
"class_declaration",
"abstract_class_declaration",
"else_clause",
},
},
})
end,
},
}

View file

@ -10,3 +10,5 @@
gpgsign = true
[init]
defaultBranch = main
[alias]
tree = log --oneline --greaph --decorate --all

View file

@ -4,7 +4,7 @@
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find -L ~/Nextcloud ~/.config ~/gits ~/gits/qmk_firmware/keyboards/tsousa ~/ -mindepth 1 -maxdepth 1 -type d,l | fzf)
selected=$(find -L ~/org ~/.config ~/gits ~/gits/qmk_firmware/keyboards/tsousa ~/ -mindepth 1 -maxdepth 1 -type d,l | fzf)
fi
if [[ -z "$selected" ]]; then