From 4230158ff5664fff22ef5992f35a92f0a09db57d Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sat, 2 Sep 2023 20:14:14 +0200 Subject: [PATCH] Add further customizations --- init.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 697860c..eea6469 100644 --- a/init.lua +++ b/init.lua @@ -239,7 +239,27 @@ require('lazy').setup({ build = "cd app && npm install", init = function() vim.g.mkdp_filetypes = { "markdown" } end, }, + -- show notifications etc in a nice area + {'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + } + }, + -- tmux vim keybindings 'christoomey/vim-tmux-navigator', + -- databse connections from within vim using DBGUI and DB + 'tpope/vim-dadbod', + 'kristijanhusak/vim-dadbod-ui', + 'kristijanhusak/vim-dadbod-completion', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -353,6 +373,13 @@ require('telescope').setup { }, }, }, + pickers = { + live_grep = { + additional_args = function(opts) + return {"--hidden"} + end + }, + }, } -- Enable telescope fzf native, if installed @@ -370,12 +397,13 @@ vim.keymap.set('n', '/', function() end, { desc = '[/] Fuzzily search in current buffer' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) +vim.keymap.set('n', 'sfn', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles [N]o Hidden' }) +vim.keymap.set('n', 'sfh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[S]earch [F]iles [H]idden' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` @@ -607,6 +635,7 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'vim-dadbod-completion' }, }, } @@ -629,3 +658,11 @@ wilder.setup({modes = {':', '/', '?'}}) -- Unless you are still migrating, remove the deprecated commands from v1.x vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) +-- neo_tree +vim.keymap.set('n', 'f', 'Neotree toggle', { desc = 'Toggle NeoTree' }) + +-- database +vim.keymap.set('n', 'nu', 'DBUIToggle', { desc = 'Toggle UI' }) +vim.keymap.set('n', 'nf', 'DBUIFindBuffer', { desc = 'Find buffer' }) +vim.keymap.set('n', 'nr', 'DBUIRenameBuffer', { desc = 'Rename buffer' }) +vim.keymap.set('n', 'nq', 'DBUILastQueryInfo', { desc = 'Last query info' })