diff --git a/.env b/.env new file mode 100644 index 00000000..e69de29b diff --git a/init.lua b/init.lua index aad49986..ed3da84f 100644 --- a/init.lua +++ b/init.lua @@ -441,6 +441,7 @@ require('lazy').setup({ -- pickers = {} pickers = { find_files = { + themes = 'dropdown', file_ignore_patterns = { 'node_modules', '.git', '.venv' }, hidden = true, }, @@ -456,6 +457,18 @@ require('lazy').setup({ require('telescope.themes').get_dropdown(), }, }, + defaults = { + layout_strategy = 'vertical', + layout_config = { + preview_height = 0.7, + vertical = { + size = { + width = '95%', + height = '95%', + }, + }, + }, + }, } -- Enable Telescope extensions if they are installed diff --git a/lua/custom/plugins/avante.lua b/lua/custom/plugins/avante.lua new file mode 100644 index 00000000..eae82a81 --- /dev/null +++ b/lua/custom/plugins/avante.lua @@ -0,0 +1,123 @@ +return { + 'yetone/avante.nvim', + event = 'VeryLazy', + lazy = false, + version = false, -- set this if you want to always pull the latest change + opts = { + -- add any opts here + { + ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string + provider = 'copilot', -- Recommend using Claude + auto_suggestions_provider = 'copilot', -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot + -- claude = { + -- endpoint = 'https://api.anthropic.com', + -- model = 'claude-3-5-sonnet-20240620', + -- temperature = 0, + -- max_tokens = 4096, + -- }, + behaviour = { + auto_suggestions = false, -- Experimental stage + auto_set_highlight_group = true, + auto_set_keymaps = true, + auto_apply_diff_after_generation = false, + support_paste_from_clipboard = true, + }, + mappings = { + --- @class AvanteConflictMappings + diff = { + ours = 'co', + theirs = 'ct', + all_theirs = 'ca', + both = 'cb', + cursor = 'cc', + next = ']x', + prev = '[x', + }, + suggestion = { + accept = '', + next = '', + prev = '', + dismiss = '', + }, + jump = { + next = ']]', + prev = '[[', + }, + submit = { + normal = '', + insert = '', + }, + }, + hints = { enabled = true }, + windows = { + ---@type "right" | "left" | "top" | "bottom" + position = 'right', -- the position of the sidebar + wrap = true, -- similar to vim.o.wrap + width = 30, -- default % based on available width + sidebar_header = { + align = 'center', -- left, center, right for title + rounded = true, + }, + }, + highlights = { + ---@type AvanteConflictHighlights + diff = { + current = 'DiffText', + incoming = 'DiffAdd', + }, + }, + --- @class AvanteConflictUserConfig + diff = { + autojump = true, + ---@type string | fun(): any + list_opener = 'copen', + }, + }, + }, + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + build = 'make', + -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows + dependencies = { + 'stevearc/dressing.nvim', + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + --- The below dependencies are optional, + 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons + 'zbirenbaum/copilot.lua', -- for providers='copilot' + { + -- support for image pasting + 'HakonHarnes/img-clip.nvim', + event = 'VeryLazy', + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { 'markdown', 'Avante' }, + }, + ft = { 'markdown', 'Avante' }, + }, + }, + init = function() + vim.api.nvim_create_autocmd('VimEnter', { + callback = function() + -- Ensure Avante.nvim has been loaded before switching providers + if vim.fn.exists ':AvanteSwitchProvider' == 2 then + vim.cmd 'AvanteSwitchProvider copilot' + end + end, + }) + end, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index e47ca8ad..1e384780 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -46,7 +46,7 @@ return { --         section_separators = { left = '', right = '' }, component_separators = { left = '', right = '' }, - disabled_filetypes = { 'neo-tree' }, + disabled_filetypes = { 'neo-tree', 'nvim-tree' }, always_divide_middle = true, }, sections = { @@ -66,7 +66,7 @@ return { lualine_z = {}, }, tabline = {}, - extensions = { 'lazy', 'toggleterm', 'mason', 'neo-tree', 'trouble' }, + extensions = { 'lazy', 'toggleterm', 'mason', 'trouble' }, } end, } diff --git a/lua/custom/plugins/misc.lua b/lua/custom/plugins/misc.lua index 68d8fd74..39616439 100644 --- a/lua/custom/plugins/misc.lua +++ b/lua/custom/plugins/misc.lua @@ -135,4 +135,5 @@ return { end, config = true, }, + { 'github/copilot.vim' }, } diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua index c712a8c2..1096aaae 100644 --- a/lua/custom/plugins/neotree.lua +++ b/lua/custom/plugins/neotree.lua @@ -219,17 +219,18 @@ return { hide_gitignored = true, hide_hidden = true, -- only works on Windows for hidden files/directories hide_by_name = { - --"node_modules" + 'node_modules', }, hide_by_pattern = { -- uses glob style patterns --"*.meta", --"*/src/*/tsconfig.json", }, always_show = { -- remains visible even if other settings would normally hide it - --".gitignored", + '.gitignored', + '.env', -- Add this line to always show .env files }, always_show_by_pattern = { -- uses glob style patterns - --".env*", + '.env*', }, never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show --".DS_Store", diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua new file mode 100644 index 00000000..46b978f7 --- /dev/null +++ b/lua/custom/plugins/obsidian.lua @@ -0,0 +1,70 @@ +return { + 'epwalsh/obsidian.nvim', + version = '*', -- recommended, use latest release instead of latest commit + -- lazy = true, + event = 'VimEnter', + ft = 'markdown', + -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: + -- event = { + -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. + -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md" + -- -- refer to `:h file-pattern` for more examples + -- "BufReadPre path/to/my-vault/*.md", + -- "BufNewFile path/to/my-vault/*.md", + -- }, + dependencies = { + -- Required. + 'nvim-lua/plenary.nvim', + + -- see below for full list of optional dependencies 👇 + }, + -- keys = { + -- 'Nn', + -- 'ObsidianNewNote', + -- { desc = 'New Note', noremap = true, silent = true }, + -- }, + opts = { + workspaces = { + { + name = 'personal', + path = '~/notes/personal', + }, + { + name = 'work', + path = '~/notes/work', + }, + }, + mappings = { + -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. + ['gf'] = { + action = function() + return require('obsidian').util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + -- Toggle check-boxes. + ['ch'] = { + action = function() + return require('obsidian').util.toggle_checkbox() + end, + opts = { buffer = true }, + }, + -- Smart action depending on context, either follow link or toggle checkbox. + [''] = { + action = function() + return require('obsidian').util.smart_action() + end, + opts = { buffer = true, expr = true }, + }, + -- Create a new note in the current workspace. + ['Nn'] = { + action = function() + return require('obsidian').new_note() + end, + opts = { desc = 'New Note', noremap = true, silent = true }, + }, + }, + + -- see below for full list of options 👇 + }, +}