-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nvim): migrate to lazy plugin manager
- Loading branch information
Showing
51 changed files
with
1,092 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
local set_undo_ftplugin = require('kutsan/utils').set_undo_ftplugin | ||
local set_undo_ftplugin = require('user/utils').set_undo_ftplugin | ||
|
||
set_undo_ftplugin('setlocal spell<') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
local set_undo_ftplugin = require('kutsan/utils').set_undo_ftplugin | ||
local set_undo_ftplugin = require('user/utils').set_undo_ftplugin | ||
|
||
set_undo_ftplugin('setlocal commentstring<') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
local set_undo_ftplugin = require('kutsan/utils').set_undo_ftplugin | ||
local set_undo_ftplugin = require('user/utils').set_undo_ftplugin | ||
|
||
set_undo_ftplugin('setlocal statusline<') |
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...vim/autoload/kutsan/autocmds/jumplast.vim → .../nvim/autoload/user/autocmds/jumplast.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...m/autoload/kutsan/autocmds/savebuffer.vim → ...vim/autoload/user/autocmds/savebuffer.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...autoload/kutsan/autocmds/trimtrailing.vim → ...m/autoload/user/autocmds/trimtrailing.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...utoload/kutsan/mappings/motion/indent.vim → .../autoload/user/mappings/motion/indent.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, | ||
"catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, | ||
"cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, | ||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | ||
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" }, | ||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, | ||
"cmp-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, | ||
"cmp-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, | ||
"cmp-luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, | ||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | ||
"cokeline": { "branch": "main", "commit": "8b877a972337623f3f28f85a71611b2a08911b3a" }, | ||
"colorizer": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, | ||
"copilot": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, | ||
"devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, | ||
"diffview": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, | ||
"dressing": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, | ||
"fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, | ||
"gitsigns": { "branch": "main", "commit": "7e38f07cab0e5387f9f41e92474db174a63a4725" }, | ||
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, | ||
"lspconfig": { "branch": "master", "commit": "9eb6d866840df0f3fb1d2e8f34a7e0cfdf80f980" }, | ||
"luasnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, | ||
"mason": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, | ||
"mason-lspconfig": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, | ||
"nvim-tree": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, | ||
"plenary": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, | ||
"schema-store": { "branch": "main", "commit": "4ace5d886d826452abee415ff92bda986e2c01c6" }, | ||
"surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, | ||
"telescope": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, | ||
"treesitter": { "branch": "master", "commit": "208d504421e4ac53f4230a34cd4b831e8e76cb69" }, | ||
"treesitter-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, | ||
"treesitter-context": { "branch": "master", "commit": "e6e71047bb323fb36f5664993a42adaac252bb36" }, | ||
"treesitter-text-objects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, | ||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
local Plugin = { 'windwp/nvim-autopairs' } | ||
|
||
Plugin.name = 'autopairs' | ||
|
||
Plugin.config = true | ||
Plugin.event = 'InsertEnter' | ||
|
||
return Plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
local Plugin = { 'hrsh7th/nvim-cmp' } | ||
|
||
Plugin.name = 'cmp' | ||
|
||
Plugin.event = 'InsertEnter' | ||
|
||
Plugin.dependencies = { | ||
{ 'hrsh7th/cmp-buffer', name = 'cmp-buffer' }, | ||
{ 'hrsh7th/cmp-calc', name = 'cmp-calc' }, | ||
{ 'hrsh7th/cmp-cmdline', name = 'cmp-cmdline' }, | ||
{ 'hrsh7th/cmp-nvim-lsp', name = 'cmp-lsp' }, | ||
{ 'hrsh7th/cmp-nvim-lsp-signature-help', name = 'cmp-lsp-signature-help' }, | ||
{ 'saadparwaiz1/cmp_luasnip', name = 'cmp-luasnip' }, | ||
{ 'hrsh7th/cmp-path', name = 'cmp-path' }, | ||
'luasnip', | ||
'autopairs', | ||
} | ||
|
||
Plugin.opts = function() | ||
local cmp = require('cmp') | ||
|
||
local kind_icons = { | ||
Text = '', | ||
Method = '', | ||
Function = '', | ||
Constructor = '', | ||
Field = '', | ||
Variable = '', | ||
Class = '', | ||
Interface = '', | ||
Module = '', | ||
Property = '', | ||
Unit = '', | ||
Value = '', | ||
Enum = '', | ||
Keyword = '', | ||
Snippet = '', | ||
Color = '', | ||
File = '', | ||
Reference = '', | ||
Folder = '', | ||
EnumMember = '', | ||
Constant = '', | ||
Struct = '', | ||
Event = '', | ||
Operator = '', | ||
TypeParameter = '', | ||
} | ||
|
||
return { | ||
snippet = { | ||
expand = function(args) | ||
local luasnip = require('luasnip') | ||
luasnip.lsp_expand(args.body) | ||
end, | ||
}, | ||
completion = { | ||
completeopt = 'menu,menuone,noinsert', | ||
}, | ||
window = { | ||
documentation = { | ||
max_width = 60, | ||
max_height = 15, | ||
}, | ||
}, | ||
experimental = { | ||
ghost_text = true, | ||
}, | ||
formatting = { | ||
fields = { 'kind', 'abbr', 'menu' }, | ||
format = function(_, item) | ||
local label_width = 20 | ||
local label = item.abbr | ||
local truncated_label = vim.fn.strcharpart(label, 0, label_width) | ||
|
||
if truncated_label ~= label then | ||
item.abbr = truncated_label .. '…' | ||
elseif string.len(label) < label_width then | ||
local padding = string.rep(' ', label_width - string.len(label)) | ||
item.abbr = label .. padding | ||
end | ||
|
||
item.menu = item.kind | ||
item.kind = kind_icons[item.kind] | ||
return item | ||
end, | ||
}, | ||
mapping = { | ||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4)), | ||
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4)), | ||
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item()), | ||
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item()), | ||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete()), | ||
['<C-e>'] = cmp.mapping.abort(), | ||
['<CR>'] = cmp.mapping.confirm({ | ||
behavior = cmp.ConfirmBehavior.Replace, | ||
select = true, | ||
}), | ||
['<Tab>'] = cmp.mapping(function(fallback) | ||
local function has_words_before() | ||
local row_position, column_position = | ||
unpack(vim.api.nvim_win_get_cursor(0)) | ||
|
||
if column_position == 0 then | ||
return false | ||
end | ||
|
||
local current_line = vim.api.nvim_buf_get_lines( | ||
0, | ||
row_position - 1, | ||
row_position, | ||
false | ||
)[1] | ||
local character_at_cursor = | ||
current_line:sub(column_position + 1, column_position + 1) | ||
|
||
return character_at_cursor:match('%s') == nil | ||
end | ||
|
||
if cmp.visible() then | ||
cmp.select_next_item() | ||
elseif has_words_before() then | ||
cmp.complete() | ||
else | ||
fallback() | ||
end | ||
end), | ||
['<S-Tab>'] = cmp.mapping(function(fallback) | ||
if cmp.visible() then | ||
cmp.select_prev_item() | ||
else | ||
fallback() | ||
end | ||
end), | ||
}, | ||
sources = cmp.config.sources({ | ||
{ name = 'nvim_lsp' }, | ||
{ name = 'nvim_lsp_signature_help' }, | ||
{ name = 'luasnip' }, | ||
{ name = 'calc' }, | ||
}, { | ||
{ name = 'buffer' }, | ||
}), | ||
} | ||
end | ||
|
||
Plugin.config = function(_, opts) | ||
local cmp = require('cmp') | ||
local autopairs_cmp_completion = require('nvim-autopairs.completion.cmp') | ||
|
||
cmp.setup(opts) | ||
|
||
cmp.setup.cmdline(':', { | ||
completion = { | ||
completeopt = 'menu,menuone,noinsert,noselect', | ||
}, | ||
mapping = cmp.mapping.preset.cmdline(), | ||
sources = cmp.config.sources({ | ||
{ name = 'path' }, | ||
}, { | ||
{ name = 'cmdline' }, | ||
}), | ||
}) | ||
|
||
cmp.setup.cmdline({ '/', '?' }, { | ||
completion = { | ||
completeopt = 'menu,menuone,noinsert,noselect', | ||
}, | ||
view = { | ||
entries = { name = 'wildmenu' }, | ||
}, | ||
mapping = cmp.mapping.preset.cmdline(), | ||
sources = { | ||
{ name = 'buffer' }, | ||
}, | ||
}) | ||
|
||
cmp.event:on('confirm_done', autopairs_cmp_completion.on_confirm_done()) | ||
end | ||
|
||
return Plugin |
Oops, something went wrong.