diff --git a/after/plugin/defaults.lua b/after/plugin/defaults.lua index 60b41a22..8d1a867b 100644 --- a/after/plugin/defaults.lua +++ b/after/plugin/defaults.lua @@ -7,9 +7,7 @@ set.list = true set.swapfile = false set.writebackup = false set.wrap = false --- vim.o.sessionoptions = "resize,winpos,winsize,buffers,tabpages,folds,curdir,help" set.shiftwidth = 2 --- vim.o.showmode = true set.splitbelow = true set.splitright = true set.tabstop = 2 @@ -20,19 +18,10 @@ vim.keymap.set('n', 'H', 'gT', { desc = 'Tab Left' }) vim.keymap.set('n', 'L', 'gt', { desc = 'Tab Right' }) -- line bubbling - --- nnoremap :m .+1== --- nnoremap :m .-2== vim.keymap.set('n', '', ':m .+1==', { noremap = true, desc = 'Bubble Down' }) vim.keymap.set('n', '', ':m .-2==', { noremap = true, desc = 'Bubble Up' }) -- conflicts with "signature help" from LSP - --- inoremap :m .+1==gi --- inoremap :m .-2==gi vim.keymap.set('i', '', ':m .+1==gi', { noremap = true, desc = 'Bubble Down' }) vim.keymap.set('i', '', ':m .-2==gi', { noremap = true, desc = 'Bubble Up' }) - --- vnoremap :m '>+1gv=gv --- vnoremap :m '<-2gv=gv vim.keymap.set('v', '', ":m '<-2gv=gv", { noremap = true, desc = 'Bubble Down' }) vim.keymap.set('v', '', ":m '>+1gv=gv", { noremap = true, desc = 'Bubble Up' }) @@ -49,13 +38,11 @@ vim.diagnostic.config({ }, float = { source = "always", - -- close_events = { 'BufLeave', 'CursorMoved', 'InsertEnter', 'FocusLost' }, format = function(diagnostic) if diagnostic.source == 'eslint' then return string.format( '%s [%s]', diagnostic.message, - -- shows the name of the rule diagnostic.user_data.lsp.code ) end @@ -74,9 +61,7 @@ end -- null-ls -- @see: https://github.com/jay-babu/mason-null-ls.nvim -- might want to just use mason-null-ls. not yet sure what the advantage is. - local null_ls = require("null-ls") - null_ls.setup({ sources = { null_ls.builtins.formatting.prettierd, @@ -91,4 +76,25 @@ cmp.event:on( cmp_autopairs.on_confirm_done() ) +-- neogen +vim.keymap.set('n', 'nf', ":Neogen func", { noremap = true, desc = '[D]ocument [F]unction' }) + +-- hop +local hop = require('hop') +local directions = require('hop.hint').HintDirection + +vim.keymap.set( + '', + 'h', + function() hop.hint_char1({ direction = directions.AFTER_CURSOR }) end, + { remap = true } +) + +vim.keymap.set( + '', + 'H', + function() hop.hint_char1({ direction = directions.BEFORE_CURSOR }) end, + { remap = true } +) + -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 02ae290b..94f679a2 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -4,14 +4,29 @@ return { { "tpope/vim-eunuch", }, { "tpope/vim-repeat", }, { "tpope/vim-surround" }, + { "tribela/vim-transparent" }, { "nvim-tree/nvim-web-devicons", opts = {} }, + { + "danymat/neogen", + dependencies = "nvim-treesitter/nvim-treesitter", + config = true, + }, + { + 'phaazon/hop.nvim', + branch = 'v2', + config = function() + require 'hop'.setup {} + end + }, + { "windwp/nvim-autopairs", + lazy = true, config = function() require("nvim-autopairs").setup {} end, @@ -23,6 +38,7 @@ return { }, { "jose-elias-alvarez/null-ls.nvim", + lazy = true, dependencies = { "nvim-lua/plenary.nvim" }, } }