Complete refactor + moved to [lsp-zero](https://github.com/VonHeikemen/lsp-zero.nvim)

This commit is contained in:
Kristofers Solo
2023-08-09 02:01:47 +03:00
parent 9e449312d7
commit 5871bcd430
71 changed files with 2023 additions and 2204 deletions

View File

@@ -1,13 +0,0 @@
return {
{
"hrsh7th/nvim-cmp",
-- event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- The completion pluginpluguse "nvim-lua/plenary.nvim"
"saadparwaiz1/cmp_luasnip", -- snippet completions
}

167
lua/plugins/colorizer.lua Normal file
View File

@@ -0,0 +1,167 @@
return {
{
"NvChad/nvim-colorizer.lua",
opts = {
filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = true, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = true, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = {
enable = true,
parsers = { "css" },
}, -- Enable sass colors
virtualtext = "",
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
html = { names = true },
css = { names = true },
},
},
{
"uga-rosa/ccc.nvim",
event = "VeryLazy",
config = function()
local ccc = require("ccc")
local ColorInput = require("ccc.input")
local convert = require("ccc.utils.convert")
local RgbHslInput = setmetatable({
name = "RGB/HSL",
max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 },
min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 },
bar_name = { "R", "G", "B", "H", "S", "L" },
}, { __index = ColorInput })
function RgbHslInput.format(n, i)
if i <= 3 then
-- RGB
n = n * 255
elseif i >= 5 then
-- S or L of HSL
n = n * 100
end
return ("%6d"):format(n)
end
function RgbHslInput.from_rgb(RGB)
local HSL = convert.rgb2hsl(RGB)
local R, G, B = unpack(RGB)
local H, S, L = unpack(HSL)
return { R, G, B, H, S, L }
end
function RgbHslInput.to_rgb(value)
return { value[1], value[2], value[3] }
end
function RgbHslInput:_set_rgb(RGB)
self.value[1] = RGB[1]
self.value[2] = RGB[2]
self.value[3] = RGB[3]
end
function RgbHslInput:_set_hsl(HSL)
self.value[4] = HSL[1]
self.value[5] = HSL[2]
self.value[6] = HSL[3]
end
function RgbHslInput:callback(index, new_value)
self.value[index] = new_value
local v = self.value
if index <= 3 then
local RGB = { v[1], v[2], v[3] }
local HSL = convert.rgb2hsl(RGB)
self:_set_hsl(HSL)
else
local HSL = { v[4], v[5], v[6] }
local RGB = convert.hsl2rgb(HSL)
self:_set_rgb(RGB)
end
end
ccc.setup({
pickers = {
ccc.picker.custom_entries({
bg = "#1a1b26",
bg_dark = "#16161e",
bg_float = "#16161e",
bg_highlight = "#292e42",
bg_popup = "#16161e",
bg_search = "#3d59a1",
bg_sidebar = "#16161e",
bg_statusline = "#16161e",
bg_visual = "#283457",
black = "#15161e",
blue = "#7aa2f7",
blue0 = "#3d59a1",
blue1 = "#2ac3de",
blue2 = "#0db9d7",
blue5 = "#89ddff",
blue6 = "#b4f9f8",
blue7 = "#394b70",
border = "#15161e",
border_highlight = "#27a1b9",
comment = "#565f89",
cyan = "#7dcfff",
dark3 = "#545c7e",
dark5 = "#737aa2",
delta_add = "#2c5a66",
delta_delete = "#713137",
diff_add = "#20303b",
diff_change = "#1f2231",
diff_delete = "#37222c",
diff_text = "#394b70",
error = "#db4b4b",
fg = "#c0caf5",
fg_dark = "#a9b1d6",
fg_float = "#c0caf5",
fg_gutter = "#3b4261",
fg_sidebar = "#a9b1d6",
git_add = "#449dab",
git_change = "#6183bb",
git_delete = "#914c54",
git_ignore = "#545c7e",
gitSigns_add = "#266d6a",
gitSigns_change = "#536c9e",
gitSigns_delete = "#b2555b",
green = "#9ece6a",
green1 = "#73daca",
green2 = "#41a6b5",
hint = "#1abc9c",
info = "#0db9d7",
magenta = "#bb9af7",
magenta2 = "#ff007c",
none = "NONE",
orange = "#ff9e64",
purple = "#9d7cd8",
red = "#f7768e",
red1 = "#db4b4b",
teal = "#1abc9c",
terminal_black = "#414868",
warning = "#e0af68",
yellow = "#e0af68",
}),
},
inputs = {
RgbHslInput,
},
})
end,
},
}

64
lua/plugins/comment.lua Normal file
View File

@@ -0,0 +1,64 @@
return {
{
"numToStr/Comment.nvim",
lazy = false,
opts = {
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gbb",
},
-- -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 = true,
},
---Function to call before (un)comment
-- pre_hook = function(ctx)
-- local U = require("Comment.utils")
--
-- local location = nil
-- if ctx.ctype == U.ctype.block 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 = ctx.ctype == U.ctype.line and "__default" or "__multiline",
-- location = location,
-- })
-- end,
},
},
}

91
lua/plugins/cpp.lua Normal file
View File

@@ -0,0 +1,91 @@
return {
{
"p00f/clangd_extensions.nvim",
opts = {
inlay_hints = {
inline = vim.fn.has("nvim-0.10") == 1,
-- Options other than `highlight' and `priority' only work
-- if `inline' is disabled
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refresh of the inlay hints.
-- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = { "CursorHold" },
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = true,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 8,
-- The color of the hints
highlight = "Comment",
-- The highlight group priority for extmark
priority = 100,
},
ast = {
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
highlights = {
detail = "Comment",
},
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
},
},
},
{
"Civitasv/cmake-tools.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
cmake_command = "cmake",
cmake_build_directory = "target/build/",
cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" },
cmake_soft_link_compile_commands = true, -- if softlink compile commands json file
cmake_build_options = {},
cmake_console_size = 15, -- cmake output window height
cmake_console_position = "belowright", -- "belowright", "aboveleft", ...
cmake_show_console = "always", -- "always", "only_on_error"
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
cmake_variants_message = {
short = { show = true },
long = { show = true, max_length = 40 },
},
},
},
}

View File

@@ -1,10 +1,56 @@
return {
{ "rcarriga/nvim-dap-ui", event = "VeryLazy", dependencies = "jayp0521/mason-nvim-dap.nvim" },
{
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = { "jayp0521/mason-nvim-dap.nvim" },
opts = {
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacs",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
-- sidebar = {
-- elements = {
-- {
-- id = "scopes",
-- size = 0.25, -- Can be float or integer > 1
-- },
-- { id = "breakpoints", size = 0.25 },
-- },
-- size = 40,
-- position = "right", -- Can be "left", "right", "top", "bottom"
-- },
-- tray = {
-- elements = {},
-- },
},
},
{
"jayp0521/mason-nvim-dap.nvim",
event = "VeryLazy",
dependencies = {
"williamboman/mason.nvim",
{
"williamboman/mason.nvim",
opts = {
automatic_installation = true,
automatic_setup = true,
},
},
"mfussenegger/nvim-dap",
},
},

57
lua/plugins/fidget.lua Normal file
View File

@@ -0,0 +1,57 @@
return {
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
opts = {
text = {
spinner = "pipe", -- animation shown when tasks are ongoing
done = "", -- character shown when all tasks are complete
commenced = "Started", -- message shown when task starts
completed = "Completed", -- message shown when task completes
},
align = {
bottom = true, -- align fidgets along bottom edge of buffer
right = true, -- align fidgets along right edge of buffer
},
timer = {
spinner_rate = 125, -- frame rate of spinner animation, in ms
fidget_decay = 2000, -- how long to keep around empty fidget, in ms
task_decay = 1000, -- how long to keep around completed task, in ms
},
window = {
relative = "win", -- where to anchor, either "win" or "editor"
blend = 0, -- &winblend for the window
zindex = nil, -- the zindex value for the window
border = "none", -- style of border for the fidget window
},
fmt = {
leftpad = true, -- right-justify text in fidget box
stack_upwards = true, -- list of tasks grows upwards
max_width = 0, -- maximum width of the fidget box
-- function to format fidget title
fidget = function(fidget_name, spinner)
return string.format("%s %s", spinner, fidget_name)
end,
-- function to format each task line
task = function(task_name, message, percentage)
return string.format(
"%s%s [%s]",
message,
percentage and string.format(" (%s%%)", percentage) or "",
task_name
)
end,
},
sources = { -- Sources to configure
["*"] = { -- Name of source
ignore = false, -- Ignore notifications from this source
},
},
debug = {
logging = false, -- whether to enable logging, for debugging
strict = false, -- whether to interpret LSP strictly
},
},
},
}

View File

@@ -1,29 +1,48 @@
return {
{ "folke/lazy.nvim" },
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins
{ "windwp/nvim-autopairs" }, -- Autopairs, integrates with both cmp and treesitter
{ "numToStr/Comment.nvim" },
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "nvim-tree/nvim-web-devicons", lazy = true },
{ "nvim-tree/nvim-tree.lua" },
{ "moll/vim-bbye" },
{ "nvim-lualine/lualine.nvim" },
{ "arkav/lualine-lsp-progress" },
{ "akinsho/toggleterm.nvim" },
{ "ahmedkhalf/project.nvim" },
{ "lewis6991/impatient.nvim" },
{ "lukas-reineke/indent-blankline.nvim" },
{
"windwp/nvim-autopairs", -- Autopairs, integrates with both cmp and treesitter
opts = {
check_ts = true, -- treesitter integration
disable_filetype = {
"NvimTree",
"TelescopePrompt",
"alpha",
"lazy",
},
},
},
{ "goolord/alpha-nvim", lazy = true },
{ "willothy/veil.nvim", lazy = true },
{ "henriquehbr/nvim-startup.lua", lazy = true },
-- TODO: replace alphh with veil
-- { "willothy/veil.nvim", lazy = true },
{ "andweeb/presence.nvim" },
{
"andweeb/presence.nvim",
opts = {
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "The Only True Text Editor", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
-- client_id = "", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
{ "NvChad/nvim-colorizer.lua" },
{ "uga-rosa/ccc.nvim", lazy = true },
-- Rich Presence text options
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
},
},
{ "alvan/vim-closetag" },
{ "tpope/vim-surround" },
@@ -31,39 +50,22 @@ return {
{ "preservim/tagbar" },
{ "jghauser/mkdir.nvim", lazy = true },
{ "mtdl9/vim-log-highlighting", lazy = true },
{ "edluffy/hologram.nvim", lazy = true },
{
"edluffy/hologram.nvim",
lazy = true,
opts = {
auto_display = true,
},
},
{ "folke/which-key.nvim", lazy = true },
{ "folke/todo-comments.nvim", lazy = false },
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
module = "persistence",
},
{ "folke/zen-mode.nvim" },
{ "christoomey/vim-tmux-navigator" },
{ "ThePrimeagen/harpoon" },
{ "ThePrimeagen/vim-be-good", lazy = true },
-- Vimwiki
{ "vimwiki/vimwiki" },
{ "epwalsh/obsidian.nvim", lazy = true },
{ "stevearc/oil.nvim" },
-- Git
{ "lewis6991/gitsigns.nvim" },
{ "rest-nvim/rest.nvim", lazy = true },
{ "chipsenkbeil/distant.nvim", lazy = true },
{
"iamcco/markdown-preview.nvim",
build = function()
vim.fn["mkdp#util#install"]()
end,
},
{
"kevinhwang91/nvim-ufo",

35
lua/plugins/git.lua Normal file
View File

@@ -0,0 +1,35 @@
return {
{
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
},
},
}

15
lua/plugins/harpoon.lua Normal file
View File

@@ -0,0 +1,15 @@
return {
{
"ThePrimeagen/harpoon",
opts = {},
config = function()
local ui = require("harpoon.ui")
local keymap = vim.keymap.set
for i = 1, 12, 1 do
keymap("n", "<F" .. i .. ">", function()
ui.nav_file(i)
end)
end
end,
},
}

View File

@@ -0,0 +1,56 @@
return {
"RRethy/vim-illuminate",
config = function()
require("illuminate").configure({
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"alpha",
"NvimTree",
"dirvish",
"fugitive",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
-- See `:help mode()` for possible values
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
-- See `:help mode()` for possible values
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- large_file_cutoff: number of lines at which to use large_file_config
-- The `under_cursor` option is disabled when this cutoff is hit
large_file_cutoff = nil,
-- large_file_config: config to use for large files (based on large_file_cutoff).
-- Supports the same keys passed to .configure
-- If nil, vim-illuminate will be disabled for large files.
large_file_overrides = nil,
-- min_count_to_highlight: minimum number of matches required to perform highlighting
min_count_to_highlight = 1,
})
local bind = vim.keymap.set
bind("n", "<A-n>", "<cmd>lua require('illuminate').goto_next_reference(wrap)<cr>", { noremap = true })
bind("n", "<A-p>", "<cmd>lua require('illuminate').goto_prev_reference(wrap)<cr>", { noremap = true })
end,
}

View File

@@ -0,0 +1,83 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
config = function()
local g = vim.g
local opt = vim.opt
local cmd = vim.cmd
g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
g.indent_blankline_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
}
g.indentLine_enabled = 1
g.indent_blankline_char = ""
g.indent_blankline_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = true
g.indent_blankline_use_treesitter = true
g.indent_blankline_show_current_context = true
g.indent_blankline_context_patterns = {
"class",
"return",
"function",
"method",
"^if",
"^while",
"jsx_element",
"^for",
"^object",
"^table",
"block",
"arguments",
"if_statement",
"else_clause",
"jsx_element",
"jsx_self_closing_element",
"try_statement",
"catch_clause",
"import_statement",
"operation_type",
}
vim.wo.colorcolumn = "99999"
cmd([[highlight IndentBlanklineIndent1 guifg=#C678DD gui=nocombine]])
cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]])
cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]])
cmd([[highlight IndentBlanklineIndent6 guifg=#E06C75 gui=nocombine]])
opt.list = true
opt.listchars:append("space:⋅")
opt.listchars:append("eol:↴")
end,
opts = {
char = "",
show_trailing_blankline_indent = false,
show_first_indent_level = true,
use_treesitter = true,
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
buftype_exclude = { "terminal", "nofile" },
filetype_exclude = {
"help",
"lazy",
"NvimTree",
"alpha",
},
},
},
}

View File

@@ -1,19 +1,45 @@
return {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", -- enable LSP
{ "jose-elias-alvarez/null-ls.nvim", event = "VeryLazy" }, -- for formatters and linters
"jayp0521/mason-null-ls.nvim",
"RRethy/vim-illuminate",
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
dependencies = {
-- LSP Support
{ "neovim/nvim-lspconfig" }, -- Required
{ "williamboman/mason.nvim" }, -- Optional
{ "williamboman/mason-lspconfig.nvim" }, -- Optional
-- Autocompletion
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- Required
{ "hrsh7th/cmp-nvim-lsp" }, -- Required
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, -- Required
{ "saadparwaiz1/cmp_luasnip" },
},
},
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
},
-- for formatters and linters
{ "nanotee/sqls.nvim", lazy = true },
-- C++
{ "p00f/clangd_extensions.nvim", lazy = true },
{ "Civitasv/cmake-tools.nvim", lazy = true },
-- Rust
{ "Saecki/crates.nvim", lazy = true },
{ "simrat39/rust-tools.nvim", lazy = true },
-- { "codota/tabnine-nvim", event = "VeryLazy", build = "./dl_binaries.sh" },
}

26
lua/plugins/lualine.lua Normal file
View File

@@ -0,0 +1,26 @@
return {
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = {
options = {
globalstatus = true,
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard" },
always_divide_middle = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { "diff" },
lualine_x = { "lsp_progress", "diagnostics" },
lualine_y = { "filename" },
lualine_z = { "location", "progress" },
},
},
},
}

View File

@@ -0,0 +1,10 @@
return {
-- {
-- "iamcco/markdown-preview.nvim",
-- event = "VeryLazy",
-- build = function()
-- vim.fn["mkdp#util#install"]()
-- end,
-- opts = {},
-- },
}

57
lua/plugins/nvim-tree.lua Normal file
View File

@@ -0,0 +1,57 @@
return {
{
"nvim-tree/nvim-tree.lua",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
update_focused_file = {
enable = true,
update_cwd = true,
},
renderer = {
root_folder_modifier = ":t",
icons = {
glyphs = {
default = "",
symlink = "",
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
untracked = "U",
deleted = "",
ignored = "",
},
},
},
},
diagnostics = {
enable = true,
show_on_dirs = true,
icons = {
hint = "",
info = "",
error = "",
},
},
view = {
width = 30,
-- height = 30,
side = "left",
},
},
},
}

127
lua/plugins/oil.lua Normal file
View File

@@ -0,0 +1,127 @@
return {
{
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = { "nvim-tree/nvim-web-devicons" },
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,
bufhidden = "hide",
},
-- 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 = "n",
},
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
default_file_explorer = true,
-- 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,
-- Deleted files will be removed with the `trash-put` command.
delete_to_trash = true,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- 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 = {
["?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-L>"] = "actions.select_vsplit",
["C-J>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["."] = "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 = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
},
-- 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,
},
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
},
},
}

View File

@@ -0,0 +1,11 @@
return {
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
opts = {
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
pre_save = nil, -- a function to call before saving the session
},
},
}

19
lua/plugins/project.lua Normal file
View File

@@ -0,0 +1,19 @@
return {
{
"ahmedkhalf/project.nvim",
dependenvies = {
"nvim-telescope/telescope.nvim",
},
config = function()
local project = require("project_nvim")
project.setup({
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
detection_methods = { "pattern" },
-- patterns used to detect root dir, when **"pattern"** is in detection_methods
patterns = { ".git", "package.json", ".venv", "Cargo.toml", "requirements.txt", "CMakeLists.txt" },
})
local telescope = require("telescope")
telescope.load_extension("projects")
end,
},
}

314
lua/plugins/rust.lua Normal file
View File

@@ -0,0 +1,314 @@
return {
{
"simrat39/rust-tools.nvim",
event = "VeryLazy",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
tools = {
-- how to execute terminal commands
-- options right now: termopen / quickfix
-- executor = require("rust-tools.executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = " <- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = " => ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
},
-- Maximal width of the hover window. Nil means no max.
max_width = nil,
-- Maximal height of the hover window. Nil means no max.
max_height = nil,
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
},
-- settings for showing the crate graph based on graphviz and the dot
-- command
crate_graph = {
-- Backend used for displaying the graph
-- see: https://graphviz.org/docs/outputs/
-- default: x11
backend = "x11",
-- where to store the output, nil for no output stored (relative
-- path from pwd)
-- default: nil
output = nil,
-- true for all crates.io and external crates, false only the local
-- crates
-- default: true
full = true,
-- List of backends found on: https://graphviz.org/docs/outputs/
-- Is used for input validation and autocompletion
-- Last updated: 2021-08-26
enabled_graphviz_backends = {
"bmp",
"cgimage",
"canon",
"dot",
"gv",
"xdot",
"xdot1.2",
"xdot1.4",
"eps",
"exr",
"fig",
"gd",
"gd2",
"gif",
"gtk",
"ico",
"cmap",
"ismap",
"imap",
"cmapx",
"imap_np",
"cmapx_np",
"jpg",
"jpeg",
"jpe",
"jp2",
"json",
"json0",
"dot_json",
"xdot_json",
"pdf",
"pic",
"pct",
"pict",
"plain",
"plain-ext",
"png",
"pov",
"ps",
"ps2",
"psd",
"sgi",
"svg",
"svgz",
"tga",
"tiff",
"tif",
"tk",
"vml",
"vmlz",
"wbmp",
"webp",
"xlib",
"x11",
},
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
server = {
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
}, -- rust-analyzer options
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "codelldb",
name = "rt_lldb",
},
},
},
},
},
{
"Saecki/crates.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
smart_insert = true,
insert_closing_quote = true,
avoid_prerelease = true,
autoload = true,
autoupdate = true,
loading_indicator = true,
date_format = "%d-%m-%Y",
thousands_separator = ".",
notification_title = "Crates",
disable_invalid_feature_diagnostic = false,
text = {
loading = "  Loading",
version = "  %s",
prerelease = "  %s",
yanked = "  %s",
nomatch = "  No match",
upgrade = "  %s",
error = "  Error fetching crate",
},
highlight = {
loading = "CratesNvimLoading",
version = "CratesNvimVersion",
prerelease = "CratesNvimPreRelease",
yanked = "CratesNvimYanked",
nomatch = "CratesNvimNoMatch",
upgrade = "CratesNvimUpgrade",
error = "CratesNvimError",
},
popup = {
autofocus = false,
copy_register = '"',
style = "minimal",
border = "none",
show_version_date = false,
show_dependency_version = true,
max_height = 30,
min_width = 20,
padding = 1,
text = {
title = " %s",
pill_left = "",
pill_right = "",
description = "%s",
created_label = " created ",
created = "%s",
updated_label = " updated ",
updated = "%s",
downloads_label = " downloads ",
downloads = "%s",
homepage_label = " homepage ",
homepage = "%s",
repository_label = " repository ",
repository = "%s",
documentation_label = " documentation ",
documentation = "%s",
crates_io_label = " crates.io ",
crates_io = "%s",
categories_label = " categories ",
keywords_label = " keywords ",
version = " %s",
prerelease = " %s",
yanked = " %s",
version_date = " %s",
feature = " %s",
enabled = " %s",
transitive = " %s",
normal_dependencies_title = " Dependencies",
build_dependencies_title = " Build dependencies",
dev_dependencies_title = " Dev dependencies",
dependency = " %s",
optional = " %s",
dependency_version = " %s",
loading = "",
},
highlight = {
title = "CratesNvimPopupTitle",
pill_text = "CratesNvimPopupPillText",
pill_border = "CratesNvimPopupPillBorder",
description = "CratesNvimPopupDescription",
created_label = "CratesNvimPopupLabel",
created = "CratesNvimPopupValue",
updated_label = "CratesNvimPopupLabel",
updated = "CratesNvimPopupValue",
downloads_label = "CratesNvimPopupLabel",
downloads = "CratesNvimPopupValue",
homepage_label = "CratesNvimPopupLabel",
homepage = "CratesNvimPopupUrl",
repository_label = "CratesNvimPopupLabel",
repository = "CratesNvimPopupUrl",
documentation_label = "CratesNvimPopupLabel",
documentation = "CratesNvimPopupUrl",
crates_io_label = "CratesNvimPopupLabel",
crates_io = "CratesNvimPopupUrl",
categories_label = "CratesNvimPopupLabel",
keywords_label = "CratesNvimPopupLabel",
version = "CratesNvimPopupVersion",
prerelease = "CratesNvimPopupPreRelease",
yanked = "CratesNvimPopupYanked",
version_date = "CratesNvimPopupVersionDate",
feature = "CratesNvimPopupFeature",
enabled = "CratesNvimPopupEnabled",
transitive = "CratesNvimPopupTransitive",
normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle",
build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle",
dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle",
dependency = "CratesNvimPopupDependency",
optional = "CratesNvimPopupOptional",
dependency_version = "CratesNvimPopupDependencyVersion",
loading = "CratesNvimPopupLoading",
},
keys = {
hide = { "q", "<esc>" },
open_url = { "<cr>" },
select = { "<cr>" },
select_alt = { "s" },
toggle_feature = { "<cr>" },
copy_value = { "yy" },
goto_item = { "gd", "K", "<C-LeftMouse>" },
jump_forward = { "<c-i>" },
jump_back = { "<c-o>", "<C-RightMouse>" },
},
},
src = {
insert_closing_quote = true,
text = {
prerelease = "  pre-release ",
yanked = "  yanked ",
},
},
null_ls = {
enabled = true,
name = "crates.nvim",
},
},
},
}

View File

@@ -1,10 +0,0 @@
return {
{
"L3MON4D3/LuaSnip",
run = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, --snippet engine
-- { "codota/tabnine-nvim", build = "./dl_binaries.sh" },
}

View File

@@ -1,9 +1,100 @@
return {
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-media-files.nvim",
"xiyaowong/telescope-emoji.nvim",
"nvim-telescope/telescope-frecency.nvim",
"nvim-telescope/telescope-ui-select.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nat-418/telescope-color-names.nvim",
{
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nvim-telescope/telescope-media-files.nvim" },
{ "xiyaowong/telescope-emoji.nvim" },
{ "nvim-telescope/telescope-frecency.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nat-418/telescope-color-names.nvim" },
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
},
prompt_prefix = "",
selection_caret = "",
path_display = { "smart" },
file_ignore_patterns = { ".git/", "node_modules", ".venv/" },
mappings = {
i = {
["<Down>"] = actions.cycle_history_next,
["<Up>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
},
pickers = {
find_files = {
hidden = true,
follow = true,
},
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
},
media_files = {
-- filetypes whitelist
filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" },
find_cmd = "rg",
},
emoji = {
action = function(emoji)
-- argument emoji is a table.
-- {name="", value="", cagegory="", description=""}
vim.fn.setreg("*", emoji.value)
print([[Press p or "*p to paste this emoji]] .. emoji.value)
-- insert emoji when picked
-- vim.api.nvim_put({ emoji.value }, 'c', false, true)
end,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
-- pseudo code / specification for writing custom displays, like the one
-- for "codeactions"
-- specific_opts = {
-- [kind] = {
-- make_indexed = function(items) -> indexed_items, width,
-- make_displayer = function(widths) -> displayer
-- make_display = function(displayer) -> function(e)
-- make_ordinal = function(e) -> string
-- },
-- -- for example to disable the custom builtin "codeactions" display
-- do the following
-- codeactions = false,
-- }
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("media_files")
telescope.load_extension("emoji")
telescope.load_extension("ui-select")
telescope.load_extension("color_names")
end,
},
}

71
lua/plugins/todo.lua Normal file
View File

@@ -0,0 +1,71 @@
return {
{
"folke/todo-comments.nvim",
event = "VeryLazy",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match keywords.
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
},
},
},
}

View File

@@ -0,0 +1,72 @@
return {
{
"akinsho/toggleterm.nvim",
config = function()
local toggleterm = require("toggleterm")
toggleterm.setup({
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
})
function _G.set_terminal_keymaps()
local opts = { noremap = true }
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
local node = Terminal:new({ cmd = "node", hidden = true })
function _NODE_TOGGLE()
node:toggle()
end
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
function _NCDU_TOGGLE()
ncdu:toggle()
end
local btop = Terminal:new({ cmd = "btop", hidden = true })
function _BTOP_TOGGLE()
btop:toggle()
end
local python = Terminal:new({ cmd = "python", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()
end
local rust = Terminal:new({ cmd = "cargo run", hidden = true })
function _CARGO_RUN()
rust:toggle()
end
end,
},
}

View File

@@ -1,11 +1,71 @@
return {
{
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/playground",
"p00f/nvim-ts-rainbow",
"mechatroner/rainbow_csv",
"nvim-treesitter/nvim-treesitter-textobjects",
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = "all", -- one of "all" or a list of languages
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
-- ignore_install = { "" },
highlight = {
enable = true,
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
autopairs = {
enable = true,
},
autotag = {
enable = true,
filetypes = {
"html",
"htmldjango",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"svelte",
"vue",
"tsx",
"jsx",
"rescript",
"xml",
"php",
"markdown",
"glimmer",
"handlebars",
"hbs",
},
},
indent = { enable = true, disable = { "" } },
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {}, -- table of colour name strings
},
})
end,
},
}

31
lua/plugins/vimwiki.lua Normal file
View File

@@ -0,0 +1,31 @@
return {
{ "vimwiki/vimwiki" },
{
"epwalsh/obsidian.nvim",
lazy = true,
event = { "BufReadPre " .. vim.fn.expand("~") .. "/vimwiki/**/*.md" },
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
"preservim/vim-markdown",
},
opts = {
dir = "~/vimwiki/",
},
completion = {
-- If using nvim-cmp, otherwise set to false
nvim_cmp = true,
-- Trigger completion at 2 chars
min_chars = 2,
-- Where to put new notes created from completion. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "current_dir",
-- Whether to add the output of the node_id_func to new notes in autocompletion.
-- E.g. "[[Foo" completes to "[[foo|Foo]]" assuming "foo" is the ID of the note.
prepend_note_id = true,
},
},
}

View File

@@ -95,11 +95,11 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
end,
})
-- Run PackerSync on file save
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
pattern = { "**/lua/plugins/*" },
callback = function()
require("lazy").sync()
end,
})
-- Run lazy on file save
-- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
-- pattern = { "**/lua/plugins/*" },
-- callback = function()
-- require("lazy").sync()
-- end,
-- })

View File

@@ -1,17 +0,0 @@
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
end
npairs.setup({
check_ts = true, -- treesitter integration
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({}))

View File

@@ -1,9 +1,6 @@
require("solo.options")
require("solo.keymaps")
require("solo.vimwiki")
require("solo.plugin")
require("solo.autocommands")
require("solo.alpha")
require("solo.autopairs")
require("solo.autosave")
require("solo.mason")

View File

@@ -1,10 +1,10 @@
local keymap = vim.keymap.set
local bind = vim.keymap.set
local opts = { silent = true }
--Remap space as leader key
keymap("", "<Space>", "<Nop>", opts)
keymap("n", "q", "<Nop>", opts)
keymap("n", "Q", "<Nop>", opts)
bind("", "<Space>", "<Nop>", opts)
bind("n", "q", "<Nop>", opts)
bind("n", "Q", "<Nop>", opts)
vim.g.mapleader = " "
-- Modes
@@ -16,80 +16,80 @@ vim.g.mapleader = " "
-- command_mode = "c",
-- Normal --
keymap("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts)
keymap("n", "n", "nzzzv", opts)
keymap("n", "N", "Nzzzv", opts)
bind("n", "<C-d>", "<C-d>zz", opts)
bind("n", "<C-u>", "<C-u>zz", opts)
bind("n", "n", "nzzzv", opts)
bind("n", "N", "Nzzzv", opts)
-- Better window navigation with tmux
keymap("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts)
keymap("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts)
keymap("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts)
keymap("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts)
bind("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts)
bind("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts)
bind("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts)
bind("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts)
-- Resize with arrows
keymap("n", "<C-Up>", "<cmd>resize -2<cr>", opts)
keymap("n", "<C-Down>", "<cmd>resize +2<cr>", opts)
keymap("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts)
keymap("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts)
bind("n", "<C-Up>", "<cmd>resize -2<cr>", opts)
bind("n", "<C-Down>", "<cmd>resize +2<cr>", opts)
bind("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts)
bind("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts)
-- -- Navigate buffers
-- keymap("n", "<S-l>", "<cmd>bnext<cr>", opts)
-- keymap("n", "<S-h>", "<cmd>bprevious<cr>", opts)
-- bind("n", "<S-l>", "<cmd>bnext<cr>", opts)
-- bind("n", "<S-h>", "<cmd>bprevious<cr>", opts)
-- Better paste
keymap("v", "p", '"_dP', opts)
bind("v", "p", '"_dP', opts)
-- Move current line / block with Alt-j/k ala vscode
keymap("n", "<A-j>", "<cmd>m .+1<cr>==", opts)
keymap("n", "<A-k>", "<cmd>m .-2<cr>==", opts)
bind("n", "<A-j>", "<cmd>m .+1<cr>==", opts)
bind("n", "<A-k>", "<cmd>m .-2<cr>==", opts)
-- QuickFix
keymap("n", "]q", "<cmd>cnext<cr>", opts)
keymap("n", "[q", "<cmd>cprev<cr>", opts)
bind("n", "]q", "<cmd>cnext<cr>", opts)
bind("n", "[q", "<cmd>cprev<cr>", opts)
keymap("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {})
bind("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {})
keymap("n", "<S-j>", "mzJ`z")
bind("n", "<S-j>", "mzJ`z")
-- Insert --
-- Press jk fast to enter
keymap("i", "jk", "<ESC>", opts)
bind("i", "jk", "<ESC>", opts)
-- Move current line / block with Alt-j/k ala vscode.
keymap("i", "<A-j>", "<Esc><cmd>m .+1<cr>==gi", opts)
keymap("i", "<A-k>", "<Esc><cmd>m .-2<cr>==gi", opts)
bind("i", "<A-j>", "<Esc><cmd>m .+1<cr>==gi", opts)
bind("i", "<A-k>", "<Esc><cmd>m .-2<cr>==gi", opts)
-- navigation
keymap("i", "<A-Up>", "<C-\\><C-N><C-w>k", opts)
keymap("i", "<A-Down>", "<C-\\><C-N><C-w>j", opts)
keymap("i", "<A-Left>", "<C-\\><C-N><C-w>h", opts)
keymap("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts)
bind("i", "<A-Up>", "<C-\\><C-N><C-w>k", opts)
bind("i", "<A-Down>", "<C-\\><C-N><C-w>j", opts)
bind("i", "<A-Left>", "<C-\\><C-N><C-w>h", opts)
bind("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts)
-- Visual --
-- Stay in indent mode
keymap("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts)
bind("v", "<", "<gv", opts)
bind("v", ">", ">gv", opts)
-- keymap("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv")
-- keymap("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv")
-- bind("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv")
-- bind("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv")
-- Visual Block --
-- Move current line / block with Alt-j/k ala vscode.
-- keymap("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
-- keymap("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
-- bind("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
-- bind("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
-- Command --
-- navigate tab completion with <c-j> and <c-k>
-- runs conditionally
keymap("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true })
keymap("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true })
bind("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true })
bind("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true })
-- Terminal --
-- Terminal window navigation
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", opts)
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", opts)
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", opts)
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", opts)
bind("t", "<C-h>", "<C-\\><C-N><C-w>h", opts)
bind("t", "<C-j>", "<C-\\><C-N><C-w>j", opts)
bind("t", "<C-k>", "<C-\\><C-N><C-w>k", opts)
bind("t", "<C-l>", "<C-\\><C-N><C-w>l", opts)
keymap("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
keymap("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")
bind("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
bind("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")

View File

@@ -1,113 +0,0 @@
local M = {}
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not status_cmp_ok then
return
end
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
M.setup = function()
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in pairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
local config = {
virtual_text = false, -- virtual text
signs = {
active = signs, -- show signs
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focusable = true,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
}
vim.diagnostic.config(config)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
})
end
local function lsp_keymaps(bufnr)
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_buf_set_keymap
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", opts)
keymap(bufnr, "n", "gd", "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", opts)
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts)
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<cr>", opts)
keymap(bufnr, "n", "gr", "<cmd>lua require('telescope.builtin').lsp_references()<cr>", opts)
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>", opts)
end
M.on_attach = function(client, bufnr)
lsp_keymaps(bufnr)
local status_ok, illuminate = pcall(require, "illuminate")
if not status_ok then
return
end
illuminate.configure({
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
"alpha",
"NvimTree",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- max_file_lines: max number of lines in a file to illuminate
max_file_lines = nil,
})
illuminate.on_attach(client)
end
return M

View File

@@ -1,8 +0,0 @@
local status_ok, _ = pcall(require, "mason-lspconfig")
if not status_ok then
return
end
require("solo.mason.mason-installer")
require("solo.mason.handlers").setup()
require("solo.mason.null-ls")

View File

@@ -1,85 +0,0 @@
local status_ok, mason = pcall(require, "mason")
if not status_ok then
return
end
local status_lspconfig_ok, lspconfig = pcall(require, "lspconfig")
if not status_lspconfig_ok then
return
end
local status_mason_lspconfig_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not status_mason_lspconfig_ok then
return
end
local servers = {
"bashls",
"clangd",
"cmake",
"cssls",
"emmet_ls",
"html",
"jedi_language_server",
"jsonls",
"lua_ls",
"phpactor",
"ruff_lsp",
"rust_analyzer",
"sqlls",
"taplo",
"texlab",
"tsserver",
"tailwindcss",
}
mason.setup()
mason_lspconfig.setup({
ensure_installed = servers,
})
local on_attach = require("solo.mason.handlers").on_attach
local capabilities = require("solo.mason.handlers").capabilities
for _, server in pairs(servers) do
local opts = {
capabilities = capabilities,
on_attach = on_attach,
}
if server == "bashls" then
local bashls_opts = require("solo.mason.settings.bashls")
opts = vim.tbl_deep_extend("force", bashls_opts, opts)
end
if server == "lua_ls" then
local lua_ls_opts = require("solo.mason.settings.lua_ls")
opts = vim.tbl_deep_extend("force", lua_ls_opts, opts)
end
if server == "emmet_ls" then
local emmet_ls_opts = require("solo.mason.settings.emmet_ls")
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
end
if server == "rust_analyzer" then
local rust_analyzer_opts = require("solo.mason.settings.rust_analyzer")
opts = vim.tbl_deep_extend("force", rust_analyzer_opts, opts)
require("rust-tools").setup(opts)
goto continue
end
if server == "clangd" then
local clangd_opts = require("solo.mason.settings.clangd")
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
require("clangd_extensions").setup(opts)
goto continue
end
if server == "texlab" then
local texlab_opts = require("solo.mason.settings.texlab")
opts = vim.tbl_deep_extend("force", texlab_opts, opts)
end
lspconfig[server].setup(opts)
::continue::
end

View File

@@ -1,60 +0,0 @@
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
end
local mason_null_ls_status_ok, mason_null_ls = pcall(require, "mason-null-ls")
if not mason_null_ls_status_ok then
return
end
mason_null_ls.setup({
ensure_installed = {},
automatic_installation = true,
automatic_setup = true,
})
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics
-- https://github.com/prettier-solidity/prettier-plugin-solidity
null_ls.setup({
debug = false,
sources = {
diagnostics.cmake_lint,
diagnostics.codespell,
diagnostics.cpplint,
diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }),
diagnostics.misspell,
diagnostics.mypy,
formatting.beautysh,
formatting.black,
formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }),
formatting.clang_format,
formatting.cmake_format,
formatting.djlint,
formatting.google_java_format,
formatting.phpcbf,
formatting.prettier.with({
extra_filetypes = { "toml" },
extra_args = {
"--no-semi",
"--double-quote",
"--no-bracket-spacing",
"--tab-width",
"4",
"--bracket-same-line",
"--html-whitespace-sensitivity",
"strict",
},
}),
formatting.remark.with({ extra_filetypes = { "vimwiki" } }),
formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }),
formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
formatting.stylua,
formatting.usort,
formatting.yamlfmt,
},
})

View File

@@ -1,7 +0,0 @@
return {
filetypes = {
"sh",
"bash",
"zsh",
},
}

View File

@@ -1,71 +0,0 @@
return {
server = {
capabilities = {
offsetEncoding = { "utf-16" },
},
on_attach = require("solo.mason.handlers").on_attach,
},
extensions = {
-- defaults:
-- Automatically set inlay hints (type hints)
autoSetHints = true,
-- These apply to the default ClangdSetInlayHints command
inlay_hints = {
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refersh of the inlay hints.
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = "CursorHold",
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = true,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
-- The highlight group priority for extmark
priority = 100,
},
ast = {
-- These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
highlights = {
detail = "Comment",
},
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
},
},
}

View File

@@ -1,13 +0,0 @@
return {
filetypes = {
"html",
"htmldjango",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"eruby",
},
}

View File

@@ -1,35 +0,0 @@
return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim", "awesome", "client" },
},
-- workspace = {
-- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true),
-- },
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
format = {
enable = false,
},
},
},
}

View File

@@ -1,105 +0,0 @@
return {
server = {
on_attach = require("solo.mason.handlers").on_attach,
capabilities = require("solo.mason.handlers").capabilities,
},
tools = {
-- how to execute terminal commands
-- options right now: termopen / quickfix
executor = require("rust-tools.executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = " <- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = " => ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
},
-- Maximal width of the hover window. Nil means no max.
max_width = nil,
-- Maximal height of the hover window. Nil means no max.
max_height = nil,
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
},
-- settings for showing the crate graph based on graphviz and the dot
-- command
crate_graph = {
-- Backend used for displaying the graph
-- see: https://graphviz.org/docs/outputs/
-- default: x11
backend = "x11",
-- where to store the output, nil for no output stored (relative
-- path from pwd)
-- default: nil
output = nil,
-- true for all crates.io and external crates, false only the local
-- crates
-- default: true
full = true,
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
server = {
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
}, -- rust-analyzer options
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "codelldb",
name = "rt_lldb",
},
},
},
}

View File

@@ -1,27 +0,0 @@
return {
settings = {
texlab = {
auxDirectory = ".",
bibtexFormatter = "texlab",
build = {
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
executable = "xelatex",
forwardSearchAfter = false,
onSave = false,
},
chktex = {
onEdit = false,
onOpenAndSave = false,
},
diagnosticsDelay = 0,
formatterLineLength = 120,
forwardSearch = {
args = {},
},
latexFormatter = "latexindent",
latexindent = {
modifyLineBreaks = false,
},
},
},
}

View File

@@ -40,6 +40,7 @@ local options = {
guifont = "JetBrainsMono NF:h11", -- the font used in graphical neovim applications
spell = false,
foldmethod = "manual",
breakindent = true, -- Enable break indent
}
vim.opt.fillchars.eob = " "
@@ -61,3 +62,17 @@ g.loaded_netrwPlugin = 1
vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua")
vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua")
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1

View File

@@ -1,14 +0,0 @@
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1