mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
fix: messed up rebase somewhere, removing files
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
-- Commenting
|
||||
-- "gc" to comment visual regions/lines
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
version = '*',
|
||||
event = { 'BufRead', 'BufNewFile' },
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
-- ── Formatting ──────────────────────────────────────────────────────
|
||||
-- Lightweight yet powerful formatter plugin for Neovim
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
|
||||
return {
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
event = { 'BufWritePre' },
|
||||
cmd = { 'ConformInfo' },
|
||||
opts = {
|
||||
-- Enable or disable logging
|
||||
notify_on_error = false,
|
||||
-- Set the default formatter for all filetypes
|
||||
default_formatter = 'injected',
|
||||
-- Set the default formatter for all filetypes
|
||||
default_formatter_opts = {
|
||||
lsp_format = 'fallback',
|
||||
-- Set the default formatter for all filetypes
|
||||
formatter = 'injected',
|
||||
-- Set the default formatter for all filetypes
|
||||
-- formatter_opts = {},
|
||||
},
|
||||
-- The options you set here will be merged with the builtin formatters.
|
||||
-- You can also define any custom formatters here.
|
||||
formatters = {
|
||||
injected = { options = { ignore_errors = true } },
|
||||
-- # Example of using dprint only when a dprint.json file is present
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
-- # Example of using shfmt with extra args
|
||||
-- shfmt = {
|
||||
-- prepend_args = { "-i", "2", "-ci" },
|
||||
-- },
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
-- Conform will run multiple formatters sequentially
|
||||
go = { 'goimports', 'gofmt' },
|
||||
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||
-- rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable autoformat on certain filetypes
|
||||
local ignore_filetypes = {
|
||||
'c',
|
||||
'cpp',
|
||||
'sql',
|
||||
'java',
|
||||
}
|
||||
if vim.tbl_contains(ignore_filetypes, vim.bo[bufnr].filetype) then
|
||||
return
|
||||
end
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
-- Disable autoformat for files in a certain path
|
||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||
if bufname:match '/node_modules/' then return end
|
||||
if bufname:match '/vendor/' then return end
|
||||
if bufname:match '/dist/' then return end
|
||||
if bufname:match '/build/' then return end
|
||||
|
||||
return { timeout_ms = 500, lsp_format = 'fallback' }
|
||||
end,
|
||||
},
|
||||
init = function()
|
||||
-- If you want the formatexpr, here is the place to set it
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
end,
|
||||
},
|
||||
-- Automatically install formatters registered with conform.nvim via mason.nvim
|
||||
-- https://github.com/zapling/mason-conform.nvim
|
||||
{
|
||||
'zapling/mason-conform.nvim',
|
||||
depends = {
|
||||
'stevearc/conform.nvim',
|
||||
'williamboman/mason.nvim',
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
return {
|
||||
'folke/flash.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
'zk',
|
||||
mode = { 'n', 'x', 'o' },
|
||||
function() require('flash').jump() end,
|
||||
desc = 'Flash',
|
||||
},
|
||||
{
|
||||
'Zk',
|
||||
mode = { 'n', 'x', 'o' },
|
||||
function() require('flash').treesitter() end,
|
||||
desc = 'Flash Treesitter',
|
||||
},
|
||||
{
|
||||
'r',
|
||||
mode = 'o',
|
||||
function() require('flash').remote() end,
|
||||
desc = 'Remote Flash',
|
||||
},
|
||||
{
|
||||
'R',
|
||||
mode = { 'o', 'x' },
|
||||
function() require('flash').treesitter_search() end,
|
||||
desc = 'Treesitter Search',
|
||||
},
|
||||
{
|
||||
'<m-s>',
|
||||
mode = { 'c' },
|
||||
function() require('flash').toggle() end,
|
||||
desc = 'Toggle Flash Search',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
@@ -1,47 +0,0 @@
|
||||
-- Getting you where you want with the fewest keystrokes.
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
return {
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'harpoon2',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
local harpoon = require 'harpoon'
|
||||
harpoon:setup {}
|
||||
|
||||
-- basic telescope configuration
|
||||
local conf = require('telescope.config').values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require('telescope.pickers')
|
||||
.new({}, {
|
||||
prompt_title = 'Harpoon',
|
||||
finder = require('telescope.finders').new_table {
|
||||
results = file_paths,
|
||||
},
|
||||
previewer = conf.file_previewer {},
|
||||
sorter = conf.generic_sorter {},
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>hw',
|
||||
function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = 'Open harpoon window with telescope' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ht',
|
||||
function() harpoon.ui:toggle_quick_menu(harpoon:list()) end,
|
||||
{ desc = 'Open Harpoon Quick menu' }
|
||||
)
|
||||
end,
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
-- improve neovim lsp experience
|
||||
-- https://github.com/nvimdev/lspsaga.nvim
|
||||
-- https://nvimdev.github.io/lspsaga/
|
||||
return {
|
||||
'nvimdev/lspsaga.nvim',
|
||||
event = 'LspAttach',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter', -- optional
|
||||
'nvim-tree/nvim-web-devicons', -- optional
|
||||
},
|
||||
opts = {
|
||||
code_action = {
|
||||
show_server_name = true,
|
||||
},
|
||||
diagnostic = {
|
||||
keys = {
|
||||
quit = { 'q', '<ESC>' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- A better annotation generator.
|
||||
-- Supports multiple languages and annotation conventions.
|
||||
-- https://github.com/danymat/neogen
|
||||
return {
|
||||
'danymat/neogen',
|
||||
version = '*',
|
||||
opts = { enabled = true, snippet_engine = 'luasnip' },
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- The Refactoring library based off the Refactoring book by Martin Fowler
|
||||
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||
return {
|
||||
'ThePrimeagen/refactoring.nvim',
|
||||
version = '*',
|
||||
dependencies = { 'nvim-lua/plenary.nvim', 'nvim-treesitter/nvim-treesitter' },
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- Add/change/delete surrounding delimiter pairs with ease.
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
return {
|
||||
'kylechui/nvim-surround',
|
||||
version = '*',
|
||||
event = 'VeryLazy',
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- Highlight, list and search todo comments in your projects
|
||||
-- https://github.com/folke/todo-comments.nvim
|
||||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
version = '*',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
-- Neovim plugin for splitting/joining blocks of code
|
||||
-- https://github.com/Wansmer/treesj
|
||||
return {
|
||||
'Wansmer/treesj',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
},
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
-- Not UFO in the sky, but an ultra fold in Neovim.
|
||||
-- https://github.com/kevinhwang91/nvim-ufo/
|
||||
return {
|
||||
'kevinhwang91/nvim-ufo',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
{ 'kevinhwang91/promise-async' },
|
||||
{ 'nvim-treesitter/nvim-treesitter' },
|
||||
{
|
||||
-- Status column plugin that provides a configurable
|
||||
-- 'statuscolumn' and click handlers.
|
||||
-- https://github.com/luukvbaal/statuscol.nvim
|
||||
'luukvbaal/statuscol.nvim',
|
||||
config = function()
|
||||
local builtin = require 'statuscol.builtin'
|
||||
require('statuscol').setup {
|
||||
relculright = true,
|
||||
segments = {
|
||||
{
|
||||
text = { builtin.foldfunc },
|
||||
click = 'v:lua.ScFa',
|
||||
},
|
||||
{
|
||||
sign = {
|
||||
namespace = { 'diagnostic/signs' },
|
||||
maxwidth = 2,
|
||||
-- auto = true,
|
||||
},
|
||||
click = 'v:lua.ScSa',
|
||||
},
|
||||
{
|
||||
text = { builtin.lnumfunc, ' ' },
|
||||
click = 'v:lua.ScLa',
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = true,
|
||||
lineFoldingOnly = true,
|
||||
}
|
||||
local language_servers = require('lspconfig').util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
||||
for _, ls in ipairs(language_servers) do
|
||||
require('lspconfig')[ls].setup {
|
||||
capabilities = capabilities,
|
||||
-- you can add other fields for setting up lsp server in this table
|
||||
}
|
||||
end
|
||||
|
||||
require('ufo').setup {
|
||||
open_fold_hl_timeout = 150,
|
||||
close_fold_kinds_for_ft = { 'imports', 'comment' },
|
||||
preview = {
|
||||
win_config = {
|
||||
border = { '', '─', '', '', '', '─', '', '' },
|
||||
winhighlight = 'Normal:Folded',
|
||||
winblend = 0,
|
||||
},
|
||||
mappings = {
|
||||
scrollU = '<C-u>',
|
||||
scrollD = '<C-d>',
|
||||
jumpTop = '[',
|
||||
jumpBot = ']',
|
||||
},
|
||||
},
|
||||
|
||||
provider_selector = function(_, _, _) -- bufnr, filetype, buftype
|
||||
return { 'treesitter', 'indent' }
|
||||
end,
|
||||
|
||||
-- fold_virt_text_handler
|
||||
--
|
||||
-- This handler is called when the fold text is too long to fit in the window.
|
||||
-- It is expected to truncate the text and return a new list of virtual text.
|
||||
--
|
||||
---@param virtText table The current virtual text list.
|
||||
---@param lnum number The line number of the first line in the fold.
|
||||
---@param endLnum number The line number of the last line in the fold.
|
||||
---@param width number The width of the window.
|
||||
---@param truncate function Truncate function
|
||||
---@return table
|
||||
fold_virt_text_handler = function(
|
||||
virtText,
|
||||
lnum,
|
||||
endLnum,
|
||||
width,
|
||||
truncate
|
||||
)
|
||||
local newVirtText = {}
|
||||
local suffix = (' %d '):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, { chunkText, hlGroup })
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, { suffix, 'MoreMsg' })
|
||||
return newVirtText
|
||||
end,
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
-- Detect tabstop and shiftwidth automatically
|
||||
-- https://github.com/tpope/vim-sleuth
|
||||
return { 'tpope/vim-sleuth' }
|
||||
Reference in New Issue
Block a user