diff --git a/init.lua b/init.lua index f1cb29f4..62496363 100644 --- a/init.lua +++ b/init.lua @@ -214,10 +214,10 @@ do vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode - -- vim.keymap.set('n', '', 'echo "Use h to move!!"') - -- vim.keymap.set('n', '', 'echo "Use l to move!!"') - -- vim.keymap.set('n', '', 'echo "Use k to move!!"') - -- vim.keymap.set('n', '', 'echo "Use j to move!!"') + vim.keymap.set('n', '', 'echo "Use h to move!!"') + vim.keymap.set('n', '', 'echo "Use l to move!!"') + vim.keymap.set('n', '', 'echo "Use k to move!!"') + vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -573,8 +573,14 @@ require('lazy').setup({ branch = 'main', build = ':TSUpdate', config = function() - local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } - require('nvim-treesitter').install(parsers) + local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'python', 'query', 'sql', 'vim', 'vimdoc' } + require('nvim-treesitter').install(parsers, function(lang, success) + if success then + vim.notify('treesitter: installed ' .. lang, vim.log.levels.INFO) + else + vim.notify('treesitter: failed to install ' .. lang, vim.log.levels.WARN) + end + end) ---@param buf integer ---@param language string @@ -628,5 +634,9 @@ require('lazy').setup({ checker = { enabled = false }, }) + -- Open Oil in a floating window + vim.keymap.set("n", "of", "Oil --float", { desc = "Open Oil float" }) + + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lazy-lock.json b/lazy-lock.json index 65c7e00d..2c6cad0d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -29,7 +29,10 @@ "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "wezterm.nvim": { "branch": "main", "commit": "032c33b621b96cc7228955b4352b48141c482098" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua new file mode 100644 index 00000000..2c2efeb2 --- /dev/null +++ b/lua/custom/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-fugitive", +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 966924f2..2a751fd6 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -3,6 +3,30 @@ return { dependencies = { 'nvim-mini/mini.nvim' }, config = function() require('mini.icons').setup() - require('oil').setup() + require('oil').setup { + view_options = { + show_hidden = false, + is_hidden_file = function(name, bufnr) + return vim.startswith(name, '.') + end, + is_always_hidden = function(name, bufnr) + return false + end, + natural_order = false, + sort = { + { 'type', 'asc' }, + { 'name', 'asc' }, + }, + }, + keymaps = { + ['th'] = { + callback = function() + require('oil').toggle_hidden() + end, + desc = 'Toggle hidden files', + mode = 'n', + }, + }, + } end, } diff --git a/lua/custom/plugins/toggle-term.lua b/lua/custom/plugins/toggle-term.lua new file mode 100644 index 00000000..7f929d1a --- /dev/null +++ b/lua/custom/plugins/toggle-term.lua @@ -0,0 +1,18 @@ +return { + 'akinsho/toggleterm.nvim', + version = '*', + opts = { + open_mapping = [[tt]], + }, + config = function(_, opts) + require('toggleterm').setup(opts) + vim.keymap.set('t', '', [[]], { desc = 'Exit terminal mode' }) + + local lazygit = require('toggleterm.terminal').Terminal:new({ + cmd = 'lazygit', + direction = 'float', + hidden = true, + }) + vim.keymap.set('n', 'tg', function() lazygit:toggle() end, { desc = 'Toggle lazygit' }) + end, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000..3741f30a --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +}