diff --git a/init.lua b/init.lua index ed50b69d7f3..464bf2ba741 100644 --- a/init.lua +++ b/init.lua @@ -700,7 +700,7 @@ 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 }, }, }, }, @@ -914,13 +914,13 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended 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/copy-file-path.lua b/lua/custom/plugins/copy-file-path.lua new file mode 100644 index 00000000000..4a3958d7e28 --- /dev/null +++ b/lua/custom/plugins/copy-file-path.lua @@ -0,0 +1,3 @@ +return { + 'h3pei/copy-file-path.nvim', +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index b3ddcfdd3aa..4285a2b9891 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,111 @@ -- -- See the kickstart.nvim README for more information ----@module 'lazy' ----@type LazySpec -return {} +vim.keymap.set('n', 'x', '"_x') -- Delete without yanking +vim.keymap.set('n', 'pv', ':Ex') -- Open file explorer + +-- Windows specific stuff: +vim.keymap.set('n', '½', '$') -- Move to end of line in normal mode +vim.keymap.set('v', '½', '$') -- Move to end of line in visual mode +vim.keymap.set('o', '½', '$') -- operator-pending mode to end of line + +vim.o.updatetime = 250 +vim.wo.signcolumn = 'yes' +vim.opt.nu = true +vim.opt.relativenumber = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.incsearch = true +vim.opt.hlsearch = false +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.backup = false +vim.opt.writebackup = false +vim.opt.cmdheight = 1 +vim.opt.scrolloff = 8 +vim.opt.signcolumn = 'yes' +vim.opt.colorcolumn = '120' +vim.opt.cursorline = true +vim.opt.autoindent = true +vim.opt.termguicolors = true +vim.opt.winblend = 0 +vim.opt.wildoptions = 'pum' +vim.opt.pumblend = 5 +vim.opt.background = 'dark' +vim.opt.wrap = false +vim.opt.clipboard = 'unnamedplus' + +vim.g.vimwiki_list = { + { path = '~/Jottacloud/vimwiki' }, +} + +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) +vim.keymap.set('i', '', 'copilot#Accept("\\")', { + expr = true, + replace_keycodes = false, +}) +-- #vim.g.copilot_no_tab_map = true +-- + +-- Windows specific stuff: +if vim.fn.has 'wsl' == 1 then + vim.g.clipboard = { + name = 'WslClipboard', + copy = { + ['+'] = 'clip.exe', + ['*'] = 'clip.exe', + }, + paste = { + ['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw))', + ['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw))', + }, + cache_enabled = 0, + } +end + +return { + 'vimwiki/vimwiki', + 'brenoprata10/nvim-highlight-colors', -- highlight colors in files + 'github/copilot.vim', + + -- Configure Telescope to allow buffer deletion + { + 'nvim-telescope/telescope.nvim', + opts = function(_, opts) + local actions = require 'telescope.actions' + + -- Ensure pickers table exists + opts.pickers = opts.pickers or {} + + -- Configure buffers picker with deletion mapping + -- Note: conflicts with horizontal split, so we use instead + -- conflicts with preview scroll down + -- dd doesn't work because Telescope doesn't support multi-key sequences in normal mode + opts.pickers.buffers = { + mappings = { + i = { + [''] = actions.delete_buffer, -- Recommended: no conflicts + }, + n = { + ['d'] = actions.delete_buffer, -- Single 'd' key (simple and works) + [''] = actions.delete_buffer, + }, + }, + } + + return opts + end, + }, + { + 'stevearc/conform.nvim', + opts = function(_, opts) + opts.formatters_by_ft = opts.formatters_by_ft or {} + opts.formatters_by_ft.typescript = { 'prettierd', 'prettier', stop_after_first = true } + opts.formatters_by_ft.typescriptreact = { 'prettierd', 'prettier', stop_after_first = true } + opts.formatters_by_ft.javascriptreact = { 'prettierd', 'prettier', stop_after_first = true } + return opts + end, + }, +}