diff --git a/colors/poimandres-storm.lua b/colors/poimandres-storm.lua new file mode 100644 index 00000000000..155b65de6d3 --- /dev/null +++ b/colors/poimandres-storm.lua @@ -0,0 +1,133 @@ +-- Poimandres Storm (Neovim) +-- Based on Poimandres Storm by Oliver Cederborg + +vim.cmd 'highlight clear' +if vim.fn.exists 'syntax_on' then + vim.cmd 'syntax reset' +end + +vim.o.termguicolors = true +vim.g.colors_name = 'poimandres-storm' + +-- Expanded palette +local colors = { + -- Accents + yellow = '#FFFAC2', + + teal1 = '#5DE4C7', + teal2 = '#5FB3A1', + teal3 = '#42675A', + + blue1 = '#89DDFF', + blue2 = '#ADD7FF', + blue3 = '#91B4D5', + blue4 = '#7390AA', + + pink1 = '#FAE4FC', + pink2 = '#FCC5E9', + pink3 = '#D0679D', + + -- Neutrals + blueGray1 = '#A6ACCD', + blueGray2 = '#767C9D', + blueGray3 = '#506477', + + -- Background layers + bg = '#252B37', -- main editor + bg_alt = '#1B1E28', -- floats / panels + bg_dark = '#171922', -- deepest contrast + + -- Text + fg = '#E4F0FB', + white = '#FFFFFF', + + none = 'NONE', +} + +local function hi(group, opts) + vim.api.nvim_set_hl(0, group, opts) +end + +-- ====================== +-- Core UI +-- ====================== +hi('Normal', { fg = colors.fg, bg = colors.bg }) +hi('NormalFloat', { fg = colors.fg, bg = colors.bg_alt }) +hi('FloatBorder', { fg = colors.blueGray3, bg = colors.bg_alt }) + +hi('Cursor', { fg = colors.bg, bg = colors.blueGray1 }) +hi('CursorLine', { bg = colors.bg_alt }) +hi('CursorLineNr', { fg = colors.blue1, bold = true }) +hi('LineNr', { fg = colors.blueGray3 }) + +hi('Visual', { bg = colors.blueGray3 }) +hi('Search', { fg = colors.bg, bg = colors.yellow }) +hi('IncSearch', { fg = colors.bg, bg = colors.pink2 }) + +hi('StatusLine', { fg = colors.fg, bg = colors.bg_alt }) +hi('StatusLineNC', { fg = colors.blueGray2, bg = colors.bg_alt }) + +hi('WinSeparator', { fg = colors.bg_alt }) +hi('VertSplit', { fg = colors.bg_alt }) + +-- ====================== +-- Menus +-- ====================== +hi('Pmenu', { fg = colors.fg, bg = colors.bg_alt }) +hi('PmenuSel', { fg = colors.bg, bg = colors.blue1 }) +hi('PmenuSbar', { bg = colors.bg_dark }) +hi('PmenuThumb', { bg = colors.blueGray3 }) + +-- ====================== +-- Syntax +-- ====================== +hi('Comment', { fg = colors.blueGray3, italic = true }) + +hi('Constant', { fg = colors.pink2 }) +hi('String', { fg = colors.teal1 }) +hi('Character', { fg = colors.teal1 }) +hi('Number', { fg = colors.pink2 }) +hi('Boolean', { fg = colors.pink3 }) + +hi('Identifier', { fg = colors.blue1 }) +hi('Function', { fg = colors.blue1 }) + +hi('Statement', { fg = colors.pink3 }) +hi('Keyword', { fg = colors.pink3 }) +hi('Conditional', { fg = colors.pink3 }) +hi('Repeat', { fg = colors.pink3 }) +hi('Exception', { fg = colors.pink3 }) + +hi('Type', { fg = colors.yellow }) +hi('StorageClass', { fg = colors.yellow }) +hi('Structure', { fg = colors.yellow }) + +hi('Operator', { fg = colors.teal2 }) +hi('Delimiter', { fg = colors.blueGray2 }) + +-- ====================== +-- Diagnostics (LSP) +-- ====================== +hi('DiagnosticError', { fg = colors.pink3 }) +hi('DiagnosticWarn', { fg = colors.yellow }) +hi('DiagnosticInfo', { fg = colors.blue2 }) +hi('DiagnosticHint', { fg = colors.teal2 }) + +hi('DiagnosticVirtualTextError', { fg = colors.pink3, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextWarn', { fg = colors.yellow, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextInfo', { fg = colors.blue2, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextHint', { fg = colors.teal2, bg = colors.bg_dark }) + +-- ====================== +-- Git / Diff +-- ====================== +hi('DiffAdd', { fg = colors.teal1 }) +hi('DiffChange', { fg = colors.yellow }) +hi('DiffDelete', { fg = colors.pink3 }) + +-- ====================== +-- Tabs +-- ====================== +hi('TabLine', { fg = colors.blueGray2, bg = colors.bg_alt }) +hi('TabLineSel', { fg = colors.fg, bg = colors.bg_alt, bold = true }) +hi('TabLineFill', { bg = colors.bg_alt }) diff --git a/init.lua b/init.lua index d5ae6dc9b2a..71637710586 100644 --- a/init.lua +++ b/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -91,7 +5,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.o` @@ -102,6 +16,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! +vim.o.relativenumber = true -- vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! @@ -164,6 +79,16 @@ vim.o.scrolloff = 10 -- See `:help 'confirm'` vim.o.confirm = true +vim.cmd 'set expandtab' +vim.cmd 'set tabstop=2' +vim.cmd 'set softtabstop=2' +vim.cmd 'set shiftwidth=2' +vim.g.mapleader = ' ' + +vim.opt.swapfile = false + +vim.keymap.set('n', 'h', ':nohlsearch') +vim.wo.number = true -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -212,12 +137,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', '') -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -310,6 +233,10 @@ require('lazy').setup({ -- Document existing key chains spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, @@ -386,6 +313,11 @@ require('lazy').setup({ -- i = { [''] = 'to_fuzzy_refine' }, -- }, -- }, + defaults = { + path_display = { + shorten = 4, + }, + }, -- pickers = {} extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown() }, @@ -398,6 +330,7 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' + vim.keymap.set('n', '', builtin.oldfiles) vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) @@ -538,7 +471,7 @@ require('lazy').setup({ -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + -- map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. @@ -572,17 +505,39 @@ require('lazy').setup({ end, }) end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client:supports_method('textDocument/inlayHint', event.buf) then - map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') - end end, }) + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + } or {}, + virtual_text = false, + -- virtual_text = { + -- source = 'if_many', + -- spacing = 2, + -- format = function(diagnostic) + -- local diagnostic_message = { + -- [vim.diagnostic.severity.ERROR] = diagnostic.message, + -- [vim.diagnostic.severity.WARN] = diagnostic.message, + -- [vim.diagnostic.severity.INFO] = diagnostic.message, + -- [vim.diagnostic.severity.HINT] = diagnostic.message, + -- } + -- return diagnostic_message[diagnostic.severity] + -- end, + -- }, + } + -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. @@ -690,7 +645,9 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, + javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, @@ -741,54 +698,71 @@ require('lazy').setup({ -- you will need to read `:help ins-completion` -- -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, - - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = false, auto_show_delay_ms = 500 }, - }, - - sources = { - default = { 'lsp', 'path', 'snippets' }, - }, - - snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. - -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See :h blink-cmp-config-fuzzy for more information - fuzzy = { implementation = 'lua' }, - - -- Shows a signature help window while you type arguments for a function - signature = { enabled = true }, - }, + mapping = cmp.mapping.preset.insert { + -- Select the [n]ext item + [''] = cmp.mapping.select_next_item(), + -- Select the [p]revious item + [''] = cmp.mapping.select_prev_item(), + + -- Scroll the documentation window [b]ack / [f]orward + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + + -- Accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- [''] = cmp.mapping.confirm { select = true }, + + -- 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(), + + -- Manually trigger a completion from nvim-cmp. + -- Generally you don't need this, because nvim-cmp will display + -- completions whenever it has completion options available. + [''] = cmp.mapping.complete {}, + + -- Think of as moving to the right of your snippet expansion. + -- So if you have a snippet that's like: + -- function $name($args) + -- $body + -- end + -- + -- will move you to the right of each of the expansion locations. + -- is similar, except moving you backwards. + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + }, + sources = { + { + name = 'lazydev', + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it + group_index = 0, + }, + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + { name = 'nvim_lsp_signature_help' }, + }, + } + end, }, { -- You can easily change to a different colorscheme. + -- -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. -- @@ -806,7 +780,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-storm' end, }, @@ -822,27 +796,29 @@ require('lazy').setup({ -- - va) - [V]isually select [A]round [)]paren -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + require('mini.ai').setup { n_lines = 1000 } -- Add/delete/replace surroundings (brackets, quotes, etc.) -- -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() + -- require('mini.surround').setup() -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() return '%2l:%-2v' end + -- local statusline = require 'mini.statusline' + -- -- set use_icons to true if you have a Nerd Font + -- statusline.setup { use_icons = vim.g.have_nerd_font } + -- + -- -- You can configure sections in the statusline by overriding their + -- -- default behavior. For example, here we set the section for + -- -- cursor location to LINE:COLUMN + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/nvim-mini/mini.nvim @@ -871,17 +847,17 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000000..1a804873741 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,3 @@ +return { + 'github/copilot.vim', +} diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua new file mode 100644 index 00000000000..2bb27ca0834 --- /dev/null +++ b/lua/custom/plugins/flash.lua @@ -0,0 +1,22 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = { + jump = { + pos = 'range', + }, + modes = { + search = { + enabled = true, + }, + char = { + enabled = false, + jump_labels = false, + }, + }, + }, + -- stylua: ignore + keys = { + }, +} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000000..fe42cd23b6c --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,21 @@ +-- nvim v0.8.0 +return { + 'kdheepak/lazygit.nvim', + lazy = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000000..ce6fd1975b0 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,47 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + init = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff' }, + lualine_c = { 'filename' }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + } + end, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000000..7cc73bddebc --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,39 @@ +return { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = { + + default_file_explorer = true, + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + + float = { + padding = 2, + max_width = 90, + max_height = 0, + }, + win_options = { + wrap = true, + winblend = 0, + }, + keymaps = { + [''] = false, + [''] = 'actions.close', + }, + view_options = { + show_hidden = true, + natural_order = true, + is_always_hidden = function(name, _) + return name == '..' or name == '.git' + end, + }, + }, + -- Optional dependencies + dependencies = { { 'echasnovski/mini.icons', opts = {} } }, + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, + init = function() + vim.keymap.set('n', '-', 'Oil --float', { desc = 'Open parent directory' }) + end, +} diff --git a/lua/custom/plugins/theme.lua b/lua/custom/plugins/theme.lua new file mode 100644 index 00000000000..a564707544f --- /dev/null +++ b/lua/custom/plugins/theme.lua @@ -0,0 +1 @@ +return {} diff --git a/plugin/marks.lua b/plugin/marks.lua new file mode 100644 index 00000000000..70c84bc8199 --- /dev/null +++ b/plugin/marks.lua @@ -0,0 +1,33 @@ +-- Function to convert to uppercase and set a mark +vim.api.nvim_create_user_command('SetGlobalMark', function() + local ok, char = pcall(vim.fn.getcharstr) + if not ok then + return + end + + -- Convert lowercase to uppercase + if char:match '[a-z]' then + char = char:upper() + end + + vim.cmd('normal! m' .. char) +end, {}) + +-- Function to convert to uppercase and jump to a mark +vim.api.nvim_create_user_command('JumpToGlobalMark', function() + local ok, char = pcall(vim.fn.getcharstr) + if not ok then + return + end + + -- Convert lowercase to uppercase + if char:match '[a-z]' then + char = char:upper() + end + + vim.cmd("silent! normal! '" .. char) +end, {}) + +-- Map your preferred key combinations to the functions +vim.keymap.set('n', 'm', ':SetGlobalMark', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':JumpToGlobalMark', { noremap = true, silent = true })