nvim/lua/plugins/init.lua

472 lines
15 KiB
Lua
Raw Normal View History

2022-12-31 17:43:31 +01:00
return {
2023-01-01 19:36:00 +01:00
'folke/which-key.nvim',
2023-04-08 23:47:10 +02:00
'nvim-lua/plenary.nvim',
2023-01-01 22:55:55 +01:00
'mfussenegger/nvim-jdtls',
2023-04-08 23:47:10 +02:00
'simrat39/rust-tools.nvim',
2023-04-09 00:44:17 +02:00
'MunifTanjim/nui.nvim',
2023-04-15 12:29:38 +02:00
{ 'jghauser/mkdir.nvim', lazy = false },
{
url = 'https://dev.filnar.com/fiplox/neogruber.nvim',
lazy = false,
-- event = 'VeryLazy'
},
2023-04-08 23:47:10 +02:00
-- 'rcarriga/cmp-dap',
2022-12-31 17:43:31 +01:00
{
2023-04-08 23:47:10 +02:00
'phaazon/hop.nvim', -- event = 'BufRead',
2023-01-01 19:36:00 +01:00
keys = { { 's', ':HopChar2<cr>' }, { 'S', ':HopWord<cr>' } },
config = true,
2022-12-31 17:43:31 +01:00
},
2023-01-19 17:07:15 +01:00
{
'stevearc/dressing.nvim',
lazy = true,
init = function()
vim.ui.select = function(...)
require('lazy').load { plugins = { 'dressing.nvim' } }
return vim.ui.select(...)
end
vim.ui.input = function(...)
require('lazy').load { plugins = { 'dressing.nvim' } }
return vim.ui.input(...)
end
end,
opts = {
select = {
trim_prompt = false,
},
},
2023-01-19 17:07:15 +01:00
},
2023-04-09 00:44:17 +02:00
{
'folke/noice.nvim',
opts = {
messages = {
view_search = false,
},
cmdline = {
enabled = true,
view = 'cmdline', -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = false, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
['cmp.entry.get_documentation'] = true,
},
hover = {
enabled = false,
},
signature = {
enabled = false,
},
},
},
},
{
'numToStr/Comment.nvim',
-- event = 'VeryLazy',
keys = { 'gcc', { 'gc', mode = 'v' }, { 'gb', mode = 'v' } },
opts = {
-- -LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = 'gc',
---Block-comment keymap
block = 'gb',
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = 'gcO',
---Add comment on the line below
below = 'gco',
---Add comment at the end of line
eol = 'gca',
},
---Enable keybindings
---NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}`
extended = false,
},
pre_hook = function(ctx)
-- Only calculate commentstring for tsx filetypes
if vim.bo.filetype == 'typescriptreact' then
local U = require 'Comment.utils'
-- Determine whether to use linewise or blockwise commentstring
local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline'
-- Determine the location where to calculate commentstring from
local location = nil
if ctx.ctype == U.ctype.blockwise then
location = require('ts_context_commentstring.utils').get_cursor_location()
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
location = require('ts_context_commentstring.utils').get_visual_start_location()
end
return require('ts_context_commentstring.internal').calculate_commentstring {
key = type,
location = location,
}
end
end,
},
},
{
'NvChad/nvim-colorizer.lua',
-- event = 'BufReadPre',
cmd = 'ColorizerToggle',
opts = {
filetypes = { '*', '!lazy' },
buftype = { '*', '!prompt', '!nofile' },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes #ffffff
names = false, -- "Name" codes like Blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = false, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes: foreground, background
-- Available modes for `mode`: foreground, background, virtualtext
-- mode = "background", -- Set the display mode.
-- virtualtext = "■",
},
},
},
{
'williamboman/mason.nvim',
cmd = 'Mason',
opts = {
settings = {
ui = {
border = 'rounded',
icons = {
package_installed = '',
package_pending = '',
package_uninstalled = '',
2023-04-09 18:27:34 +02:00
},
2023-04-09 00:44:17 +02:00
},
-- log_level = vim.log.levels.INFO,
max_concurrent_installers = 4,
},
},
},
{
'TimUntersberger/neogit',
dependencies = 'sindrets/diffview.nvim',
cmd = 'Neogit',
opts = {
disable_signs = false,
disable_hint = false,
disable_context_highlighting = false,
disable_commit_confirmation = true,
-- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size.
-- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it.
auto_refresh = true,
disable_builtin_notifications = false,
use_magit_keybindings = false,
-- Change the default way of opening neogit
kind = 'replace',
-- The time after which an output console is shown for slow running commands
console_timeout = 2000,
-- Automatically show console if a command takes more than console_timeout milliseconds
auto_show_console = true,
-- Change the default way of opening the commit popup
commit_popup = {
kind = 'split',
},
-- Change the default way of opening popups
popup = {
kind = 'split',
},
status = {
recent_commit_count = 50,
},
-- customize displayed signs
signs = {
-- { CLOSED, OPENED }
section = { '>', 'v' },
item = { '>', 'v' },
hunk = { '', '' },
},
integrations = {
-- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`.
-- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`.
--
-- Requires you to have `sindrets/diffview.nvim` installed.
-- use {
-- 'TimUntersberger/neogit',
-- requires = {
-- 'nvim-lua/plenary.nvim',
-- 'sindrets/diffview.nvim'
-- }
-- }
--
diffview = true,
},
-- Setting any section to `false` will make the section not render at all
sections = {
untracked = {
folded = false,
},
unstaged = {
folded = false,
},
staged = {
folded = false,
},
stashes = {
folded = true,
},
unpulled = {
folded = true,
},
unmerged = {
folded = false,
},
recent = {
folded = true,
},
},
-- override/add mappings
mappings = {
-- modify status buffer mappings
status = {
-- Adds a mapping with "B" as key that does the "BranchPopup" command
['B'] = 'BranchPopup',
-- Removes the default mapping of "s"
-- ['s'] = '',
},
},
},
},
{
'stevearc/oil.nvim',
-- lazy = false,
event = 'Syntax',
opts = {
-- 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,
},
-- 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',
},
-- Restore window options to previous values when leaving an oil buffer
restore_win_options = true,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = 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 = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
['g?'] = 'actions.show_help',
['<CR>'] = 'actions.select',
['<C-s>'] = 'actions.select_vsplit',
['<C-h>'] = 'actions.select_split',
['<C-p>'] = 'actions.preview',
['<TAB>'] = 'actions.preview',
['<C-c>'] = 'actions.close',
['q'] = 'actions.close',
['<C-l>'] = 'actions.refresh',
['-'] = 'actions.parent',
['l'] = 'actions.parent',
['_'] = 'actions.open_cwd',
['`'] = 'actions.cd',
['~'] = 'actions.tcd',
['g.'] = 'actions.toggle_hidden',
},
-- 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,
},
-- 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 = 10,
},
},
},
},
{
'akinsho/toggleterm.nvim',
cmd = 'ToggleTerm',
opts = {
-- size can be a number or function which is passed the current terminal
-- size = function(term)
-- if term.direction == 'horizontal' then
-- return 15
-- elseif term.direction == 'vertical' then
-- return vim.o.columns * 0.4
-- end
-- end,
shade_filetypes = { 'none', 'fzf' },
-- open_mapping = [[<home>]],
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_terminals = true,
shading_factor = '2', -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true,
-- direction = 'horizontal', -- 'vertical' | 'horizontal' | 'window' | 'float',
direction = 'float', -- 'vertical' | 'horizontal' | 'window' | 'float',
close_on_exit = true, -- close the terminal window when the process exits
shell = vim.o.shell, -- change the default shell
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_win_open'
-- see :h nvim_win_open for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
border = 'curved', -- | 'double' | 'shadow' | 'curved' --| ... other options supported by win open
-- width = 100,
-- height = 30,
-- winblend = 20,
-- highlights = {
-- border = 'Normal',
-- background = 'Normal',
-- },
},
},
},
{
'nvim-treesitter/nvim-treesitter',
-- lazy = false,
-- dependencies = { 'nvim-treesitter/playground' },
-- dependencies = 'windwp/nvim-ts-autotag',
config = function()
local configs = require 'nvim-treesitter.configs'
configs.setup {
ignore_install = { 'haskell' },
highlight = {
enable = true, -- false will disable the whole extension
disable = { 'html' },
},
-- context_commentstring = { enable = true, config = { css = '// %s' } },
-- indent = {enable = true, disable = {"python", "html", "javascript"}},
-- TODO seems to be broken
indent = { enable = true, disable = { 'python', 'css' } },
-- autotag = { enable = true },
2023-04-09 00:44:17 +02:00
}
end,
},
{
'folke/trouble.nvim',
-- dependencies = {
-- 'nvim-tree/nvim-web-devicons',
-- },
cmd = { 'TroubleToggle', 'Trouble' },
opts = {
position = 'bottom', -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = 'quickfix', -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = '', -- icon used for open folds
fold_closed = '', -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = { -- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = 'q', -- close the list
cancel = '<esc>', -- cancel the preview and get back to your last window / buffer / cursor
refresh = 'r', -- manually refresh
jump_close = { '<cr>', '<tab>' }, -- jump to the diagnostic or open / close folds
open_split = { '<c-x>' }, -- open buffer in new split
open_vsplit = { '<c-v>' }, -- open buffer in new vsplit
open_tab = { '<c-t>' }, -- open buffer in new tab
jump = { 'o' }, -- jump to the diagnostic and close the list
toggle_mode = 'm', -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = 'P', -- toggle auto_preview
hover = 'K', -- opens a small popup with the full multiline message
preview = 'p', -- preview the diagnostic location
close_folds = { 'zM', 'zm' }, -- close all folds
open_folds = { 'zR', 'zr' }, -- open all folds
toggle_fold = { 'zA', 'za' }, -- toggle fold of current file
previous = 'k', -- preview item
next = 'j', -- next item
},
indent_lines = true, -- add an indent guide below the fold icons
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = false, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation
auto_jump = { 'lsp_definitions' }, -- for the given modes, automatically jump if there is only a single result
signs = {
-- icons / text used for a diagnostic
error = '',
warning = '',
hint = '',
information = '',
other = '',
},
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
},
},
{
'j-morano/buffer_manager.nvim',
opts = {
-- line_keys = '', -- deactivate line keybindings
short_file_names = true,
short_term_names = false,
select_menu_item_commands = {
edit = {
key = '<CR>',
command = 'edit',
},
v = {
key = '<C-v>',
command = 'vsplit',
},
h = {
key = '<C-h>',
command = 'split',
},
},
width = 0.6,
},
},
2022-12-31 17:43:31 +01:00
}