feat!: minor rework

Moved all plugins that I don't change often/ever to plugins/init.lua.
Removed mason-lspconfig, not useful in my case.
This commit is contained in:
fiplox 2023-04-15 15:47:38 +02:00
parent 8ce9021de7
commit 650c582972
20 changed files with 1034 additions and 1166 deletions

View File

@ -16,12 +16,12 @@ vim.opt.runtimepath:prepend(lazypath)
vim.api.nvim_create_autocmd('User', { vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted', pattern = 'LazyVimStarted',
callback = function() callback = function()
require 'feline'
require 'config.mappings' require 'config.mappings'
require 'config.autocmd' require 'config.autocmd'
vim.cmd 'colorscheme neogruber'
require 'nvim-treesitter'
require 'feline'
require 'noice' require 'noice'
require 'nvim-treesitter'
vim.cmd 'colorscheme neogruber'
end, end,
}) })

View File

@ -96,19 +96,7 @@ function UnMapDHM()
vim.api.nvim_del_keymap('n', 'N') vim.api.nvim_del_keymap('n', 'N')
end end
if os.getenv 'SSH_TTY' then MapDHM()
MapDHM()
else
local handle = io.popen 'lsusb | grep -c Sofle'
if handle == nil then
return
end
local automap = handle:read '*n'
handle:close()
if automap == 1 then
MapDHM()
end
end
local wk = require 'which-key' local wk = require 'which-key'

282
lua/config/utils.lua Normal file
View File

@ -0,0 +1,282 @@
local M = {}
M.kind_icons = {
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
M.has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
end
M.feline_theme = {
fg = '#c9d1d9',
bg = '#1f2428',
green = '#66cc66',
yellow = '#d5992a',
purple = '#c678dd',
orange = '#b17135',
peanut = '#f6d5a4',
red = '#e06c75',
aqua = '#61afef',
bg2 = '#24293a',
dark_red = '#f75f5f',
}
M.feline_vi_mode_colors = {
NORMAL = 'green',
OP = 'green',
INSERT = 'yellow',
VISUAL = 'purple',
LINES = 'orange',
BLOCK = 'dark_red',
REPLACE = 'red',
COMMAND = 'aqua',
}
M.feline_c = {
vim_mode = {
provider = {
name = 'vi_mode',
opts = {
show_mode_name = true,
-- padding = "center", -- Uncomment for extra padding.
},
},
hl = function()
return {
fg = require('feline.providers.vi_mode').get_mode_color(),
bg = 'bg2',
style = 'bold',
name = 'NeovimModeHLColor',
}
end,
left_sep = 'block',
right_sep = 'block',
},
gitBranch = {
provider = 'git_branch',
hl = {
fg = 'peanut',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffAdded = {
provider = 'git_diff_added',
hl = {
fg = 'green',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffRemoved = {
provider = 'git_diff_removed',
hl = {
fg = 'red',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffChanged = {
provider = 'git_diff_changed',
hl = {
fg = 'fg',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'right_filled',
},
separator = {
provider = '',
},
file_info = {
provider = {
name = 'file_info',
opts = {
colored_icon = false,
type = 'relative-short',
},
},
hl = {
style = 'bold',
},
left_sep = ' ',
right_sep = ' ',
},
diagnostic_errors = {
provider = 'diagnostic_errors',
hl = {
fg = 'red',
},
},
diagnostic_warnings = {
provider = 'diagnostic_warnings',
hl = {
fg = 'yellow',
},
},
diagnostic_hints = {
provider = 'diagnostic_hints',
hl = {
fg = 'aqua',
},
},
diagnostic_info = {
provider = 'diagnostic_info',
},
lsp_client_names = {
provider = 'lsp_client_names',
hl = {
fg = 'purple',
bg = 'bg2',
style = 'bold',
},
left_sep = 'left_filled',
right_sep = 'right_filled',
},
file_type = {
provider = {
name = 'file_type',
opts = {
-- filetype_icon = true,
colored_icon = false,
case = 'titlecase',
},
},
hl = {
fg = 'red',
bg = 'bg2',
style = 'bold',
},
left_sep = 'left_filled',
right_sep = 'block',
},
file_encoding = {
provider = 'file_encoding',
hl = {
fg = 'orange',
bg = 'bg2',
-- style = 'italic',
},
left_sep = 'block',
right_sep = 'block',
},
position = {
provider = 'position',
hl = {
fg = 'green',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
line_percentage = {
provider = 'line_percentage',
hl = {
fg = 'aqua',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
scroll_bar = {
provider = 'scroll_bar',
hl = {
fg = 'yellow',
style = 'bold',
},
},
search_count = {
provider = 'search_count',
hl = {
style = 'bold',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
macro = {
provider = 'macro',
hl = {
style = 'bold',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
}
function M.on_attach(client, bufnr)
local has_formatter = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
--[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]]
if client.name == 'jdt.ls' then
client.server_capabilities.documentFormattingProvider = false
vim.lsp.codelens.refresh()
if JAVA_DAP_ACTIVE then
require('jdtls').setup_dap { hotcodereplace = 'auto' }
require('jdtls.dap').setup_dap_main_class_configs()
end
end
local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype')
local enable = false
if has_formatter then
enable = client.name == 'null-ls'
else
enable = not (client.name == 'null-ls')
end
-- util.info(client.name .. " " .. (enable and "yes" or "no"), "format")
client.server_capabilities.documentFormattingProvider = enable
client.server_capabilities.semanticTokensProvider = false
end
M.lsp_config = {
virtual_text = {
prefix = '',
},
signs = false,
underline = true,
update_in_insert = true,
severity_sort = false,
float = {
focusable = false,
-- style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
}
return M

View File

@ -1,65 +0,0 @@
local M = {
'numToStr/Comment.nvim',
-- event = 'VeryLazy',
keys = { 'gcc', { 'gc', mode = 'v' }, {'gb', mode = 'v'} },
}
function M.config()
local comment = require 'Comment'
comment.setup {
-- -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,
}
local ft = require 'Comment.ft'
ft({ 's', 'asm' }, '# %s')
end
return M

View File

@ -1,28 +0,0 @@
local M = {
'windwp/nvim-autopairs',
event = 'InsertEnter'
}
function M.config()
local npairs = require 'nvim-autopairs'
npairs.setup {
check_ts = true, -- treesitter integration
fast_wrap = {
map = '<C-e>',
highlight = 'Search',
highlight_grey = 'Comment',
},
map_c_w = true,
-- disable_filetype = { "TelescopePrompt" },
}
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp_status_ok, cmp = pcall(require, 'cmp')
if not cmp_status_ok then
return
end
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done {})
end
return M

View File

@ -1,28 +0,0 @@
local M = {
'j-morano/buffer_manager.nvim',
}
function M.config()
require('buffer_manager').setup {
-- 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.8,
}
end
return M

View File

@ -1,4 +1,4 @@
local M = { return {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
-- lazy = false, -- lazy = false,
dependencies = { dependencies = {
@ -9,50 +9,18 @@ local M = {
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'windwp/nvim-autopairs',
}, },
event = { 'InsertEnter', 'CmdlineEnter' }, event = { 'InsertEnter', 'CmdlineEnter' },
version = false, version = false,
} config = function()
function M.config()
local kind_icons = {
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
local cmp = require 'cmp' local cmp = require 'cmp'
local utils = require 'config.utils'
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
end
cmp.setup { cmp.setup {
enabled = function() -- enabled = function()
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt' or require('cmp_dap').is_dap_buffer() -- return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt' or require('cmp_dap').is_dap_buffer()
end, -- end,
view = { view = {
entries = { entries = {
name = 'custom', -- can be "custom", "wildmenu" or "native" name = 'custom', -- can be "custom", "wildmenu" or "native"
@ -80,7 +48,7 @@ function M.config()
format = function(_, item) format = function(_, item)
local ELLIPSIS_CHAR = '' local ELLIPSIS_CHAR = ''
local MAX_LABEL_WIDTH = 20 local MAX_LABEL_WIDTH = 20
item.kind = string.format('%s %s', kind_icons[item.kind], item.kind) -- This concatonates the icons with the name of the item kind item.kind = string.format('%s %s', utils.kind_icons[item.kind], item.kind) -- This concatonates the icons with the name of the item kind
local label = item.abbr local label = item.abbr
local truncated_label = vim.fn.strcharpart(label, 0, MAX_LABEL_WIDTH) local truncated_label = vim.fn.strcharpart(label, 0, MAX_LABEL_WIDTH)
@ -106,7 +74,7 @@ function M.config()
cmp.select_next_item { behavior = cmp.SelectBehavior.Select } cmp.select_next_item { behavior = cmp.SelectBehavior.Select }
elseif require('snippy').can_expand_or_advance() then elseif require('snippy').can_expand_or_advance() then
require('snippy').expand_or_advance() require('snippy').expand_or_advance()
elseif has_words_before() then elseif utils.has_words_before() then
cmp.complete() cmp.complete()
else else
fallback() fallback()
@ -156,6 +124,20 @@ function M.config()
{ name = 'dap' }, { name = 'dap' },
}, },
}) })
end
return M local npairs = require 'nvim-autopairs'
npairs.setup {
check_ts = true, -- treesitter integration
fast_wrap = {
map = '<C-e>',
highlight = 'Search',
highlight_grey = 'Comment',
},
map_c_w = true,
-- disable_filetype = { "TelescopePrompt" },
}
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done {})
end,
}

View File

@ -1,24 +0,0 @@
return {
'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 = "■",
},
},
}

View File

@ -1,4 +1,4 @@
local M = { return {
'feline-nvim/feline.nvim', 'feline-nvim/feline.nvim',
-- lazy = false -- lazy = false
-- event = 'UIEnter', -- event = 'UIEnter',
@ -6,214 +6,12 @@ local M = {
dependencies = { dependencies = {
'nvim-tree/nvim-web-devicons', 'nvim-tree/nvim-web-devicons',
}, },
} config = function()
function M.config()
local feline = require 'feline' local feline = require 'feline'
local utils = require 'config.utils'
local theme = { local c = utils.feline_c
fg = '#c9d1d9', local theme = utils.feline_theme
bg = '#1f2428', local vi_mode_colors = utils.feline_vi_mode_colors
green = '#66cc66',
yellow = '#d5992a',
purple = '#c678dd',
orange = '#b17135',
peanut = '#f6d5a4',
red = '#e06c75',
aqua = '#61afef',
bg2 = '#24293a',
dark_red = '#f75f5f',
}
local vi_mode_colors = {
NORMAL = 'green',
OP = 'green',
INSERT = 'yellow',
VISUAL = 'purple',
LINES = 'orange',
BLOCK = 'dark_red',
REPLACE = 'red',
COMMAND = 'aqua',
}
local c = {
vim_mode = {
provider = {
name = 'vi_mode',
opts = {
show_mode_name = true,
-- padding = "center", -- Uncomment for extra padding.
},
},
hl = function()
return {
fg = require('feline.providers.vi_mode').get_mode_color(),
bg = 'bg2',
style = 'bold',
name = 'NeovimModeHLColor',
}
end,
left_sep = 'block',
right_sep = 'block',
},
gitBranch = {
provider = 'git_branch',
hl = {
fg = 'peanut',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffAdded = {
provider = 'git_diff_added',
hl = {
fg = 'green',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffRemoved = {
provider = 'git_diff_removed',
hl = {
fg = 'red',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
gitDiffChanged = {
provider = 'git_diff_changed',
hl = {
fg = 'fg',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'right_filled',
},
separator = {
provider = '',
},
file_info = {
provider = {
name = 'file_info',
opts = {
colored_icon = false,
type = 'relative-short',
},
},
hl = {
style = 'bold',
},
left_sep = ' ',
right_sep = ' ',
},
diagnostic_errors = {
provider = 'diagnostic_errors',
hl = {
fg = 'red',
},
},
diagnostic_warnings = {
provider = 'diagnostic_warnings',
hl = {
fg = 'yellow',
},
},
diagnostic_hints = {
provider = 'diagnostic_hints',
hl = {
fg = 'aqua',
},
},
diagnostic_info = {
provider = 'diagnostic_info',
},
lsp_client_names = {
provider = 'lsp_client_names',
hl = {
fg = 'purple',
bg = 'bg2',
style = 'bold',
},
left_sep = 'left_filled',
right_sep = 'right_filled',
},
file_type = {
provider = {
name = 'file_type',
opts = {
-- filetype_icon = true,
colored_icon = false,
case = 'titlecase',
},
},
hl = {
fg = 'red',
bg = 'bg2',
style = 'bold',
},
left_sep = 'left_filled',
right_sep = 'block',
},
file_encoding = {
provider = 'file_encoding',
hl = {
fg = 'orange',
bg = 'bg2',
-- style = 'italic',
},
left_sep = 'block',
right_sep = 'block',
},
position = {
provider = 'position',
hl = {
fg = 'green',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
line_percentage = {
provider = 'line_percentage',
hl = {
fg = 'aqua',
bg = 'bg2',
style = 'bold',
},
left_sep = 'block',
right_sep = 'block',
},
scroll_bar = {
provider = 'scroll_bar',
hl = {
fg = 'yellow',
style = 'bold',
},
},
search_count = {
provider = 'search_count',
hl = {
style = 'bold',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
macro = {
provider = 'macro',
hl = {
style = 'bold',
bg = 'bg2',
},
left_sep = 'block',
right_sep = 'block',
},
}
local left = { local left = {
c.vim_mode, c.vim_mode,
@ -262,6 +60,5 @@ function M.config()
theme = theme, theme = theme,
vi_mode_colors = vi_mode_colors, vi_mode_colors = vi_mode_colors,
} }
end end,
}
return M

View File

@ -5,13 +5,16 @@ return {
'simrat39/rust-tools.nvim', 'simrat39/rust-tools.nvim',
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim',
{ 'jghauser/mkdir.nvim', lazy = false }, { 'jghauser/mkdir.nvim', lazy = false },
{
url = 'https://dev.filnar.com/fiplox/neogruber.nvim',
lazy = false,
-- event = 'VeryLazy'
},
-- 'rcarriga/cmp-dap', -- 'rcarriga/cmp-dap',
{ {
'phaazon/hop.nvim', -- event = 'BufRead', 'phaazon/hop.nvim', -- event = 'BufRead',
keys = { { 's', ':HopChar2<cr>' }, { 'S', ':HopWord<cr>' } }, keys = { { 's', ':HopChar2<cr>' }, { 'S', ':HopWord<cr>' } },
config = function() config = true,
require('hop').setup()
end,
}, },
{ {
'stevearc/dressing.nvim', 'stevearc/dressing.nvim',
@ -26,18 +29,15 @@ return {
return vim.ui.input(...) return vim.ui.input(...)
end end
end, end,
config = function() opts = {
require('dressing').setup {
select = { select = {
trim_prompt = false, trim_prompt = false,
}, },
} },
end,
}, },
{ {
'folke/noice.nvim', 'folke/noice.nvim',
config = function() opts = {
require('noice').setup {
messages = { messages = {
view_search = false, view_search = false,
}, },
@ -66,7 +66,406 @@ return {
enabled = false, 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 = '',
},
},
-- 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 },
} }
end, 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,
},
},
} }

View File

@ -3,59 +3,46 @@ local M = {
name = 'lsp', name = 'lsp',
event = { 'BufRead', 'BufNewFile' }, event = { 'BufRead', 'BufNewFile' },
-- lazy = false, -- lazy = false,
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason-lspconfig.nvim' }, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason.nvim' },
} }
local function has_formatter(ft) local servers = { 'clangd', 'rust_analyzer', 'lua_ls', 'pyright', 'gopls', 'jdtls' }
local sources = require 'null-ls.sources'
local available = sources.get_available(ft, 'NULL_LS_FORMATTING')
return #available > 0
end
function M.config() function M.config()
require('mason-lspconfig').setup { local utils = require 'config.utils'
automatic_installation = false,
}
local opts = {} local opts = {}
local cmp_nvim_lsp = require 'cmp_nvim_lsp' local cmp_nvim_lsp = require 'cmp_nvim_lsp'
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = cmp_nvim_lsp.default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true local lspconfig = require 'lspconfig'
capabilities = cmp_nvim_lsp.default_capabilities(capabilities)
local on_attach = function(client, bufnr) for _, server in ipairs(servers) do
--[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]]
if client.name == 'jdt.ls' then
client.server_capabilities.documentFormattingProvider = false
vim.lsp.codelens.refresh()
if JAVA_DAP_ACTIVE then
require('jdtls').setup_dap { hotcodereplace = 'auto' }
require('jdtls.dap').setup_dap_main_class_configs()
end
end
local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype')
local enable = false
if has_formatter(ft) then
enable = client.name == 'null-ls'
else
enable = not (client.name == 'null-ls')
end
-- util.info(client.name .. " " .. (enable and "yes" or "no"), "format")
client.server_capabilities.documentFormattingProvider = enable
client.server_capabilities.semanticTokensProvider = false
end
require('mason-lspconfig').setup_handlers {
function(server) -- default handler (optional)
opts = { opts = {
on_attach = on_attach, on_attach = utils.on_attach,
capabilities = capabilities, capabilities = capabilities,
} }
if server == 'sumneko_lua' or server == 'lua_ls' then if server == 'lua_ls' then
local sumneko_opts = require 'plugins.lsp.settings.sumneko_lua' local sumneko_opts = {
flags = {
debounce_text_changes = 150,
},
settings = {
Lua = {
diagnostics = {
globals = { 'vim' },
},
-- workspace = {
-- library = {
-- [vim.fn.expand '$VIMRUNTIME/lua'] = true,
-- [vim.fn.stdpath 'config' .. '/lua'] = true,
-- },
-- },
telemetry = {
enable = false,
},
},
},
}
opts = vim.tbl_deep_extend('force', sumneko_opts, opts) opts = vim.tbl_deep_extend('force', sumneko_opts, opts)
end end
if server == 'clangd' then if server == 'clangd' then
@ -89,43 +76,23 @@ function M.config()
-- vim.cmd "command! -buffer JdtJshell lua require('jdtls').jshell()" -- vim.cmd "command! -buffer JdtJshell lua require('jdtls').jshell()"
goto continue goto continue
end end
require('lspconfig')[server].setup(opts) lspconfig[server].setup(opts)
::continue:: ::continue::
end, end
}
local config = { vim.diagnostic.config(utils.lsp_config)
virtual_text = {
prefix = '',
},
signs = false,
underline = true,
update_in_insert = true,
severity_sort = false,
float = {
focusable = false,
-- style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
}
vim.diagnostic.config(config)
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {
border = 'rounded', border = 'rounded',
}) })
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = 'rounded', border = 'rounded',
}) })
-- local on_references = vim.lsp.handlers['textDocument/references']
local on_references = vim.lsp.handlers['textDocument/references'] -- vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, {
vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { -- -- Use location list instead of quickfix list
-- Use location list instead of quickfix list -- loclist = true,
loclist = true, -- })
})
end end
return M return M

View File

@ -1,21 +0,0 @@
return {
flags = {
debounce_text_changes = 150,
},
settings = {
Lua = {
diagnostics = {
globals = { 'vim' },
},
-- workspace = {
-- library = {
-- [vim.fn.expand '$VIMRUNTIME/lua'] = true,
-- [vim.fn.stdpath 'config' .. '/lua'] = true,
-- },
-- },
telemetry = {
enable = false,
},
},
},
}

View File

@ -1,44 +0,0 @@
local M = {
'williamboman/mason.nvim',
cmd = 'Mason',
}
-- M.tools = {
-- 'clang-format',
-- 'clangd',
-- 'gopls',
-- 'lua-language-server',
-- 'rust-analyzer',
-- 'prettierd',
-- 'stylua',
-- }
--
-- function M.check()
-- local mr = require 'mason-registry'
-- for _, tool in ipairs(M.tools) do
-- local p = mr.get_package(tool)
-- if not p:is_installed() then
-- p:install()
-- end
-- end
-- end
function M.config()
require('mason').setup {
settings = {
ui = {
border = 'rounded',
icons = {
package_installed = '',
package_pending = '',
package_uninstalled = '',
},
},
log_level = vim.log.levels.INFO,
max_concurrent_installers = 4,
},
}
-- M.check()
end
return M

View File

@ -1,94 +0,0 @@
local M = {
'TimUntersberger/neogit',
dependencies = 'sindrets/diffview.nvim',
cmd = 'Neogit',
}
function M.config()
require('neogit').setup {
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'] = '',
},
},
}
end
return M

View File

@ -1,9 +1,7 @@
local M = { return {
'jose-elias-alvarez/null-ls.nvim', 'jose-elias-alvarez/null-ls.nvim',
ft = 'markdown', ft = 'markdown',
} config = function()
function M.config()
local null_ls = require 'null-ls' local null_ls = require 'null-ls'
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
@ -17,14 +15,14 @@ function M.config()
formatting.prettier.with { extra_args = { '--no-semi', '--single-quote', '--jsx-single-quote' } }, formatting.prettier.with { extra_args = { '--no-semi', '--single-quote', '--jsx-single-quote' } },
formatting.black.with { extra_args = { '--fast' } }, formatting.black.with { extra_args = { '--fast' } },
formatting.stylua.with { extra_args = { '--quote-style=AutoPreferSingle', '--call-parentheses=None' } }, formatting.stylua.with { extra_args = { '--quote-style=AutoPreferSingle', '--call-parentheses=None' } },
formatting.clang_format.with { -- formatting.clang_format.with {
filetypes = { 'c' }, -- filetypes = { 'c' },
extra_args = { -- extra_args = {
'--style', -- '--style',
'{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, AlwaysBreakAfterReturnType: AllDefinitions}', -- '{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, AlwaysBreakAfterReturnType: AllDefinitions}',
-- '{AccessModifierOffset : -2, AllowShortIfStatementsOnASingleLine : Never, AlignConsecutiveMacros : true, AllowShortLoopsOnASingleLine : false, AlwaysBreakTemplateDeclarations : true, Standard : c++20, NamespaceIndentation : All, IndentWidth : 4, TabWidth : 4, BreakBeforeBraces : Linux, AllowShortFunctionsOnASingleLine : Empty, AllowShortBlocksOnASingleLine : Never, FixNamespaceComments : true, PointerAlignment : Right, ColumnLimit : 120, ContinuationIndentWidth : 2, UseTab : Always }', -- -- '{AccessModifierOffset : -2, AllowShortIfStatementsOnASingleLine : Never, AlignConsecutiveMacros : true, AllowShortLoopsOnASingleLine : false, AlwaysBreakTemplateDeclarations : true, Standard : c++20, NamespaceIndentation : All, IndentWidth : 4, TabWidth : 4, BreakBeforeBraces : Linux, AllowShortFunctionsOnASingleLine : Empty, AllowShortBlocksOnASingleLine : Never, FixNamespaceComments : true, PointerAlignment : Right, ColumnLimit : 120, ContinuationIndentWidth : 2, UseTab : Always }',
}, -- },
}, -- },
formatting.clang_format.with { formatting.clang_format.with {
filetypes = { 'cpp' }, filetypes = { 'cpp' },
extra_args = { extra_args = {
@ -56,6 +54,5 @@ function M.config()
-- diagnostics.flake8 -- diagnostics.flake8
}, },
} }
end end,
}
return M

View File

@ -1,79 +0,0 @@
local M = {
'stevearc/oil.nvim',
-- lazy = false,
event = 'Syntax',
}
function M.config()
require('oil').setup {
-- 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,
},
},
}
end
return M

View File

@ -1,5 +0,0 @@
return {
url = 'https://dev.filnar.com/fiplox/neogruber.nvim',
lazy = false,
-- event = 'VeryLazy'
}

View File

@ -1,48 +0,0 @@
local M = {
'akinsho/toggleterm.nvim',
cmd = 'ToggleTerm',
}
function M.config()
local toggleterm = require 'toggleterm'
toggleterm.setup {
-- 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',
-- },
},
}
end
return M

View File

@ -1,47 +0,0 @@
local M = {
'nvim-treesitter/nvim-treesitter',
-- lazy = false,
-- dependencies = { 'nvim-treesitter/playground' },
-- event = { 'BufReadPost', 'BufNewFile' },
-- event = 'VeryLazy'
}
function M.config()
local configs = require 'nvim-treesitter.configs'
configs.setup {
ensure_installed = {
'bash',
'c',
'cpp',
'go',
'json',
'lua',
'python',
'rust',
'markdown',
'markdown_inline',
'regex',
'vim',
},
ignore_install = { 'haskell' },
-- matchup = {
-- enable = true -- mandatory, false will disable the whole extension
-- -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
-- },
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 },
-- autopairs = {
-- enable = true,
-- },
}
end
return M

View File

@ -1,61 +0,0 @@
local M = {
'folke/trouble.nvim',
-- dependencies = {
-- 'nvim-tree/nvim-web-devicons',
-- },
cmd = { 'TroubleToggle', 'Trouble' },
}
function M.config()
local trouble = require 'trouble'
trouble.setup {
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
}
end
return M