Merge pull request #5 from S4NKALP/beta
Updates
This commit was merged in pull request #5.
This commit is contained in:
73 files changed
+2552
-836
No files matched your search
@@ -1,27 +1,4 @@
|
||||
require('preferences')
|
||||
require('keymaps')
|
||||
require('remaps')
|
||||
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
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
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup({
|
||||
spec = {
|
||||
{ import = 'plugins' },
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd('colorscheme onedark')
|
||||
require('config.keymaps')
|
||||
require('config.options')
|
||||
require('config.lazy')
|
||||
require('config.autocmd')
|
||||
+62
-16
@@ -2,40 +2,86 @@
|
||||
"LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" },
|
||||
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "355fbb81a59637a8963cf5847074f8c44dbef11f" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
|
||||
"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" },
|
||||
"codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
|
||||
"eagle.nvim": { "branch": "main", "commit": "f590404f510be11ef2cf7c68e135441bfa48c9a8" },
|
||||
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
|
||||
"flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
||||
"github-preview.nvim": { "branch": "main", "commit": "b1f286a0c2c5bfcc0fea467decbb73e657428065" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" },
|
||||
"hlargs.nvim": { "branch": "main", "commit": "cc0d9ee75e5ffba730393049119361b9e3a5b1b6" },
|
||||
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
|
||||
"lspsaga.nvim": { "branch": "main", "commit": "4ce44df854f447cf0a8972e5387b3aeb5efc798b" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" },
|
||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "3ed90180e70a6a50cd37ce7ecc3693bcdaa7b290" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "49e2699dc0d585b445eda24ed4bb45952ac20508" },
|
||||
"modes.nvim": { "branch": "main", "commit": "3188692abf02a8838ec75e59d68c2ce3e4323f5c" },
|
||||
"moonfly": { "branch": "master", "commit": "4f7d18cb471ede7407dd966c7563868cae7f4f99" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "532dcc8cea4287c4cad6bb77532989a8217cfc7b" },
|
||||
"neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" },
|
||||
"neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" },
|
||||
"neotest-vitest": { "branch": "main", "commit": "353364aa05b94b09409cbef21b79c97c5564e2ce" },
|
||||
"noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" },
|
||||
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
||||
"nvim": { "branch": "main", "commit": "18bab5ec4c782cdf7d7525dbe89c60bfa02fc195" },
|
||||
"numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a67bc39aaa4f1e13212c5022a561120846eaef27" },
|
||||
"nvim-cokeline": { "branch": "main", "commit": "adfd1eb87e0804b6b86126e03611db6f62bb2909" },
|
||||
"nvim-dap": { "branch": "master", "commit": "2b428ff2632e73295e9decbcf1c40d8e26213305" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "037ea0901ce9a28cfcaa36302618f06d2e164fbf" },
|
||||
"nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" },
|
||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "047ce49ccf9a2dce22e1cf3843bef3b5682a8144" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "bfb50de9cb0673a3bff620d881f690fb7e0d1328" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ced6375723b20616282f9f6a1018a63ae19b106a" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
||||
"oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
|
||||
"odoo-snippets": { "branch": "main", "commit": "5e6b7191e3ea60bba00df6cdbc031291b194768d" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "c097f728a409d9923a3c70c1507e8389978a9b85" },
|
||||
"resession.nvim": { "branch": "master", "commit": "e087ebeef81df25a12fcc4ec067ca73e2bb54c4a" },
|
||||
"screenkey.nvim": { "branch": "main", "commit": "a96a13fede30bba0b37f6a87cb0a2cdd1679e422" },
|
||||
"statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "a46780830b576049c675680650f773bedfa8677a" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
|
||||
"termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" },
|
||||
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "1420fb9e07b1d80cc6d87e7d90827fb2c1109cb3" },
|
||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" },
|
||||
"transparent.nvim": { "branch": "main", "commit": "2c78d94448b534c35ca1d88a3bae90b1cd1a3d4d" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
|
||||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "0f51d8de368c8c6220973e8acd156d17da746f4c" },
|
||||
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "53bba6bb8342de9cbdafc82142a9b5e82008d858" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
-- 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', {
|
||||
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,
|
||||
}
|
||||
)
|
||||
|
||||
-- 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,
|
||||
})
|
||||
|
||||
-- resize neovim split when terminal is resized
|
||||
vim.api.nvim_command('autocmd VimResized * wincmd =')
|
||||
@@ -0,0 +1,73 @@
|
||||
local fn = vim.fn
|
||||
local api = vim.api
|
||||
local ns_id = vim.api.nvim_create_namespace('md-codeblaock')
|
||||
local M = {}
|
||||
|
||||
vim.cmd([[
|
||||
hi DError guibg=#2F1D29 guifg=#EB4838
|
||||
hi DBError guibg=#2F1D29
|
||||
hi DWarn guibg=#322425 guifg=#FA9535
|
||||
hi DBWarn guibg=#322425
|
||||
]])
|
||||
|
||||
function get_hl_group_bg_color(hl_group)
|
||||
local hl_info = vim.api.nvim_get_hl_by_name(hl_group, true)
|
||||
if hl_info and hl_info.background then
|
||||
local bg_color = string.format('#%06x', hl_info.background)
|
||||
return bg_color
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function hl_line(bufnr, line, hl, vtext)
|
||||
local text = string.rep(' ', fn.winwidth(fn.bufwinnr(bufnr)))
|
||||
local opts = {
|
||||
virt_text = { { ' ' .. vtext .. text, hl.vig } },
|
||||
hl_eol = true,
|
||||
virt_text_pos = 'overlay',
|
||||
}
|
||||
api.nvim_buf_add_highlight(bufnr, ns_id, hl.gui, line, 0, -1)
|
||||
pcall(api.nvim_buf_set_extmark, bufnr, ns_id, line, fn.len(fn.getline(line + 1)), opts)
|
||||
end
|
||||
|
||||
function show_diag(bufnr, level, message, lnum)
|
||||
local hl = {
|
||||
[1] = {
|
||||
gui = 'DBError',
|
||||
vig = 'DError',
|
||||
},
|
||||
[2] = {
|
||||
gui = 'DBWarn',
|
||||
vig = 'DWarn',
|
||||
},
|
||||
[3] = {
|
||||
gui = 'DBWarn',
|
||||
vig = 'DWarn',
|
||||
},
|
||||
[4] = {
|
||||
gui = 'DBWarn',
|
||||
vig = 'DWarn',
|
||||
},
|
||||
[5] = {
|
||||
gui = 'DBWarn',
|
||||
vig = 'DWarn',
|
||||
},
|
||||
}
|
||||
hl_line(bufnr, lnum, hl[level], message)
|
||||
end
|
||||
|
||||
vim.lsp.handlers['textDocument/publishDiagnostics'] = function(_, result, ctx, _)
|
||||
if not result.diagnostics then
|
||||
return
|
||||
end
|
||||
local bufnr = vim.uri_to_bufnr(result.uri)
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, ns_id, 0, -1)
|
||||
for _, diagnostic in ipairs(result.diagnostics) do
|
||||
local line = diagnostic.range.start.line
|
||||
local severity = diagnostic.severity
|
||||
local message = diagnostic.message
|
||||
show_diag(bufnr, severity, message, line)
|
||||
end
|
||||
end
|
||||
return M
|
||||
@@ -0,0 +1,158 @@
|
||||
return {
|
||||
kind = {
|
||||
Array = '',
|
||||
Boolean = '',
|
||||
Class = '',
|
||||
Color = '',
|
||||
Constant = '',
|
||||
Constructor = '',
|
||||
Enum = '',
|
||||
EnumMember = '',
|
||||
Event = '',
|
||||
Field = '',
|
||||
File = '',
|
||||
Folder = '',
|
||||
Function = '',
|
||||
Interface = '',
|
||||
Key = '',
|
||||
Keyword = '',
|
||||
Method = '',
|
||||
-- Module = " ",
|
||||
Module = '',
|
||||
Namespace = '',
|
||||
Null = '',
|
||||
Number = '',
|
||||
Object = '',
|
||||
Operator = '',
|
||||
Package = '',
|
||||
Property = '',
|
||||
Reference = '',
|
||||
Snippet = '',
|
||||
String = '',
|
||||
Struct = '',
|
||||
Text = '',
|
||||
TypeParameter = '',
|
||||
Unit = '',
|
||||
Value = '',
|
||||
Variable = '',
|
||||
},
|
||||
git = {
|
||||
LineAdded = '',
|
||||
LineModified = '',
|
||||
LineRemoved = '',
|
||||
FileDeleted = '',
|
||||
FileIgnored = '◌',
|
||||
FileRenamed = '',
|
||||
FileStaged = 'S',
|
||||
FileUnmerged = '',
|
||||
FileUnstaged = '',
|
||||
FileUntracked = 'U',
|
||||
Diff = '',
|
||||
Repo = '',
|
||||
Octoface = '',
|
||||
Copilot = '',
|
||||
Branch = '',
|
||||
},
|
||||
ui = {
|
||||
ArrowCircleDown = '',
|
||||
ArrowCircleLeft = '',
|
||||
ArrowCircleRight = '',
|
||||
ArrowCircleUp = '',
|
||||
BoldArrowDown = '',
|
||||
BoldArrowLeft = '',
|
||||
BoldArrowRight = '',
|
||||
BoldArrowUp = '',
|
||||
BoldClose = '',
|
||||
BoldDividerLeft = '',
|
||||
BoldDividerRight = '',
|
||||
BoldLineLeft = '▎',
|
||||
BoldLineMiddle = '┃',
|
||||
BoldLineDashedMiddle = '┋',
|
||||
BookMark = '',
|
||||
BoxChecked = '',
|
||||
Bug = '',
|
||||
Stacks = '',
|
||||
Scopes = '',
|
||||
Watches = '',
|
||||
DebugConsole = '',
|
||||
Calendar = '',
|
||||
Check = '',
|
||||
ChevronRight = '',
|
||||
ChevronShortDown = '',
|
||||
ChevronShortLeft = '',
|
||||
ChevronShortRight = '',
|
||||
ChevronShortUp = '',
|
||||
Circle = '',
|
||||
Close = '',
|
||||
CloudDownload = '',
|
||||
Code = '',
|
||||
Comment = '',
|
||||
Dashboard = '',
|
||||
DividerLeft = '',
|
||||
DividerRight = '',
|
||||
DoubleChevronRight = '»',
|
||||
Ellipsis = '',
|
||||
EmptyFolder = '',
|
||||
EmptyFolderOpen = '',
|
||||
File = '',
|
||||
FileSymlink = '',
|
||||
Files = '',
|
||||
FindFile = '',
|
||||
FindText = '',
|
||||
Fire = '',
|
||||
Folder = '',
|
||||
FolderOpen = '',
|
||||
FolderSymlink = '',
|
||||
Forward = '',
|
||||
Gear = '',
|
||||
History = '',
|
||||
Lightbulb = '',
|
||||
LineLeft = '▏',
|
||||
LineMiddle = '│',
|
||||
List = '',
|
||||
Lock = '',
|
||||
NewFile = '',
|
||||
Note = '',
|
||||
Package = '',
|
||||
Pencil = '',
|
||||
Plus = '',
|
||||
Project = '',
|
||||
Search = '',
|
||||
SignIn = '',
|
||||
SignOut = '',
|
||||
Tab = '',
|
||||
Table = '',
|
||||
Target = '',
|
||||
Telescope = '',
|
||||
Text = '',
|
||||
Tree = '',
|
||||
Triangle = '',
|
||||
TriangleShortArrowDown = '',
|
||||
TriangleShortArrowLeft = '',
|
||||
TriangleShortArrowRight = '',
|
||||
TriangleShortArrowUp = '',
|
||||
},
|
||||
diagnostics = {
|
||||
BoldError = '',
|
||||
Error = '',
|
||||
BoldWarning = '',
|
||||
Warn = '',
|
||||
BoldInformation = '',
|
||||
Info = '',
|
||||
BoldQuestion = '',
|
||||
Question = '',
|
||||
BoldHint = '',
|
||||
Hint = '',
|
||||
Debug = '',
|
||||
Trace = '✎',
|
||||
},
|
||||
misc = {
|
||||
Robot = '',
|
||||
Squirrel = '',
|
||||
Tag = '',
|
||||
Watch = '',
|
||||
Smiley = '',
|
||||
Package = '',
|
||||
CircuitBoard = '',
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
-- Increment / Decrement
|
||||
vim.keymap.set('n', '+', '<C-a>')
|
||||
vim.keymap.set('n', '-', '<C-x>')
|
||||
|
||||
-- Select all
|
||||
vim.keymap.set('n', '<C-a>', 'gg<S-v>G')
|
||||
|
||||
-- Replace currently selected text with default register without yanking it
|
||||
vim.keymap.set('x', '<leader>p', '"_dP')
|
||||
|
||||
-- Delete without yanking
|
||||
vim.keymap.set('n', '<leader>d', '"_d', { desc = 'Delete highlighted text' })
|
||||
vim.keymap.set('v', '<leader>d', '"_d', { desc = 'Delete highlighted text' })
|
||||
|
||||
-- save file
|
||||
vim.keymap.set('n', '<leader>w', ':w<CR>', { desc = 'Save file' })
|
||||
|
||||
-- save and quit
|
||||
vim.keymap.set('n', '<leader>Q', '<cmd>wq!<CR>', { desc = 'Force save and quit' })
|
||||
|
||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
vim.keymap.set('n', '<A-Up>', '<cmd>resize +2<cr>', { desc = 'Increase Window Height' })
|
||||
vim.keymap.set('n', '<A-Down>', '<cmd>resize -2<cr>', { desc = 'Decrease Window Height' })
|
||||
vim.keymap.set('n', '<A-Left>', '<cmd>vertical resize -2<cr>', { desc = 'Decrease Window Width' })
|
||||
vim.keymap.set('n', '<A-Right>', '<cmd>vertical resize +2<cr>', { desc = 'Increase Window Width' })
|
||||
|
||||
-- Visual vim.keymap.sets
|
||||
vim.keymap.set('v', '<leader>r', '"hy:%s/<C-r>h//g<left><left>') -- Replace all instances of highlighted words
|
||||
vim.keymap.set('v', '<A-s>', ':sort<CR>') -- Sort highlighted text in visual mode with Control+S
|
||||
vim.keymap.set('v', 'K', ":m '>-2<CR>gv=gv") -- Move current line up
|
||||
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv") -- Move current line down
|
||||
|
||||
-- for buffers
|
||||
vim.api.nvim_set_keymap('n', '<Tab>', ':bnext<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<S-Tab>', ':bprev<CR>', { noremap = true, silent = true })
|
||||
|
||||
--utility vim.keymap.setpings
|
||||
vim.keymap.set('n', 'n', 'nzzzv') -- keep the cursor centered when doing 'n'
|
||||
vim.keymap.set('n', 'N', 'Nzzzv') -- keep the cursor centered when doing 'N'
|
||||
vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Join line without moving the cursor' })
|
||||
vim.keymap.set('n', 'cn', '*``cgn', { desc = 'Change next match by pressing dot (.)' })
|
||||
vim.keymap.set('n', 'cN', '*``cgN', { desc = 'Change previous match by pressing dot (.)' })
|
||||
vim.keymap.set('n', '<leader>vp', '`[v`]<CR>', { desc = 'Select pasted text' })
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz', { desc = 'Scroll down' })
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz', { desc = 'Scroll up' })
|
||||
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y', { desc = 'Copy to system clipboard' })
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
|
||||
|
||||
vim.keymap.set({ 'i' }, '<C-l>', '<Right>', { desc = 'Move cursor to right' })
|
||||
vim.keymap.set({ 'i' }, '<C-h>', '<Left>', { desc = 'Move cursor to right' })
|
||||
|
||||
-- Better window management
|
||||
vim.keymap.set('n', 'vs', ':vsp<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', 'hs', ':sp<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to left split' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to below split' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Move to above split' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Move to right split' })
|
||||
vim.keymap.set('n', '<A-Up>', '<cmd>resize -2<CR>', { desc = 'Resize split up' })
|
||||
vim.keymap.set('n', '<A-Down>', '<cmd>resize +2<CR>', { desc = 'Resize split down' })
|
||||
vim.keymap.set('n', '<A-Left>', '<cmd>vertical resize -2<CR>', { desc = 'Resize split left' })
|
||||
vim.keymap.set('n', '<A-Right>', '<cmd>vertical resize +2<CR>', { desc = 'Resize split right' })
|
||||
|
||||
-- Stay in indent mode
|
||||
vim.keymap.set('v', '<', '<gv', { desc = '(V) Indent to left' })
|
||||
vim.keymap.set('v', '>', '>gv', { desc = '(V) Indent to right' })
|
||||
|
||||
vim.keymap.set('n', '<Leader>lo', '<cmd>lopen<CR>', { desc = 'Open location list' })
|
||||
vim.keymap.set('n', '<Leader>lc', '<cmd>lclose<CR>', { desc = 'Close location list' })
|
||||
vim.keymap.set('n', '<Leader>ln', '<cmd>lnext<CR>', { desc = 'Next location list item' })
|
||||
vim.keymap.set('n', '<Leader>lp', '<cmd>lprev<CR>', { desc = 'Previous location list item' })
|
||||
|
||||
-- insert semicolon in the end
|
||||
vim.keymap.set('i', '<A-;>', '<Esc>miA;<Esc>`ii', { desc = 'insert semicolon in the end' })
|
||||
|
||||
-- Change text without putting it into the vim register,
|
||||
vim.keymap.set({ 'n', 'x' }, 'c', '"_c', { desc = 'Change without yanking' })
|
||||
vim.keymap.set({ 'n', 'x' }, 'C', '"_C', { desc = 'Change without yanking' })
|
||||
vim.keymap.set({ 'n', 'x' }, 'cc', '"_cc', { desc = 'Change without yanking' })
|
||||
vim.keymap.set({ 'n', 'x' }, 'x', '"_x', { desc = 'delete without yanking' })
|
||||
|
||||
-- Better escape using jk in insert and terminal mode
|
||||
vim.keymap.set('i', 'jk', '<ESC>')
|
||||
vim.keymap.set('i', 'kj', '<ESC>')
|
||||
vim.keymap.set('i', 'jj', '<ESC>')
|
||||
|
||||
-- Terminal Mappings
|
||||
vim.keymap.set('t', 'jk', '<C-\\><C-n>')
|
||||
vim.keymap.set('t', 'kj', '<C-\\><C-n>')
|
||||
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>')
|
||||
@@ -0,0 +1,76 @@
|
||||
-- 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
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup({
|
||||
spec = {
|
||||
{ import = 'plugins' },
|
||||
},
|
||||
install = {
|
||||
missing = true,
|
||||
colorscheme = { 'onedark' },
|
||||
},
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
ui = {
|
||||
icons = {
|
||||
ft = '',
|
||||
lazy = ' ',
|
||||
loaded = '',
|
||||
not_loaded = '',
|
||||
},
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,59 @@
|
||||
--Remap space as leader key
|
||||
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 = ' ',
|
||||
})
|
||||
|
||||
vim.opt.shortmess:append('c')
|
||||
|
||||
vim.cmd('set whichwrap+=<,>,[,],h,l')
|
||||
vim.cmd([[set iskeyword+=-]])
|
||||
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_mouse = 2
|
||||
@@ -210,69 +210,74 @@ map('i', 'kj', '<ESC>')
|
||||
map('i', 'jj', '<ESC>')
|
||||
|
||||
-- Terminal Mappings
|
||||
map("t", "jk", "<C-\\><C-n>")
|
||||
map("t", "kj", "<C-\\><C-n>")
|
||||
map("t", "<ESC>", "<C-\\><C-n>")
|
||||
map('t', 'jk', '<C-\\><C-n>')
|
||||
map('t', 'kj', '<C-\\><C-n>')
|
||||
map('t', '<ESC>', '<C-\\><C-n>')
|
||||
|
||||
-- Move with shift-arrows
|
||||
map("n", "<S-Left>", "<C-w><S-h>", {
|
||||
desc = "Move window to the left"
|
||||
map('n', '<S-Left>', '<C-w><S-h>', {
|
||||
desc = 'Move window to the left',
|
||||
})
|
||||
map("n", "<S-Down>", "<C-w><S-j>", {
|
||||
desc = "Move window down"
|
||||
map('n', '<S-Down>', '<C-w><S-j>', {
|
||||
desc = 'Move window down',
|
||||
})
|
||||
map("n", "<S-Up>", "<C-w><S-k>", {
|
||||
desc = "Move window up"
|
||||
map('n', '<S-Up>', '<C-w><S-k>', {
|
||||
desc = 'Move window up',
|
||||
})
|
||||
map("n", "<S-Right>", "<C-w><S-l>", {
|
||||
desc = "Move window to the right"
|
||||
map('n', '<S-Right>', '<C-w><S-l>', {
|
||||
desc = 'Move window to the right',
|
||||
})
|
||||
|
||||
-- Search
|
||||
map({
|
||||
"n",
|
||||
"x"
|
||||
}, "gw", "*N", {
|
||||
desc = "Search word under cursor"
|
||||
})
|
||||
map(
|
||||
{
|
||||
'n',
|
||||
'x',
|
||||
},
|
||||
'gw',
|
||||
'*N',
|
||||
{
|
||||
desc = 'Search word under cursor',
|
||||
}
|
||||
)
|
||||
|
||||
-- Some cool remaps
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
map("n", "J", "mzJ`z")
|
||||
map("n", "}", "}zzzv")
|
||||
map("n", "{", "{zzzv")
|
||||
map("n", "g,", "g,zvzz")
|
||||
map("n", "g;", "g;zvzz")
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
map("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "^", "g^")
|
||||
map("n", "0", "g0")
|
||||
map('n', 'n', 'nzzzv')
|
||||
map('n', 'N', 'Nzzzv')
|
||||
map('n', 'J', 'mzJ`z')
|
||||
map('n', '}', '}zzzv')
|
||||
map('n', '{', '{zzzv')
|
||||
map('n', 'g,', 'g,zvzz')
|
||||
map('n', 'g;', 'g;zvzz')
|
||||
map('n', '<C-d>', '<C-d>zz')
|
||||
map('n', '<C-u>', '<C-u>zz')
|
||||
map('n', '^', 'g^')
|
||||
map('n', '0', 'g0')
|
||||
-- Do not include white space characters when using $ in visual mode,
|
||||
map("x", "$", "g_")
|
||||
map('x', '$', 'g_')
|
||||
-- Always use very magic mode for searching
|
||||
map("n", "/", [[/\v]])
|
||||
map('n', '/', [[/\v]])
|
||||
|
||||
-- Add undo break-points
|
||||
map("i", "?", "?<c-g>u")
|
||||
map("i", "!", "!<c-g>u")
|
||||
map("i", ",", ",<c-g>u")
|
||||
map("i", ".", ".<c-g>u")
|
||||
map("i", ";", ";<c-g>u")
|
||||
map('i', '?', '?<c-g>u')
|
||||
map('i', '!', '!<c-g>u')
|
||||
map('i', ',', ',<c-g>u')
|
||||
map('i', '.', '.<c-g>u')
|
||||
map('i', ';', ';<c-g>u')
|
||||
|
||||
-- compromised backward search when comma is being used as localleader
|
||||
map("n", "<A-,>", ",")
|
||||
map('n', '<A-,>', ',')
|
||||
|
||||
-- Better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ 'n', 'x' }, 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ 'n', 'x' }, '<Down>', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ 'n', 'x' }, 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ 'n', 'x' }, '<Up>', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- Move text up and down
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
|
||||
map("v", "<A-k>", ":m '<-4<cr>gv=gv", { desc = "Move Up" })
|
||||
map('n', '<A-j>', '<cmd>m .+1<cr>==', { desc = 'Move Down' })
|
||||
map('n', '<A-k>', '<cmd>m .-2<cr>==', { desc = 'Move Up' })
|
||||
map('i', '<A-j>', '<esc><cmd>m .+1<cr>==gi', { desc = 'Move Down' })
|
||||
map('i', '<A-k>', '<esc><cmd>m .-2<cr>==gi', { desc = 'Move Up' })
|
||||
map('v', '<A-j>', ":m '>+1<cr>gv=gv", { desc = 'Move Down' })
|
||||
map('v', '<A-k>', ":m '<-4<cr>gv=gv", { desc = 'Move Up' })
|
||||
@@ -1,80 +0,0 @@
|
||||
-- File Explorer
|
||||
vim.keymap.set('n', '<leader>n', ':Neotree filesystem reveal left toggle<CR>')
|
||||
|
||||
-- Telescope
|
||||
vim.keymap.set('n', '<leader>ff', ':Telescope find_files<CR>')
|
||||
vim.keymap.set('n', '<leader>tc', ':Telescope colorscheme<CR>')
|
||||
vim.keymap.set('n', '<leader>of', ':Telescope oldfiles<CR>')
|
||||
vim.keymap.set('n', '<leader>tl', ':Telescope live_grep<CR>')
|
||||
vim.keymap.set('n', '<leader>km', ':Telescope keymaps<CR>')
|
||||
vim.keymap.set('n', '<leader>tf', function()
|
||||
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({
|
||||
previewer = false,
|
||||
}))
|
||||
end)
|
||||
|
||||
-- formatter
|
||||
vim.keymap.set('n', '<leader>ft', vim.lsp.buf.format, {})
|
||||
|
||||
-- buffer
|
||||
vim.keymap.set('n', '<tab>', ':BufferNext<CR>')
|
||||
vim.keymap.set('n', '<S-tab>', ':BufferPrevious<CR>')
|
||||
vim.keymap.set('n', '<leader>q', ':BufferClose<CR>')
|
||||
|
||||
-- comment
|
||||
vim.keymap.set('n', '<leader>/', 'gcc', { remap = true })
|
||||
|
||||
-- terminal
|
||||
vim.keymap.set('n', '<leader>tv', ':Vterm<CR>') -- Vertical terminal
|
||||
vim.keymap.set('n', '<leader>th', ':Sterm<CR>') -- Horizontal terminal
|
||||
vim.keymap.set('n', '<leader>tf', ':Fterm<CR>') -- Floating terminal
|
||||
|
||||
-- File Explorer
|
||||
vim.keymap.set('n', '<leader>e', function()
|
||||
require('oil').toggle_float()
|
||||
end)
|
||||
|
||||
-- Primeagen Refactoring
|
||||
-- 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")
|
||||
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
vim.keymap.set({ 'i', 'n' }, '<esc>', '<cmd>noh<cr><esc>', { desc = 'Escape and clear hlsearch' })
|
||||
|
||||
-- Navigator
|
||||
vim.keymap.set('n', '<C-h>', '<cmd>NavigatorLeft<cr>', { desc = 'Move Left' })
|
||||
vim.keymap.set('n', '<C-j>', '<cmd>NavigatorDown<cr>', { desc = 'Move Down' })
|
||||
vim.keymap.set('n', '<C-k>', '<cmd>NavigatorUp<cr>', { desc = 'Move Up' })
|
||||
vim.keymap.set('n', '<C-l>', '<cmd>NavigatorRight<cr>', { desc = 'Move Right' })
|
||||
vim.keymap.set('n', '<C-\\>', '<cmd>NavigatorPrevious<cr>', { desc = 'Previous Panel' })
|
||||
|
||||
-- Move with shift-arrows
|
||||
vim.keymap.set('n', '<S-Left>', '<C-w><S-h>', {
|
||||
desc = 'Move window to the left',
|
||||
})
|
||||
vim.keymap.set('n', '<S-Down>', '<C-w><S-j>', {
|
||||
desc = 'Move window down',
|
||||
})
|
||||
vim.keymap.set('n', '<S-Up>', '<C-w><S-k>', {
|
||||
desc = 'Move window up',
|
||||
})
|
||||
vim.keymap.set('n', '<S-Right>', '<C-w><S-l>', {
|
||||
desc = 'Move window to the right',
|
||||
})
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
vim.keymap.set('n', '<C-Up>', '<cmd>resize +2<cr>', { desc = 'Increase Window Height' })
|
||||
vim.keymap.set('n', '<C-Down>', '<cmd>resize -2<cr>', { desc = 'Decrease Window Height' })
|
||||
vim.keymap.set('n', '<C-Left>', '<cmd>vertical resize -2<cr>', { desc = 'Decrease Window Width' })
|
||||
vim.keymap.set('n', '<C-Right>', '<cmd>vertical resize +2<cr>', { desc = 'Increase Window Width' })
|
||||
|
||||
-- clear notification
|
||||
vim.keymap.set('n', '<leader>mu', function()
|
||||
require('notify').dismiss({ silent = true, pending = true })
|
||||
end, { desc = 'Dismiss All Notifications' })
|
||||
@@ -1,20 +0,0 @@
|
||||
return {
|
||||
-- Markdown Preview
|
||||
{
|
||||
'wallpants/github-preview.nvim',
|
||||
cmd = { 'GithubPreviewToggle' },
|
||||
keys = { '<leader>mpt' },
|
||||
opts = {
|
||||
-- config goes here
|
||||
},
|
||||
config = function(_, opts)
|
||||
local gpreview = require('github-preview')
|
||||
gpreview.setup(opts)
|
||||
|
||||
local fns = gpreview.fns
|
||||
vim.keymap.set('n', '<leader>mpt', fns.toggle)
|
||||
vim.keymap.set('n', '<leader>mps', fns.single_file_toggle)
|
||||
vim.keymap.set('n', '<leader>mpd', fns.details_tags_toggle)
|
||||
end,
|
||||
},
|
||||
}
|
||||
+40
-40
@@ -1,11 +1,9 @@
|
||||
--- @type LazyPluginSpec
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
'goolord/alpha-nvim',
|
||||
event = 'VimEnter',
|
||||
opts = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
require("alpha.term")
|
||||
local dashboard = require('alpha.themes.dashboard')
|
||||
require('alpha.term')
|
||||
local arttoggle = false
|
||||
|
||||
local logo = {
|
||||
@@ -21,23 +19,23 @@ return {
|
||||
|
||||
local art = {
|
||||
-- { name, width, height }
|
||||
{ "tohru", 62, 17 },
|
||||
{ 'tohru', 62, 17 },
|
||||
}
|
||||
|
||||
if arttoggle == true then
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
dashboard.section.terminal.opts.redraw = true
|
||||
local path = vim.fn.stdpath("config") .. "/assets/"
|
||||
local path = vim.fn.stdpath('config') .. '/assets/'
|
||||
-- local random = math.random(1, #art)
|
||||
local currentart = art[1]
|
||||
dashboard.section.terminal.command = "cat " .. path .. currentart[1]
|
||||
dashboard.section.terminal.command = 'cat ' .. path .. currentart[1]
|
||||
|
||||
dashboard.section.terminal.width = currentart[2]
|
||||
dashboard.section.terminal.height = currentart[3]
|
||||
|
||||
dashboard.opts.layout = {
|
||||
dashboard.section.terminal,
|
||||
{ type = "padding", val = 2 },
|
||||
{ type = 'padding', val = 2 },
|
||||
dashboard.section.buttons,
|
||||
dashboard.section.footer,
|
||||
}
|
||||
@@ -45,55 +43,57 @@ return {
|
||||
dashboard.section.header.val = logo
|
||||
end
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("ff", " " .. " Find files", ":Telescope find_files <CR>"),
|
||||
dashboard.button("of", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("l", " " .. " Lazy", ":Lazy <CR>"),
|
||||
dashboard.button("q", " " .. " Quit", ":q <CR>"),
|
||||
dashboard.button('n', ' ' .. ' New File', '<cmd>ene<CR>'),
|
||||
dashboard.button('e', ' ' .. ' File Tree', ':Telescope file_browser <CR>'),
|
||||
dashboard.button('f', ' ' .. ' Find files', ':Telescope find_files <CR>'),
|
||||
dashboard.button('o', ' ' .. ' Recent files', ':Telescope oldfiles <CR>'),
|
||||
dashboard.button('l', ' ' .. ' Lazy', ':Lazy <CR>'),
|
||||
dashboard.button('q', ' ' .. ' Quit', ':q <CR>'),
|
||||
}
|
||||
for _, button in ipairs(dashboard.section.buttons.val) do
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
button.opts.hl = 'AlphaButtons'
|
||||
button.opts.hl_shortcut = 'AlphaShortcut'
|
||||
end
|
||||
dashboard.section.header.opts.hl = "Function"
|
||||
dashboard.section.buttons.opts.hl = "Identifier"
|
||||
dashboard.section.footer.opts.hl = "Function"
|
||||
dashboard.section.header.opts.hl = 'Function'
|
||||
dashboard.section.buttons.opts.hl = 'Identifier'
|
||||
dashboard.section.footer.opts.hl = 'Function'
|
||||
dashboard.opts.layout[1].val = 4
|
||||
return dashboard
|
||||
end,
|
||||
config = function(_, dashboard)
|
||||
if vim.o.filetype == "lazy" then
|
||||
if vim.o.filetype == 'lazy' then
|
||||
vim.cmd.close()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AlphaReady",
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'AlphaReady',
|
||||
callback = function()
|
||||
require("lazy").show()
|
||||
require('lazy').show()
|
||||
end,
|
||||
})
|
||||
end
|
||||
require("alpha").setup(dashboard.opts)
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimStarted",
|
||||
require('alpha').setup(dashboard.opts)
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'LazyVimStarted',
|
||||
callback = function()
|
||||
local v = vim.version()
|
||||
local dev = ""
|
||||
if v.prerelease == "dev" then
|
||||
dev = "-dev+" .. v.build
|
||||
local dev = ''
|
||||
if v.prerelease == 'dev' then
|
||||
dev = '-dev+' .. v.build
|
||||
else
|
||||
dev = ""
|
||||
dev = ''
|
||||
end
|
||||
local version = v.major .. "." .. v.minor .. "." .. v.patch .. dev
|
||||
local stats = require("lazy").stats()
|
||||
local plugins_count = stats.loaded .. "/" .. stats.count
|
||||
local version = v.major .. '.' .. v.minor .. '.' .. v.patch .. dev
|
||||
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 = " " .. version
|
||||
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 = ' ' .. version
|
||||
|
||||
local line1_width = vim.fn.strdisplaywidth(line1)
|
||||
local line2Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
|
||||
local line3Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
|
||||
local line2Padded = string.rep(' ', (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
|
||||
local line3Padded = string.rep(' ', (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
|
||||
|
||||
dashboard.section.footer.val = {
|
||||
line1,
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
-- autopairing of (){}[] etc
|
||||
return {
|
||||
'altermo/ultimate-autopair.nvim',
|
||||
event = { 'InsertEnter', 'CmdlineEnter' },
|
||||
branch = 'v0.6',
|
||||
opts = {},
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
enabled = false,
|
||||
config = function(_, opts)
|
||||
require('nvim-autopairs').setup(opts)
|
||||
|
||||
-- setup cmp for autopairs
|
||||
-- If you want insert `(` after select function or method item
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
require('cmp').event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
return {
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'lewis6991/gitsigns.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('barbar').setup()
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
'utilyre/barbecue.nvim',
|
||||
name = 'barbecue',
|
||||
version = '*',
|
||||
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'SmiteshP/nvim-navic',
|
||||
'nvim-tree/nvim-web-devicons', -- optional dependency
|
||||
},
|
||||
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',
|
||||
|
||||
-- include this if you have set `show_modified` to `true`
|
||||
-- "BufModifiedSet",
|
||||
}, {
|
||||
group = vim.api.nvim_create_augroup('barbecue.updater', {}),
|
||||
callback = function()
|
||||
require('barbecue.ui').update()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'famiu/bufdelete.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
init = function()
|
||||
vim.keymap.set('n', '<leader>q', function()
|
||||
require('bufdelete').bufdelete(0, false)
|
||||
end, { silent = true, desc = 'Quit Buffer' })
|
||||
end,
|
||||
}
|
||||
@@ -3,22 +3,21 @@ return {
|
||||
event = 'InsertEnter',
|
||||
cmd = 'Codeium',
|
||||
build = 'Codeium Auth:',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'hrsh7th/nvim-cmp',
|
||||
},
|
||||
|
||||
config = function()
|
||||
vim.keymap.set('i', '<C-g>', function()
|
||||
vim.keymap.set('i', '<M-CR>', function()
|
||||
return vim.fn['codeium#Accept']()
|
||||
end, { expr = true, silent = true })
|
||||
vim.keymap.set('i', '<c-;>', function()
|
||||
vim.keymap.set("n", "<leader>c", 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, { expr = true, silent = true })
|
||||
vim.keymap.set('i', '<c-,>', function()
|
||||
vim.keymap.set('i', '<M-[,>', function()
|
||||
return vim.fn['codeium#CycleCompletions'](-1)
|
||||
end, { expr = true, silent = true })
|
||||
vim.keymap.set('i', '<c-x>', function()
|
||||
vim.keymap.set('i', '<M-c>', function()
|
||||
return vim.fn['codeium#Clear']()
|
||||
end, { expr = true, silent = true })
|
||||
end,
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
return {
|
||||
'willothy/nvim-cokeline',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim', -- Required for v0.4.0+
|
||||
'nvim-tree/nvim-web-devicons', -- If you want devicons
|
||||
'stevearc/resession.nvim', -- Optional, for persistent history
|
||||
},
|
||||
config = function()
|
||||
local get_hex = require('cokeline.hlgroups').get_hl_attr
|
||||
|
||||
local yellow = vim.g.terminal_color_3
|
||||
|
||||
require('cokeline').setup({
|
||||
default_hl = {
|
||||
fg = function(buffer)
|
||||
return buffer.is_focused and get_hex('Normal', 'fg') or get_hex('Comment', 'fg')
|
||||
end,
|
||||
bg = function()
|
||||
return get_hex('ColorColumn', 'bg')
|
||||
end,
|
||||
},
|
||||
|
||||
sidebar = {
|
||||
filetype = { 'NvimTree', 'neo-tree' },
|
||||
components = {
|
||||
{
|
||||
text = function(buf)
|
||||
-- Center the text by adding padding spaces
|
||||
local total_width = vim.api.nvim_win_get_width(0)
|
||||
local padding = math.floor((total_width - #buf.filetype) / 2)
|
||||
return string.rep(' ', padding) .. buf.filetype .. string.rep(' ', padding)
|
||||
end,
|
||||
fg = yellow,
|
||||
bg = function()
|
||||
return get_hex('NvimTreeNormal', 'bg')
|
||||
end,
|
||||
bold = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
components = {
|
||||
{
|
||||
text = function(buffer)
|
||||
return (buffer.index ~= 1) and '▏' or ''
|
||||
end,
|
||||
},
|
||||
{
|
||||
text = ' ',
|
||||
},
|
||||
{
|
||||
text = function(buffer)
|
||||
return buffer.devicon.icon
|
||||
end,
|
||||
fg = function(buffer)
|
||||
return buffer.devicon.color
|
||||
end,
|
||||
},
|
||||
{
|
||||
text = ' ',
|
||||
},
|
||||
{
|
||||
text = function(buffer)
|
||||
return buffer.filename .. ' '
|
||||
end,
|
||||
bold = function(buffer)
|
||||
return buffer.is_focused
|
||||
end,
|
||||
},
|
||||
{
|
||||
text = '',
|
||||
on_click = function(_, _, _, _, buffer)
|
||||
buffer:delete()
|
||||
end,
|
||||
},
|
||||
{
|
||||
text = ' ',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
return {
|
||||
'navarasu/onedark.nvim',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('onedark').setup({
|
||||
style = 'deep',
|
||||
transparent = true,
|
||||
term_colors = false,
|
||||
ending_tildes = false,
|
||||
cmp_itemkind_reverse = false,
|
||||
-- toggle_style_key = '<leader>ot',
|
||||
-- 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 },
|
||||
})
|
||||
end,
|
||||
}
|
||||
+76
-69
@@ -1,81 +1,88 @@
|
||||
-- configure autocomplete
|
||||
return {
|
||||
{
|
||||
'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' } },
|
||||
},
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
require('luasnip/loaders/from_vscode').lazy_load()
|
||||
|
||||
dependencies = {
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
'onsails/lspkind.nvim',
|
||||
},
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
cmp.setup({
|
||||
completion = {
|
||||
keyword_length = 1,
|
||||
completeopt = 'menu,menuone',
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = { 'kind', 'abbr', 'menu' },
|
||||
format = function(entry, vim_item)
|
||||
local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50 })(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, '%s', { trimempty = true })
|
||||
kind.kind = ' ' .. (strings[1] or '') .. ' '
|
||||
kind.menu = ' (' .. (strings[2] or '') .. ')'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
return kind
|
||||
end,
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(), -- show completion suggestions
|
||||
['<C-e>'] = cmp.mapping.abort(), -- close completion window
|
||||
['<Esc>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
{ name = 'codeium' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol', -- show only symbol annotations
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
-- can also be a function to dynamically calculate max width such as
|
||||
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
|
||||
|
||||
-- The function below will be called before any actual modifications from lspkind
|
||||
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
|
||||
before = function(entry, vim_item)
|
||||
return vim_item
|
||||
end,
|
||||
}),
|
||||
},
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'cmdline' },
|
||||
},
|
||||
})
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
}),
|
||||
cmp.setup.cmdline('/', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' },
|
||||
}, {
|
||||
{ name = 'cmdline' },
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- snippets
|
||||
{ name = 'buffer' }, -- text within current buffer
|
||||
{ name = 'path' }, -- file system paths
|
||||
{ name = 'codeium' }, -- AI for autocompletion
|
||||
-- { name = "nvim_lsp_signature_help" },
|
||||
-- { name = "calc" }, --for maths calculations
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
return {
|
||||
'nvimdev/dashboard-nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
require('dashboard').setup({
|
||||
theme = 'hyper',
|
||||
disable_move = false,
|
||||
shortcut_type = 'letter',
|
||||
change_to_vcs_root = true,
|
||||
hide = {
|
||||
statusline = true,
|
||||
tabline = false,
|
||||
winbar = false,
|
||||
},
|
||||
config = {
|
||||
header = {
|
||||
'',
|
||||
|
||||
' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ',
|
||||
' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ',
|
||||
' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ',
|
||||
' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ',
|
||||
' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ',
|
||||
' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ',
|
||||
'',
|
||||
},
|
||||
weak_header = {
|
||||
enable = false,
|
||||
append = { ' Learn, Make, Explore! ' },
|
||||
},
|
||||
packages = { enable = true },
|
||||
project = { enable = true, limit = 8 },
|
||||
mru = { limit = 8 },
|
||||
shortcut ={
|
||||
{
|
||||
desc = ' Recent files',
|
||||
group = 'Label',
|
||||
action = 'Telescope oldfiles',
|
||||
key = 'r',
|
||||
},
|
||||
{
|
||||
desc = ' Find file',
|
||||
group = 'Label',
|
||||
action = 'Telescope find_files',
|
||||
key = 'f',
|
||||
},
|
||||
{
|
||||
desc = ' Find text',
|
||||
group = 'Label',
|
||||
action = 'Telescope live_grep',
|
||||
key = 't',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
return {
|
||||
{
|
||||
'tpope/vim-dadbod',
|
||||
dependencies = {
|
||||
'kristijanhusak/vim-dadbod-ui',
|
||||
'kristijanhusak/vim-dadbod-completion',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>du', ':DBUIToggle<cr>', desc = 'Toggle DB UI' },
|
||||
{ '<leader>db', ':DBUIFindBuffer<cr>', desc = 'DB Find buffer' },
|
||||
{
|
||||
'<leader>dr',
|
||||
':DBUIRenameBuffer<cr>',
|
||||
desc = 'DB Rename buffer',
|
||||
},
|
||||
{ '<leader>dl', ':DBUILastQueryInfo<cr>', desc = 'DB Last query' },
|
||||
},
|
||||
config = function()
|
||||
local function db_completion()
|
||||
require('plugins.completion.cmp').setup.buffer({
|
||||
sources = { { name = 'vim-dadbod-completion' } },
|
||||
})
|
||||
end
|
||||
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath('config') .. require('plenary.path').path.sep .. 'db_ui'
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {
|
||||
'sql',
|
||||
},
|
||||
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {
|
||||
'sql',
|
||||
'mysql',
|
||||
'plsql',
|
||||
},
|
||||
callback = function()
|
||||
vim.schedule(db_completion)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
cmd = {
|
||||
'DBUIToggle',
|
||||
'DBUI',
|
||||
'DBUIAddConnection',
|
||||
'DBUIFindBuffer',
|
||||
'DBUIRenameBuffer',
|
||||
'DBUILastQueryInfo',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
return {
|
||||
'kndndrj/nvim-dbee',
|
||||
dependencies = {
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
build = function()
|
||||
-- "curl", "wget", "bitsadmin", "go"
|
||||
require('dbee').install(curl)
|
||||
end,
|
||||
cmd = 'DBToggle',
|
||||
enabled = false,
|
||||
|
||||
config = function()
|
||||
require('dbee').setup({
|
||||
sources = {
|
||||
require('dbee.sources').EnvSource:new('NVIM_DB'),
|
||||
-- require("dbee.sources").MemorySource:new({
|
||||
-- {
|
||||
-- name = "dbname",
|
||||
-- type = "postgres",
|
||||
-- url = "postgres://pguser:pguser@localhost:5602/dbname?sslmode=disable"
|
||||
-- },
|
||||
-- }),
|
||||
-- require("dbee.sources").FileSource:new(vim.fn.stdpath("cache") .. "/dbee/config.json"),
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command('DBToggle', function()
|
||||
require('dbee').toggle()
|
||||
end, {})
|
||||
end,
|
||||
}
|
||||
@@ -1,32 +1,5 @@
|
||||
-- Neovim plugin to improve the default vim.ui interfaces
|
||||
return {
|
||||
'stevearc/dressing.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('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,
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'soulis-1256/eagle.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('eagle').setup({})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'folke/flash.nvim',
|
||||
event = { 'CursorHold', 'CursorHoldI' },
|
||||
vscode = true,
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--open files in neovim without creating a nested sessions
|
||||
return {
|
||||
'willothy/flatten.nvim',
|
||||
priority = 1001,
|
||||
opts = {
|
||||
window = {
|
||||
open = 'alternate',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'm-demare/hlargs.nvim',
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'ziontee113/icon-picker.nvim',
|
||||
enabled = true,
|
||||
cmd = { 'IconPickerInsert' },
|
||||
vim.keymap.set('n', '<Leader>se', '<cmd>IconPickerInsert emoji<cr>'),
|
||||
config = function()
|
||||
require('icon-picker').setup({ disable_legacy_commands = true })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Incremental rename
|
||||
return {
|
||||
'smjonas/inc-rename.nvim',
|
||||
cmd = 'IncRename',
|
||||
config = true,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
'nmac427/guess-indent.nvim',
|
||||
enabled = true,
|
||||
config = function()
|
||||
require('guess-indent').setup({})
|
||||
end,
|
||||
event = 'BufReadPost',
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua', -- only load on lua files
|
||||
cmd = 'LazyDev',
|
||||
lazy = true,
|
||||
event = 'LspAttach',
|
||||
opts = {
|
||||
library = {},
|
||||
},
|
||||
},
|
||||
{ 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings
|
||||
}
|
||||
+160
-71
@@ -1,81 +1,170 @@
|
||||
return {
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
cmd = 'Mason',
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'clangd',
|
||||
'pylsp',
|
||||
'bashls',
|
||||
'jsonls',
|
||||
'vimls',
|
||||
'jdtls',
|
||||
'html',
|
||||
'cssls',
|
||||
'tailwindcss',
|
||||
'tsserver',
|
||||
},
|
||||
})
|
||||
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'prettier',
|
||||
'stylua',
|
||||
'clang-format',
|
||||
'black',
|
||||
'gdformat',
|
||||
'djhtml',
|
||||
},
|
||||
})
|
||||
end,
|
||||
'neovim/nvim-lspconfig',
|
||||
lazy = true,
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
{ 'antosha417/nvim-lsp-file-operations', config = true },
|
||||
},
|
||||
config = function()
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require('lspconfig')
|
||||
-- import cmp-nvim-lsp plugin
|
||||
local cmp_nvim_lsp = require('cmp_nvim_lsp')
|
||||
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
local handlers = {
|
||||
['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' }),
|
||||
['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = 'rounded' }),
|
||||
}
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
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 }
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
-- set keybinds
|
||||
opts.desc = 'Show LSP references'
|
||||
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<CR>', opts) -- show definition, references
|
||||
|
||||
opts.desc = 'Go to declaration'
|
||||
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
|
||||
opts.desc = 'Show LSP definitions'
|
||||
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', opts) -- show lsp definitions
|
||||
|
||||
opts.desc = 'Show LSP implementations'
|
||||
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', opts) -- show lsp implementations
|
||||
|
||||
opts.desc = 'Show LSP type definitions'
|
||||
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', opts) -- show lsp type definitions
|
||||
|
||||
opts.desc = 'See available code actions'
|
||||
keymap.set({ 'n', 'v' }, '<leader>ca', 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>rn', vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
opts.desc = 'Show buffer diagnostics'
|
||||
keymap.set('n', '<leader>D', '<cmd>Telescope diagnostics bufnr=0<CR>', opts) -- show diagnostics for file
|
||||
|
||||
opts.desc = 'Show line diagnostics'
|
||||
keymap.set('n', '<leader>d', 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 = 'Restart LSP'
|
||||
keymap.set('n', '<leader>rs', ':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,
|
||||
})
|
||||
-- configure bash server
|
||||
lspconfig['bashls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
-- configure html server
|
||||
lspconfig['html'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
-- configure typescript server with plugin
|
||||
lspconfig['tsserver'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure css server
|
||||
lspconfig['cssls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure tailwindcss server
|
||||
lspconfig['tailwindcss'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- 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,
|
||||
})
|
||||
-- configure python server
|
||||
lspconfig['pyright'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
handlers = handlers,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig.clangd.setup({
|
||||
capabilities = capabilities,
|
||||
handlers = handlers,
|
||||
})
|
||||
lspconfig.gdscript.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.pyright.setup({
|
||||
capabilities = capabilities,
|
||||
handlers = handlers,
|
||||
})
|
||||
lspconfig.tsserver.setup({
|
||||
capabilities = capabilities,
|
||||
handlers = handlers,
|
||||
})
|
||||
end,
|
||||
},
|
||||
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 = '',
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
-- add borders to lsp info window
|
||||
require('lspconfig.ui.windows').default_options.border = 'single'
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
return {
|
||||
'nvimdev/lspsaga.nvim',
|
||||
lazy = true,
|
||||
event = 'LspAttach',
|
||||
config = function()
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ot',
|
||||
'<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,
|
||||
}
|
||||
+193
-29
@@ -1,46 +1,210 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
-- Eviline config for lualine
|
||||
-- Author: shadmansaleh
|
||||
-- Credit: glepnir
|
||||
local lualine = require('lualine')
|
||||
|
||||
-- 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 conditions = {
|
||||
buffer_not_empty = function()
|
||||
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
|
||||
end,
|
||||
hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end,
|
||||
check_git_workspace = function()
|
||||
local filepath = vim.fn.expand('%:p:h')
|
||||
local gitdir = vim.fn.finddir('.git', filepath .. ';')
|
||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
end,
|
||||
}
|
||||
|
||||
-- Config
|
||||
local config = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
-- Disable sections and component separators
|
||||
component_separators = '',
|
||||
section_separators = '',
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
'NeoTree',
|
||||
'NvimTree',
|
||||
'Outline',
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
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 = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
inactive_sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
-- These will be filled later
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
inactive_sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
},
|
||||
}
|
||||
|
||||
-- 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 },
|
||||
},
|
||||
})
|
||||
|
||||
-- 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 '%='
|
||||
end,
|
||||
})
|
||||
|
||||
ins_left({
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = 'No Active Lsp'
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
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, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = ' LSP:',
|
||||
color = { fg = '#ffffff', gui = 'bold' },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
'diff',
|
||||
-- Is it me or the symbol for modified us really weird
|
||||
symbols = { added = ' ', modified = ' ', removed = ' ' },
|
||||
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' },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
function()
|
||||
return '▊'
|
||||
end,
|
||||
color = { fg = colors.blue },
|
||||
padding = { left = 1 },
|
||||
})
|
||||
|
||||
-- Now don't forget to initialize lualine
|
||||
lualine.setup(config)
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
-- snippet plugin
|
||||
return {
|
||||
'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,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
{
|
||||
'iamcco/markdown-preview.nvim',
|
||||
build = 'cd app && yarn install',
|
||||
ft = { 'markdown' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>mp',
|
||||
'<cmd>MarkdownPreviewToggle<CR>',
|
||||
{ desc = 'toggle markdown preview', noremap = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
return {
|
||||
'williamboman/mason.nvim',
|
||||
cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' },
|
||||
dependencies = {
|
||||
{ 'williamboman/mason-lspconfig.nvim', event = { 'BufReadPre', 'BufNewFile' } },
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
config = function()
|
||||
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 = '✗',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
'tsserver',
|
||||
'html',
|
||||
'cssls',
|
||||
'tailwindcss',
|
||||
'svelte',
|
||||
'lua_ls',
|
||||
'pyright',
|
||||
'jdtls',
|
||||
'bashls',
|
||||
'jsonls',
|
||||
'clangd',
|
||||
},
|
||||
})
|
||||
|
||||
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
|
||||
'luacheck',
|
||||
'pylint',
|
||||
'eslint_d',
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
return {
|
||||
{
|
||||
'echasnovski/mini.nvim',
|
||||
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
|
||||
version = false,
|
||||
config = function()
|
||||
require('mini.comment').setup({})
|
||||
require('mini.pairs').setup({})
|
||||
require('mini.move').setup({})
|
||||
require('mini.cursorword').setup()
|
||||
-- require("mini.tabline").setup()
|
||||
local statusline = require('mini.statusline')
|
||||
statusline.setup({ use_icons = true })
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
|
||||
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`
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
'mvllow/modes.nvim',
|
||||
tag = 'v0.2.0',
|
||||
config = function()
|
||||
require('modes').setup({
|
||||
|
||||
colors = {
|
||||
visual = '#f5c359',
|
||||
delete = '#c75c6a',
|
||||
copy = '#78ccc5',
|
||||
insert = '#c5739a',
|
||||
},
|
||||
|
||||
-- Set opacity for cursorline and number background
|
||||
line_opacity = 0.15,
|
||||
|
||||
-- Enable cursor highlights
|
||||
set_cursor = true,
|
||||
|
||||
-- Enable cursorline initially, and disable cursorline for inactive windows
|
||||
-- or ignored filetypes
|
||||
set_cursorline = true,
|
||||
|
||||
-- Enable line number highlights to match cursorline
|
||||
set_number = true,
|
||||
|
||||
-- Disable modes highlights in specified filetypes
|
||||
-- Please PR commonly ignored filetypes
|
||||
ignore_filetypes = { 'NvimTree', 'TelescopePrompt' },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
'bluz71/vim-moonfly-colors',
|
||||
name = 'moonfly',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require('moonfly').custom_colors({
|
||||
bg = '#000000',
|
||||
})
|
||||
vim.cmd([[colorscheme moonfly]])
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
'SmiteshP/nvim-navbuddy',
|
||||
dependencies = {
|
||||
'neovim/nvim-lspconfig',
|
||||
'SmiteshP/nvim-navic',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>nv', '<cmd>Navbuddy<cr>', desc = 'Nav' },
|
||||
},
|
||||
config = function()
|
||||
local actions = require('nvim-navbuddy.actions')
|
||||
local navbuddy = require('nvim-navbuddy')
|
||||
navbuddy.setup({
|
||||
window = {
|
||||
border = 'double',
|
||||
},
|
||||
mappings = {
|
||||
['k'] = actions.next_sibling,
|
||||
['i'] = actions.previous_sibling,
|
||||
['j'] = actions.parent,
|
||||
['l'] = actions.children,
|
||||
},
|
||||
lsp = { auto_attach = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
return {
|
||||
'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,
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.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' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
-- Smooth scrolling neovim plugin written in lua
|
||||
return {
|
||||
'karb94/neoscroll.nvim',
|
||||
event = { 'CursorHold', 'CursorHoldI' },
|
||||
config = function()
|
||||
require('neoscroll').setup({
|
||||
mappings = { -- Keys to be mapped to their corresponding default scrolling animation
|
||||
'<C-u>',
|
||||
'<C-d>',
|
||||
'<C-b>',
|
||||
'<C-f>',
|
||||
'<C-y>',
|
||||
'<C-e>',
|
||||
'zt',
|
||||
'zz',
|
||||
'zb',
|
||||
},
|
||||
hide_cursor = true, -- Hide cursor while scrolling
|
||||
stop_eof = true, -- Stop at <EOF> when scrolling downwards
|
||||
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
|
||||
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
|
||||
easing = 'linear', -- Default easing function
|
||||
pre_hook = nil, -- Function to run before the scrolling animation starts
|
||||
post_hook = nil, -- Function to run after the scrolling animation ends
|
||||
performance_mode = false, -- Disable "Performance Mode" on all buffers.
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
return {
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = { 'haydenmeade/neotest-jest', 'marilari88/neotest-vitest' },
|
||||
cmd = 'Neotest',
|
||||
config = function()
|
||||
require('neotest').setup({
|
||||
status = { virtual_text = true },
|
||||
output = { open_on_run = true },
|
||||
adapters = {
|
||||
require('neotest-vitest'),
|
||||
require('neotest-jest')({
|
||||
jestCommand = 'npm test --',
|
||||
jestConfigFile = 'custom.jest.config.ts',
|
||||
env = { CI = true },
|
||||
cwd = function(path)
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>tw',
|
||||
function()
|
||||
require('neotest').run.run(vim.fn.expand('%'))
|
||||
end,
|
||||
desc = 'Run File',
|
||||
},
|
||||
{
|
||||
'<leader>tT',
|
||||
function()
|
||||
require('neotest').run.run(vim.loop.cwd())
|
||||
end,
|
||||
desc = 'Run All Test Files',
|
||||
},
|
||||
{
|
||||
'<leader>tr',
|
||||
function()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Run Nearest',
|
||||
},
|
||||
{
|
||||
'<leader>ts',
|
||||
function()
|
||||
require('neotest').summary.toggle()
|
||||
end,
|
||||
desc = 'Toggle Summary',
|
||||
},
|
||||
{
|
||||
'<leader>to',
|
||||
function()
|
||||
require('neotest').output.open({ enter = true, auto_close = true })
|
||||
end,
|
||||
desc = 'Show Output',
|
||||
},
|
||||
{
|
||||
'<leader>tO',
|
||||
function()
|
||||
require('neotest').output_panel.toggle()
|
||||
end,
|
||||
desc = 'Toggle Output Panel',
|
||||
},
|
||||
{
|
||||
'<leader>tS',
|
||||
function()
|
||||
require('neotest').run.stop()
|
||||
end,
|
||||
desc = 'Stop',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
-- override nvim ui
|
||||
return {
|
||||
'folke/noice.nvim',
|
||||
event = 'VeryLazy',
|
||||
enabled = true,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'MunifTanjim/nui.nvim',
|
||||
'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 = {
|
||||
-- you can enable a preset by setting it to true, or a table that will override the preset config
|
||||
-- you can also add custom presets that you can enable/disable with enabled=true
|
||||
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
|
||||
},
|
||||
},
|
||||
}
|
||||
+66
-14
@@ -1,18 +1,70 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
'nvimtools/none-ls.nvim', -- configure formatters & linters
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local null_ls = require('null-ls')
|
||||
dependencies = {
|
||||
'jay-babu/mason-null-ls.nvim',
|
||||
},
|
||||
config = function()
|
||||
local mason_null_ls = require('mason-null-ls')
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.gdformat,
|
||||
null_ls.builtins.formatting.djhtml,
|
||||
},
|
||||
})
|
||||
end,
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
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
|
||||
},
|
||||
})
|
||||
|
||||
-- for conciseness
|
||||
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', {})
|
||||
|
||||
-- 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,
|
||||
})
|
||||
end,
|
||||
}
|
||||
+19
-23
@@ -1,26 +1,22 @@
|
||||
return {
|
||||
'rcarriga/nvim-notify',
|
||||
'rcarriga/nvim-notify',
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
vim.notify = require('notify')
|
||||
|
||||
require('notify')('Welcome Back!')
|
||||
require('notify').setup({
|
||||
background_colour = 'Normal',
|
||||
fps = 30,
|
||||
icons = {
|
||||
DEBUG = ' ',
|
||||
ERROR = ' ',
|
||||
INFO = ' ',
|
||||
TRACE = '✎',
|
||||
WARN = ' ',
|
||||
},
|
||||
level = 2,
|
||||
minimum_width = 40,
|
||||
maximum_width = 40,
|
||||
render = 'wrapped-compact',
|
||||
stages = 'slide',
|
||||
timeout = 2000,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>un',
|
||||
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',
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return { 'MunifTanjim/nui.nvim', lazy = true }
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
'nacro90/numb.nvim',
|
||||
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,
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'leoluz/nvim-dap-go',
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'nvim-neotest/nvim-nio',
|
||||
},
|
||||
lazy = true,
|
||||
config = function()
|
||||
require('dap-go').setup()
|
||||
require('dapui').setup()
|
||||
local dap = require('dap')
|
||||
local keymap = vim.keymap
|
||||
local dapui = require('dapui')
|
||||
|
||||
keymap.set('n', '<leader>dt', dap.toggle_breakpoint, {})
|
||||
keymap.set('n', '<leader>dc', dap.continue, {})
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,18 +1,90 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
'windwp/nvim-ts-autotag',
|
||||
-- Syntax highlightings
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
cmd = { 'TSInstall', 'TSBufEnable', 'TSBufDisable', 'TSModuleInfo' },
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
config = function()
|
||||
require('nvim-ts-autotag').setup()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'bash',
|
||||
'c',
|
||||
'cpp',
|
||||
'java',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'tsx',
|
||||
'json',
|
||||
'toml',
|
||||
'html',
|
||||
'css',
|
||||
'scss',
|
||||
'lua',
|
||||
'python',
|
||||
},
|
||||
auto_install = true,
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
['af'] = { query = '@function.outer', desc = 'Select outer part of a function region' },
|
||||
['if'] = { query = '@function.inner', desc = 'Select inner part of a function region' },
|
||||
['ac'] = { query = '@class.outer', desc = 'Select outer part of a class region' },
|
||||
['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' },
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>xp'] = { query = '@parameter.inner', desc = 'Swap parameter with the next one' },
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>xP'] = {
|
||||
query = '@parameter.inner',
|
||||
desc = 'Swap parameter with the previous one',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
config = function()
|
||||
require('treesitter-context').setup({ enable = false })
|
||||
end,
|
||||
cmd = 'TSContextToggle',
|
||||
init = function()
|
||||
vim.keymap.set('n', '[c', function()
|
||||
require('treesitter-context').go_to_context()
|
||||
end, { silent = true, desc = 'Go to TS context' })
|
||||
vim.keymap.set('n', '<leader>tc', function()
|
||||
require('treesitter-context').toggle()
|
||||
end, { silent = true, desc = 'Toggle TS Context' })
|
||||
end,
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "python", "cpp", "html", "css", "javascript", "typescript", "json", "php", "gdscript", 'markdown', 'markdown_inline', 'bash','java' },
|
||||
sync_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'oil',
|
||||
callback = function()
|
||||
vim.opt_local.colorcolumn = ''
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('oil').setup({
|
||||
use_default_keymaps = false,
|
||||
keymaps = {
|
||||
['g?'] = 'actions.show_help',
|
||||
['<CR>'] = 'actions.select',
|
||||
['<C-\\>'] = 'actions.select_split',
|
||||
['<C-enter>'] = 'actions.select_vsplit', -- this is used to navigate left
|
||||
['<C-t>'] = 'actions.select_tab',
|
||||
['<C-p>'] = 'actions.preview',
|
||||
['<C-c>'] = 'actions.close',
|
||||
['<C-r>'] = 'actions.refresh',
|
||||
['-'] = 'actions.parent',
|
||||
['_'] = 'actions.open_cwd',
|
||||
['`'] = 'actions.cd',
|
||||
['~'] = 'actions.tcd',
|
||||
['gs'] = 'actions.change_sort',
|
||||
['gx'] = 'actions.open_external',
|
||||
['g.'] = 'actions.toggle_hidden',
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return { 'nvim-lua/plenary.nvim', lazy = true }
|
||||
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
'folke/persistence.nvim',
|
||||
event = 'BufReadPre',
|
||||
opts = { options = vim.opt.sessionoptions:get() },
|
||||
keys = {
|
||||
{
|
||||
'<leader>ss',
|
||||
function()
|
||||
require('persistence').load()
|
||||
end,
|
||||
desc = 'Restore Session',
|
||||
},
|
||||
{
|
||||
'<leader>sl',
|
||||
function()
|
||||
require('persistence').load({ last = true })
|
||||
end,
|
||||
desc = 'Restore Last Session',
|
||||
},
|
||||
{
|
||||
'<leader>sd',
|
||||
function()
|
||||
require('persistence').stop()
|
||||
end,
|
||||
desc = "Don't Save Current Session",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
return {
|
||||
'HiPhish/rainbow-delimiters.nvim',
|
||||
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,
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
return {
|
||||
'ThePrimeagen/refactoring.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
config = function()
|
||||
require('refactoring').setup({
|
||||
prompt_func_return_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
prompt_func_param_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
printf_statements = {},
|
||||
print_var_statements = {},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
'NStefan002/screenkey.nvim',
|
||||
cmd = 'Screenkey',
|
||||
version = '*',
|
||||
vim.keymap.set('n', '<leader>kt', '<cmd>Screenkey<CR>', { desc = 'Toggle keys' }),
|
||||
config = function()
|
||||
require('screenkey').setup({
|
||||
-- see :h nvim_open_win
|
||||
win_opts = {
|
||||
relative = 'editor',
|
||||
anchor = 'SE',
|
||||
width = 40,
|
||||
height = 1,
|
||||
border = 'single',
|
||||
},
|
||||
-- compress input when repeated <compress_after> times
|
||||
compress_after = 3,
|
||||
-- clear the input after <clear_after> seconds of inactivity
|
||||
clear_after = 3,
|
||||
-- temporarily disable screenkey (for example when inside of the terminal)
|
||||
disable = {
|
||||
filetypes = {}, -- for example: "toggleterm"
|
||||
-- :h 'buftype'
|
||||
buftypes = {}, -- for example: "terminal"
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
'nvim-pack/nvim-spectre',
|
||||
build = false,
|
||||
cmd = 'Spectre',
|
||||
opts = { open_cmd = 'noswapfile vnew' },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
{
|
||||
'luukvbaal/statuscol.nvim',
|
||||
event = 'BufReadPre',
|
||||
config = function()
|
||||
local builtin = require('statuscol.builtin')
|
||||
require('statuscol').setup({
|
||||
setopt = true,
|
||||
separator = '',
|
||||
foldfunc = 'builtin',
|
||||
relculright = true,
|
||||
segments = {
|
||||
{ text = { '%s' }, click = 'v:lua.ScSa' },
|
||||
{
|
||||
text = { builtin.lnumfunc, ' ' },
|
||||
click = 'v:lua.ScLa',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
+140
-25
@@ -1,30 +1,145 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.8',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
|
||||
cond = vim.fn.executable('cmake') == 1,
|
||||
},
|
||||
|
||||
config = function()
|
||||
require('telescope').setup({
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true,
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
cmd = 'Telescope',
|
||||
version = false,
|
||||
lazy = true,
|
||||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'zig' },
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
{ 'nvim-telescope/telescope-file-browser.nvim' },
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>sf',
|
||||
function()
|
||||
require('telescope.builtin').find_files()
|
||||
end,
|
||||
desc = 'Find File (CWD)',
|
||||
},
|
||||
|
||||
defaults = {
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
preview_cutoff = 0,
|
||||
{
|
||||
'<leader>sh',
|
||||
function()
|
||||
require('telescope.builtin').help_tags()
|
||||
end,
|
||||
desc = 'Find Help',
|
||||
},
|
||||
{
|
||||
'<leader>sH',
|
||||
function()
|
||||
require('telescope.builtin').highlights()
|
||||
end,
|
||||
desc = 'Find highlight groups',
|
||||
},
|
||||
{
|
||||
'<leader>sM',
|
||||
function()
|
||||
require('telescope.builtin').man_pages()
|
||||
end,
|
||||
desc = 'Map Pages',
|
||||
},
|
||||
{
|
||||
'<leader>so',
|
||||
function()
|
||||
require('telescope.builtin').oldfiles()
|
||||
end,
|
||||
desc = 'Open Recent File',
|
||||
},
|
||||
{
|
||||
'<leader>sg',
|
||||
function()
|
||||
require('telescope.builtin').live_grep()
|
||||
end,
|
||||
desc = 'Live Grep',
|
||||
},
|
||||
{
|
||||
'<leader>sw',
|
||||
function()
|
||||
require('telescope.builtin').grep_string()
|
||||
end,
|
||||
desc = 'Grep String',
|
||||
},
|
||||
{
|
||||
'<leader>sk',
|
||||
function()
|
||||
require('telescope.builtin').keymaps()
|
||||
end,
|
||||
desc = 'Keymaps',
|
||||
},
|
||||
{
|
||||
'<leader>sC',
|
||||
function()
|
||||
require('telescope.builtin').commands()
|
||||
end,
|
||||
desc = 'Commands',
|
||||
},
|
||||
{
|
||||
'<leader><leader>',
|
||||
function()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
desc = 'Buffers',
|
||||
},
|
||||
{
|
||||
'<leader>sd',
|
||||
function()
|
||||
require('telescope.builtin').diagnostics()
|
||||
end,
|
||||
desc = 'diagnostics',
|
||||
},
|
||||
{
|
||||
'<leader>sF',
|
||||
'<cmd>Telescope file_browser<CR>',
|
||||
"desc = 'File Browser'",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local telescope = require('telescope')
|
||||
local fb_actions = require('telescope').extensions.file_browser.actions
|
||||
telescope.setup({
|
||||
file_ignore_patterns = { '%.git/.' },
|
||||
defaults = {
|
||||
preview = {
|
||||
treesitter = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
end,
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = 'smart_case', -- or "ignore_case" or "respect_case"
|
||||
},
|
||||
file_browser = {
|
||||
theme = 'ivy',
|
||||
hijack_netrw = true,
|
||||
mapping = {
|
||||
['i'] = {
|
||||
['<A-c>'] = fb_actions.create,
|
||||
['<A-r>'] = fb_actions.rename,
|
||||
['<A-d>'] = fb_actions.remove,
|
||||
['<A-h>'] = fb_actions.toggle_hidden,
|
||||
},
|
||||
['n'] = {
|
||||
['a'] = fb_actions.create,
|
||||
['r'] = fb_actions.rename,
|
||||
['d'] = fb_actions.remove,
|
||||
['h'] = fb_actions.toggle_hidden,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
borderchars = {
|
||||
prompt = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
|
||||
results = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
|
||||
},
|
||||
})
|
||||
telescope.load_extension('ui-select')
|
||||
telescope.load_extension('file_browser')
|
||||
-- telescope.load_extension("refactoring")
|
||||
telescope.load_extension('notify')
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,51 @@
|
||||
local size = function()
|
||||
return vim.o.columns * 0.5
|
||||
end
|
||||
return {
|
||||
'2kabhishek/termim.nvim',
|
||||
cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' },
|
||||
'akinsho/toggleterm.nvim',
|
||||
lazy = true,
|
||||
cmd = {
|
||||
'ToggleTerm',
|
||||
'ToggleTermSetName',
|
||||
'ToggleTermToggleAll',
|
||||
'ToggleTermSendVisualLines',
|
||||
'ToggleTermSendCurrentLine',
|
||||
'ToggleTermSendVisualSelection',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>1', '<cmd>1ToggleTerm<cr>', desc = 'Toggle Terminal', mode = 'n' },
|
||||
{ '<A-t>', '<cmd>ToggleTerm size=' .. size() .. '<cr>', desc = 'Toggle Terminal', mode = 'n' },
|
||||
{ '<leader>2', '<cmd>2ToggleTerm<cr>', desc = 'Toggle Terminal', mode = 'n' },
|
||||
},
|
||||
opts = {
|
||||
size = 10,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = '2',
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
direction = 'float', -- Use 'float' for floating terminal windows
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = 'curved', -- or 'single', 'double', 'shadow', etc.
|
||||
winblend = 0, -- Set to 0 for full transparency
|
||||
highlights = {
|
||||
border = 'Normal',
|
||||
background = 'Normal',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'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' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
{
|
||||
'xiyaowong/transparent.nvim',
|
||||
config = function()
|
||||
require('transparent').clear_prefix('Navic')
|
||||
require('transparent').clear_prefix('Float')
|
||||
-- require("transparent").clear_prefix("Normal")
|
||||
require('transparent').clear_prefix('NeoTree')
|
||||
require('transparent').clear_prefix('Noice')
|
||||
require('transparent').clear_prefix('Notify')
|
||||
-- require("transparent").clear_prefix("Mini")
|
||||
require('transparent').clear_prefix('WhichKey')
|
||||
require('transparent').clear_prefix('BufferLine')
|
||||
require('transparent').clear_prefix('Telescope')
|
||||
require('transparent').setup({ -- Optional, you don't have to run setup.
|
||||
groups = { -- table: default groups
|
||||
'Comment',
|
||||
'Constant',
|
||||
'TabLineFill',
|
||||
'Special',
|
||||
'WinBar',
|
||||
'Identifier',
|
||||
'Statement',
|
||||
'PreProc',
|
||||
'Type',
|
||||
'Underlined',
|
||||
'Todo',
|
||||
'String',
|
||||
'Function',
|
||||
'Conditional',
|
||||
'Repeat',
|
||||
'Operator',
|
||||
'Structure',
|
||||
'LineNr',
|
||||
'NonText',
|
||||
'SignColumn',
|
||||
'StatusLine',
|
||||
'StatusLineNC',
|
||||
'EndOfBuffer',
|
||||
'SignColumn',
|
||||
'HoverNormal',
|
||||
},
|
||||
extra_groups = {
|
||||
'OctoEditable',
|
||||
'EndOfBuffer',
|
||||
'Search',
|
||||
'Cursor',
|
||||
'LazyNormal',
|
||||
}, -- table: additional groups that should be cleared
|
||||
exclude_groups = {}, -- table: groups you don't want to clear
|
||||
on_clear = function() end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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>cs', '<cmd>Trouble symbols toggle<cr>', desc = 'Symbols (Trouble)' },
|
||||
{ '<leader>cS', '<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',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'mbbill/undotree',
|
||||
keys = {
|
||||
{ '<leader>uu', '<cmd>UndotreeToggle<cr>', desc = 'Toggle Undotree' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'szw/vim-maximizer',
|
||||
|
||||
keys = {
|
||||
{ '<leader>sm', '<cmd>MaximizerToggle<CR>', { desc = 'Maximize/minimize a split' } },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'wakatime/vim-wakatime',
|
||||
lazy = false,
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
preset = 'helix',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>?',
|
||||
function()
|
||||
require('which-key').show({ global = false })
|
||||
end,
|
||||
desc = 'Buffer Local Keymaps (which-key)',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'gelguy/wilder.nvim',
|
||||
keys = {
|
||||
':',
|
||||
'/',
|
||||
'?',
|
||||
},
|
||||
dependencies = {
|
||||
'catppuccin/nvim',
|
||||
},
|
||||
config = function()
|
||||
local wilder = require('wilder')
|
||||
|
||||
-- Enable wilder when pressing :, / or ?
|
||||
wilder.setup({ modes = { ':', '/', '?' } })
|
||||
|
||||
-- Enable fuzzy matching for commands and buffers
|
||||
wilder.set_option('pipeline', {
|
||||
wilder.branch(
|
||||
wilder.cmdline_pipeline({
|
||||
fuzzy = 1,
|
||||
}),
|
||||
wilder.vim_search_pipeline({
|
||||
fuzzy = 1,
|
||||
})
|
||||
),
|
||||
})
|
||||
|
||||
wilder.set_option(
|
||||
'renderer',
|
||||
wilder.popupmenu_renderer(wilder.popupmenu_palette_theme({
|
||||
border = 'rounded',
|
||||
max_height = '75%',
|
||||
min_height = 0,
|
||||
prompt_position = 'top',
|
||||
reverse = 0,
|
||||
}))
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
'folke/zen-mode.nvim',
|
||||
cmd = { 'ZenMode' },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ '<leader>zz', '<cmd>ZenMode<cr>', desc = 'Toggle zen mode' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
-- This file is automatically loaded by plugins.core
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
local opt = vim.opt
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.expandtab = false
|
||||
opt.tabstop = 6
|
||||
opt.shiftwidth = 6
|
||||
opt.wrap = false
|
||||
|
||||
-- netrw file explorer settings
|
||||
vim.g.netrw_winsize = 20
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_liststyle = 1
|
||||
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.breakindent = true
|
||||
opt.clipboard = 'unnamedplus' -- allows neovim to access the system clipboard
|
||||
opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
|
||||
opt.conceallevel = 0 -- so that `` is visible in markdown files
|
||||
opt.hlsearch = true -- highlight all matches on previous search pattern
|
||||
opt.ignorecase = true -- ignore case in search patterns
|
||||
opt.inccommand = 'split' -- preview incremental substitute
|
||||
opt.mouse = 'a' -- allow the mouse to be used in neovim
|
||||
opt.numberwidth = 4 -- set number column width to 2 {default 4}
|
||||
opt.scrolloff = 10
|
||||
opt.shiftround = true -- round indent
|
||||
opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
|
||||
opt.showcmd = false
|
||||
opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
|
||||
opt.showtabline = 0 -- always show tabs
|
||||
opt.signcolumn = 'yes' -- always show the sign column, otherwise it would shift the text each timeout
|
||||
opt.smartcase = true -- smart case
|
||||
opt.smartindent = true -- make indenting smarter again
|
||||
opt.smarttab = true
|
||||
opt.splitbelow = true -- force all horizontal splits to go below current window
|
||||
opt.splitright = true -- force all vertical splits to go right of the current window
|
||||
opt.swapfile = false -- creastes a swapfile
|
||||
opt.tabstop = 4 -- insert 2 spaces for a tab
|
||||
opt.undofile = true -- enable persistent undofile
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 50 -- faster completion (4000ms default)
|
||||
opt.writebackup = false -- donot edit backups
|
||||
opt.backup = false -- creates a backup file
|
||||
opt.autowrite = true
|
||||
opt.autoindent = true
|
||||
opt.ai = true
|
||||
|
||||
-- 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 buffer
|
||||
vim.cmd([[set fillchars+=eob:\ ]])
|
||||
|
||||
vim.cmd([[autocmd FileType * set formatoptions-=ro]])
|
||||
Reference in new issue
Block a user