This commit is contained in:
sankalp committed 2024-08-22 07:38:23 +05:45
1 parent a13ea6d3a9
commit 6224efd4a8
30 files changed
+2144 -3784

No files matched your search

-76
View File
@@ -1,76 +0,0 @@
-- Header
local function header()
local banner_small = {
' ',
' ',
' ',
' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ',
' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ',
' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ',
' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ',
' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ',
' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ',
' ',
' With experience comes perspective ',
}
return banner_small
end
-- Footer
local function footer()
local version = vim.version()
local print_version = 'v' .. version.major .. '.' .. version.minor .. '.' .. version.patch
local stats = require('lazy').stats()
local plugins_count = stats.loaded .. '/' .. stats.count
local ms = math.floor(stats.startuptime + 0.5)
local time = vim.fn.strftime('%H:%M:%S')
local date = vim.fn.strftime('%d.%m.%Y')
local line1 = '' .. plugins_count .. ' plugins loaded in ' .. ms .. 'ms'
local line2 = '󰃭 ' .. date .. '' .. time
local line3 = '' .. print_version
-- Calculate padding for centering lines
local line1_width = vim.fn.strdisplaywidth(line1)
local line2_padding = math.max(0, math.floor((line1_width - vim.fn.strdisplaywidth(line2)) / 2))
local line3_padding = math.max(0, math.floor((line1_width - vim.fn.strdisplaywidth(line3)) / 2))
-- Apply padding to lines
line2 = string.rep(' ', line2_padding) .. line2
line3 = string.rep(' ', line3_padding) .. line3
return {
' ',
line1,
line2,
line3,
}
end
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
dashboard.section.header.val = header()
dashboard.section.footer.val = footer()
-- Menu
-- TODO: Add projects and Frecency?
dashboard.section.buttons.val = {
dashboard.button('e', ' New file', ':ene <BAR> startinsert<CR>'),
dashboard.button('f', ' Find files', '<cmd>Telescope find_files<CR>'),
dashboard.button('t', '󰊄 Find text', '<cmd>Telescope live_grep<CR>'),
dashboard.button('F', ' File browser', '<cmd>Telescope file_browser<CR>'),
dashboard.button('r', '󰔠 Recent files', '<cmd>Telescope oldfiles<CR>'),
dashboard.button('s', ' Open last session', ':lua require("persistence").load({ last = true })<CR>'),
dashboard.button('c', ' Config', '<cmd>e $MYVIMRC<CR>'),
dashboard.button('l', ' Plugins', '<cmd>Lazy<CR>'),
dashboard.button('q', ' Quit', '<cmd>qa<CR>'),
}
alpha.setup(dashboard.config)
-- Update the footer after all plugins are fully loaded
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
callback = function()
dashboard.section.footer.val = footer()
pcall(vim.cmd, 'AlphaRedraw')
end,
})
+73
View File
@@ -0,0 +1,73 @@
local dashboard = require("dashboard")
local icons = require("lib.icons")
dashboard.setup({
theme = "hyper",
disable_move = false,
shortcut_type = "letter",
change_to_vcs_root = true,
hide = {
statusline = true,
tabline = false,
winbar = false,
},
config = {
week_header = {
enable = true,
append = { "", icons.ui.Circle .. " Learn, Make, Explore! " .. icons.ui.Circle },
},
packages = { enable = true },
project = { enable = true, limit = 8 },
mru = { limit = 8 },
shortcut = {
{
desc = icons.ui.Package .. "Mason",
group = "@property",
action = "Mason",
key = "m",
},
{
desc = icons.ui.Sleep .. "Lazy",
group = "@property",
action = "Lazy",
key = "l",
},
{
desc = icons.documents.OpenFolder .. "Files",
group = "Label",
action = "Telescope find_files",
key = "f",
},
{
desc = icons.ui.Search .. "Search",
group = "Label",
action = "Telescope live_grep",
key = "g",
},
{
desc = icons.ui.Note .. "Todo",
group = "Label",
action = "Tdo",
key = "d",
},
{
desc = icons.ui.Power,
group = "Action",
action = "quit",
key = "q",
},
},
footer = { "", icons.ui.Heart .. " Happiness is a state of mind. " .. icons.ui.Heart },
},
})
-- Show dashboard when lazy closes
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end
+104 -116
View File
@@ -1,172 +1,160 @@
local lspconfig = require('lspconfig')
local lspconfig = require("lspconfig")
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require('cmp_nvim_lsp')
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true }
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true }
-- set keybinds
opts.desc = 'Show LSP references'
keymap.set('n', 'lR', '<cmd>Telescope lsp_references<CR>', opts) -- show definition, references
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "lR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = 'Go to declaration'
keymap.set('n', 'lD', vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Go to declaration"
keymap.set("n", "lD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = 'Show LSP definitions'
keymap.set('n', 'ld', '<cmd>Telescope lsp_definitions<CR>', opts) -- show lsp definitions
opts.desc = "Show LSP definitions"
keymap.set("n", "ld", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = 'Show LSP implementations'
keymap.set('n', 'li', '<cmd>Telescope lsp_implementations<CR>', opts) -- show lsp implementations
opts.desc = "Show LSP implementations"
keymap.set("n", "li", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = 'Show LSP type definitions'
keymap.set('n', 'lt', '<cmd>Telescope lsp_type_definitions<CR>', opts) -- show lsp type definitions
opts.desc = "Show LSP type definitions"
keymap.set("n", "lt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
opts.desc = 'See available code actions'
keymap.set({ 'n', 'v' }, '<leader>la', vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>la", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = 'Smart rename'
keymap.set('n', '<leader>mr', vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Smart rename"
keymap.set("n", "<leader>mr", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = 'Show buffer diagnostics'
keymap.set('n', '<leader>lD', '<cmd>Telescope diagnostics bufnr=0<CR>', opts) -- show diagnostics for file
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>lD", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = 'Show line diagnostics'
keymap.set('n', '<leader>ld', vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>ld", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = 'Show documentation for what is under cursor'
keymap.set('n', 'K', vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = 'Restart LSP'
keymap.set('n', '<leader>ls', ':LspRestart<CR>', opts) -- mapping to restart lsp if necessary
end,
opts.desc = "Restart LSP"
keymap.set("n", "<leader>ls", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end,
})
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
-- configure matlab server
lspconfig['clangd'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["clangd"].setup({
capabilities = capabilities,
})
-- configure bash server
lspconfig['bashls'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["bashls"].setup({
capabilities = capabilities,
})
-- configure html server
lspconfig['html'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["html"].setup({
capabilities = capabilities,
})
-- configure typescript server with plugin
lspconfig['tsserver'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["tsserver"].setup({
capabilities = capabilities,
})
-- configure css server
lspconfig['cssls'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["cssls"].setup({
capabilities = capabilities,
})
-- configure tailwindcss server
lspconfig['tailwindcss'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["tailwindcss"].setup({
capabilities = capabilities,
})
-- configure svelte server
lspconfig['svelte'].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
vim.api.nvim_create_autocmd('BufWritePost', {
pattern = { '*.js', '*.ts' },
callback = function(ctx)
if client.name == 'svelte' then
client.notify('$/onDidChangeTsOrJsFile', { uri = ctx.file })
end
end,
})
end,
lspconfig["svelte"].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
if client.name == "svelte" then
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end
end,
})
end,
})
-- configure prisma orm server
lspconfig['prismals'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["prismals"].setup({
capabilities = capabilities,
})
-- configure emmet language server
lspconfig['emmet_ls'].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { 'html', 'typescriptreact', 'javascriptreact', 'css', 'sass', 'scss', 'less', 'svelte' },
lspconfig["emmet_ls"].setup({
capabilities = capabilities,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
-- configure python server
lspconfig['pyright'].setup({
capabilities = capabilities,
on_attach = on_attach,
lspconfig["pyright"].setup({
capabilities = capabilities,
})
-- configure lua server (with special settings)
lspconfig['lua_ls'].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { 'vim' },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.stdpath('config') .. '/lua'] = true,
},
},
},
},
lspconfig["lua_ls"].setup({
capabilities = capabilities,
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
})
local x = vim.diagnostic.severity
local config = {
-- Enable virtual text
virtual_text = { -- or false for disable
prefix = '', -- ■  󰊠
suffix = '',
format = function(diagnostic)
local prefix = '󰊠 '
local suffix = ' '
-- return full message with custom prefix & suffix
return prefix .. diagnostic.message .. suffix
end,
},
update_in_insert = true,
signs = { text = { [x.ERROR] = '', [x.WARN] = '', [x.HINT] = '󰌵', [x.INFO] = '' } },
underline = false,
severity_sort = true,
float = {
focusable = false,
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
-- Enable virtual text
virtual_text = { -- or false for disable
prefix = "", -- ■  󰊠
suffix = "",
format = function(diagnostic)
local prefix = "󰊠 "
local suffix = " "
-- return full message with custom prefix & suffix
return prefix .. diagnostic.message .. suffix
end,
},
update_in_insert = true,
signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.HINT] = "󰌵", [x.INFO] = "" } },
underline = false,
severity_sort = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
}
vim.diagnostic.config(config)
-- add borders to lsp info window
require('lspconfig.ui.windows').default_options.border = 'single'
require("lspconfig.ui.windows").default_options.border = "single"
+161 -163
View File
@@ -1,25 +1,50 @@
local lualine = require('lualine')
local icons = require('lib.icons')
-- Color table for highlights
-- stylua: ignore
local colors = {
bg = 'none',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local mode_color = {
n = colors.green,
i = colors.blue,
v = colors.magenta,
[''] = colors.magenta,
V = colors.magenta,
c = colors.yellow,
t = colors.red,
R = colors.orange,
Rv = colors.orange,
no = colors.fg,
s = colors.violet,
S = colors.violet,
[''] = colors.violet,
ic = colors.yellow,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
buffer_is_file = function()
return vim.bo.buftype == ''
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
@@ -29,170 +54,143 @@ local conditions = {
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
local searchcount = { 'searchcount', color = { fg = colors.fg, gui = 'bold' } }
local selectioncount = { 'selectioncount', color = { fg = colors.fg, gui = 'bold' } }
local progress = { 'progress', color = { fg = colors.fg, gui = 'bold' } }
local filetype = { 'filetype', color = { fg = colors.blue, gui = 'bold' } }
local filesize = { 'filesize', color = { fg = colors.fg, gui = 'bold' }, cond = conditions.buffer_not_empty }
local fileformat = { 'fileformat', icons_enabled = true, color = { fg = colors.white, gui = 'bold' } }
-- Config
local config = {
options = {
-- Disable sections and component separators
component_separators = '',
section_separators = '',
disabled_filetypes = {
'NeoTree',
'NvimTree',
'Outline',
'alpha',
},
theme = {
-- We are going to use lualine_c an lualine_x as left and
-- right section. Both are highlighted by c theme . So we
-- are just setting default looks o statusline
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
},
sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
-- These will be filled later
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
local filename = {
'filename',
cond = conditions.buffer_not_empty and conditions.buffer_is_file,
color = { fg = colors.magenta, gui = 'bold' },
}
-- Inserts a component in lualine_c at left section
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x at right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
ins_left({
function()
return '▊'
end,
color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 0, right = 1 }, -- We don't need space before this
})
ins_left({
-- mode component
function()
return ''
end,
color = function()
-- auto change color according to neovims mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
['␖'] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
['␓'] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
})
ins_left({
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
})
ins_left({
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
diagnostics_color = {
error = { fg = colors.red },
warn = { fg = colors.yellow },
info = { fg = colors.cyan },
local buffers = {
'buffers',
filetype_names = {
TelescopePrompt = icons.ui.Telescope .. 'Telescope',
dashboard = icons.ui.Dashboard .. 'Dashboard',
lazy = icons.ui.Sleep .. 'Lazy',
mason = icons.ui.Package .. 'Mason',
NvimTree = icons.documents.OpenFolder .. 'Files',
spectre_panel = icons.ui.Search .. 'Spectre',
},
})
use_mode_colors = true,
}
-- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2
ins_left({
function()
return '%='
local branch = {
'branch',
icon = icons.git.Branch,
fmt = function(str)
return str:sub(1, 32)
end,
})
color = { fg = colors.green, gui = 'bold' },
}
ins_left({
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' LSP:',
color = { fg = '#ffffff', gui = 'bold' },
})
ins_right({
local diff_icons = {
'diff',
-- Is it me or the symbol for modified us really weird
symbols = { added = '', modified = '', removed = '' },
symbols = { added = icons.git.AddAlt, modified = icons.git.DiffAlt, removed = icons.git.RemoveAlt },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
})
}
ins_right({
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
})
local diagnostics = {
'diagnostics',
sources = { 'nvim_lsp', 'nvim_diagnostic', 'nvim_workspace_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warning,
info = icons.diagnostics.Information,
hint = icons.diagnostics.Hint,
},
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.blue },
color_hint = { fg = colors.yellow },
},
}
ins_right({
local lsp = {
function()
return '▊'
local msg = 'No LSP'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
color = { fg = colors.blue },
padding = { left = 1 },
})
icon = icons.ui.Gear,
color = { fg = colors.fg, gui = 'bold' },
}
-- Now don't forget to initialize lualine
lualine.setup(config)
local encoding = {
'o:encoding',
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
}
local separator = {
function()
return icons.ui.Separator
end,
color = function()
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { left = 0, right = 0 },
}
local function mode(icon)
icon = icon or icons.ui.Neovim
return {
function()
return icon
end,
color = function()
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { left = 1, right = 0 },
}
end
lualine.setup({
options = {
component_separators = '',
-- section_separators = '',
theme = 'onedark',
disabled_filetypes = {
'dashboard',
},
},
-- extensions = { 'quickfix', 'man', 'mason', 'lazy', 'toggleterm', 'nvim-tree' },
tabline = {
lualine_a = {},
lualine_b = { mode(), buffers },
lualine_c = {},
lualine_x = { diff_icons, branch },
lualine_y = { searchcount, selectioncount },
lualine_z = {},
},
sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { separator, mode(icons.ui.Heart), 'location', progress, filename },
lualine_x = { diagnostics, lsp, filetype, filesize, fileformat, encoding, separator },
lualine_y = {},
lualine_z = {},
},
})
+38 -37
View File
@@ -1,47 +1,48 @@
local mason = require('mason')
local mason_lspconfig = require('mason-lspconfig')
local mason_tool_installer = require('mason-tool-installer')
local mason = require("mason")
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
-- enable mason and configure icons
mason.setup({
ui = {
border = 'rounded',
icons = {
package_installed = '✓',
package_pending = '➜',
package_uninstalled = '✗',
},
},
automatic_installation = true,
ui = {
border = "rounded",
icons = {
package_installed = "✓",
package_pending = "➜",
package_uninstalled = "✗",
},
},
})
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
'tsserver',
'html',
'cssls',
'tailwindcss',
'svelte',
'lua_ls',
'pyright',
'jdtls',
'bashls',
'jsonls',
'clangd',
'emmet_ls',
'prismals',
},
-- list of servers for mason to install
ensure_installed = {
"tsserver",
"html",
"cssls",
"tailwindcss",
"svelte",
"lua_ls",
"pyright",
"jdtls",
"bashls",
"jsonls",
"clangd",
"emmet_ls",
"prismals",
},
})
mason_tool_installer.setup({
ensure_installed = {
'prettier', -- prettier formatter
'biome', -- js formatter
'stylua', -- lua formatter
'black', -- python formatter
'isort', -- python formatter
'clang-format', -- c/c++ formatter
'pylint',
'eslint_d',
},
ensure_installed = {
"prettier", -- prettier formatter
"biome", -- js formatter
"stylua", -- lua formatter
"black", -- python formatter
"isort", -- python formatter
"clang-format", -- c/c++ formatter
"pylint",
"eslint_d",
},
})
+46 -46
View File
@@ -1,19 +1,19 @@
local mason_null_ls = require('mason-null-ls')
local mason_null_ls = require("mason-null-ls")
local null_ls = require('null-ls')
local null_ls = require("null-ls")
local null_ls_utils = require('null-ls.utils')
local null_ls_utils = require("null-ls.utils")
mason_null_ls.setup({
ensure_installed = {
'prettier', -- prettier formatter
'biome', -- js formatter
'clang-format', -- c/c++ formatter
'stylua', -- lua formatter
'black', -- python formatter
'pylint', -- python linter
-- "eslint_d", -- js linter
},
ensure_installed = {
"prettier", -- prettier formatter
"biome", -- js formatter
"clang-format", -- c/c++ formatter
"stylua", -- lua formatter
"black", -- python formatter
"pylint", -- python linter
-- "eslint_d", -- js linter
},
})
-- for conciseness
@@ -21,41 +21,41 @@ local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
-- to setup format on save
local augroup = vim.api.nvim_create_augroup('LspFormatting', {})
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- configure null_ls
null_ls.setup({
root_dir = null_ls_utils.root_pattern('.null-ls-root', 'Makefile', '.git', 'package.json'),
sources = {
formatting.prettier, -- js/ts formatter
formatting.stylua, -- lua formatter
formatting.isort,
formatting.black,
formatting.clang_format,
diagnostics.pylint,
-- diagnostics.eslint_d.with({ -- js/ts linter
-- condition = function(utils)
-- return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs
-- end,
-- }),
},
-- configure format on save
on_attach = function(current_client, bufnr)
if current_client.supports_method('textDocument/formatting') then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd('BufWritePre', {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == 'null-ls'
end,
bufnr = bufnr,
})
end,
})
end
end,
root_dir = null_ls_utils.root_pattern(".null-ls-root", "Makefile", ".git", "package.json"),
sources = {
formatting.prettier, -- js/ts formatter
formatting.stylua, -- lua formatter
formatting.isort,
formatting.black,
formatting.clang_format,
diagnostics.pylint,
-- diagnostics.eslint_d.with({ -- js/ts linter
-- condition = function(utils)
-- return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs
-- end,
-- }),
},
-- configure format on save
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})
+88 -144
View File
@@ -1,161 +1,105 @@
local function augroup(name)
return vim.api.nvim_create_augroup('nvim2k_' .. name, { clear = true })
return vim.api.nvim_create_augroup("nvim" .. name, { clear = true })
end
-- don't auto comment new line
vim.api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] })
-- to make border as same as neovim ColorScheme
vim.api.nvim_create_autocmd({ 'UIEnter', 'ColorScheme' }, {
callback = function()
local normal = vim.api.nvim_get_hl(0, { name = 'Normal' })
if not normal.bg then
return
end
io.write(string.format('\027Ptmux;\027\027]11;#%06x\007\027\\', normal.bg))
io.write(string.format('\027]11;#%06x\027\\', normal.bg))
end,
})
vim.api.nvim_create_autocmd('UILeave', {
callback = function()
io.write('\027Ptmux;\027\027]111;\007\027\\')
io.write('\027]111\027\\')
end,
})
-- Highlight on yank
vim.api.nvim_create_autocmd('TextYankPost', {
group = augroup('highlight_yank'),
callback = function()
vim.highlight.on_yank()
end,
})
-- go to last loc when opening a buffer
-- this mean that when you open a file, you will be at the last position
vim.api.nvim_create_autocmd('BufReadPost', {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- auto close brackets
vim.api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] })
-- show cursor line only in active window
local cursorGrp = vim.api.nvim_create_augroup('CursorLine', { clear = true })
vim.api.nvim_create_autocmd({ 'InsertLeave', 'WinEnter' }, {
pattern = '*',
command = 'set cursorline',
group = cursorGrp,
})
vim.api.nvim_create_autocmd(
{ 'InsertEnter', 'WinLeave' },
{ pattern = '*', command = 'set nocursorline', group = cursorGrp }
)
-- Enable spell checking for certain file types
vim.api.nvim_create_autocmd(
{ 'BufRead', 'BufNewFile' },
-- { pattern = { "*.txt", "*.md", "*.tex" }, command = [[setlocal spell<cr> setlocal spelllang=en,de<cr>]] }
{
pattern = { '*.txt', '*.md', '*.tex' },
callback = function()
vim.opt.spell = true
vim.opt.spelllang = 'en,de'
end,
}
)
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd('BufReadPost', {
group = augroup('last_loc'),
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- Strip trailing spaces before write
vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
group = augroup('strip_space'),
pattern = { '*' },
callback = function()
vim.cmd([[ %s/\s\+$//e ]])
end,
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("strip_space"),
pattern = { "*" },
callback = function()
vim.cmd([[ %s/\s\+$//e ]])
end,
})
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, {
group = augroup('checktime'),
command = 'checktime',
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
command = "checktime",
})
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function()
vim.highlight.on_yank()
end,
})
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ 'VimResized' }, {
group = augroup('resize_splits'),
callback = function()
vim.cmd('tabdo wincmd =')
end,
vim.api.nvim_create_autocmd({ "VimResized" }, {
group = augroup("resize_splits"),
callback = function()
vim.cmd("tabdo wincmd =")
end,
})
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd('FileType', {
group = augroup('wrap_spell'),
pattern = { 'gitcommit', 'markdown' },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
group = augroup('auto_create_dir'),
callback = function(event)
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p')
end,
})
-- Set arb filetype
vim.api.nvim_create_autocmd({ 'BufEnter' }, {
group = augroup('set_file_type'),
pattern = { '*.arb' },
command = require('core.util').get_file_type_cmd('arb'),
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- close some filetypes with <q>
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('close_with_q', { clear = true }),
pattern = {
'PlenaryTestPopup',
'help',
'lspinfo',
'man',
'notify',
'qf',
'spectre_panel',
'startuptime',
'tsplayground',
'neotest-output',
'checkhealth',
'neotest-summary',
'neotest-output-panel',
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set('n', 'q', '<cmd>close<cr>', { buffer = event.buf, silent = true })
end,
vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"DressingSelect",
"Jaq",
"PlenaryTestPopup",
"fugitive",
"help",
"lir",
"lspinfo",
"man",
"notify",
"qf",
"spectre_panel",
"startuptime",
"tsplayground",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})
-- resize neovim split when terminal is resized
vim.api.nvim_command('autocmd VimResized * wincmd =')
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})
-- Set arb filetype
vim.api.nvim_create_autocmd({ "BufEnter" }, {
group = augroup("set_file_type"),
pattern = { "*.arb" },
command = require("lib.util").get_file_type_cmd("arb"),
})
-- Disable format options
vim.api.nvim_create_autocmd("FileType", {
group = augroup("disable_formatoptions"),
pattern = "*",
callback = function()
vim.opt_local.formatoptions:remove({ "c", "r", "o" })
end,
})
+1 -1
View File
@@ -30,7 +30,7 @@ end, {})
-- Switch to git root or file parent dir
vim.api.nvim_create_user_command('RootDir', function()
local root = require('core.util').get_root_dir()
local root = require('lib.util').get_root_dir()
if root == '' then
return
-75
View File
@@ -1,75 +0,0 @@
local function map(mode, lhs, rhs, opts)
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
local opts = { noremap = true, silent = true }
-- Use jj as escape
map('i', 'jj', '<Esc>', opts)
map('t', 'JJ', '<C-\\><C-n>', opts)
-- Visual overwrite paste
map({ 'v', 'x' }, 'p', '"_dP', opts)
-- Do not copy on x
map({ 'v', 'x' }, 'x', '"_x', opts)
-- Increment/decrement
map({ 'n', 'v', 'x' }, '-', '<C-x>', opts)
map({ 'n', 'v', 'x' }, '=', '<C-a>', opts)
-- Move to line beginning and end
map({ 'n', 'v', 'x' }, 'gl', '$', { desc = 'End of line' })
map({ 'n', 'v', 'x' }, 'gh', '^', { desc = 'Beginning of line' })
-- Select all
map('n', '<C-a>', 'gg<S-v>G')
-- Deleting without yanking empty line
map('n', 'dd', function()
local is_empty_line = vim.api.nvim_get_current_line():match('^%s*$')
if is_empty_line then
return '"_dd'
else
return 'dd'
end
end, { noremap = true, expr = true, desc = "Don't Yank Empty Line to Clipboard" })
-- Center Cursors
map('n', 'J', 'mzJ`z', opts)
map('n', '<C-d>', '<C-d>zz', opts)
map('n', '<C-u>', '<C-u>zz', opts)
map('n', 'n', 'nzzzv', opts)
map('n', 'N', 'Nzzzv', opts)
-- Better up/down
map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move text up and down
map({ 'v', 'x' }, 'J', ":move '>+1<CR>gv-gv", opts)
map({ 'v', 'x' }, 'K', ":move '<-2<CR>gv-gv", opts)
-- Clear search, diff update and redraw
map({ 'i', 'n' }, '<esc>', '<cmd>noh<cr><esc>', { desc = 'Escape and clear hlsearch' })
-- Consistent n/N search navigation
map('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
map('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
map('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
-- Better indenting
map('v', '<', '<gv')
map('v', '>', '>gv')
-- Add undo breakpoints
map('i', ',', ',<c-g>u')
map('i', '.', '.<c-g>u')
map('i', ';', ';<c-g>u')
map({ 'i' }, '<C-l>', '<Right>', { desc = 'Move cursor to right' })
map({ 'i' }, '<C-h>', '<Left>', { desc = 'Move cursor to right' })
+72
View File
@@ -0,0 +1,72 @@
local function map(mode, lhs, rhs, opts)
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
local opts = { noremap = true, silent = true }
-- Use jj as escape
map("i", "jj", "<Esc>", opts)
map("t", "JJ", "<C-\\><C-n>", opts)
-- Visual overwrite paste
map({ "v", "x" }, "p", '"_dP', opts)
-- Do not copy on x
map({ "v", "x" }, "x", '"_x', opts)
-- Increment/decrement
map({ "n", "v", "x" }, "-", "<C-x>", opts)
map({ "n", "v", "x" }, "=", "<C-a>", opts)
-- Move to line beginning and end
map({ "n", "v", "x" }, "gl", "$", { desc = "End of line" })
map({ "n", "v", "x" }, "gh", "^", { desc = "Beginning of line" })
-- Select all
map("n", "<C-a>", "gg<S-v>G")
map("n", "<C-s>", "<CMD>up<CR>", { desc = "Save File" })
-- Center Cursors
map("n", "J", "mzJ`z", opts)
map("n", "<C-d>", "<C-d>zz", opts)
map("n", "<C-u>", "<C-u>zz", opts)
map("n", "n", "nzzzv", opts)
map("n", "N", "Nzzzv", opts)
-- Better up/down
map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move text up and down
map({ "v", "x" }, "J", ":move '>+1<CR>gv-gv", opts)
map({ "v", "x" }, "K", ":move '<-2<CR>gv-gv", opts)
-- Clear search, diff update and redraw
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
-- Consistent n/N search navigation
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
-- Better indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- Add undo breakpoints
map("i", ",", ",<c-g>u")
map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u")
map({ "i" }, "<C-l>", "<Right>", { desc = "Move cursor to right" })
map({ "i" }, "<C-h>", "<Left>", { desc = "Move cursor to right" })
map("n", "d", '"_d', { desc = "Delete without replacing clipboad" })
map("n", "x", '"_x', { desc = "Cut without replacing clipboad" })
map("n", "c", '"_c', { desc = "Change without replacing clipboad" })
map("v", "p", '"_dP', { desc = "Paste without replacing clipboard" })
+94 -81
View File
@@ -1,95 +1,108 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
---@diagnostic disable-next-line: undefined-field
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'--single-branch',
'https://github.com/folke/lazy.nvim.git',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.opt.runtimepath:prepend(lazypath)
require('lazy').setup({
spec = {
{ import = 'plugins' },
},
install = {
missing = true,
colorscheme = { 'moonfly' },
},
checker = {
enabled = true,
notify = false,
},
change_detection = {
enabled = true,
notify = false,
},
ui = {
icons = {
cmd = '',
config = '',
event = '',
ft = '',
init = '',
import = '',
keys = '',
lazy = '󰒲 ',
loaded = '●',
not_loaded = '○',
plugin = '',
runtime = '',
require = '󰢱 ',
source = '',
start = '',
task = '✔ ',
list = {
'●',
'➜',
'★',
'‒',
},
},
},
local status_ok, lazy = pcall(require, 'lazy')
if not status_ok then
return
end
local icons = require('lib.icons')
lazy.setup({
root = vim.fn.stdpath('data') .. '/lazy',
defaults = { lazy = true },
spec = 'plugins',
lockfile = vim.fn.stdpath('config') .. '/lua/lock.json',
concurrency = 8,
dev = { path = '~/Projects/GitHub/', patterns = {}, fallback = false },
install = { missing = true, colorscheme = { 'onedark' } },
git = {
log = { '--since=3 days ago' },
timeout = 120,
url_format = 'https://github.com/%s.git',
filter = true,
},
ui = {
size = { width = 0.9, height = 0.8 },
wrap = true,
border = 'rounded',
icons = {
cmd = icons.ui.Terminal,
config = icons.ui.Gear,
event = icons.ui.Electric,
ft = icons.documents.File,
init = icons.ui.Rocket,
import = icons.documents.Import,
keys = icons.ui.Keyboard,
lazy = icons.ui.Sleep,
loaded = icons.ui.CircleSmall,
not_loaded = icons.ui.CircleSmallEmpty,
plugin = icons.ui.Package,
runtime = icons.ui.Neovim,
source = icons.ui.Code,
start = icons.ui.Play,
task = icons.ui.Check,
list = {
icons.ui.CircleSmall,
icons.ui.Arrow,
icons.ui.Star,
icons.ui.Minus,
},
},
browser = nil,
throttle = 20,
custom_keys = {
['<localleader>l'] = function(plugin)
require('lazy.util').float_term({ 'lazygit', 'log' }, {
cwd = plugin.dir,
})
end,
['<localleader>t'] = function(plugin)
require('lazy.util').float_term(nil, {
cwd = plugin.dir,
})
end,
},
},
diff = { cmd = 'git' },
checker = { enabled = false, concurrency = nil, notify = true, frequency = 3600 },
change_detection = { enabled = true, notify = true },
performance = {
cache = { enabled = true },
reset_packpath = true,
rtp = {
reset = true,
paths = {},
disabled_plugins = {
'2html_plugin',
'tohtml',
'getscript',
'getscriptPlugin',
'gzip',
'logipat',
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
'matchit',
'tar',
'tarPlugin',
'rrhelper',
'spellfile_plugin',
'vimball',
'vimballPlugin',
'zip',
'zipPlugin',
'tutor',
'rplugin',
'syntax',
'synmenu',
'optwin',
'compiler',
'bugreport',
'ftplugin',
'tohtml',
-- 'tutor',
-- 'matchit',
-- 'matchparen',
-- 'netrwPlugin',
},
},
},
readme = {
root = vim.fn.stdpath('state') .. '/lazy/readme',
files = { 'README.md', 'lua/**/README.md' },
skip_if_doc_exists = true,
},
state = vim.fn.stdpath('state') .. '/lazy/state.json',
})
+88 -55
View File
@@ -1,59 +1,92 @@
--Remap space as leader key
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.opt.backup = false -- creates a backup file
vim.opt.clipboard = 'unnamedplus' -- allows neovim to access the system clipboard
vim.opt.cmdheight = 0 -- more space in the neovim command line for displaying messages
vim.opt.completeopt = { 'menuone', 'noselect' } -- mostly just for cmp
vim.opt.conceallevel = 0 -- so that `` is visible in markdown files
-- vim.opt.fileencoding = "utf-8" -- the encoding written to a file
vim.opt.hlsearch = true -- highlight all matches on previous search pattern
vim.opt.ignorecase = true -- ignore case in search patterns
vim.opt.mouse = 'a' -- allow the mouse to be used in neovim
vim.opt.pumheight = 10 -- pop up menu height
vim.opt.pumblend = 10
vim.opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
vim.opt.showtabline = 2 -- always show tabs
vim.opt.smartcase = true -- smart case
vim.opt.smartindent = true -- make indenting smarter again
vim.opt.splitbelow = true -- force all horizontal splits to go below current window
vim.opt.splitright = true -- force all vertical splits to go to the right of current window
vim.opt.swapfile = false -- creates a swapfile
vim.opt.termguicolors = true -- set term gui colors (most terminals support this)
vim.opt.timeoutlen = 1000 -- time to wait for a mapped sequence to complete (in milliseconds)
vim.opt.undofile = true -- enable persistent undo
vim.opt.updatetime = 100 -- faster completion (4000ms default)
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
vim.opt.expandtab = true -- convert tabs to spaces
vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation
vim.opt.tabstop = 2 -- insert 2 spaces for a tab
vim.opt.cursorline = false -- highlight the current line
vim.opt.cursorlineopt = 'number'
vim.opt.number = true -- set numbered lines
vim.opt.laststatus = 0 --disable native statusline
vim.opt.showcmd = false
vim.opt.ruler = false
vim.opt.relativenumber = true -- set relative numbered lines
vim.opt.numberwidth = 4 -- set number column width to 2 {default 4}
vim.opt.signcolumn = 'yes' -- always show the sign column, otherwise it would shift the text each time
vim.opt.wrap = false -- display lines as one long line
vim.opt.scrolloff = 0
vim.opt.sidescrolloff = 8
vim.opt.guifont = 'monospace:h17' -- the font used in graphical neovim applications
vim.opt.title = true
vim.opt.titlelen = 0 -- do not shorten title
vim.opt.inccommand = 'split' -- split below for to show replaces
vim.opt.virtualedit = 'block'
vim.opt.fillchars = vim.opt.fillchars + 'eob: '
vim.opt.fillchars:append({
stl = ' ',
})
local options = {
ai = true,
autoindent = true,
autowrite = true,
backspace = "indent,eol,start",
backup = false, -- creates a backup file
breakindent = true,
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 1, -- more space in the neovim command line for displaying messages
completeopt = "menu,menuone,noselect", -- mostly just for cmp
conceallevel = 0, -- so that `` is visible in markdown files
confirm = true, -- Confirm to save changes before exiting modified buffer
cursorline = true, -- highlight the current line
expandtab = true, -- convert tabs to spaces
fileencoding = "utf-8", -- the encoding written to a file
formatoptions = "jlnqt", -- set formatoptions, check help fo-table
grepformat = "%f:%l:%c:%m",
grepprg = "rg --vimgrep",
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
inccommand = "split", -- preview incremental substitute
laststatus = 3,
list = false,
-- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight
mouse = "a", -- allow the mouse to be used in neovim
number = true, -- set numbered lines
numberwidth = 4, -- set number column width to 3 {default 4}
pumblend = 10, -- Popup blen
pumheight = 10, -- pop up menu height
relativenumber = true, -- set relative numbered lines
scrolloff = 10, -- is one of my fav
sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal",
shiftround = true, -- Round indent
shiftwidth = 4, -- the number of spaces inserted for each indentation
showcmd = false,
showmode = false, -- we don't need to see things like -- INSERT -- anymore
showtabline = 0, -- always show tabs
si = true,
sidescrolloff = 8,
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
smartcase = true, -- smart case
smartindent = true, -- make indenting smarter again
smarttab = true,
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
tabstop = 4, -- insert 2 spaces for a tab
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 300, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
undolevels = 10000,
updatetime = 50, -- faster completion (4000ms default)
wildmenu = true, -- wildmenu
wildmode = "longest:full,full", -- Command-line completion mode
winminwidth = 5, -- Minimum window width
wrap = false, -- display lines as one long line
writebackup = false, -- do not edit backups
}
vim.opt.shortmess:append('c')
vim.cmd('set whichwrap+=<,>,[,],h,l')
vim.cmd([[set iskeyword+=-]])
for k, v in pairs(options) do
vim.opt[k] = v
end
-- netrw file explorer settings
vim.g.netrw_winsize = 20
vim.g.netrw_banner = 0
vim.g.netrw_mouse = 2
vim.g.netrw_liststyle = 1
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0
vim.opt.path:append({ "**" })
vim.opt.shortmess:append({ W = true, I = true, c = true })
-- hides `~` at the end of the buffer
vim.cmd([[set fillchars+=eob:\ ]])
vim.cmd([[
setlocal spell spelllang=en "Set spellcheck language to en
setlocal spell! "Disable spell checks by default
filetype plugin indent on
if has('win32')
let g:python3_host_prog = $HOME . '/scoop/apps/python/current/python.exe'
endif
let &t_Cs = "\e[4:3m" "Undercurl
let &t_Ce = "\e[4:0m"
set whichwrap+=<,>,[,],h,l
set iskeyword+=-
]])
-66
View File
@@ -1,66 +0,0 @@
local util = {}
util.get_user_config = function(key, default)
local status_ok, user = pcall(require, 'user')
if not status_ok then
return default
end
local user_config = user[key]
if user_config == nil then
return default
end
return user_config
end
util.get_root_dir = function()
local bufname = vim.fn.expand('%:p')
if vim.fn.filereadable(bufname) == 0 then
return
end
local parent = vim.fn.fnamemodify(bufname, ':h')
local git_root = vim.fn.systemlist('git -C ' .. parent .. ' rev-parse --show-toplevel')
if #git_root > 0 and git_root[1] ~= '' then
return git_root[1]
else
return parent
end
end
util.get_file_type_cmd = function(extension)
local root = util.get_root_dir()
if extension == 'arb' and root then
local gemfile_exists = vim.fn.filereadable(root .. '/Gemfile') == 1
local pubspec_exists = vim.fn.filereadable(root .. '/pubspec.yaml') == 1
if gemfile_exists then
return 'setfiletype ruby'
end
if pubspec_exists then
return 'setfiletype json'
end
end
return ''
end
util.is_present = function(bin)
return vim.fn.executable(bin) == 1
end
util.telescope_select = function(options, options_desc, select_prompt)
require('telescope.pickers')
.new({}, {
prompt_title = select_prompt,
results_title = options_desc,
finder = require('telescope.finders').new_table({
results = options,
entry_maker = require('telescope.make_entry').gen_from_file(),
}),
sorter = require('telescope.sorters').get_fzy_sorter(),
previewer = require('telescope.previewers').vim_buffer_cat.new({}),
})
:find()
end
return util
+164
View File
@@ -0,0 +1,164 @@
return {
diagnostics = {
Error = '',
Hint = '󰠠 ',
Information = '',
Question = '',
Warning = '',
},
documents = {
File = '',
FileEmpty = '',
Files = '',
Folder = '',
FolderEmpty = '',
OpenFolder = '',
OpenFolderEmpty = '',
SymLink = '',
SymlinkFolder = '',
Import = '',
},
git = {
Add = '',
AddAlt = '',
Branch = '',
Diff = '',
DiffAlt = '',
Ignore = '◌ ',
Mod = '',
Octoface = '',
Remove = '',
RemoveAlt = '',
Rename = '',
Repo = '',
Tag = '',
Untrack = '',
},
kind = {
Class = '',
Color = '',
Constant = '',
Constructor = '󰈏 ',
Enum = '',
EnumMember = '',
Event = '',
Field = '',
File = '',
Folder = '',
Function = '󰊕 ',
Interface = '',
Keyword = '',
Method = '',
Module = '',
Operator = '',
Property = '',
Reference = '',
Snippet = '',
Struct = '',
Text = '',
TypeParameter = '',
Unit = '',
Value = '',
Variable = '',
},
type = {
Array = '',
Boolean = '⏻ ',
Number = '',
Object = '',
String = '',
},
ui = {
Arrow = '',
ArrowClosed = '',
ArrowLeft = '',
ArrowOpen = '',
ArrowRight = '',
Bluetooth = '',
Bookmark = '',
Bug = '',
Calendar = '',
Camera = '',
Check = '',
ChevronRight = '',
Circle = '',
CircleSmall = '● ',
CircleSmallEmpty = '○ ',
Clipboard = '',
Close = '',
Code = '',
Collection = '',
Color = '',
Command = '',
Comment = '',
Copilot = '',
CopilotError = '',
Corner = '└ ',
Dashboard = '',
Database = '',
Download = '',
Edge = '│ ',
Electric = '',
Eye = '',
Fire = '',
Firefox = '',
Flag = '',
Game = '',
Gear = '',
GitHub = '',
Heart = '',
History = '',
Home = '',
Incoming = '',
Jump = '',
Keyboard = '',
Ligthbulb = '󰌵 ',
List = '',
Lock = '',
Minus = '‒ ',
Music = '󰝚 ',
Neovim = '',
NewFile = '',
None = ' ',
Note = '',
Outgoing = '',
Package = '',
Paint = '',
Pause = '',
Pencil = '',
Person = '',
Pin = '',
Play = '',
Plug = '',
Plus = '',
Power = '',
PowerlineArrowLeft = '',
PowerlineArrowRight = '',
PowerlineLeftRound = '',
PowerlineRightRound = '',
Project = '',
Question = '',
Reload = '',
Rocket = '',
Save = '󰆓 ',
Search = '',
Separator = '▊ ',
SeparatorLight = '▍',
SeparatorDashed = '┆',
SignIn = '',
SignOut = '',
Sleep = '󰒲 ',
Star = '',
Table = '',
Telescope = '',
Terminal = '',
Test = '',
Time = '',
Topline = '‾',
Trash = '',
User = '',
Vim = '',
Wifi = '',
Windows = '',
},
}
+66
View File
@@ -0,0 +1,66 @@
local util = {}
util.get_user_config = function(key, default)
local status_ok, user = pcall(require, "user")
if not status_ok then
return default
end
local user_config = user[key]
if user_config == nil then
return default
end
return user_config
end
util.get_root_dir = function()
local bufname = vim.fn.expand("%:p")
if vim.fn.filereadable(bufname) == 0 then
return
end
local parent = vim.fn.fnamemodify(bufname, ":h")
local git_root = vim.fn.systemlist("git -C " .. parent .. " rev-parse --show-toplevel")
if #git_root > 0 and git_root[1] ~= "" then
return git_root[1]
else
return parent
end
end
util.get_file_type_cmd = function(extension)
local root = util.get_root_dir()
if extension == "arb" and root then
local gemfile_exists = vim.fn.filereadable(root .. "/Gemfile") == 1
local pubspec_exists = vim.fn.filereadable(root .. "/pubspec.yaml") == 1
if gemfile_exists then
return "setfiletype ruby"
end
if pubspec_exists then
return "setfiletype json"
end
end
return ""
end
util.is_present = function(bin)
return vim.fn.executable(bin) == 1
end
util.telescope_select = function(options, options_desc, select_prompt)
require("telescope.pickers")
.new({}, {
prompt_title = select_prompt,
results_title = options_desc,
finder = require("telescope.finders").new_table({
results = options,
entry_maker = require("telescope.make_entry").gen_from_file(),
}),
sorter = require("telescope.sorters").get_fzy_sorter(),
previewer = require("telescope.previewers").vim_buffer_cat.new({}),
})
:find()
end
return util
+18 -16
View File
@@ -1,28 +1,27 @@
{
"LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" },
"LuaSnip": { "branch": "master", "commit": "7ad2eaeaca56d6ed63acacbfc114b99f1f67b982" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"alpha-nvim": { "branch": "main", "commit": "355fbb81a59637a8963cf5847074f8c44dbef11f" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"better-escape.nvim": { "branch": "master", "commit": "d337e02b140d909345441392de47a42d283747c1" },
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
"bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" },
"codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" },
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
"dotfyle-metadata.nvim": { "branch": "main", "commit": "342ef8f3f98f3ccc451c9cf2be74e95149ced05d" },
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" },
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
"hardtime.nvim": { "branch": "main", "commit": "91c6be1a54fa057002e21ae209a49436bd215355" },
"hardtime.nvim": { "branch": "main", "commit": "6513bf42cd9261669d1ee41ff8b4065dfdc53a09" },
"hlargs.nvim": { "branch": "main", "commit": "cc0d9ee75e5ffba730393049119361b9e3a5b1b6" },
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
"indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" },
"indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
"lspsaga.nvim": { "branch": "main", "commit": "4ce44df854f447cf0a8972e5387b3aeb5efc798b" },
@@ -33,15 +32,17 @@
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.files": { "branch": "main", "commit": "170d0dd321ca377cb427fb5576d4d75601c1c2da" },
"mini.nvim": { "branch": "main", "commit": "d6e6a6fb010cc452b491704aa9ecc96a8aa2cde1" },
"mini.files": { "branch": "main", "commit": "9de79b28e5b7a9dc92b9ae2ba21296f7075b51a7" },
"mini.icons": { "branch": "main", "commit": "12e7b5d47bfc1b4c5ba4278fb49ec9100138df14" },
"mini.nvim": { "branch": "main", "commit": "71b5694a2df4f7e3661855eb8e2814980d2e0ac9" },
"mini.pick": { "branch": "main", "commit": "27fc7862b7a1fc2e04356dc5ed1caf7049baccb4" },
"modes.nvim": { "branch": "main", "commit": "3188692abf02a8838ec75e59d68c2ce3e4323f5c" },
"moonfly": { "branch": "master", "commit": "4f7d18cb471ede7407dd966c7563868cae7f4f99" },
"neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" },
"neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" },
"neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" },
"neotest-python": { "branch": "master", "commit": "e5bff6dcf3cb33e6dfb97722e142961099c6021e" },
"neotest-python": { "branch": "master", "commit": "72603dfdbaad5695160268cb10531a14cc37236e" },
"neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" },
"nerdy.nvim": { "branch": "main", "commit": "b467d6609b78d6a5f1e12cbc08fcc1ac87af20f5" },
"noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" },
"none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
@@ -50,21 +51,22 @@
"nvim-dap": { "branch": "master", "commit": "281a2e4cd1e7a17cea7ecb1745d84a8ab1249925" },
"nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
"nvim-lspconfig": { "branch": "master", "commit": "a89de2e049b5f89a0ee55029d5a31213bd4de6f8" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-lspconfig": { "branch": "master", "commit": "6ecab74936b16b8a4d76246906b729e546220f1b" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-recorder": { "branch": "main", "commit": "ce96792c1ff750977fc3affc56f0561b0c20a7e2" },
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
"nvim-treesitter": { "branch": "master", "commit": "ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631" },
"nvim-treesitter": { "branch": "master", "commit": "0b8b78f9d08dc338a146eb4cd4bcbed8dd36a783" },
"nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ced6375723b20616282f9f6a1018a63ae19b106a" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "41e3abf6bfd9a9a681eb1f788bdeba91c9004b2b" },
"nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" },
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
"odoo-snippets": { "branch": "main", "commit": "5e6b7191e3ea60bba00df6cdbc031291b194768d" },
"onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "c097f728a409d9923a3c70c1507e8389978a9b85" },
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "9f3d10e66a79e8975926f8cb930856e4930d9da4" },
"refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" },
"screenkey.nvim": { "branch": "main", "commit": "b1516d5d610c89555062397d29fa7f32fc8ec431" },
"tdo.nvim": { "branch": "main", "commit": "f8d4ee275309c8a696236fcee92d78ecd98971bd" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "a46780830b576049c675680650f773bedfa8677a" },
+225 -200
View File
@@ -1,211 +1,236 @@
return {
{
'max397574/better-escape.nvim',
event = 'InsertEnter',
opts = {
k = function()
vim.api.nvim_input('<esc>')
local current_line = vim.api.nvim_get_current_line()
if current_line:match('^%s+j$') then
vim.schedule(function()
vim.api.nvim_set_current_line('')
end)
end
end,
},
},
{
'L3MON4D3/LuaSnip',
event = { 'BufReadPost', 'BufNewFile' },
dependencies = {
'rafamadriz/friendly-snippets',
'mstuttgart/odoo-snippets',
},
opts = {
history = true,
updateevents = 'TextChanged,TextChangedI',
},
keys = function()
return {}
end,
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
{
'altermo/ultimate-autopair.nvim',
event = { 'InsertEnter', 'CmdlineEnter' },
branch = 'v0.6', --recommended as each new version will have breaking changes
opts = {},
},
{
'hrsh7th/nvim-cmp',
event = { 'InsertEnter' },
dependencies = {
-- autocomplete plugins
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
'saadparwaiz1/cmp_luasnip',
-- "hrsh7th/cmp-nvim-lsp-signature-help",
-- "hrsh7th/cmp-calc",
{
"max397574/better-escape.nvim",
event = "InsertEnter",
opts = {
k = function()
vim.api.nvim_input("<esc>")
local current_line = vim.api.nvim_get_current_line()
if current_line:match("^%s+j$") then
vim.schedule(function()
vim.api.nvim_set_current_line("")
end)
end
end,
},
},
{
"CRAG666/code_runner.nvim",
config = true,
vim.keymap.set("n", "<leader>rc", "<cmd>RunCode<CR>", { desc = "Run Code " }),
vim.keymap.set("n", "<leader>rf", "<cmd>RunFile<CR>", { desc = "Run Code File " }),
vim.keymap.set("n", "<leader>rp", "<cmd>RunProject<CR>", { desc = "Run Code Project " }),
vim.keymap.set("n", "<leader>rx", "<cmd>RunClose<CR>", { desc = "Close Code Run " }),
opts = {
filetype = {
python = "python3 -u",
c = "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
sh = "bash",
go = "go run",
lua = "lua",
julia = "julia",
typescript = "ts-node",
javascript = "node",
rust = "cd $dir && cargo run",
php = "php",
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
kotlin = "cd $dir && kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar",
},
},
},
{
"L3MON4D3/LuaSnip",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
"rafamadriz/friendly-snippets",
"mstuttgart/odoo-snippets",
},
opts = {
history = true,
updateevents = "TextChanged,TextChangedI",
},
keys = function()
return {}
end,
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"altermo/ultimate-autopair.nvim",
event = { "InsertEnter", "CmdlineEnter" },
branch = "v0.6", --recommended as each new version will have breaking changes
opts = {},
},
{
"hrsh7th/nvim-cmp",
event = { "InsertEnter" },
dependencies = {
-- autocomplete plugins
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
-- "hrsh7th/cmp-nvim-lsp-signature-help",
-- "hrsh7th/cmp-calc",
-- vscode like icons to autocomplete list
'onsails/lspkind.nvim',
-- snippet plugin
{ 'L3MON4D3/LuaSnip', event = { 'BufReadPost', 'BufNewFile' } },
{ 'rafamadriz/friendly-snippets', event = { 'BufReadPost', 'BufNewFile' } },
},
config = function()
require('configs.cmp')
end,
},
{
'Exafunction/codeium.vim',
event = 'InsertEnter',
config = function()
local cmp = require('cmp')
cmp.event:on('menu_opened', function()
vim.g.codeium_manual = true
vim.fn['codeium#Clear']()
end)
cmp.event:on('menu_closed', function()
vim.g.codeium_manual = false
vim.fn['codeium#Complete']()
end)
-- vscode like icons to autocomplete list
"onsails/lspkind.nvim",
-- snippet plugin
{ "L3MON4D3/LuaSnip", event = { "BufReadPost", "BufNewFile" } },
{ "rafamadriz/friendly-snippets", event = { "BufReadPost", "BufNewFile" } },
},
config = function()
require("configs.cmp")
end,
},
{
"Exafunction/codeium.vim",
event = "InsertEnter",
config = function()
local cmp = require("cmp")
cmp.event:on("menu_opened", function()
vim.g.codeium_manual = true
vim.fn["codeium#Clear"]()
end)
cmp.event:on("menu_closed", function()
vim.g.codeium_manual = false
vim.fn["codeium#Complete"]()
end)
vim.g.codeium_filetypes = {
TelescopePrompt = false,
DressingInput = false,
['neo-tree-popup'] = false,
['dap-repl'] = false,
}
vim.g.codeium_filetypes = {
TelescopePrompt = false,
DressingInput = false,
["neo-tree-popup"] = false,
["dap-repl"] = false,
}
local opts = { expr = true, silent = true }
vim.g.codeium_disable_bindings = 1
local opts = { expr = true, silent = true }
vim.g.codeium_disable_bindings = 1
vim.keymap.set('i', '<M-CR>', function()
return vim.fn['codeium#Accept']()
end, opts)
vim.keymap.set("i", "<M-CR>", function()
return vim.fn["codeium#Accept"]()
end, opts)
vim.keymap.set('n', '<leader>ch', function()
return vim.fn['codeium#Chat']()
end, { desc = 'Chat with IA (Codeium)' })
vim.keymap.set("n", "<leader>ch", function()
return vim.fn["codeium#Chat"]()
end, { desc = "Chat with IA (Codeium)" })
vim.keymap.set('i', '<M-]>', function()
return vim.fn['codeium#CycleCompletions'](1)
end, opts)
vim.keymap.set("i", "<M-]>", function()
return vim.fn["codeium#CycleCompletions"](1)
end, opts)
vim.keymap.set('i', '<M-[>', function()
return vim.fn['codeium#CycleCompletions'](-1)
end, opts)
vim.keymap.set("i", "<M-[>", function()
return vim.fn["codeium#CycleCompletions"](-1)
end, opts)
vim.keymap.set('i', '<M-c>', function()
return vim.fn['codeium#Clear']()
end, opts)
vim.keymap.set("i", "<M-c>", function()
return vim.fn["codeium#Clear"]()
end, opts)
vim.keymap.set('n', '<leader>cI', '<cmd>CodeiumToggle<cr>', { desc = 'Toggle IA (Codeium)' })
end,
},
{
'nacro90/numb.nvim',
event = 'CmdlineEnter',
config = function()
require('numb').setup({
show_numbers = true, -- Enable 'number' for the window while peeking
show_cursorline = true, -- Enable 'cursorline' for the window while peeking
hide_relativenumbers = true, -- Enable turning off 'relativenumber' for the window while peeking
number_only = false, -- Peek only when the command is only a number instead of when it starts with a number
centered_peeking = true, -- Peeked line will be centered relative to window
})
end,
},
{
'NStefan002/screenkey.nvim',
cmd = 'Screenkey',
version = '*',
vim.keymap.set('n', '<leader>kt', '<cmd>Screenkey<CR>', { desc = 'Toggle keys' }),
config = function()
require('screenkey').setup({
win_opts = {
relative = 'editor',
anchor = 'SE',
width = 40,
height = 1,
border = 'single',
},
compress_after = 3,
clear_after = 3,
disable = {
filetypes = {}, -- for example: "toggleterm"
buftypes = {}, -- for example: "terminal"
},
})
end,
},
{
'gbprod/yanky.nvim',
event = 'BufReadPost',
keys = {
{ '<C-n>', '<Plug>(YankyCycleForward)' },
{ '<C-p>', '<Plug>(YankyCycleBackward)' },
{
'<leader>yp',
function()
require('telescope').extensions.yank_history.yank_history({})
end,
desc = 'Open Yank History',
},
{ 'y', '<Plug>(YankyYank)', mode = { 'n', 'x' }, desc = 'Yank text' },
{ 'p', '<Plug>(YankyPutAfter)', mode = { 'n', 'x' }, desc = 'Put yanked text after cursor' },
{ 'P', '<Plug>(YankyPutBefore)', mode = { 'n', 'x' }, desc = 'Put yanked text before cursor' },
{ 'gp', '<Plug>(YankyGPutAfter)', mode = { 'n', 'x' }, desc = 'Put yanked text after selection' },
{ 'gP', '<Plug>(YankyGPutBefore)', mode = { 'n', 'x' }, desc = 'Put yanked text before selection' },
-- This is not plugin keymaps
{ '<leader>yP', '<cmd>CopyAbsolutePath<cr>', desc = 'Absolute Path' },
{ '<leader>ya', '<cmd>%y+<cr>', desc = 'Copy Whole File' },
{ '<leader>yf', '<cmd>CopyFileName<cr>', desc = 'File Name' },
{ '<leader>yg', '<cmd>lua require"gitlinker".get_buf_range_url()<cr>', desc = 'Copy Git URL' },
{ '<leader>yp', '<cmd>CopyRelativePath<cr>', desc = 'Relative Path' },
},
opts = {
highlight = {
timer = 150,
},
},
},
{
{
'LudoPinelli/comment-box.nvim',
opts = {},
vscode = true,
keys = {
{ '<leader>Cb', '<cmd>CBccbox<CR>', mode = { 'n', 'v' }, desc = 'Comment Box' },
{ '<leader>Ct', '<cmd>CBllline<CR>', mode = { 'n', 'v' }, desc = 'Tiled line' },
{ '<leader>Cl', '<cmd>CBline<CR>', desc = 'Line' },
{ '<leader>Cm', '<cmd>CBllbox14<CR>', mode = { 'n', 'v' }, desc = 'Marked' },
{ '<leader>Cc', '<cmd>CBcatalog<CR>', desc = 'Catalog' },
{ '<leader>Cd', '<cmd>CBd<CR>', mode = { 'n', 'v' }, desc = 'Delete Comment Style' },
},
},
},
{
'm-demare/hlargs.nvim',
event = { 'BufReadPost', 'BufNewFile' },
},
{
'numToStr/Navigator.nvim',
keys = {
{ '<C-h>', '<cmd>NavigatorLeft<cr>' },
{ '<C-j>', '<cmd>NavigatorDown<cr>' },
{ '<C-k>', '<cmd>NavigatorUp<cr>' },
{ '<C-l>', '<cmd>NavigatorRight<cr>' },
{ '<C-\\>', '<cmd>NavigatorPrevious<cr>' },
},
config = function()
require('Navigator').setup()
end,
},
vim.keymap.set("n", "<leader>cI", "<cmd>CodeiumToggle<cr>", { desc = "Toggle IA (Codeium)" })
end,
},
{
"nacro90/numb.nvim",
event = "CmdlineEnter",
config = function()
require("numb").setup({
show_numbers = true, -- Enable 'number' for the window while peeking
show_cursorline = true, -- Enable 'cursorline' for the window while peeking
hide_relativenumbers = true, -- Enable turning off 'relativenumber' for the window while peeking
number_only = false, -- Peek only when the command is only a number instead of when it starts with a number
centered_peeking = true, -- Peeked line will be centered relative to window
})
end,
},
{
"NStefan002/screenkey.nvim",
cmd = "Screenkey",
version = "*",
vim.keymap.set("n", "<leader>kt", "<cmd>Screenkey<CR>", { desc = "Toggle keys" }),
config = function()
require("screenkey").setup({
win_opts = {
relative = "editor",
anchor = "SE",
width = 40,
height = 1,
border = "single",
},
compress_after = 3,
clear_after = 3,
disable = {
filetypes = {}, -- for example: "toggleterm"
buftypes = {}, -- for example: "terminal"
},
})
end,
},
{
"gbprod/yanky.nvim",
event = "BufReadPost",
keys = {
{ "<C-n>", "<Plug>(YankyCycleForward)" },
{ "<C-p>", "<Plug>(YankyCycleBackward)" },
{
"<leader>yp",
function()
require("telescope").extensions.yank_history.yank_history({})
end,
desc = "Open Yank History",
},
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
-- This is not plugin keymaps
{ "<leader>yP", "<cmd>CopyAbsolutePath<cr>", desc = "Absolute Path" },
{ "<leader>ya", "<cmd>%y+<cr>", desc = "Copy Whole File" },
{ "<leader>yf", "<cmd>CopyFileName<cr>", desc = "File Name" },
{ "<leader>yg", '<cmd>lua require"gitlinker".get_buf_range_url()<cr>', desc = "Copy Git URL" },
{ "<leader>yp", "<cmd>CopyRelativePath<cr>", desc = "Relative Path" },
},
opts = {
highlight = {
timer = 150,
},
},
},
{
{
"LudoPinelli/comment-box.nvim",
opts = {},
vscode = true,
keys = {
{ "<leader>Cb", "<cmd>CBccbox<CR>", mode = { "n", "v" }, desc = "Comment Box" },
{ "<leader>Ct", "<cmd>CBllline<CR>", mode = { "n", "v" }, desc = "Tiled line" },
{ "<leader>Cl", "<cmd>CBline<CR>", desc = "Line" },
{ "<leader>Cm", "<cmd>CBllbox14<CR>", mode = { "n", "v" }, desc = "Marked" },
{ "<leader>Cc", "<cmd>CBcatalog<CR>", desc = "Catalog" },
{ "<leader>Cd", "<cmd>CBd<CR>", mode = { "n", "v" }, desc = "Delete Comment Style" },
},
},
},
{
"m-demare/hlargs.nvim",
event = { "BufReadPost", "BufNewFile" },
},
{
"numToStr/Navigator.nvim",
keys = {
{ "<C-h>", "<cmd>NavigatorLeft<cr>" },
{ "<C-j>", "<cmd>NavigatorDown<cr>" },
{ "<C-k>", "<cmd>NavigatorUp<cr>" },
{ "<C-l>", "<cmd>NavigatorRight<cr>" },
{ "<C-\\>", "<cmd>NavigatorPrevious<cr>" },
},
config = function()
require("Navigator").setup()
end,
},
}
+33 -12
View File
@@ -1,14 +1,35 @@
return {
{
'bluz71/vim-moonfly-colors',
name = 'moonfly',
lazy = false,
priority = 1000,
config = function()
require('moonfly').custom_colors({
bg = '#000000',
})
vim.cmd([[colorscheme moonfly]])
end,
},
{
"navarasu/onedark.nvim",
lazy = false,
priority = 1000,
config = function()
local onedark = require("onedark")
local util = require("lib.util")
onedark.setup({
style = "deep",
transparent = true,
term_colors = false,
ending_tildes = false,
cmp_itemkind_reverse = false,
toggle_style_key = "<leader>mt",
toggle_style_list = { "dark", "darker", "cool", "warm", "warmer", "deep", "light" },
-- Options are italic, bold, underline, none and combos 'italic,bold'
code_style = {
comments = "italic",
keywords = "none",
functions = "none",
strings = "none",
variables = "none",
},
lualine = { transparent = true },
diagnostics = { darker = true, undercurl = true, background = false },
})
onedark.load()
end,
},
}
+245 -248
View File
@@ -1,50 +1,43 @@
return {
{
'echasnovski/mini.files',
version = false,
keys = {
{ '-', "<cmd>lua require('mini.files').open(vim.api.nvim_buf_get_name(0))<CR>", { silent = true } },
},
},
{
'nvim-neo-tree/neo-tree.nvim',
keys = {
{ '<leader>ee', ':Neotree toggle float<CR>', silent = true, desc = 'Float File Explorer' },
{ '<leader><tab>', ':Neotree toggle left<CR>', silent = true, desc = ' Left File Explorer' },
},
cmd = { 'Neotree' },
opts = {
filesystem = {
filtered_items = {
visible = true,
show_hidden_count = true,
hide_dotfiles = false,
hide_gitignored = true,
hide_by_name = {
'.git',
'.DS_Store',
'thumbs.db',
'.venv',
},
never_show = {},
},
},
window = {
position = 'right',
width = 35,
},
},
},
{
'folke/flash.nvim',
event = 'VeryLazy',
opts = {
modes = {
char = {
jump_labels = true,
},
},
},
{
"nvim-neo-tree/neo-tree.nvim",
keys = {
{ "<leader>ee", ":Neotree toggle float<CR>", silent = true, desc = "Float File Explorer" },
{ "<leader><tab>", ":Neotree toggle left<CR>", silent = true, desc = " Left File Explorer" },
},
cmd = { "Neotree" },
opts = {
filesystem = {
filtered_items = {
visible = true,
show_hidden_count = true,
hide_dotfiles = false,
hide_gitignored = true,
hide_by_name = {
".git",
".DS_Store",
"thumbs.db",
".venv",
},
never_show = {},
},
},
window = {
position = "right",
width = 35,
},
},
},
{
"folke/flash.nvim",
event = "VeryLazy",
opts = {
modes = {
char = {
jump_labels = true,
},
},
},
-- stylua: ignore
keys = {
{
@@ -74,208 +67,212 @@ return {
},
},
},
{
'folke/trouble.nvim',
lazy = true,
cmd = { 'Trouble', 'TroubleToggle', 'TroubleRefresh' },
opts = {
modes = {
lsp = {
win = { position = 'right' },
},
},
},
keys = {
{ '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', desc = 'Diagnostics (Trouble)' },
{ '<leader>xX', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', desc = 'Buffer Diagnostics (Trouble)' },
{ '<leader>xs', '<cmd>Trouble symbols toggle<cr>', desc = 'Symbols (Trouble)' },
{ '<leader>xS', '<cmd>Trouble lsp toggle<cr>', desc = 'LSP references/definitions/... (Trouble)' },
{ '<leader>xL', '<cmd>Trouble loclist toggle<cr>', desc = 'Location List (Trouble)' },
{ '<leader>xQ', '<cmd>Trouble qflist toggle<cr>', desc = 'Quickfix List (Trouble)' },
{
'[q',
function()
if require('trouble').is_open() then
require('trouble').prev({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = 'Previous Trouble/Quickfix Item',
},
{
']q',
function()
if require('trouble').is_open() then
require('trouble').next({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = 'Next Trouble/Quickfix Item',
},
},
},
{
'nvim-telescope/telescope.nvim',
cmd = 'Telescope',
version = false,
lazy = true,
dependencies = {
{ 'nvim-tree/nvim-web-devicons' },
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'zig' },
{ 'nvim-telescope/telescope-ui-select.nvim' },
{ 'nvim-telescope/telescope-symbols.nvim' },
{ 'nvim-telescope/telescope-file-browser.nvim' },
{ 'debugloop/telescope-undo.nvim' },
},
keys = {
{ '<leader>ff', '<cmd>Telescope find_files<cr>', desc = 'Find Files (CWD)' },
{ '<leader>fg', '<cmd>Telescope live_grep<cr>', desc = 'Live Grep' },
{ '<leader>fb', '<cmd>Telescope buffers<cr>', desc = 'Buffers' },
{ '<leader>fh', '<cmd>Telescope help_tags<cr>', desc = 'Find Help' },
{ '<leader>fo', '<cmd>Telescope oldfiles<cr>', desc = 'Old Recent Files' },
{ '<leader>fm', '<cmd>Telescope marks<cr>', desc = 'Marks' },
{ '<leader>fH', '<cmd>Telescope highlights<cr>', desc = 'Find Highlight Groups' },
{ '<leader>fG', '<cmd>Telescope grep_string<cr>', desc = 'Grep String' },
{ '<leader>kk', '<cmd>Telescope keymaps<cr>', desc = 'Keymaps' },
{ '<leader>kc', '<cmd>Telescope commands<cr>', desc = 'Commands' },
{ '<leader>kh', '<cmd>Telescope command_history<cr>', desc = 'Command History' },
{ '<leader>ks', '<cmd>Telescope search_history<cr>', desc = 'Search History' },
{ '<leader>fd', '<cmd>Telescope diagnostics<cr>', desc = 'Diagnostics' },
{ '<leader>ef', '<cmd>Telescope file_browser<cr>', desc = 'File Browser' },
{ '<leader>cr', '<cmd>Telescope reloader<cr>', desc = 'Reload Module' },
{ '<leader>cn', '<cmd>Telescope notify<cr>', desc = 'Notifications' },
{ '<leader>fu', '<cmd>Telescope undo<cr>', desc = 'Undo History' },
{ '<leader>fb', '<cmd>Telescope buffers<cr>', desc = 'Buffers' },
{ '<leader>fq', '<cmd>Telescope quickfix<cr>', desc = 'Quickfix' },
{ '<leader>fs', '<cmd>Telescope current_buffer_fuzzy_find<cr>', desc = 'Fuzzy Find in File' },
},
},
{
"folke/trouble.nvim",
lazy = true,
cmd = { "Trouble", "TroubleToggle", "TroubleRefresh" },
opts = {
modes = {
lsp = {
win = { position = "right" },
},
},
},
keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
{ "<leader>xs", "<cmd>Trouble symbols toggle<cr>", desc = "Symbols (Trouble)" },
{ "<leader>xS", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/... (Trouble)" },
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
{
"[q",
function()
if require("trouble").is_open() then
require("trouble").prev({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = "Previous Trouble/Quickfix Item",
},
{
"]q",
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = "Next Trouble/Quickfix Item",
},
},
},
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
version = false,
lazy = true,
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "zig" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-symbols.nvim" },
{ "nvim-telescope/telescope-file-browser.nvim" },
{ "debugloop/telescope-undo.nvim" },
},
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files (CWD)" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live Grep" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Find Help" },
{ "<leader>fo", "<cmd>Telescope oldfiles<cr>", desc = "Old Recent Files" },
{ "<leader>fm", "<cmd>Telescope marks<cr>", desc = "Marks" },
{ "<leader>fH", "<cmd>Telescope highlights<cr>", desc = "Find Highlight Groups" },
{ "<leader>fG", "<cmd>Telescope grep_string<cr>", desc = "Grep String" },
{ "<leader>kk", "<cmd>Telescope keymaps<cr>", desc = "Keymaps" },
{ "<leader>kc", "<cmd>Telescope commands<cr>", desc = "Commands" },
{ "<leader>kh", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>ks", "<cmd>Telescope search_history<cr>", desc = "Search History" },
{ "<leader>fd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" },
{ "<leader>ef", "<cmd>Telescope file_browser<cr>", desc = "File Browser" },
{ "<leader>cr", "<cmd>Telescope reloader<cr>", desc = "Reload Module" },
{ "<leader>cn", "<cmd>Telescope notify<cr>", desc = "Notifications" },
{ "<leader>fu", "<cmd>Telescope undo<cr>", desc = "Undo History" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fq", "<cmd>Telescope quickfix<cr>", desc = "Quickfix" },
{ "<leader>fs", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Fuzzy Find in File" },
},
config = function()
require('configs.telescope')
end,
},
{
'smjonas/inc-rename.nvim',
cmd = 'IncRename',
config = true,
},
{
config = function()
require("configs.telescope")
end,
},
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
config = true,
},
{
'akinsho/toggleterm.nvim',
cmd = { 'ToggleTerm' },
version = 'v2.*',
keys = {
{ '<leader>t1', '<cmd>1ToggleTerm<cr>', desc = 'Toggle Terminal', mode = 'n' },
{ '<leader>t2', '<cmd>2ToggleTerm<cr>', desc = 'Toggle Terminal', mode = 'n' },
},
config = function()
require('configs.toggleterm')
end,
},
{
'2kabhishek/termim.nvim',
cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' },
keys = {
{ '<leader>th', '<cmd>Sterm<cr>', desc = 'Horizontal Terminal' },
{ '<leader>tv', '<cmd>Vterm<cr>', desc = 'Vertical Terminal' },
},
},
{
'nvimdev/lspsaga.nvim',
lazy = true,
event = 'LspAttach',
config = function()
vim.keymap.set(
'n',
'<leader>lo',
'<cmd>Lspsaga outline<cr>',
{ desc = 'Lspsaga | Code Outline', silent = true }
)
require('lspsaga').setup({
ui = {
theme = 'round',
border = 'rounded',
winblend = 0,
expand = '',
collaspe = '',
preview = '',
code_action = '󱧣 ',
diagnostic = '',
hover = '',
kind = {},
},
lightbulb = {
enable = false,
enable_in_insert = true,
sign = true,
sign_priority = 40,
virtual_text = true,
},
symbol_in_winbar = {
enable = false,
separator = '',
hide_keyword = true,
show_file = true,
folder_level = 0,
},
})
end,
},
{
'HiPhish/rainbow-delimiters.nvim',
event = { 'BufReadPost', 'BufNewFile' },
config = function()
local rainbow_delimiters = require('rainbow-delimiters')
require('rainbow-delimiters.setup').setup({
{
strategy = {
[''] = rainbow_delimiters.strategy['global'],
vim = rainbow_delimiters.strategy['local'],
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
},
priority = {
[''] = 110,
lua = 210,
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
},
})
end,
},
{
'2kabhishek/tdo.nvim',
dependencies = 'nvim-telescope/telescope.nvim',
cmd = { 'Tdo', 'TdoEntry', 'TdoNote', 'TdoTodos', 'TdoToggle', 'TdoFind', 'TdoFiles' },
keys = {
{ '<leader>nd', '<cmd>Tdo<cr>', desc = "Today's Todo" },
{ '<leader>ne', '<cmd>TdoEntry<cr>', desc = "Today's Entry" },
{ '<leader>nf', '<cmd>TdoFiles<cr>', desc = 'All Notes' },
{ '<leader>ng', '<cmd>TdoFind<cr>', desc = 'Find Notes' },
{ '<leader>nh', '<cmd>Tdo -1<cr>', desc = "Yesterday's Todo" },
{ '<leader>nl', '<cmd>Tdo 1<cr>', desc = "Tomorrow's Todo" },
{ '<leader>nn', '<cmd>TdoNote<cr>', desc = 'New Note' },
{ '<leader>nt', '<cmd>TdoTodos<cr>', desc = 'Incomplete Todos' },
{ '<leader>nx', '<cmd>TdoToggle<cr>', desc = 'Toggle Todo' },
},
},
"akinsho/toggleterm.nvim",
cmd = { "ToggleTerm" },
version = "v2.*",
keys = {
{ "<leader>t1", "<cmd>1ToggleTerm<cr>", desc = "Toggle Terminal", mode = "n" },
{ "<leader>t2", "<cmd>2ToggleTerm<cr>", desc = "Toggle Terminal", mode = "n" },
},
config = function()
require("configs.toggleterm")
end,
},
{
"2kabhishek/termim.nvim",
cmd = { "Fterm", "FTerm", "Sterm", "STerm", "Vterm", "VTerm" },
keys = {
{ "<leader>th", "<cmd>Sterm<cr>", desc = "Horizontal Terminal" },
{ "<leader>tv", "<cmd>Vterm<cr>", desc = "Vertical Terminal" },
},
},
{
"nvimdev/lspsaga.nvim",
lazy = true,
event = "LspAttach",
config = function()
vim.keymap.set(
"n",
"<leader>lo",
"<cmd>Lspsaga outline<cr>",
{ desc = "Lspsaga | Code Outline", silent = true }
)
local icons = require("lib.icons")
require("lspsaga").setup({
ui = {
theme = "round",
border = "rounded",
devicon = true,
title = true,
winblend = 1,
expand = icons.ui.ArrowOpen,
collapse = icons.ui.ArrowClosed,
preview = icons.ui.List,
code_action = icons.diagnostics.Hint,
diagnostic = icons.ui.Bug,
incoming = icons.ui.Incoming,
outgoing = icons.ui.Outgoing,
hover = icons.ui.Comment,
},
lightbulb = {
enable = false,
enable_in_insert = true,
sign = true,
sign_priority = 40,
virtual_text = true,
},
symbol_in_winbar = {
enable = false,
separator = "",
hide_keyword = true,
show_file = true,
folder_level = 0,
},
})
end,
},
{
"HiPhish/rainbow-delimiters.nvim",
event = { "BufReadPost", "BufNewFile" },
config = function()
local rainbow_delimiters = require("rainbow-delimiters")
require("rainbow-delimiters.setup").setup({
{
strategy = {
[""] = rainbow_delimiters.strategy["global"],
vim = rainbow_delimiters.strategy["local"],
},
query = {
[""] = "rainbow-delimiters",
lua = "rainbow-blocks",
},
priority = {
[""] = 110,
lua = 210,
},
highlight = {
"RainbowDelimiterRed",
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
},
},
})
end,
},
{
"2kabhishek/tdo.nvim",
dependencies = "nvim-telescope/telescope.nvim",
cmd = { "Tdo", "TdoEntry", "TdoNote", "TdoTodos", "TdoToggle", "TdoFind", "TdoFiles" },
keys = {
{ "<leader>nd", "<cmd>Tdo<cr>", desc = "Today's Todo" },
{ "<leader>ne", "<cmd>TdoEntry<cr>", desc = "Today's Entry" },
{ "<leader>nf", "<cmd>TdoFiles<cr>", desc = "All Notes" },
{ "<leader>ng", "<cmd>TdoFind<cr>", desc = "Find Notes" },
{ "<leader>nh", "<cmd>Tdo -1<cr>", desc = "Yesterday's Todo" },
{ "<leader>nl", "<cmd>Tdo 1<cr>", desc = "Tomorrow's Todo" },
{ "<leader>nn", "<cmd>TdoNote<cr>", desc = "New Note" },
{ "<leader>nt", "<cmd>TdoTodos<cr>", desc = "Incomplete Todos" },
{ "<leader>nx", "<cmd>TdoToggle<cr>", desc = "Toggle Todo" },
},
},
}
+63
View File
@@ -0,0 +1,63 @@
return {
"stevearc/conform.nvim",
enabled = false,
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
cpp = { "clang-format" },
c = { "clang-format" },
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier", "biome" },
typescriptreact = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
markdown = { "markdownlint", "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
php = { "php-cs-fixer" },
java = { "google-java-formatter", "trivy" },
graphql = { "prettier" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return {
lsp_fallback = true,
async = false,
timeout_ms = 500,
}
end,
})
vim.keymap.set({ "n", "v" }, "<leader>cf", function()
conform.format({
lsp_fallback = true,
async = true,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
vim.keymap.set({ "n" }, "<leader>cfb", function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
vim.notify(
"Buffer auto-format on-save: " .. (vim.b.disable_autoformat and "OFF" or "ON"),
vim.log.levels.INFO
)
end, { desc = "Toggle auto-format on-save for buffer." })
vim.keymap.set({ "n" }, "<leader>ftg", function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
vim.notify(
"Global auto-format on-save: " .. (vim.g.disable_autoformat and "OFF" or "ON"),
vim.log.levels.INFO
)
end, { desc = "Toggle auto-format on-save globally." })
end,
}
+27
View File
@@ -0,0 +1,27 @@
return {
"mfussenegger/nvim-lint",
enabled = false,
event = { "BufReadPre", "BufNewFile" },
opts = {
linters_by_ft = {
lua = { "selene" },
cpp = { "cpplint" },
c = { "cpplint" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
python = { "pylint" },
markdown = { "markdownlint" },
java = { "trivy" },
php = { "phpcs" },
},
},
config = function()
local lint = require("lint")
-- TODO create auto command ran after Buffer Wrote
vim.keymap.set("n", "<leader>cl", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })
end,
}
+22 -22
View File
@@ -1,24 +1,24 @@
return {
{
'williamboman/mason.nvim',
cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' },
dependencies = {
{ 'williamboman/mason-lspconfig.nvim', event = { 'BufReadPre', 'BufNewFile' } },
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
{ 'zapling/mason-lock.nvim', cmd = { 'MasonLock', 'MasonLockRestore' }, opts = {} },
},
config = function()
require('mason').setup()
end,
},
{
'nvimtools/none-ls.nvim', -- configure formatters & linters
event = { 'BufRead', 'FileType' },
dependencies = {
'jay-babu/mason-null-ls.nvim',
},
config = function()
require('configs.none-ls')
end,
},
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
dependencies = {
{ "williamboman/mason-lspconfig.nvim", event = { "BufReadPre", "BufNewFile" } },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "zapling/mason-lock.nvim", cmd = { "MasonLock", "MasonLockRestore" }, opts = {} },
},
config = function()
require("mason").setup()
end,
},
{
"nvimtools/none-ls.nvim", -- configure formatters & linters
event = { "BufRead", "FileType" },
dependencies = {
"jay-babu/mason-null-ls.nvim",
},
config = function()
require("configs.none-ls")
end,
},
}
+79 -57
View File
@@ -1,60 +1,82 @@
return {
{
'echasnovski/mini.nvim',
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
version = false,
config = function()
require('mini.comment').setup({})
require('mini.ai').setup({})
require('mini.cursorword').setup()
-- require("mini.tabline").setup()
require('mini.bracketed').setup({
file = { suffix = '' },
window = { suffix = '' },
quickfix = { suffix = '' },
yank = { suffix = '' },
treesitter = { suffix = 'n' },
})
require('mini.surround').setup({
mappings = {
add = 'gsa', -- Add surrounding in Normal and Visual modes
delete = 'gsd', -- Delete surrounding
replace = 'gsr', -- Replace surrounding
find = 'gsf', -- Find surrounding (to the right)
find_left = 'gsF', -- Find surrounding (to the left)
highlight = 'gsh', -- Highlight surrounding
update_n_lines = 'gsn', -- Update `n_lines`
},
keys = {
{ 'gz', '', desc = '+surround' },
},
})
require('mini.pairs').setup({
odes = { command = true },
mappings = {
['<'] = { action = 'open', pair = '<>', neigh_pattern = '[^\\].' },
['>'] = { action = 'close', pair = '<>', neigh_pattern = '[^\\].' },
},
})
require('mini.move').setup({
keys = {
{ '<M-Left>', mode = { 'n', 'v' } },
{ '<M-Down>', mode = { 'n', 'v' } },
{ '<M-Up>', mode = { 'n', 'v' } },
{ '<M-Right>', mode = { 'n', 'v' } },
},
{
"echasnovski/mini.nvim",
event = { "BufReadPost", "BufAdd", "BufNewFile" },
version = false,
config = function()
require("mini.comment").setup({})
require("mini.ai").setup({})
require("mini.cursorword").setup()
require("mini.bracketed").setup({
file = { suffix = "" },
window = { suffix = "" },
quickfix = { suffix = "" },
yank = { suffix = "" },
treesitter = { suffix = "n" },
})
require("mini.surround").setup({
mappings = {
add = "gsa", -- Add surrounding in Normal and Visual modes
delete = "gsd", -- Delete surrounding
replace = "gsr", -- Replace surrounding
find = "gsf", -- Find surrounding (to the right)
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
keys = {
{ "gz", "", desc = "+surround" },
},
})
require("mini.pairs").setup({
-- odes = { command = true },
-- mappings = {
-- ['<'] = { action = 'open', pair = '<>', neigh_pattern = '[^\\].' },
-- ['>'] = { action = 'close', pair = '<>', neigh_pattern = '[^\\].' },
-- },
})
require("mini.move").setup({
keys = {
{ "<M-Left>", mode = { "n", "v" } },
{ "<M-Down>", mode = { "n", "v" } },
{ "<M-Up>", mode = { "n", "v" } },
{ "<M-Right>", mode = { "n", "v" } },
},
mappings = {
left = '<M-Left>',
line_left = '<M-Left>',
right = '<M-Right>',
line_right = '<M-Right>',
down = '<M-Down>',
line_down = '<M-Down>',
up = '<M-Up>',
line_up = '<M-Up>',
},
})
end,
},
mappings = {
left = "<M-Left>",
line_left = "<M-Left>",
right = "<M-Right>",
line_right = "<M-Right>",
down = "<M-Down>",
line_down = "<M-Down>",
up = "<M-Up>",
line_up = "<M-Up>",
},
})
end,
},
{
"echasnovski/mini.files",
version = false,
keys = {
{ "-", "<cmd>lua require('mini.files').open(vim.api.nvim_buf_get_name(0))<CR>", { silent = true } },
},
},
{
"echasnovski/mini.icons",
opts = {},
lazy = true,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
},
init = function()
package.preload["nvim-web-devicons"] = function()
-- needed since it will be false when loading and mini will fail
package.loaded["nvim-web-devicons"] = {}
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
}
+193 -165
View File
@@ -1,170 +1,198 @@
return {
{
'folke/persistence.nvim',
event = 'BufReadPre',
opts = { options = vim.opt.sessionoptions:get() },
keys = {
{
'<leader>ms',
function()
require('persistence').load()
end,
desc = 'Restore Session',
},
{
'<leader>ml',
function()
require('persistence').load({ last = true })
end,
desc = 'Restore Last Session',
},
{
'<leader>md',
function()
require('persistence').stop()
end,
desc = "Don't Save Current Session",
},
},
},
{
'nvim-lua/plenary.nvim',
lazy = true,
},
{
'iamcco/markdown-preview.nvim',
build = 'cd app && yarn install',
ft = { 'markdown' },
keys = {
{
'<leader>cm',
'<cmd>MarkdownPreviewToggle<CR>',
desc = 'toggle markdown preview',
},
},
},
{
'nvim-pack/nvim-spectre',
build = false,
cmd = 'Spectre',
opts = { open_cmd = 'noswapfile vnew' },
keys = {
{
'<leader>mr',
function()
require('spectre').open()
end,
desc = 'Replace in Files (Spectre)',
},
},
},
{
'szw/vim-maximizer',
{
"ThePrimeagen/refactoring.nvim",
config = function()
require("refactoring").setup()
-- vim.keymap.set("x", "<leader>re", ":Refactor extract ")
-- vim.keymap.set("x", "<leader>rf", ":Refactor extract_to_file ")
--
-- vim.keymap.set("x", "<leader>rv", ":Refactor extract_var ")
--
-- vim.keymap.set({ "n", "x" }, "<leader>ri", ":Refactor inline_var")
--
-- vim.keymap.set("n", "<leader>rI", ":Refactor inline_func")
--
-- vim.keymap.set("n", "<leader>rb", ":Refactor extract_block")
-- vim.keymap.set("n", "<leader>rbf", ":Refactor extract_block_to_file")
-- load refactoring Telescope extension
require("telescope").load_extension("refactoring")
keys = {
{ '<leader>mm', '<cmd>MaximizerToggle<CR>', desc = 'Maximize/minimize a split' },
},
},
{
'folke/zen-mode.nvim',
cmd = { 'ZenMode' },
opts = {},
keys = {
{ '<leader>wz', '<cmd>ZenMode<cr>', desc = 'Toggle zen mode' },
},
},
{
'chrisgrieser/nvim-recorder',
dependencies = { 'rcarriga/nvim-notify' },
event = 'VeryLazy',
vscode = true,
keys = {
{ 'q', desc = 'Start Recording' },
{ 'Q', desc = 'Play Recording' },
{ '<C-q>', desc = 'Switch Slot' },
{ 'cq', desc = 'Edit Macro' },
{ 'yq', desc = 'Yank Macro' },
{ 'dq', desc = 'Delete All Macros' },
},
opts = {
useNerdFontsIcons = false,
slots = { 'a', 'b', 'c', 'd' },
mapping = {
startStopRecording = 'q',
playMacro = 'Q',
editMacro = 'cq',
switchSlot = '<C-q>',
deleteAllMacros = 'dq',
yankMacro = 'yq',
},
},
},
{
'creativenull/dotfyle-metadata.nvim',
cmd = { 'DotfyleGenerate', 'DotfyleOpen' },
},
{
'willothy/flatten.nvim',
priority = 1001,
opts = {
window = {
open = 'alternate',
},
},
},
{
'wakatime/vim-wakatime',
lazy = false,
},
{
'mvllow/modes.nvim',
event = { 'BufReadPost', 'BufNewFile' },
tag = 'v0.2.0',
config = function()
require('modes').setup({
vim.keymap.set({ "n", "x" }, "<leader>rr", function()
require("telescope").extensions.refactoring.refactors()
end, { desc = "Refactor" })
end,
},
{
"2kabhishek/nerdy.nvim",
dependencies = { "stevearc/dressing.nvim" },
cmd = "Nerdy",
},
{
"folke/persistence.nvim",
event = "BufReadPre",
opts = { options = vim.opt.sessionoptions:get() },
keys = {
{
"<leader>ms",
function()
require("persistence").load()
end,
desc = "Restore Session",
},
{
"<leader>ml",
function()
require("persistence").load({ last = true })
end,
desc = "Restore Last Session",
},
{
"<leader>md",
function()
require("persistence").stop()
end,
desc = "Don't Save Current Session",
},
},
},
{
"nvim-lua/plenary.nvim",
lazy = true,
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && yarn install",
ft = { "markdown" },
keys = {
{
"<leader>cm",
"<cmd>MarkdownPreviewToggle<CR>",
desc = "toggle markdown preview",
},
},
},
{
"nvim-pack/nvim-spectre",
build = false,
cmd = "Spectre",
opts = { open_cmd = "noswapfile vnew" },
keys = {
{
"<leader>mr",
function()
require("spectre").open()
end,
desc = "Replace in Files (Spectre)",
},
},
},
{
"szw/vim-maximizer",
colors = {
visual = '#f5c359',
delete = '#c75c6a',
copy = '#78ccc5',
insert = '#c5739a',
},
line_opacity = 0.15,
set_cursor = true,
set_cursorline = true,
set_number = true,
ignore_filetypes = { 'NvimTree', 'TelescopePrompt' },
})
end,
},
{
'LunarVim/bigfile.nvim',
event = { 'BufEnter', 'WinEnter' },
opts = {
-- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines)
pattern = function(bufnr, filesize_mib)
if filesize_mib >= 2 then
return true
end
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
local file_length = #file_contents
if file_length > 5000 then
return true
end
keys = {
{ "<leader>mm", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
},
},
{
"folke/zen-mode.nvim",
cmd = { "ZenMode" },
opts = {},
keys = {
{ "<leader>wz", "<cmd>ZenMode<cr>", desc = "Toggle zen mode" },
},
},
{
"chrisgrieser/nvim-recorder",
dependencies = { "rcarriga/nvim-notify" },
event = "VeryLazy",
vscode = true,
keys = {
{ "q", desc = "Start Recording" },
{ "Q", desc = "Play Recording" },
{ "<C-q>", desc = "Switch Slot" },
{ "cq", desc = "Edit Macro" },
{ "yq", desc = "Yank Macro" },
{ "dq", desc = "Delete All Macros" },
},
opts = {
useNerdFontsIcons = false,
slots = { "a", "b", "c", "d" },
mapping = {
startStopRecording = "q",
playMacro = "Q",
editMacro = "cq",
switchSlot = "<C-q>",
deleteAllMacros = "dq",
yankMacro = "yq",
},
},
},
{
"creativenull/dotfyle-metadata.nvim",
cmd = { "DotfyleGenerate", "DotfyleOpen" },
},
{
"willothy/flatten.nvim",
priority = 1001,
opts = {
window = {
open = "alternate",
},
},
},
{
"wakatime/vim-wakatime",
lazy = false,
},
{
"mvllow/modes.nvim",
event = { "BufReadPost", "BufNewFile" },
tag = "v0.2.0",
config = function()
require("modes").setup({
return false
end,
},
},
{
'm4xshen/hardtime.nvim',
config = function()
require('hardtime').setup({ enabled = true })
end,
cmd = 'Hardtime',
init = function()
vim.keymap.set('n', '<leader>ch', '<cmd>HardtimeToggle<cr>', { desc = 'Toggle Hardtime' })
end,
},
colors = {
visual = "#f5c359",
delete = "#c75c6a",
copy = "#78ccc5",
insert = "#c5739a",
},
line_opacity = 0.15,
set_cursor = true,
set_cursorline = true,
set_number = true,
ignore_filetypes = { "NvimTree", "TelescopePrompt" },
})
end,
},
{
"LunarVim/bigfile.nvim",
event = { "BufEnter", "WinEnter" },
opts = {
-- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines)
pattern = function(bufnr, filesize_mib)
if filesize_mib >= 2 then
return true
end
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
local file_length = #file_contents
if file_length > 5000 then
return true
end
return false
end,
},
},
{
"m4xshen/hardtime.nvim",
config = function()
require("hardtime").setup({ enabled = true })
end,
cmd = "Hardtime",
init = function()
vim.keymap.set("n", "<leader>ch", "<cmd>HardtimeToggle<cr>", { desc = "Toggle Hardtime" })
end,
},
}
+184 -219
View File
@@ -1,222 +1,187 @@
return {
{
'rcarriga/nvim-notify',
event = 'VeryLazy',
keys = {
{
'<leader>mn',
function()
require('notify').dismiss({ silent = true, pending = true })
end,
desc = 'Dismiss All Notifications',
},
},
opts = {
level = 2,
minimum_width = 50,
stages = 'fade',
timeout = 3000,
top_down = true,
render = 'compact',
background_colour = '#000000',
},
},
{
'folke/noice.nvim',
event = 'UIEnter',
dependencies = {
{ 'MunifTanjim/nui.nvim', lazy = true },
'rcarriga/nvim-notify',
},
opts = {
cmdline = {
view = 'cmdline',
format = {
cmdline = { icon = '▍' },
substitute = {
pattern = '^:%%?s/',
icon = '',
ft = 'regex',
opts = { border = { text = { top = ' sub (old/new/) ' } } },
},
input = { view = 'cmdline_input', icon = '█' },
},
},
routes = {
{
view = 'notify',
filter = { event = 'msg_showmode' },
},
{
filter = {
event = 'msg_show',
kind = '',
find = 'written',
},
opts = { skip = true },
},
},
lsp = {
progress = {
enabled = false,
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
-- See the section on formatting for more details on how to customize.
format = 'lsp_progress',
format_done = 'lsp_progress_done',
throttle = 1000 / 30, -- frequency to update lsp progress message
view = 'mini',
},
override = {
-- override the default lsp markdown formatter with Noice
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
-- override the lsp markdown formatter with Noice
['vim.lsp.util.stylize_markdown'] = true,
-- override cmp documentation with Noice (needs the other options to work)
['cmp.entry.get_documentation'] = true,
},
hover = {
enabled = true,
silent = false, -- set to true to not show a message if hover is not available
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
signature = {
enabled = false,
auto_open = {
enabled = true,
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
throttle = 50, -- Debounce lsp signature help request by 50ms
},
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
message = {
-- Messages shown by lsp servers
enabled = true,
view = 'notify',
opts = {},
},
-- defaults for hover and signature help
documentation = {
view = 'hover',
opts = {
lang = 'markdown',
replace = true,
render = 'plain',
format = { '{message}' },
win_options = { concealcursor = 'n', conceallevel = 3 },
},
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = false, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
},
},
{
'stevearc/dressing.nvim',
event = 'VeryLazy',
},
{
'akinsho/bufferline.nvim',
event = 'UIEnter',
version = '*',
config = function()
require('bufferline').setup({
options = {
close_command = function()
require('bufdelete').bufdelete(0, true)
end,
right_mouse_command = function()
require('bufdelete').bugdelete(0, false)
end,
diagnostics = 'nvim_lsp',
always_show_bufferline = true,
buffer_close_icon = '',
modified_icon = '',
close_icon = '',
left_trunc_marker = '',
right_trunc_marker = '',
offsets = {
{
filetype = 'neo-tree',
text = 'Neo-tree',
highlight = 'Directory',
text_align = 'left',
},
},
},
})
end,
},
{
'nvim-lualine/lualine.nvim',
event = { 'BufReadPost', 'BufNewFile' },
config = function()
require('configs.lualine')
end,
},
{
'nvim-tree/nvim-web-devicons',
config = true,
},
{
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',
event = { 'BufReadPost', 'BufNewFile' },
opts = {
exclude = {
filetypes = { 'help', 'alpha', 'dashboard', 'neo-tree', 'Trouble', 'lazy' },
},
},
},
{
"rcarriga/nvim-notify",
event = "VeryLazy",
keys = {
{
"<leader>mn",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Dismiss All Notifications",
},
},
opts = {
level = 2,
minimum_width = 50,
stages = "fade",
timeout = 3000,
top_down = true,
render = "compact",
background_colour = "#000000",
},
},
{
"folke/noice.nvim",
event = "UIEnter",
dependencies = {
{ "MunifTanjim/nui.nvim", lazy = true },
"rcarriga/nvim-notify",
},
opts = {
cmdline = {
view = "cmdline",
format = {
cmdline = { icon = "▍" },
substitute = {
pattern = "^:%%?s/",
icon = "",
ft = "regex",
opts = { border = { text = { top = " sub (old/new/) " } } },
},
input = { view = "cmdline_input", icon = "█" },
},
},
routes = {
{
view = "notify",
filter = { event = "msg_showmode" },
},
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
lsp = {
progress = {
enabled = false,
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
-- See the section on formatting for more details on how to customize.
format = "lsp_progress",
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
override = {
-- override the default lsp markdown formatter with Noice
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
-- override the lsp markdown formatter with Noice
["vim.lsp.util.stylize_markdown"] = true,
-- override cmp documentation with Noice (needs the other options to work)
["cmp.entry.get_documentation"] = true,
},
hover = {
enabled = true,
silent = false, -- set to true to not show a message if hover is not available
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
signature = {
enabled = false,
auto_open = {
enabled = true,
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
throttle = 50, -- Debounce lsp signature help request by 50ms
},
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
message = {
-- Messages shown by lsp servers
enabled = true,
view = "notify",
opts = {},
},
-- defaults for hover and signature help
documentation = {
view = "hover",
opts = {
lang = "markdown",
replace = true,
render = "plain",
format = { "{message}" },
win_options = { concealcursor = "n", conceallevel = 3 },
},
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = false, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
},
},
{
"stevearc/dressing.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local dressing = require("dressing")
{
'utilyre/barbecue.nvim',
name = 'barbecue',
version = '*',
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
dependencies = {
'SmiteshP/nvim-navic',
},
opts = {},
keys = {
{
'<leader>bq',
function()
require('barbecue.ui').toggle()
end,
desc = 'toggle barbecue',
},
},
config = function()
require('barbecue').setup({
create_autocmd = false, -- prevent barbecue from updating itself automatically
})
vim.api.nvim_create_autocmd({
'WinScrolled', -- or WinResized on NVIM-v0.9 and higher
'BufWinEnter',
'CursorHold',
'InsertLeave',
}, {
group = vim.api.nvim_create_augroup('barbecue.updater', {}),
callback = function()
require('barbecue.ui').update()
end,
})
end,
},
{
'goolord/alpha-nvim',
event = 'VimEnter',
config = function()
require('configs.alpha')
end,
},
dressing.setup({
win_options = {
winblend = 10,
winhighlight = "Normal:DressingInputNormalFloat,NormalFloat:DressingInputNormalFloat,FloatBorder:DressingInputFloatBorder",
},
input = {
enabled = true,
default_prompt = "Input:",
prompt_align = "left",
insert_only = true,
start_in_insert = true,
border = "rounded",
relative = "cursor",
prefer_width = 40,
width = nil,
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
get_config = nil,
},
select = {
enabled = true,
backend = { "telescope", "fzf_lua", "fzf", "nui", "builtin" },
trim_prompt = true,
},
})
end,
},
{
"nvim-lualine/lualine.nvim",
event = { "BufReadPost", "BufNewFile" },
config = function()
require("configs.lualine")
end,
},
-- {
-- "nvim-tree/nvim-web-devicons",
-- config = true,
-- },
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
event = { "BufReadPost", "BufNewFile" },
opts = {
exclude = {
filetypes = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy" },
},
},
},
{
"nvimdev/dashboard-nvim",
cmd = "Dashboard",
config = function()
require("configs.dashboard")
end,
event = function()
if vim.fn.argc() == 0 then
return "VimEnter"
end
end,
},
}
+9 -4
View File
@@ -1,13 +1,17 @@
local icons = require("lib.icons")
return {
"folke/which-key.nvim",
event = "UIEnter",
opts = {
preset = "helix",
icons = {
breadcrumb = "",
separator = "",
breadcrumb = icons.ui.ArrowOpen,
separator = icons.ui.Arrow,
group = "",
rules = false,
keys = {
Space = icons.ui.Rocket,
},
rules = false, -- enable auto icon rules
},
triggers = {
{ "<auto>", mode = "nixsotc" },
@@ -30,6 +34,7 @@ return {
{ "<leader>m", group = "󰠠 Misc" },
{ "<leader>n", group = " Notes" },
{ "<leader>q", group = " Quit" },
{ "<leader>r", group = " Run" },
{ "<leader>s", group = " Split" },
{ "<leader>t", group = " Terminal" },
{ "<leader>u", group = " Test" },
@@ -51,7 +56,7 @@ return {
{ "<leader>cR", "<cmd>ReloadConfig<cr>", desc = "Reload Configs" },
{ "<leader>cd", "<cmd>RootDir<cr>", desc = "Root Directory" },
{ "<leader>cc", "<cmd>:g/^\\s*$/d<cr>", desc = "Clean Empty Lines" },
{ "<leader>co", "<cmd>Alpha<cr>", desc = "Alpha" },
{ "<leader>co", "<cmd>Dashboard<cr>", desc = "Dashboard" },
{ "<leader>cr", "<cmd>Telescope reloader<cr>", desc = "Reload Module" },
--edit
{ "<leader>ea", "<cmd>b#<cr>", desc = "Alternate File" },