update
This commit is contained in:
1 parent
3709c38c6d
commit
d93e388067
17 files changed
+261
-223
No files matched your search
+3
-3
@@ -17,9 +17,9 @@ end)
|
||||
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>')
|
||||
vim.keymap.set("n", "<tab>", ":BufferLineCycleNext<CR>")
|
||||
vim.keymap.set("n", "<S-tab>", ":BufferLineCyclePrev<CR>")
|
||||
vim.keymap.set("n", "<leader>q", ":BufferLinePickClose<CR>")
|
||||
|
||||
-- comment
|
||||
vim.keymap.set('n', '<leader>/', 'gcc', { remap = true })
|
||||
|
||||
+1
-20
@@ -1,20 +1 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
return {}
|
||||
@@ -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,33 @@
|
||||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
|
||||
version = '*',
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
opts = {
|
||||
options = {
|
||||
debug = { logging = true },
|
||||
mode = 'buffers',
|
||||
indicator = { icon = '▍', style = 'none' },
|
||||
sort_by = 'insert_after_current',
|
||||
move_wraps_at_ends = true,
|
||||
right_mouse_command = 'vert sbuffer %d',
|
||||
show_close_icon = false,
|
||||
show_buffer_close_icons = false,
|
||||
diagnostics = 'nvim_lsp',
|
||||
diagnostics_indicator = function(count, level)
|
||||
local icon = level:match('error') and ' ' or ' '
|
||||
return ' ' .. icon .. count
|
||||
end,
|
||||
diagnostics_update_in_insert = false,
|
||||
hover = { enabled = true, reveal = { 'close' } },
|
||||
offsets = {
|
||||
{
|
||||
filetype = 'neo-tree',
|
||||
text = ' File Explorer',
|
||||
highlight = 'Directory',
|
||||
separator = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -33,7 +33,30 @@ return {
|
||||
['<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.
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
}),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require('luasnip').expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require('luasnip').jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
@@ -44,15 +67,11 @@ return {
|
||||
}),
|
||||
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
|
||||
mode = 'symbol',
|
||||
maxwidth = 50,
|
||||
ellipsis_char = '...',
|
||||
show_labelDetails = true,
|
||||
|
||||
-- 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,
|
||||
|
||||
@@ -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,6 @@
|
||||
return {
|
||||
"smjonas/inc-rename.nvim",
|
||||
config = function()
|
||||
require("inc_rename").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,42 +1,4 @@
|
||||
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',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
|
||||
+6
-45
@@ -1,46 +1,7 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
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 = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require("lualine").setup()
|
||||
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,54 @@
|
||||
return {
|
||||
'williamboman/mason.nvim',
|
||||
cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' },
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'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',
|
||||
'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
|
||||
'clang-format', -- c/c++ formatter
|
||||
'luacheck',
|
||||
'pylint',
|
||||
'eslint_d',
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"2kabhishek/nerdy.nvim",
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
cmd = "Nerdy",
|
||||
vim.keymap.set("n", "<Leader>si", "<cmd>Nerdy<cr>", opts), --> nerd icons
|
||||
}
|
||||
+67
-15
@@ -1,18 +1,70 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local null_ls = require('null-ls')
|
||||
'nvimtools/none-ls.nvim', -- configure formatters & linters
|
||||
event = { 'CursorHold', 'CursorHoldI' },
|
||||
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,
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
return {
|
||||
'rcarriga/nvim-notify',
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
vim.notify = require('notify')
|
||||
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
dependencies = {
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
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,
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
'c',
|
||||
'lua',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'python',
|
||||
'cpp',
|
||||
'html',
|
||||
'css',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'json',
|
||||
'php',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'bash',
|
||||
'java',
|
||||
},
|
||||
sync_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
Reference in new issue
Block a user