From b382585803db8d98327c8ebb59564839cc504631 Mon Sep 17 00:00:00 2001 From: Joost Agterhoek Date: Thu, 22 Aug 2024 09:30:33 +0200 Subject: [PATCH] added current nvim-kickstart plugins here --- lua/custom/plugins/barbar.lua | 9 ++ lua/custom/plugins/image.lua | 116 +++++++++++++++++++++++++ lua/custom/plugins/lualine.lua | 21 +++++ lua/custom/plugins/nvimtree.lua | 20 +++++ lua/custom/plugins/nvterm.lua | 6 ++ lua/custom/plugins/obsidian.lua | 26 ++++++ lua/custom/plugins/toggleterm.lua | 6 ++ lua/custom/plugins/transparent.lua.off | 6 ++ 8 files changed, 210 insertions(+) create mode 100644 lua/custom/plugins/barbar.lua create mode 100644 lua/custom/plugins/image.lua create mode 100644 lua/custom/plugins/lualine.lua create mode 100644 lua/custom/plugins/nvimtree.lua create mode 100644 lua/custom/plugins/nvterm.lua create mode 100644 lua/custom/plugins/obsidian.lua create mode 100644 lua/custom/plugins/toggleterm.lua create mode 100644 lua/custom/plugins/transparent.lua.off diff --git a/lua/custom/plugins/barbar.lua b/lua/custom/plugins/barbar.lua new file mode 100644 index 0000000..6546028 --- /dev/null +++ b/lua/custom/plugins/barbar.lua @@ -0,0 +1,9 @@ +return { + 'romgrk/barbar.nvim', + config = function() + require('barbar').setup() + vim.keymap.set('n', '', ':BufferNext', { silent = true }) + vim.keymap.set('n', '', ':BufferPrevious', { silent = true }) + vim.keymap.set('n', 'x', ':BufferClose', { silent = true }) + end, +} diff --git a/lua/custom/plugins/image.lua b/lua/custom/plugins/image.lua new file mode 100644 index 0000000..fadb99d --- /dev/null +++ b/lua/custom/plugins/image.lua @@ -0,0 +1,116 @@ +-- 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() + require('image').setup { + backend = 'kitty', + 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/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 0000000..8719b3e --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,21 @@ +return { + 'nvim-lualine/lualine.nvim', + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = '|', + disabled_filetypes = { + 'packer', + 'NvimTree', + 'barbar', + 'lua', + 'c', + }, + }, + sections = {}, + } + --require('lualine').hide { place = { 'statusline' }, unhide = false } + end, +} diff --git a/lua/custom/plugins/nvimtree.lua b/lua/custom/plugins/nvimtree.lua new file mode 100644 index 0000000..5f37179 --- /dev/null +++ b/lua/custom/plugins/nvimtree.lua @@ -0,0 +1,20 @@ +return { + 'nvim-tree/nvim-tree.lua', + config = function() + vim.keymap.set('n', 'n', ':NvimTreeToggle', { silent = true }) + require('nvim-tree').setup { + sort = { + sorter = 'case_sensitive', + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + } + end, +} diff --git a/lua/custom/plugins/nvterm.lua b/lua/custom/plugins/nvterm.lua new file mode 100644 index 0000000..999312d --- /dev/null +++ b/lua/custom/plugins/nvterm.lua @@ -0,0 +1,6 @@ +return { + 'NvChad/nvterm', + config = function() + require('nvterm').setup() + end, +} diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua new file mode 100644 index 0000000..b001afe --- /dev/null +++ b/lua/custom/plugins/obsidian.lua @@ -0,0 +1,26 @@ +return { + 'epwalsh/obsidian.nvim', + version = '*', + lazy = true, + ft = 'markdown', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + opts = { + workspaces = { + { + name = 'work', + path = '~/notes-work', + }, + { + name = 'personal', + path = '~/notes-personal', + }, + }, + templates = { + folder = '~/notes-templates', + date_format = '%Y-%m-%d', + time_format = '%H:%M', + }, + }, +} diff --git a/lua/custom/plugins/toggleterm.lua b/lua/custom/plugins/toggleterm.lua new file mode 100644 index 0000000..8bcc153 --- /dev/null +++ b/lua/custom/plugins/toggleterm.lua @@ -0,0 +1,6 @@ +return { + 'akinsho/toggleterm.nvim', + config = function() + require('toggleterm').setup() + end, +} diff --git a/lua/custom/plugins/transparent.lua.off b/lua/custom/plugins/transparent.lua.off new file mode 100644 index 0000000..8e98c0d --- /dev/null +++ b/lua/custom/plugins/transparent.lua.off @@ -0,0 +1,6 @@ +return { + 'xiyaowong/transparent.nvim', + config = function() + require('transparent').clear_prefix 'lualine' + end, +}