This commit is contained in:
Michael Thomson 2024-05-07 15:05:39 -04:00
parent e25c7b3be6
commit aca639d43c
No known key found for this signature in database
7 changed files with 149 additions and 9 deletions

View File

@ -39,18 +39,19 @@ opt.undofile = true --Save undo history
opt.ignorecase = true --Case insensitive searching unless /C or capital in search opt.ignorecase = true --Case insensitive searching unless /C or capital in search
opt.smartcase = true -- Smart case opt.smartcase = true -- Smart case
opt.updatetime = 50 --Decrease update time opt.updatetime = 50 --Decrease update time
opt.signcolumn = "yes" -- Always show sign column opt.signcolumn = 'yes' -- Always show sign column
opt.clipboard = "unnamedplus" -- Access system clipboard opt.clipboard = 'unnamedplus' -- Access system clipboard
opt.laststatus = 3 -- Global status line opt.laststatus = 3 -- Global status line
opt.swapfile = false opt.swapfile = false
opt.wrap = false opt.wrap = false
vim.opt_local.conceallevel = 2 vim.opt_local.conceallevel = 2
vim.opt.inccommand = 'split'
-- Time in milliseconds to wait for a mapped sequence to complete. -- Time in milliseconds to wait for a mapped sequence to complete.
opt.timeoutlen = 300 opt.timeoutlen = 300
opt.showmode = false -- Do not need to show the mode. We use the statusline instead. opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
-- opt.scrolloff = 8 -- Lines of context opt.scrolloff = 10 -- Lines of context
opt.smartindent = true --Smart indent opt.smartindent = true --Smart indent
opt.expandtab = true opt.expandtab = true
opt.smarttab = true opt.smarttab = true
@ -89,9 +90,10 @@ vim.keymap.set("n", "<leader>fe", "<cmd>Oil<CR>")
vim.keymap.set("i", "jk", "<Esc>") vim.keymap.set("i", "jk", "<Esc>")
vim.cmd[[ vim.api.nvim_create_autocmd('TextYankPost', {
augroup highlight_yank desc = 'Highlight when yanking (copying) text',
autocmd! group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
au TextYankPost * silent! lua vim.highlight.on_yank({higroup="Visual", timeout=200}) callback = function()
augroup END vim.highlight.on_yank()
]] end,
})

View File

@ -11,6 +11,11 @@ return {
harpoon = true, harpoon = true,
leap = true, leap = true,
mason = true, mason = true,
mini = {
enabled = true,
},
neotest = true,
markdown = true,
telescope = { telescope = {
enabled = true, enabled = true,
}, },

View File

@ -0,0 +1,12 @@
return { -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
}
}
}

View File

@ -0,0 +1,52 @@
return { -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
vue = { 'stylelint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
require('lint').try_lint()
end,
})
end,
}

View File

@ -0,0 +1,37 @@
return { -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [']quote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
-- 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()
-- 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 = true }
-- 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/echasnovski/mini.nvim
end,
}

View File

@ -0,0 +1,29 @@
return {
"nvim-neotest/neotest",
lazy = false,
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"marilari88/neotest-vitest",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-vitest") {
-- Filter directories when searching for test files. Useful in large projects (see Filter directories notes).
filter_dir = function(name, rel_path, root)
return name ~= "node_modules" and name ~=".direnv"
end,
},
}
})
vim.keymap.set("n", "<leader>tt", function() require("neotest").run.run() end)
vim.keymap.set("n", "<leader>tf", function() require("neotest").run.run(vim.fn.expand("%")) end)
vim.keymap.set("n", "<leader>ts", function() require("neotest").summary.toggle() end)
vim.keymap.set("n", "<leader>to", function() require("neotest").output.open({ enter = true }) end)
vim.keymap.set("n", "<leader>tp", function() require("neotest").output_panel.toggle() end)
end,
}

View File

@ -0,0 +1,3 @@
return {
'tpope/vim-sleuth'
}