diff --git a/ftplugin/docx.lua b/ftplugin/docx.lua new file mode 100644 index 0000000..5f9b8ed --- /dev/null +++ b/ftplugin/docx.lua @@ -0,0 +1 @@ +vim.cmd 'autocmd BufReadPre * !pandoc %:h -t markdown' diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua index 72f1eaf..58feb5c 100644 --- a/ftplugin/markdown.lua +++ b/ftplugin/markdown.lua @@ -1,3 +1,4 @@ vim.opt_local.conceallevel = 2 vim.cmd 'autocmd BufEnter * set formatoptions-=cro' vim.cmd 'autocmd BufEnter * setlocal formatoptions-=cro' +-- vim.cmd 'autocmd BufEnter * EnableAutocorrect' diff --git a/init.lua b/init.lua index 4389b24..6b287e8 100644 --- a/init.lua +++ b/init.lua @@ -3,14 +3,16 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true +-- vim: set filetype=markdown.graphics : -- vim.g.vim_markdown_auto_insert_bullets = 0 -- To make sure image.nvim works with luarocks -package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;' -package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua' +--package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;' +--package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua' -vim.opt_local.autochdir = true +-- trying to make Telescope search work better +-- vim.opt_local.autochdir = true vim.opt.spelllang = { 'en_us', 'nl' } vim.opt.spell = true @@ -21,9 +23,8 @@ vim.keymap.set('n', '', '[s1z=$', { desc = 'Correct previous misspelt word require 'keymaps' -vim.opt.foldmethod = syntax - -vim.opt.foldlevel = 99 +-- vim.opt.foldmethod = syntax +-- vim.opt.foldlevel = 99 vim.g.autoread = true @@ -190,7 +191,7 @@ vim.opt.cursorline = true vim.opt.cursorlineopt = 'number' -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +-- vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -340,9 +341,11 @@ require('lazy').setup({ event = 'VimEnter', branch = '0.1.x', dependencies = { + 'nvim-telescope/telescope-live-grep-args.nvim', 'nvim-lua/plenary.nvim', { -- If encountering errors, see telescope-fzf-native README for installation instructions 'nvim-telescope/telescope-fzf-native.nvim', + 'nvim-telescope/telescope-media-files.nvim', -- `build` is used to run some command when the plugin is installed/updated. -- This is only run then, not every time Neovim starts up. @@ -385,7 +388,13 @@ require('lazy').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { + defaults = { + file_ignore_patterns = { + 'env/', + 'venv/', + '__pycache__/', + }, + }, -- mappings = { -- i = { [''] = 'to_fuzzy_refine' }, -- }, @@ -407,6 +416,8 @@ require('lazy').setup({ -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension, 'live_grep_args') + pcall(require('telescope').load_extension, 'media_files') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -417,8 +428,11 @@ require('lazy').setup({ vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'si', builtin.git_files, { desc = '[S]earch [F]iles [i]n git repo' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', 'st', ':ObsidianTags', { desc = '[S]earch Obsidian [T]ags' }) vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + -- vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sg', ":lua require('telescope').extensions.live_grep_args.live_grep_args()", { desc = '[S]earch by live [G]rep' }) + vim.keymap.set('n', 'sn', ':Telescope notify', { desc = '[S]earch [N]otifications' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) @@ -446,9 +460,9 @@ require('lazy').setup({ end, { desc = '[S]earch [/] in Open Files' }) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() + vim.keymap.set('n', 'sc', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) + end, { desc = '[S]earch neovim [C]onfiguration files' }) end, }, @@ -865,7 +879,8 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + -- 'folke/tokyonight.nvim', + 'rose-pine/neovim', -- { 'rose-pine/neovim', name = 'rose-pine' }, priority = 1000, -- Make sure to load this before all the other start plugins. init = function() @@ -995,6 +1010,34 @@ require('lazy').setup({ }, }, }) +-- VENN KEYMAPS TESTING +-- venn.nvim: enable or disable keymappings +function _G.Toggle_venn() + local venn_enabled = vim.inspect(vim.b.venn_enabled) + if venn_enabled == 'nil' then + vim.b.venn_enabled = true + vim.cmd [[setlocal ve=all]] + -- draw a line on HJKL keystokes + vim.api.nvim_buf_set_keymap(0, 'n', 'J', 'j:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'K', 'k:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'L', 'l:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'H', 'h:VBox', { noremap = true }) + -- draw a box by pressing "f" with visual selection + vim.api.nvim_buf_set_keymap(0, 'v', 'f', ':VBox', { noremap = true }) + else + vim.cmd [[setlocal ve=]] + vim.api.nvim_buf_del_keymap(0, 'n', 'J') + vim.api.nvim_buf_del_keymap(0, 'n', 'K') + vim.api.nvim_buf_del_keymap(0, 'n', 'L') + vim.api.nvim_buf_del_keymap(0, 'n', 'H') + vim.api.nvim_buf_del_keymap(0, 'v', 'f') + vim.b.venn_enabled = nil + end +end +-- toggle keymappings for venn using v +vim.api.nvim_set_keymap('n', 'v', ':lua Toggle_venn()', { noremap = true }) + +-- END OF VENN KEYMAPS TESTING -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/abbrevman.lua.off b/lua/custom/plugins/abbrevman.lua.off new file mode 100644 index 0000000..4b04d3b --- /dev/null +++ b/lua/custom/plugins/abbrevman.lua.off @@ -0,0 +1,15 @@ +return { + 'bolt12/AbbrevMan.nvim', + config = function() + require('abbrev-man').setup { + load_natural_dictionaries_at_startup = true, + load_programming_dictionaries_at_startup = true, + natural_dictionaries = { + ['nt_en'] = {}, + }, + programming_dictionaries = { + ['pr_py'] = {}, + }, + } + end, +} diff --git a/lua/custom/plugins/cmp_dictionary.lua.off b/lua/custom/plugins/cmp_dictionary.lua.off new file mode 100644 index 0000000..4d1301e --- /dev/null +++ b/lua/custom/plugins/cmp_dictionary.lua.off @@ -0,0 +1,9 @@ +return { + 'uga-rosa/cmp_dictionary.nvim', + config = function() + require('cmp_dictionary').setup { + paths = { '/usr/share/dict/words' }, + exact_length = 2, + } + end, +} diff --git a/lua/custom/plugins/diagram.lua.off b/lua/custom/plugins/diagram.lua.off new file mode 100644 index 0000000..36de4a0 --- /dev/null +++ b/lua/custom/plugins/diagram.lua.off @@ -0,0 +1,26 @@ +return { + '3rd/diagram.nvim', + dependencies = { + '3rd/image.nvim', + }, + opts = {}, + config = function() + require('diagram').setup { + integrations = { + require 'diagram.integrations.markdown', + require 'diagram.integrations.neorg', + }, + renderer_options = { + mermaid = { + theme = 'forest', + }, + plantuml = { + charset = 'utf-8', + }, + d2 = { + theme_id = 1, + }, + }, + } + end, +} diff --git a/lua/custom/plugins/dictionary.lua.off b/lua/custom/plugins/dictionary.lua.off new file mode 100644 index 0000000..d560f7f --- /dev/null +++ b/lua/custom/plugins/dictionary.lua.off @@ -0,0 +1,10 @@ +return { + 'paysancorrezien/dictionary.nvim', + ft = 'markdown', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + config = function() + require('dictionary').setup() + end, +} diff --git a/lua/custom/plugins/gx-extended.lua b/lua/custom/plugins/gx-extended.lua new file mode 100644 index 0000000..2c13ba1 --- /dev/null +++ b/lua/custom/plugins/gx-extended.lua @@ -0,0 +1,3 @@ +return { + 'stsewd/gx-extended.vim', +} diff --git a/lua/custom/plugins/gx.lua b/lua/custom/plugins/gx.lua.off similarity index 100% rename from lua/custom/plugins/gx.lua rename to lua/custom/plugins/gx.lua.off diff --git a/lua/custom/plugins/image.lua.off b/lua/custom/plugins/image.lua.off new file mode 100644 index 0000000..b899976 --- /dev/null +++ b/lua/custom/plugins/image.lua.off @@ -0,0 +1,119 @@ +-- https://github.com/3rd/image.nvim +-- +-- Filename: ~/github/dotfiles-latest/neovim/nvim-lazyvim/lua/plugins/image-nvim.lua +-- ~/github/dotfiles-latest/neovim/nvim-lazyvim/lua/plugins/image-nvim.lua + +-- For dependencies see +-- `~/github/dotfiles-latest/neovim/nvim-lazyvim/README.md` +-- +-- -- Uncomment the following 2 lines if you use the local luarocks installation +-- -- Leave them commented to instead use `luarocks.nvim` +-- -- instead of luarocks.nvim +-- Notice that in the following 2 commands I'm using luaver +-- package.path = package.path +-- .. ";" +-- .. vim.fn.expand("$HOME") +-- .. "/.luaver/luarocks/3.11.0_5.1/share/lua/5.1/magick/?/init.lua" +-- package.path = package.path +-- .. ";" +-- .. vim.fn.expand("$HOME") +-- .. "/.luaver/luarocks/3.11.0_5.1/share/lua/5.1/magick/?.lua" +-- +-- -- Here I'm not using luaver, but instead installed lua and luarocks directly through +-- -- homebrew +-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua" +-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua" + +return { + { + -- luarocks.nvim is a Neovim plugin designed to streamline the installation + -- of luarocks packages directly within Neovim. It simplifies the process + -- of managing Lua dependencies, ensuring a hassle-free experience for + -- Neovim users. + -- https://github.com/vhyrro/luarocks.nvim + 'vhyrro/luarocks.nvim', + -- this plugin needs to run before anything else + priority = 1001, + opts = { + rocks = { 'magick' }, + }, + }, + { + '3rd/image.nvim', + dependencies = { 'luarocks.nvim' }, + config = function() + package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;' + package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua' + require('image').setup { + -- backend = 'kitty', + backend = 'ueberzug', + -- kitty_method = 'normal', + integrations = { + -- Notice these are the settings for markdown files + markdown = { + enabled = true, + clear_in_insert_mode = false, + -- Set this to false if you don't want to render images coming from + -- a URL + download_remote_images = true, + -- Change this if you would only like to render the image where the + -- cursor is at + -- I set this to true, because if the file has way too many images + -- it will be laggy and will take time for the initial load + only_render_image_at_cursor = true, + -- markdown extensions (ie. quarto) can go here + filetypes = { 'markdown', 'vimwiki' }, + -- TRYING + resolve_image_path = function(document_path, image_path, fallback) + return fallback(document_path, image_path) + end, + -- END TRYING + }, + neorg = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { 'norg' }, + }, + -- This is disabled by default + -- Detect and render images referenced in HTML files + -- Make sure you have an html treesitter parser installed + -- ~/github/dotfiles-latest/neovim/nvim-lazyvim/lua/plugins/treesitter.lua + html = { + enabled = true, + }, + -- This is disabled by default + -- Detect and render images referenced in CSS files + -- Make sure you have a css treesitter parser installed + -- ~/github/dotfiles-latest/neovim/nvim-lazyvim/lua/plugins/treesitter.lua + css = { + enabled = true, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + + -- This is what I changed to make my images look smaller, like a + -- thumbnail, the default value is 50 + -- max_height_window_percentage = 20, + max_height_window_percentage = 40, + + -- toggles images when windows are overlapped + window_overlap_clear_enabled = false, + window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '' }, + + -- auto show/hide images when the editor gains/looses focus + editor_only_render_when_focused = true, + + -- auto show/hide images in the correct tmux window + -- In the tmux.conf add `set -g visual-activity off` + tmux_show_only_in_active_window = true, + + -- render image files as images when opened + hijack_file_patterns = { '*.png', '*.jpg', '*.jpeg', '*.gif', '*.webp', '*.avif' }, + } + end, + }, +} diff --git a/lua/custom/plugins/img-clip.lua b/lua/custom/plugins/img-clip.lua new file mode 100644 index 0000000..9fe752f --- /dev/null +++ b/lua/custom/plugins/img-clip.lua @@ -0,0 +1,8 @@ +return { + 'HakonHarnes/img-clip.nvim', + event = 'VeryLazy', + opts = {}, + keys = { + { 'p', 'PasteImage', desc = 'Paste image from system clipboard' }, + }, +} diff --git a/lua/custom/plugins/luasnip.lua.off b/lua/custom/plugins/luasnip.lua.off new file mode 100644 index 0000000..e108b7e --- /dev/null +++ b/lua/custom/plugins/luasnip.lua.off @@ -0,0 +1,5 @@ +return { + L3MON4D3/LuaSnip', + version = 'v2.*', + build = "make install_jsregexp" +} diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua index b1591c3..41a864a 100644 --- a/lua/custom/plugins/markdown-preview.lua +++ b/lua/custom/plugins/markdown-preview.lua @@ -1,8 +1,19 @@ +-- return { +-- 'iamcco/markdown-preview.nvim', +-- cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, +-- ft = { 'markdown' }, +-- build = function() +-- vim.fn['mkdp#util#install']() +-- end, +-- } + +-- install with yarn or npm return { 'iamcco/markdown-preview.nvim', cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, - ft = { 'markdown' }, - build = function() - vim.fn['mkdp#util#install']() + build = 'cd app && npm install', + init = function() + vim.g.mkdp_filetypes = { 'markdown' } end, + ft = { 'markdown' }, } diff --git a/lua/custom/plugins/markdown.lua.off b/lua/custom/plugins/markdown.lua.off new file mode 100644 index 0000000..1d8876b --- /dev/null +++ b/lua/custom/plugins/markdown.lua.off @@ -0,0 +1,7 @@ +return { + 'tadmccorkle/markdown.nvim', + ft = 'markdown', -- or 'event = "VeryLazy"' + opts = { + -- configuration here or empty for defaults + }, +} diff --git a/lua/custom/plugins/md-headers.lua b/lua/custom/plugins/md-headers.lua new file mode 100644 index 0000000..21c64bb --- /dev/null +++ b/lua/custom/plugins/md-headers.lua @@ -0,0 +1,6 @@ +return { + 'AntonVanAssche/md-headers.nvim', + version = '*', + opts = {}, + ft = { 'markdown' }, +} diff --git a/lua/custom/plugins/mistake.lua.off b/lua/custom/plugins/mistake.lua.off new file mode 100644 index 0000000..024d336 --- /dev/null +++ b/lua/custom/plugins/mistake.lua.off @@ -0,0 +1,3 @@ +return { + 'ck-zhang/mistake.nvim', +} diff --git a/lua/custom/plugins/neowarrior.lua b/lua/custom/plugins/neowarrior.lua new file mode 100644 index 0000000..33cc196 --- /dev/null +++ b/lua/custom/plugins/neowarrior.lua @@ -0,0 +1,41 @@ +return { + 'duckdm/neowarrior.nvim', + dependencies = { + 'nvim-telescope/telescope.nvim', + 'folke/noice.nvim', + }, + config = function() + local nw = require 'neowarrior' + local home = vim.env.HOME + nw.setup { + report = 'next', + filter = '\\(due.before:2d or due: \\)', + dir_setup = { + { + dir = home .. '/dev/nvim/neowarrior.nvim', + filter = 'project:neowarrior', + mode = 'tree', + expanded = true, + }, + }, + } + vim.keymap.set('n', 'nl', function() + nw.open_left() + end, { desc = 'Open nwarrior on the left side' }) + vim.keymap.set('n', 'nc', function() + nw.open_current() + end, { desc = 'Open nwarrior below current buffer' }) + vim.keymap.set('n', 'nb', function() + nw.open_below() + end, { desc = 'Open nwarrior below current buffer' }) + vim.keymap.set('n', 'na', function() + nw.open_above() + end, { desc = 'Open nwarrior above current buffer' }) + vim.keymap.set('n', 'nr', function() + nw.open_right() + end, { desc = 'Open nwarrior on the right side' }) + vim.keymap.set('n', 'nt', function() + nw.focus() + end, { desc = 'Focus nwarrior' }) + end, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua index ddc97f3..5bb38e1 100644 --- a/lua/custom/plugins/noice.lua +++ b/lua/custom/plugins/noice.lua @@ -12,6 +12,7 @@ return { -- `nvim-notify` is only needed, if you want to use the notification view. -- If not available, we use `mini` as the fallback -- 'rcarriga/nvim-notify', + 'rcarriga/nvim-notify', }, config = function() require('noice').setup { @@ -25,13 +26,29 @@ return { }, -- you can enable a preset for easier configuration presets = { - bottom_search = true, -- use a classic bottom cmdline for search + bottom_search = false, -- use a classic bottom cmdline for search command_palette = true, -- position the cmdline and popupmenu together long_message_to_split = true, -- long messages will be sent to a split inc_rename = false, -- enables an input dialog for inc-rename.nvim lsp_doc_border = false, -- add a border to hover docs and signature help }, + -- routes = { + -- { + -- filter = { + -- event = 'msg_show', + -- kind = '', + -- find = 'written', + -- }, + -- opts = { skip = true }, + -- }, + -- }, + } + require('notify').setup { + timeout = 1000, + stages = 'static', } end, + -- Would be nice to add this for error messages: + -- https://www.reddit.com/r/neovim/comments/1214soy/has_anyone_figured_out_how_to_customize_noicenvim/ }, } diff --git a/lua/custom/plugins/nvim-notify.lua b/lua/custom/plugins/nvim-notify.lua new file mode 100644 index 0000000..325ddc4 --- /dev/null +++ b/lua/custom/plugins/nvim-notify.lua @@ -0,0 +1,3 @@ +return { + 'rcarriga/nvim-notify', +} diff --git a/lua/custom/plugins/nvim-treesitter-context.lua b/lua/custom/plugins/nvim-treesitter-context.lua new file mode 100644 index 0000000..f3e8f75 --- /dev/null +++ b/lua/custom/plugins/nvim-treesitter-context.lua @@ -0,0 +1,20 @@ +return { + 'nvim-treesitter/nvim-treesitter-context', + config = function() + require('treesitter-context').setup { + enable = true, + multiwindow = false, -- Enable multiwindow support. + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. + line_numbers = true, + multiline_threshold = 20, -- Maximum number of lines to show for a single context + trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' + -- Separator between context and content. Should be a single character string, like '-'. + -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. + separator = nil, + zindex = 20, -- The Z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching + } + end, +} diff --git a/lua/custom/plugins/nvimtree.lua b/lua/custom/plugins/nvimtree.lua.off similarity index 100% rename from lua/custom/plugins/nvimtree.lua rename to lua/custom/plugins/nvimtree.lua.off diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua.off similarity index 65% rename from lua/custom/plugins/obsidian.lua rename to lua/custom/plugins/obsidian.lua.off index ce168c3..faebc61 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua.off @@ -24,12 +24,13 @@ return { }, disable_frontmatter = true, ui = { - enable = true, - -- checkboxes = { - -- [' '] = { char = '👀', hl_group = 'ObsidianTodo' }, - -- ['/'] = { char = '🚧', hl_group = 'ObsidianDoing' }, - -- ['x'] = { char = '✅', hl_group = 'ObsidianDone' }, - -- }, + enable = false, + -- checkboxes = { + -- [' '] = { char = '👀', hl_group = 'ObsidianTodo' }, + -- ['/'] = { char = '🚧', hl_group = 'ObsidianDoing' }, + -- ['x'] = { char = '✅', hl_group = 'ObsidianDone' }, + -- ['-'] = { char = '❌', hl_group = 'ObsidianImportant' }, + -- }, }, ---@param url string follow_url_func = function(url) diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index b5d2024..42d4aa8 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -1,3 +1,15 @@ +function _G.get_oil_winbar() + local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid) + local dir = require('oil').get_current_dir(bufnr) + if dir then + return vim.fn.fnamemodify(dir, ':~') + else + -- If there is no current directory (e.g. over ssh), just show the buffer name + return vim.api.nvim_buf_get_name(0) + end +end + +local detail = false return { 'stevearc/oil.nvim', ---@module 'oil' @@ -8,7 +20,17 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if prefer nvim-web-devicons config = function() require('oil').setup { + columns = { + 'icon', + 'mtime', + }, vim.keymap.set('n', 'o', ':Oil'), + view_options = { + show_hidden = true, + }, + win_options = { + winbar = '%!v:lua.get_oil_winbar()', + }, } end, } diff --git a/lua/custom/plugins/pastify.lua b/lua/custom/plugins/pastify.lua index 9185883..43d3964 100644 --- a/lua/custom/plugins/pastify.lua +++ b/lua/custom/plugins/pastify.lua @@ -1,3 +1,4 @@ +local path = vim.fn.expand '%:h' return { 'TobinPalmer/pastify.nvim', cmd = { 'Pastify', 'PastifyAfter' }, @@ -10,10 +11,12 @@ return { config = function() require('pastify').setup { opts = { - absolute_path = false, -- use absolute or relative path to the working directory + -- absolute_path = true, -- use absolute or relative path to the working directory + absolute_path = true, apikey = '', -- Api key, required for online saving - local_path = '/attachments/', -- The path to put local files in, ex ~/Projects//assets/images/.png - save = 'local', -- Either 'local' or 'online' or 'local_file' + -- local_path = path .. '/attachments/', -- The path to put local files in, ex ~/Projects//assets/images/.png + local_path = '/mnt/c/Users/jag206/screenshots/', + save = 'local_file', -- Either 'local' or 'online' or 'local_file' filename = function() return vim.fn.expand '%:t:r' .. '_' .. os.date '%Y-%m-%d_%H-%M-%S' end, diff --git a/lua/custom/plugins/rainbow-csv.lua.off b/lua/custom/plugins/rainbow-csv.lua.off new file mode 100644 index 0000000..97e195e --- /dev/null +++ b/lua/custom/plugins/rainbow-csv.lua.off @@ -0,0 +1,3 @@ +return { + 'mechatroner/rainbow_csv', +} diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua index 0e69f23..38ed45d 100644 --- a/lua/custom/plugins/render-markdown.lua +++ b/lua/custom/plugins/render-markdown.lua @@ -23,10 +23,19 @@ return { highlight = 'RenderMarkdownChecked', }, custom = { - doing = { raw = '[/]', rendered = '🔜', highlight = 'RenderMarkdownTodo' }, - cancelled = { raw = '[-]', rendered = '❌', highlight = 'RenderMarkdownBullet' }, + doing = { raw = '[/]', rendered = '🚧', highlight = 'RenderMarkdownTodo' }, + cancelled = { raw = '[-]', rendered = '❌', highlight = 'RenderMarkdownTodo' }, }, }, + callout = { + cite = { raw = '[!CITE]', rendered = '󱆨 Cite', highlight = 'RenderMarkdownInfo' }, + }, + html = { + comment = { + conceal = false, + }, + }, + only_render_image_at_cursor = true, } vim.keymap.set('n', 'rm', ':RenderMarkdown toggle', { silent = true }) end, diff --git a/lua/custom/plugins/rose-pine.lua b/lua/custom/plugins/rose-pine.lua index 210acc7..4ab1c98 100644 --- a/lua/custom/plugins/rose-pine.lua +++ b/lua/custom/plugins/rose-pine.lua @@ -2,10 +2,14 @@ return { 'rose-pine/neovim', config = function() require('rose-pine').setup { - styles = { - italic = false, - bold = true, - -- transparency = true, + disable_italics = true, + highlight_groups = { + Comment = { italic = true }, + -- htmlBold = { bold = true }, + -- ['@markup.strong'] = { bold = true }, + ['@markup.italic'] = { italic = true }, + -- ['neorg.markup.bold.norg'] = { bold = true }, + -- ['@text.strong'] = { bold = true }, }, } end, diff --git a/lua/custom/plugins/sixelview.lua b/lua/custom/plugins/sixelview.lua new file mode 100644 index 0000000..1876aec --- /dev/null +++ b/lua/custom/plugins/sixelview.lua @@ -0,0 +1,3 @@ +return { + 'kjuq/sixelview.nvim', +} diff --git a/lua/custom/plugins/smoji.lua.off b/lua/custom/plugins/smoji.lua.off new file mode 100644 index 0000000..2d5bdc4 --- /dev/null +++ b/lua/custom/plugins/smoji.lua.off @@ -0,0 +1,16 @@ +return { + 'zakissimo/smoji.nvim', + -- config = function() + -- require 'smoji' + -- vim.keymap.set('n', 'em', 'Smoji') + -- end, + cmd = 'Smoji', + keys = { + { 'e', 'Smoji', desc = 'Git [e]moji' }, + -- { '', 'Smoji', desc = 'Git [e]moji', mode = 'i' }, + -- { '', 'Smoji', desc = 'Git [e]moji', mode = 't' }, + }, + config = function() + require 'smoji' + end, +} diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 0000000..2922348 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,36 @@ +return { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + -- notifier = { enabled = true }, + quickfile = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, + styles = { + notification = { wo = { wrap = true } }, + }, + keys = { + { + 'gg', + function() + Snacks.lazygit { cwd = Snacks.git.get_root() } + end, + desc = 'Lazygit', + }, + { + 'd', + function() + Snacks.dashboard() + end, + desc = 'Snacks Dashboard', + }, + }, +} diff --git a/lua/custom/plugins/surround.lua b/lua/custom/plugins/surround.lua index 9ae2b94..7afa2f8 100644 --- a/lua/custom/plugins/surround.lua +++ b/lua/custom/plugins/surround.lua @@ -1,16 +1,3 @@ return { - 'kylechui/nvim-surround', - version = '*', -- Use for stability; omit to use `main` branch for the latest features - event = 'VeryLazy', - config = function() - require('nvim-surround').setup { - -- Configuration here, or leave empty to use defaults - surrounds = { - ['('] = false, - }, - aliases = { - ['('] = ')', - }, - } - end, + 'tpope/vim-surround', } diff --git a/lua/custom/plugins/surround.lua.off b/lua/custom/plugins/surround.lua.off new file mode 100644 index 0000000..e32286c --- /dev/null +++ b/lua/custom/plugins/surround.lua.off @@ -0,0 +1,10 @@ +return { + 'kylechui/nvim-surround', + version = '*', -- Use for stability; omit to use `main` branch for the latest features + event = 'VeryLazy', + config = function() + require('nvim-surround').setup { + -- Configuration here, or leave empty to use defaults + } + end, +} diff --git a/lua/custom/plugins/taskwarrior.lua.off b/lua/custom/plugins/taskwarrior.lua.off new file mode 100644 index 0000000..944c071 --- /dev/null +++ b/lua/custom/plugins/taskwarrior.lua.off @@ -0,0 +1,10 @@ +return { + 'ribelo/taskwarrior.nvim', + -- opts = {}, + config = function() + local tw = require 'taskwarrior_nvim' + vim.keymap.set('n', 'tw', function() + tw.browser { 'ready' } + end, { desc = 'taskwarrior Telescope' }) + end, +} diff --git a/lua/custom/plugins/telekasten.lua b/lua/custom/plugins/telekasten.lua new file mode 100644 index 0000000..45e9d9c --- /dev/null +++ b/lua/custom/plugins/telekasten.lua @@ -0,0 +1,9 @@ +return { + 'renerocksai/telekasten.nvim', + dependencies = { 'nvim-telescope/telescope.nvim' }, + config = function() + require('telekasten').setup { + home = vim.fn.expand '~/notes-work', + } + end, +} diff --git a/lua/custom/plugins/textutil.lua b/lua/custom/plugins/textutil.lua new file mode 100644 index 0000000..92f0c7a --- /dev/null +++ b/lua/custom/plugins/textutil.lua @@ -0,0 +1,3 @@ +return { + 'vim-scripts/textutil.vim', +} diff --git a/lua/custom/plugins/thethethe.lua.off b/lua/custom/plugins/thethethe.lua.off new file mode 100644 index 0000000..5b49295 --- /dev/null +++ b/lua/custom/plugins/thethethe.lua.off @@ -0,0 +1,3 @@ +return { + 'https://git.sr.ht/~swaits/thethethe.nvim', +} diff --git a/lua/custom/plugins/todo-comments.lua b/lua/custom/plugins/todo-comments.lua new file mode 100644 index 0000000..fe909d3 --- /dev/null +++ b/lua/custom/plugins/todo-comments.lua @@ -0,0 +1,23 @@ +return { + 'folke/todo-comments.nvim', + lazy = false, + -- event = 'VimEnter', + -- dependencies = { 'nvim-lua/plenary.nvim' }, + -- opts = {}, + config = function() + require('todo-comments').setup { + keywords = { + TODO = { icon = '🚧', color = 'hint', alt = { 'TODO' } }, + DOING = { icon = '🔄', color = 'info', alt = { 'DOING' } }, + DONE = { icon = '✅', color = 'default', alt = { 'DONE' } }, + }, + vim.keymap.set('n', 'tw', ':TodoTelescope cwd=~/notes-work/', { silent = true, desc = 'Show [t]odo in work' }), + vim.keymap.set('n', 'tm', ':TodoTelescope cwd=~/notes-personal/', { silent = true, desc = 'Show [t]odo in [my] personal notes' }), + vim.keymap.set('n', 'tp', ':TodoTelescope cwd=~/code-personal/', { silent = true, desc = 'Show [t]odo in [p]rogramming' }), + vim.keymap.set('n', 'ts', ':TodoTelescope cwd=~/notes-work/socc/', { silent = true, desc = 'Show [t]odo in [s]occ' }), + vim.keymap.set('n', 'tc', ':TodoTelescope cwd=~/notes-work/cloud/', { silent = true, desc = 'Show [t]odo in [c]loud folder' }), + vim.keymap.set('n', 'tt', ':TodoTelescope cwd=~/notes-work/tdw/', { silent = true, desc = 'Show [t]odo in [t]dw folder' }), + vim.keymap.set('n', 'tl', ':TodoTelescope cwd=%:h', { silent = true, desc = 'Show [t]odo in [l]ocal folder' }), + } + end, +} diff --git a/lua/custom/plugins/toggle.lua b/lua/custom/plugins/toggle.lua new file mode 100644 index 0000000..03a3273 --- /dev/null +++ b/lua/custom/plugins/toggle.lua @@ -0,0 +1,4 @@ +return { + 'gregorias/toggle.nvim', + config = true, +} diff --git a/lua/custom/plugins/venn.lua b/lua/custom/plugins/venn.lua new file mode 100644 index 0000000..91ec96b --- /dev/null +++ b/lua/custom/plugins/venn.lua @@ -0,0 +1,3 @@ +return { + 'jbyuki/venn.nvim', +} diff --git a/lua/custom/plugins/vim-graphical-preview.lua b/lua/custom/plugins/vim-graphical-preview.lua new file mode 100644 index 0000000..bf15693 --- /dev/null +++ b/lua/custom/plugins/vim-graphical-preview.lua @@ -0,0 +1,3 @@ +return { + 'bytesnake/vim-graphical-preview', +} diff --git a/lua/custom/plugins/vim-markdown.lua b/lua/custom/plugins/vim-markdown.lua.off similarity index 100% rename from lua/custom/plugins/vim-markdown.lua rename to lua/custom/plugins/vim-markdown.lua.off diff --git a/lua/custom/plugins/vim-office.lua b/lua/custom/plugins/vim-office.lua new file mode 100644 index 0000000..ceb6e64 --- /dev/null +++ b/lua/custom/plugins/vim-office.lua @@ -0,0 +1,3 @@ +return { + 'Konfekt/vim-office', +} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 644ca9f..52d8817 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -1 +1,35 @@ -- vim.keymap.set('n', 'si', ':!feh ', { desc = 'Open file under cursor with feh' }) + +------------------------------------------- +-- venn.nvim: enable or disable keymappings +------------------------------------------- +function _G.Toggle_venn() + local venn_enabled = vim.inspect(vim.b.venn_enabled) + if venn_enabled == 'nil' then + vim.b.venn_enabled = true + vim.cmd [[setlocal ve=all]] + -- draw a line on HJKL keystokes + vim.api.nvim_buf_set_keymap(0, 'n', 'J', 'j:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'K', 'k:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'L', 'l:VBox', { noremap = true }) + vim.api.nvim_buf_set_keymap(0, 'n', 'H', 'h:VBox', { noremap = true }) + -- draw a box by pressing "f" with visual selection + vim.api.nvim_buf_set_keymap(0, 'v', 'f', ':VBox', { noremap = true }) + else + vim.cmd [[setlocal ve=]] + vim.api.nvim_buf_del_keymap(0, 'n', 'J') + vim.api.nvim_buf_del_keymap(0, 'n', 'K') + vim.api.nvim_buf_del_keymap(0, 'n', 'L') + vim.api.nvim_buf_del_keymap(0, 'n', 'H') + vim.api.nvim_buf_del_keymap(0, 'v', 'f') + vim.b.venn_enabled = nil + end +end +-- toggle keymappings for venn using v +vim.api.nvim_set_keymap('n', 'v', ':lua Toggle_venn()', { noremap = true }) + +-- vim.keymap.set('n', 'ae', ':EnableAutocorrect', { noremap = false, silent = false, desc = 'Auto[c]orrect [e]able]' }) +-- vim.keymap.set('n', 'ad', ':DisableAutocorrect', { noremap = false, silent = false, desc = 'Auto[c]orrect [disable]' }) +vim.api.nvim_set_keymap('n', 'AE', ':EnableAutocorrect', { noremap = true }) +vim.keymap.set('n', 'ae', ':EnableAutocorrect', { noremap = true }) +vim.keymap.set('n', 'ad', ':DisableAutocorrect', { noremap = true })