diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index f9e3514..8e775c4 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -95,7 +95,13 @@ local plugins = { }, { "Dynge/gitmoji.nvim", - ft = "gitcommit", + ft = { "gitcommit", "NeogitCommitMessage" }, + opts = { + filetypes = { "gitcommit", "octo", "NeogitCommitMessage" }, + completion = { + append_space = true, + }, + }, dependencies = "hrsh7th/nvim-cmp" }, { @@ -151,8 +157,12 @@ local plugins = { }, { "nvim-telescope/telescope.nvim", - dependencies = { 'nvim-lua/plenary.nvim'}, + dependencies = { 'nvim-lua/plenary.nvim' }, event = "CmdlineEnter", + keys = { + vim.keymap.set('', 'fd', ':Telescope fd'), + vim.keymap.set('', 'bf', ':Telescope buffers'), + }, config = function() require("plugins.telescope") end @@ -202,6 +212,9 @@ local plugins = { { 'simrat39/symbols-outline.nvim', cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' }, + keys = { + vim.keymap.set('n', 'o', ':SymbolsOutline'), + }, opts = { autofold_depth = 12 } }, { @@ -240,7 +253,10 @@ local plugins = { } local vscode_plugins = { - "machakann/vim-sandwich", + { + "machakann/vim-sandwich", + keys = "s" + }, { "numToStr/Comment.nvim", event = "BufEnter", @@ -248,7 +264,6 @@ local vscode_plugins = { require("Comment").setup() end }, - "tpope/vim-fugitive" } if vim.g.vscode then diff --git a/lua/mappings.lua b/lua/mappings.lua index b93b7d8..79741ea 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -1,11 +1,12 @@ -local map = vim.api.nvim_set_keymap +-- TODO: Use vim.keymap.set() +local map = vim.keymap.set -- vscode if vim.g.vscode then -- undo/REDO via vscode - map("n", "u", "call VSCodeNotify('undo')", {}) - map("n", "", "call VSCodeNotify('redo')", {}) - map("n", "gf", "call VSCodeCall('editor.action.openLink')", { silent = true, noremap = true }) + map("n", "u", "call VSCodeNotify('undo')") + map("n", "", "call VSCodeNotify('redo')") + map("n", "gf", "call VSCodeCall('editor.action.openLink')", { noremap = true }) end -- generic mappings @@ -16,28 +17,22 @@ map('n', 'n', 'nzzzv', { noremap = true }) map('n', 'N', 'Nzzzv', { noremap = true }) -- Shortcutting split navigation -map('', '', 'h', {}) -map('', '', 'j', {}) -map('', '', 'k', {}) -map('', '', 'l', {}) -map('', '', 'H', {}) -map('', '', 'J', {}) -map('', '', 'K', {}) -map('', '', 'L', {}) -map('', '', '>', {}) -map('', '', '<', {}) -map('', '', '+', {}) -map('', '', '-', {}) -map('', '', 'T', {}) +map('', '', 'h') +map('', '', 'j') +map('', '', 'k') +map('', '', 'l') +map('', '', 'H') +map('', '', 'J') +map('', '', 'K') +map('', '', 'L') +map('', '', '>') +map('', '', '<') +map('', '', '+') +map('', '', '-') +map('', '', 'T') -- undo to the last , . or ! map('i', ',', ',u', { noremap = true }) map('i', '.', '.u', { noremap = true }) map('i', '!', '!u', { noremap = true }) map('i', '?', '?u', { noremap = true }) --- plugin mappings --- symbols outline -map('n', 'o', ':SymbolsOutline', { silent = true }) --- telescope -map('', 'fd', ':Telescope fd', { silent = true }) -map('', 'bf', ':Telescope buffers', { silent = true }) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 8e9ba6d..5390752 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -57,7 +57,7 @@ cmp.setup({ { name = 'nvim_lua' }, { name = "treesitter" }, { name = "async_path" }, - { name = "git" }, + { name = "gitmoji" }, { name = "buffer" }, }), completion = { @@ -75,16 +75,6 @@ cmp.setup.cmdline({ '/', '?' }, { }, }) --- Set configuration for specific filetype. -cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources( - { - { name = 'buffer' }, - }, { - { name = 'gitmoji' } - }) -}) - -- `:` cmdline setup. cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), @@ -97,7 +87,7 @@ cmp.setup.cmdline(':', { { name = 'cmdline', option = { - ignore_cmds = { 'Man', '!' } + ignore_cmds = {} } } }) @@ -108,6 +98,6 @@ cmp.setup.cmdline(':', { local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp = require('cmp') cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() + 'confirm_done', + cmp_autopairs.on_confirm_done() )