diff --git a/init.lua b/init.lua index ea86b792..0810bd1a 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -99,10 +99,10 @@ vim.g.have_nerd_font = false -- For more options, you can see `:help option-list` -- Make line numbers default -vim.opt.number = true +-- vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -779,9 +779,9 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -929,7 +929,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/browser.lua b/lua/custom/plugins/browser.lua new file mode 100644 index 00000000..5b84a0dd --- /dev/null +++ b/lua/custom/plugins/browser.lua @@ -0,0 +1,67 @@ +return { + "lalitmee/browse.nvim", + depends = { "nvim-telescope/telescope.nvim" }, + lazy = false, + config = function() + local bookmarks = { + ["SE GitHub"] = { + ["Landing Page"] = "https://github.schneider-electric.com/", + ["Hpc-Firmware"] = "https://github.schneider-electric.com/MSol-NGM-HPC/hpc-firmware", + ["SEAPyPI"] = "https://github.schneider-electric.com/SEAPyPI", + ["Code Search"] = "https://github.schneider-electric.com/search?q=%s&type=code", + ["Repo Search"] = "https://github.schneider-electric.com/search?q=%s&type=repositories", + ["Issues Search"] = "https://github.schneider-electric.com/search?q=%s&type=issues", + ["Pulls Search"] = "https://github.schneider-electric.com/search?q=%s&type=pullrequests", + }, + ["GitHub"] = { + ["GitHub.com"] = "https://github.com/", + ["Code Search"] = "https://github.com/search?q=%s&type=code", + ["Repo Search"] = "https://github.com/search?q=%s&type=repositories", + ["Issues Search"] = "https://github.com/search?q=%s&type=issues", + ["Pulls Search"] = "https://github.com/search?q=%s&type=pullrequests", + }, + ["SE"] = { + ["Support"] = "https://schneider.service-now.com/supportatschneider?id=se_index", + ["Spice"] = "https://spice.se.com/", + ["Jira Board"] = "https://jira.se.com/secure/RapidBoard.jspa?rapidView=7703&quickFilter=61920#", + ["Jira Landing"] = "https://jira.se.com/", + ["TimeSheet"] = "https://se-ppm.sciforma.net/sciforma/?ACSREQUESTID=_f2b21659-6f25-470d-bab7-dbf9e5dbac64#2766", + }, + ["AvistoConnector"] = "https://vpn.elsys-eastern.com:1443/remote/login?lang=en", + ["Ziteboard"] = "https://app.ziteboard.com", + } + local browse = require "browse" + + function command(name, rhs, opts) + opts = opts or {} + vim.api.nvim_create_user_command(name, rhs, opts) + end + + command("InputSearch", function() browse.input_search() end, {}) + + -- this will open telescope using dropdown theme with all the available options + -- in which `browse.nvim` can be used + command("Browse", function() browse.browse { bookmarks = bookmarks } end) + + command("Bookmarks", function() browse.open_bookmarks { bookmarks = bookmarks } end) + + command("DevdocsSearch", function() browse.devdocs.search() end) + + command("DevdocsFiletypeSearch", function() browse.devdocs.search_with_filetype() end) + + command("MdnSearch", function() browse.mdn.search() end) + browse.setup { + -- search provider you want to use + provider = "duckduckgo", -- duckduckgo, bing + + -- either pass it here or just pass the table to the functions + -- see below for more + bookmarks = {}, + icons = { + bookmark_alias = "->", -- if you have nerd fonts, you can set this to "" + bookmarks_prompt = "", -- if you have nerd fonts, you can set this to "󰂺 " + grouped_bookmarks = "->", -- if you have nerd fonts, you can set this to  + }, + } + end, +} diff --git a/lua/custom/plugins/catppuccin.lua b/lua/custom/plugins/catppuccin.lua new file mode 100644 index 00000000..84c8a8df --- /dev/null +++ b/lua/custom/plugins/catppuccin.lua @@ -0,0 +1,47 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + transparent_background = true, + opts = { + flavour = "mocha", + dim_inactive = { enabled = true, percentage = 0.25 }, + integrations = { + alpha = true, + dashboard = false, + flash = false, + nvimtree = false, + ts_rainbow = false, + ts_rainbow2 = false, + barbecue = false, + indent_blankline = false, + navic = false, + dropbar = false, + + aerial = true, + dap = { enabled = true, enable_ui = true }, + headlines = true, + mason = true, + native_lsp = { enabled = true, inlay_hints = { background = false } }, + neogit = true, + neotree = true, + noice = true, + notify = true, + sandwich = true, + semantic_tokens = true, + symbols_outline = true, + telescope = { enabled = true, style = "nvchad" }, + which_key = true, + }, + custom_highlights = { + -- disable italics for treesitter highlights + TabLineFill = { link = "StatusLine" }, + LspInlayHint = { style = { "italic" } }, + ["@parameter"] = { style = {} }, + ["@type.builtin"] = { style = {} }, + ["@namespace"] = { style = {} }, + ["@text.uri"] = { style = { "underline" } }, + ["@tag.attribute"] = { style = {} }, + ["@tag.attribute.tsx"] = { style = {} }, + }, + }, +} diff --git a/lua/custom/plugins/clangd.lua b/lua/custom/plugins/clangd.lua new file mode 100644 index 00000000..a77b545d --- /dev/null +++ b/lua/custom/plugins/clangd.lua @@ -0,0 +1,24 @@ +local lspconfig = require 'lspconfig' +local default_capabilities = require('cmp_nvim_lsp').default_capabilities() +default_capabilities.offsetEncoding = { 'utf-16' } +lspconfig.clangd.setup { + settings = { + clangd = { + usePlaceholders = true, + completeUnimported = true, + semanticHighlighting = true, + }, + }, + cmd = { + 'clangd', + '--background-index', + '--clang-tidy', + '--header-insertion=iwyu', + '--completion-style=detailed', + '--function-arg-placeholders', + '--fallback-style=llvm', + }, + capabilities = default_capabilities, +} + +return {} diff --git a/lua/custom/plugins/clangd_extensions.lua b/lua/custom/plugins/clangd_extensions.lua new file mode 100644 index 00000000..6d7c7a53 --- /dev/null +++ b/lua/custom/plugins/clangd_extensions.lua @@ -0,0 +1,30 @@ +return { + "p00f/clangd_extensions.nvim", + lazy = true, + config = function() end, + opts = { + inlay_hints = { + inline = false, + }, + ast = { + --These require codicons (https://github.com/microsoft/vscode-codicons) + role_icons = { + type = "", + declaration = "", + expression = "", + specifier = "", + statement = "", + ["template argument"] = "", + }, + kind_icons = { + Compound = "", + Recovery = "", + TranslationUnit = "", + PackExpansion = "", + TemplateTypeParm = "", + TemplateTemplateParm = "", + TemplateParamObject = "", + }, + }, + }, +} diff --git a/lua/custom/plugins/community.lua b/lua/custom/plugins/community.lua new file mode 100644 index 00000000..483de73b --- /dev/null +++ b/lua/custom/plugins/community.lua @@ -0,0 +1,9 @@ +return { + -- Add the community repository of plugin specifications + "AstroNvim/astrocommunity", + -- example of importing a plugin, comment out to use it or add your own + -- available plugins can be found at https://github.com/AstroNvim/astrocommunity + + -- { import = "astrocommunity.colorscheme.catppuccin" }, + -- { import = "astrocommunity.completion.copilot-lua-cmp" }, +} diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua new file mode 100644 index 00000000..0a3e23cb --- /dev/null +++ b/lua/custom/plugins/copilot-chat.lua @@ -0,0 +1,14 @@ +return { + 'CopilotC-Nvim/CopilotChat.nvim', + branch = 'canary', + dependencies = { + { 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim + { 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper + }, + config = function() + require('CopilotChat').setup { + debug = true, -- Enable debugging + -- See Configuration section for rest + } + end, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..593deb4f --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,28 @@ +return { + "zbirenbaum/copilot.lua", + lazy = false, + opts = { + filetypes = { + ["*"] = true, + }, + panel = { + auto_refresh = false, + keymap = { + accept = "", + jump_prev = "[[", + jump_next = "]]", + refresh = "gr", + open = "", + }, + }, + suggestion = { + auto_trigger = true, + keymap = { + accept = "", + prev = "", + next = "", + dismiss = "", + }, + }, + }, +} diff --git a/lua/custom/plugins/core.lua b/lua/custom/plugins/core.lua new file mode 100644 index 00000000..3f6b8b0b --- /dev/null +++ b/lua/custom/plugins/core.lua @@ -0,0 +1,63 @@ +return { + -- customize alpha options +{ + "coffebar/transfer.nvim", + lazy = true, + cmd = { "TransferInit", "DiffRemote", "TransferUpload", "TransferDownload", "TransferDirDiff", "TransferRepeat" }, + opts = {}, +}, + -- You can disable default plugins as follows: + -- { "max397574/better-escape.nvim", enabled = false }, + -- + -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call + -- { + -- "L3MON4D3/LuaSnip", + -- config = function(plugin, opts) + -- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom luasnip configuration such as filetype extend or custom snippets + -- local luasnip = require "luasnip" + -- luasnip.filetype_extend("javascript", { "javascriptreact" }) + -- end, + -- }, + -- { + -- "windwp/nvim-autopairs", + -- config = function(plugin, opts) + -- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom autopairs configuration such as custom rules + -- local npairs = require "nvim-autopairs" + -- local Rule = require "nvim-autopairs.rule" + -- local cond = require "nvim-autopairs.conds" + -- npairs.add_rules( + -- { + -- Rule("$", "$", { "tex", "latex" }) + -- -- don't add a pair if the next character is % + -- :with_pair(cond.not_after_regex "%%") + -- -- don't add a pair if the previous character is xxx + -- :with_pair( + -- cond.not_before_regex("xxx", 3) + -- ) + -- -- don't move right when repeat character + -- :with_move(cond.none()) + -- -- don't delete if the next character is xx + -- :with_del(cond.not_after_regex "xx") + -- -- disable adding a newline when you press + -- :with_cr(cond.none()), + -- }, + -- -- disable for .vim files, but it work for another filetypes + -- Rule("a", "a", "-vim") + -- ) + -- end, + -- }, + -- By adding to the which-key config and using our helper function you can add more which-key registered bindings + -- { + -- "folke/which-key.nvim", + -- config = function(plugin, opts) + -- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- Add bindings which show up as group name + -- local wk = require "which-key" + -- wk.register({ + -- b = { name = "Buffer" }, + -- }, { mode = "n", prefix = "" }) + -- end, + -- }, +} diff --git a/lua/custom/plugins/ddgr.lua b/lua/custom/plugins/ddgr.lua new file mode 100644 index 00000000..a9257ddd --- /dev/null +++ b/lua/custom/plugins/ddgr.lua @@ -0,0 +1,4 @@ +return { + "pbnj/vim-ddgr", + lazy = false, +} diff --git a/lua/custom/plugins/everforest.lua b/lua/custom/plugins/everforest.lua new file mode 100644 index 00000000..64982886 --- /dev/null +++ b/lua/custom/plugins/everforest.lua @@ -0,0 +1,5 @@ +return { + "neanias/everforest-nvim", + lazy = true, + transparent_background = true, +} diff --git a/lua/custom/plugins/ezguifont.lua b/lua/custom/plugins/ezguifont.lua new file mode 100644 index 00000000..a3fa6813 --- /dev/null +++ b/lua/custom/plugins/ezguifont.lua @@ -0,0 +1,4 @@ +return { + "mkropat/vim-ezguifont", + lazy = false, +} diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua new file mode 100644 index 00000000..d611ffd9 --- /dev/null +++ b/lua/custom/plugins/fugitive.lua @@ -0,0 +1,4 @@ +return { + "tpope/vim-fugitive", + lazy = false, +} diff --git a/lua/custom/plugins/gruv.lua b/lua/custom/plugins/gruv.lua new file mode 100644 index 00000000..57e2586f --- /dev/null +++ b/lua/custom/plugins/gruv.lua @@ -0,0 +1,33 @@ +return { + 'ellisonleao/gruvbox.nvim', + lazy = false, + + config = function() + require('gruvbox').setup { + terminal_colors = false, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = 'hard', -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = true, + } + vim.o.background = 'dark' + vim.cmd [[colorscheme gruvbox]] + end, +} diff --git a/lua/custom/plugins/hardtime.lua b/lua/custom/plugins/hardtime.lua new file mode 100644 index 00000000..bc4be3a9 --- /dev/null +++ b/lua/custom/plugins/hardtime.lua @@ -0,0 +1,6 @@ +return { + "m4xshen/hardtime.nvim", + lazy = false, + dependencies = {"MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim"}, + opts = {} +} diff --git a/lua/custom/plugins/mappings.lua b/lua/custom/plugins/mappings.lua new file mode 100644 index 00000000..95f481dc --- /dev/null +++ b/lua/custom/plugins/mappings.lua @@ -0,0 +1,34 @@ +vim.keymap.set('n', 'b;', ':let @+ = expand("%:p")', { desc = 'Copy Name' }) +vim.keymap.set('n', 't;', ':tc %:p:h', { desc = 'Change Directory to file path' }) +vim.keymap.set('n', 'tr', ':tc +', { desc = 'Change Directory to file path' }) + +vim.keymap.set('n', ',', function() + local output = string.gsub(vim.fn.expand '%', '.md', '.pdf') + local command = ':!pandoc -t pdf --pdf-engine tectonic -o ' .. output .. ' --section-divs=true % ; okular ' .. output + vim.fn.execute(command) +end) + +vim.keymap.set('n', 'be', ':tabe %', { desc = 'Open in New Tab' }) +vim.keymap.set('n', 'T', ':term', { desc = 'Terminal Here' }) +vim.keymap.set('n', '-', ':tc -:pwd', { desc = 'Cd -' }) +vim.keymap.set('n', 'Q', ':bd! %', { desc = 'Quit buffer' }) +vim.keymap.set('n', 'L', ':!ls', { desc = 'List Items' }) +vim.keymap.set('n', 'D', ':!ri -Force %', { desc = 'Delete Item' }) + +vim.keymap.set('n', 'gv', ':vs | lua vim.lsp.buf.definition()', { desc = 'Goto Definition split vertical' }) +vim.keymap.set('n', 'gs', ':sp | lua vim.lsp.buf.definition()', { desc = 'Goto Definition split horizontal' }) + +vim.keymap.set('n', '', ':DecreaseFont', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':IncreaseFont', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':IncreaseFont', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':ResetFontSize', { noremap = true, silent = true }) + +vim.keymap.set('n', '', 'w!', { desc = 'Force write' }) +vim.keymap.set('n', '', 'qa!', { desc = 'Force quit' }) +vim.keymap.set('n', '|', 'vsplit', { desc = 'Vertical Split' }) +vim.keymap.set('n', '\\', 'split', { desc = 'Horizontal Split' }) +vim.keymap.set('t', '', 'wincmd h', { desc = 'Terminal left window navigation' }) +vim.keymap.set('t', '', 'wincmd j', { desc = 'Terminal down window navigation' }) +vim.keymap.set('t', '', 'wincmd k', { desc = 'Terminal up window navigation' }) +vim.keymap.set('t', '', 'wincmd l', { desc = 'Terminal right window navigation' }) +return {} diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua new file mode 100644 index 00000000..294ebee0 --- /dev/null +++ b/lua/custom/plugins/markdown-preview.lua @@ -0,0 +1,26 @@ +return { + "iamcco/markdown-preview.nvim", + ft = "markdown", + build = function() + vim.fn["mkdp#util#install"]() + end, + init = function() + local g = vim.g + g.mkdp_auto_start = 0 + g.mkdp_auto_close = 1 + g.mkdp_refresh_slow = 0 + g.mkdp_command_for_global = 0 + g.mkdp_open_to_the_world = 0 + g.mkdp_open_ip = '' + g.mkdp_browser = 'firefox' + g.mkdp_echo_preview_url = 0 + g.mkdp_browserfunc = '' + g.mkdp_theme = 'dark' + g.mkdp_filetypes = { "markdown" } + g.mkdp_page_title = "${name}.md" + g.mkdp_preview_options = { + disable_sync_scroll = 0, + disable_filename = 1 + } + end, +} diff --git a/lua/custom/plugins/md-pdf.lua b/lua/custom/plugins/md-pdf.lua new file mode 100644 index 00000000..00069599 --- /dev/null +++ b/lua/custom/plugins/md-pdf.lua @@ -0,0 +1,15 @@ +return { + "arminveres/md-pdf.nvim", + branch = "main", -- you can assume that main is somewhat stable until releases will be made + lazy = true, + keys = { + { + ",", + function() require("md-pdf").convert_md_to_pdf() end, + desc = "Markdown preview", + }, + }, + opts = { + toc = false, + }, +} diff --git a/lua/custom/plugins/melange.lua b/lua/custom/plugins/melange.lua new file mode 100644 index 00000000..695aaffb --- /dev/null +++ b/lua/custom/plugins/melange.lua @@ -0,0 +1,4 @@ +return{ + "savq/melange-nvim", + name = "melange" +} diff --git a/lua/custom/plugins/mkdir.lua b/lua/custom/plugins/mkdir.lua new file mode 100644 index 00000000..06afa291 --- /dev/null +++ b/lua/custom/plugins/mkdir.lua @@ -0,0 +1,4 @@ +return { + "jghauser/mkdir.nvim", + lazy = false, +} diff --git a/lua/custom/plugins/neoscroll.lua b/lua/custom/plugins/neoscroll.lua new file mode 100644 index 00000000..6b600d5f --- /dev/null +++ b/lua/custom/plugins/neoscroll.lua @@ -0,0 +1,17 @@ +return { + "karb94/neoscroll.nvim", + lazy = false, + config = function() + require("neoscroll").setup { + mappings = { "", "", "", "", "", "", "zt", "zz", "zb" }, + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further + easing_function = "quadratic", -- Default easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, -- Function to run after the scrolling animation ends + performance_mode = false, -- Disable "Performance Mode" on all buffers. + } + end, +} diff --git a/lua/custom/plugins/nightfox.lua b/lua/custom/plugins/nightfox.lua new file mode 100644 index 00000000..8953671f --- /dev/null +++ b/lua/custom/plugins/nightfox.lua @@ -0,0 +1,7 @@ +return { + "EdenEast/nightfox.nvim", + name = "nightfox", + style = "duskfox", + lazy = false, + transparent = true, +} diff --git a/lua/custom/plugins/null-ls.lua b/lua/custom/plugins/null-ls.lua new file mode 100644 index 00000000..beceedad --- /dev/null +++ b/lua/custom/plugins/null-ls.lua @@ -0,0 +1,17 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + opts = function(_, config) + -- config variable is the default configuration table for the setup function call + -- local null_ls = require "null-ls" + + -- Check supported formatters and linters + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics + config.sources = { + -- Set a formatter + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.prettier, + } + return config -- return final config table + end, +} diff --git a/lua/custom/plugins/nvim-surround.lua b/lua/custom/plugins/nvim-surround.lua new file mode 100644 index 00000000..b58dada5 --- /dev/null +++ b/lua/custom/plugins/nvim-surround.lua @@ -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/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..84905448 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,162 @@ +return { + "stevearc/oil.nvim", + lazy = false, + depends = { + "nvim-lua/nvim-web-devicons", + }, + config = function() + require("oil").setup { + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you still want to use netrw. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) + delete_to_trash = false, + -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) + skip_confirm_for_simple_edits = false, + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + -- (:help prompt_save_on_select_new_entry) + prompt_save_on_select_new_entry = true, + -- Oil will automatically delete hidden buffers after this delay + -- You can set the delay to false to disable cleanup entirely + -- Note that the cleanup process only starts when none of the oil buffers are currently displayed + cleanup_delay_ms = 2000, + lsp_file_methods = { + -- Time to wait for LSP file operations to complete before skipping + timeout_ms = 1000, + -- Set to true to autosave buffers that are updated with LSP willRenameFiles + -- Set to "unmodified" to only save unmodified buffers + autosave_changes = false, + }, + -- Constrain the cursor to the editable parts of the oil buffer + -- Set to `false` to disable, or "name" to keep it on the file names + constrain_cursor = "editable", + -- Set to true to watch the filesystem for changes and reload oil + experimental_watch_for_changes = false, + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) + -- Additionally, if it is a string that matches "actions.", + -- it will use the mapping at require("oil.actions"). + -- Set to `false` to remove a keymap + -- See :help oil-actions for a list of all available actions + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = "actions.select_split", + [""] = "actions.select_tab", + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + -- Configuration for the floating keymaps help window + keymaps_help = { + border = "rounded", + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, + view_options = { + -- Show files and directories that start with "." + show_hidden = false, + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) return vim.startswith(name, ".") end, + -- This function defines what will never be shown, even when `show_hidden` is set + is_always_hidden = function(name, bufnr) return false end, + sort = { + -- sort order can be "asc" or "desc" + -- see :help oil-columns to see which columns are sortable + { "type", "asc" }, + { "name", "asc" }, + }, + }, + -- Configuration for the floating window in oil.open_float + float = { + -- Padding around the floating window + padding = 2, + max_width = 0, + max_height = 0, + border = "rounded", + win_options = { + winblend = 0, + }, + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + override = function(conf) return conf end, + }, + -- Configuration for the actions floating preview window + preview = { + -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_width and max_width can be a single value or a list of mixed integer/float types. + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" + max_width = 0.9, + -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" + min_width = { 40, 0.4 }, + -- optionally define an integer/float for the exact width of the preview window + width = nil, + -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_height and max_height can be a single value or a list of mixed integer/float types. + -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" + max_height = 0.9, + -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" + min_height = { 5, 0.1 }, + -- optionally define an integer/float for the exact height of the preview window + height = nil, + border = "rounded", + win_options = { + winblend = 0, + }, + -- Whether the preview window is automatically updated when the cursor is moved + update_on_cursor_moved = true, + }, + -- Configuration for the floating progress window + progress = { + max_width = 0.9, + min_width = { 40, 0.4 }, + width = nil, + max_height = { 10, 0.9 }, + min_height = { 5, 0.1 }, + height = nil, + border = "rounded", + minimized_border = "none", + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating SSH window + ssh = { + border = "rounded", + }, + } + end, +} diff --git a/lua/custom/plugins/portal.lua b/lua/custom/plugins/portal.lua new file mode 100644 index 00000000..ea6fc2bc --- /dev/null +++ b/lua/custom/plugins/portal.lua @@ -0,0 +1,9 @@ +return { + "cbochs/portal.nvim", + -- Optional dependencies + event = "BufRead", + dependencies = { + "cbochs/grapple.nvim", + "ThePrimeagen/harpoon", + }, +} diff --git a/lua/custom/plugins/pwsh_es.lua b/lua/custom/plugins/pwsh_es.lua new file mode 100644 index 00000000..1d319326 --- /dev/null +++ b/lua/custom/plugins/pwsh_es.lua @@ -0,0 +1,11 @@ +local lspconfig = require 'lspconfig' +local bundle_path = '~/Lsp/PowerShellEditorServices' +local default_capabilities = require('cmp_nvim_lsp').default_capabilities() +lspconfig.powershell_es.setup { + capabilities = default_capabilities, + bundle_path = bundle_path, + filetypes = { 'ps1' }, + init_options = { enableProfileLoading = false }, +} + +return {} diff --git a/lua/custom/plugins/pylsp.lua b/lua/custom/plugins/pylsp.lua new file mode 100644 index 00000000..9f2308d0 --- /dev/null +++ b/lua/custom/plugins/pylsp.lua @@ -0,0 +1,35 @@ +local lspconfig = require 'lspconfig' +local lsp_capabilities = vim.lsp.protocol.make_client_capabilities() +lspconfig.pylsp.setup { + settings = { + pylsp = { + plugins = { + -- formatter options + black = { enabled = false }, + autopep8 = { enabled = true }, + yapf = { enabled = false }, + -- linter options + pylint = { enabled = false, executable = 'pylint' }, + pyflakes = { enabled = false }, + pycodestyle = { enabled = true, maxLineLength = 200 }, + -- type checker + pylsp_mypy = { enabled = true, live_mode = true, strict = true }, + -- auto-completion options + jedi_completion = { fuzzy = true }, + -- import sorting + pyls_isort = { enabled = true }, + rope_autoimport = { + enabled = false, + completions = { enabled = true }, + code_actions = { enabled = true }, + }, + }, + }, + }, + flags = { + debounce_text_changes = 200, + }, + capabilities = lsp_capabilities, +} + +return {} diff --git a/lua/custom/plugins/shell.lua b/lua/custom/plugins/shell.lua new file mode 100644 index 00000000..dfd384b8 --- /dev/null +++ b/lua/custom/plugins/shell.lua @@ -0,0 +1,18 @@ +vim.opt.shell = 'pwsh' +vim.opt.shellcmdflag = + "-NoProfile -NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';$PSStyle.OutputRendering = [System.Management.Automation.OutputRendering]::PlainText;" +vim.opt.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' +vim.opt.shellpipe = '2>&1 | %%{ "$_" } | Tee-Object %s; exit $LastExitCode' +vim.opt.shellquote = '' +vim.opt.shellxquote = '' + +vim.api.nvim_create_user_command('Pterm', 'term pwsh', {}) +vim.api.nvim_create_user_command('PT', 'term pwsh', {}) +vim.api.nvim_create_user_command('Uterm', 'term wsl.exe', {}) +vim.api.nvim_create_user_command('UT', 'term wsl.exe', {}) +vim.api.nvim_create_user_command('BDAll', '%bd! | e#', {}) +vim.api.nvim_create_user_command('NT', 'bd! % | term', {}) +vim.api.nvim_create_user_command('NUT', 'bd! % | Uterm', {}) +vim.api.nvim_create_user_command('CC', 'CopilotChat', {}) + +return {} diff --git a/lua/custom/plugins/sleuth.lua b/lua/custom/plugins/sleuth.lua new file mode 100644 index 00000000..225638e0 --- /dev/null +++ b/lua/custom/plugins/sleuth.lua @@ -0,0 +1,4 @@ +return { + 'tpope/vim-sleuth', + -- config = function() require("vim-sleuth").setup {} end, +} diff --git a/lua/custom/plugins/sonokai.lua b/lua/custom/plugins/sonokai.lua new file mode 100644 index 00000000..fdaf57db --- /dev/null +++ b/lua/custom/plugins/sonokai.lua @@ -0,0 +1,4 @@ +return { + "sainnhe/sonokai", + lazy = false, +} diff --git a/lua/custom/plugins/tokyo.lua b/lua/custom/plugins/tokyo.lua new file mode 100644 index 00000000..e69c3dba --- /dev/null +++ b/lua/custom/plugins/tokyo.lua @@ -0,0 +1 @@ +return { "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {}, transparent = true } diff --git a/lua/custom/plugins/transparent.lua b/lua/custom/plugins/transparent.lua new file mode 100644 index 00000000..b6606082 --- /dev/null +++ b/lua/custom/plugins/transparent.lua @@ -0,0 +1,37 @@ +return { + "xiyaowong/transparent.nvim", + lazy = false, + config = function() + require("transparent").setup { -- Optional, you don't have to run setup. + groups = { -- table: default groups + "Normal", + "NormalNC", + "Comment", + "Constant", + "Special", + "Identifier", + "Statement", + "PreProc", + "Type", + "Underlined", + "Todo", + "String", + "Function", + "Conditional", + "Repeat", + "Operator", + "Structure", + "LineNr", + "NonText", + "SignColumn", + "CursorLine", + "CursorLineNr", + "StatusLine", + "StatusLineNC", + "EndOfBuffer", + }, + extra_groups = {}, -- table: additional groups that should be cleared + exclude_groups = {}, -- table: groups you don't want to clear + } + end, +} diff --git a/lua/custom/plugins/typos-lsp.lua b/lua/custom/plugins/typos-lsp.lua new file mode 100644 index 00000000..64143888 --- /dev/null +++ b/lua/custom/plugins/typos-lsp.lua @@ -0,0 +1,17 @@ +local lspconfig = require 'lspconfig' +local lsp_capabilities = vim.lsp.protocol.make_client_capabilities() +lspconfig.typos_lsp.setup { + -- Logging level of the language server. Logs appear in :LspLog. Defaults to error. + -- cmd_env = { RUST_LOG = "error" }, + capabilities = lsp_capabilities, + init_options = { + -- Custom config. Used together with any workspace config files, taking precedence for + -- settings declared in both. Equivalent to the typos `--config` cli argument. + -- config = "~/code/typos-lsp/crates/typos-lsp/tests/typos.toml", + -- How typos are rendered in the editor, eg: as errors, warnings, information, or hints. + -- Defaults to error. + diagnosticSeverity = 'Error', + }, +} + +return {} diff --git a/lua/custom/plugins/user.lua b/lua/custom/plugins/user.lua new file mode 100644 index 00000000..313b9bab --- /dev/null +++ b/lua/custom/plugins/user.lua @@ -0,0 +1,20 @@ +return { + -- You can also add new plugins here as well: + -- Add plugins, the lazy syntax + -- "andweeb/presence.nvim", + -- { + -- "ray-x/lsp_signature.nvim", + -- event = "BufRead", + -- config = function() + -- require("lsp_signature").setup() + -- end, + { + 'chipsenkbeil/distant.nvim', + branch = 'v0.3', + config = function() + require('distant'):setup() + end +}, + + -- }, +} diff --git a/lua/custom/plugins/web-devicons.lua b/lua/custom/plugins/web-devicons.lua new file mode 100644 index 00000000..e318bd50 --- /dev/null +++ b/lua/custom/plugins/web-devicons.lua @@ -0,0 +1,3 @@ +return { + "nvim-tree/nvim-web-devicons" +}