diff options
| author | talha <talha@talhaamir.xyz> | 2026-07-26 11:55:58 +0500 |
|---|---|---|
| committer | talha <talha@talhaamir.xyz> | 2026-07-26 11:55:58 +0500 |
| commit | 1c8503345693788660ac0a132b111ebeb08ed87f (patch) | |
| tree | f78456b136fef6ad77885ee518e3def2dcde1a6f /lua/talha/plugins | |
| parent | 70fe2441aa025243e29d47aabe1b6674c4e0ed71 (diff) | |
Updated config
Diffstat (limited to 'lua/talha/plugins')
| -rw-r--r-- | lua/talha/plugins/oil.lua | 24 | ||||
| -rw-r--r-- | lua/talha/plugins/telescope.lua | 38 | ||||
| -rw-r--r-- | lua/talha/plugins/treesitter.lua | 30 |
3 files changed, 78 insertions, 14 deletions
diff --git a/lua/talha/plugins/oil.lua b/lua/talha/plugins/oil.lua new file mode 100644 index 0000000..a7196fa --- /dev/null +++ b/lua/talha/plugins/oil.lua @@ -0,0 +1,24 @@ +return { + 'stevearc/oil.nvim', + dependencies = { { "nvim-mini/mini.icons", version = '*', + config = function() + require('mini.icons').setup() + end + } }, + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, + config = function() + require("oil").setup({ + columns = { + "icon", + }, + view_options = { + show_hidden = true, + }, + keymaps = { + ["<A-l>"] = { "actions.select", mode = "n" }, + ["<A-h>"] = { "actions.parent", mode = "n" }, + } + }) + end +} diff --git a/lua/talha/plugins/telescope.lua b/lua/talha/plugins/telescope.lua index 8b3a54b..65bfae9 100644 --- a/lua/talha/plugins/telescope.lua +++ b/lua/talha/plugins/telescope.lua @@ -1,6 +1,6 @@ return { { - "nvim-telescope/telescope.nvim", version = "0.1.2", + "nvim-telescope/telescope.nvim", version = "*", dependencies = { "nvim-lua/plenary.nvim" }, config = function() local builtin = require('telescope.builtin') @@ -13,6 +13,40 @@ return { vim.keymap.set('n', '<leader>pb', builtin.buffers) vim.keymap.set('n', '<leader>ph', builtin.help_tags) vim.keymap.set('n', '<leader>mp', builtin.man_pages) - end + + + local actions = require('telescope.actions') + require("telescope").setup({ + defaults = { + mappings = { + i = { -- Insert mode mappings + ["<C-u>"] = actions.preview_scrolling_up, + ["<C-d>"] = actions.preview_scrolling_down, + ["<C-h>"] = actions.preview_scrolling_left, + ["<C-l>"] = actions.preview_scrolling_right, + ["<A-j>"] = actions.move_selection_next, + ["<A-k>"] = actions.move_selection_previous, + ["<A-u>"] = actions.results_scrolling_up, + ["<A-d>"] = actions.results_scrolling_down, + ["<A-h>"] = actions.results_scrolling_left, + ["<A-l>"] = actions.results_scrolling_right, + }, + n = { -- Normal mode mappings + ["<C-u>"] = actions.preview_scrolling_up, + ["<C-d>"] = actions.preview_scrolling_down, + ["<C-h>"] = actions.preview_scrolling_left, + ["<C-l>"] = actions.preview_scrolling_right, + ["<A-k>"] = actions.move_selection_previous, + ["<A-j>"] = actions.move_selection_next, + ["<A-u>"] = actions.results_scrolling_up, + ["<A-d>"] = actions.results_scrolling_down, + ["<A-h>"] = actions.results_scrolling_left, + ["<A-l>"] = actions.results_scrolling_right, + ["<C-[>"] = actions.close, + }, + }, + }, + }) + end } } diff --git a/lua/talha/plugins/treesitter.lua b/lua/talha/plugins/treesitter.lua index 53d3ca0..7cf6c38 100644 --- a/lua/talha/plugins/treesitter.lua +++ b/lua/talha/plugins/treesitter.lua @@ -1,22 +1,28 @@ return { { "nvim-treesitter/nvim-treesitter", + branch = "main", lazy = false, build = ":TSUpdate", config = function () - local configs = require("nvim-treesitter.configs") + local ts = require("nvim-treesitter") - configs.setup({ - ensure_installed = { - "c", "cpp", "python", - "vim", "vimdoc", "query", - }, - sync_install = false, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { enable = true }, + -- Automatically install your specified parsers + ts.install({ + "c", "cpp", "python", + "vim", "vimdoc", "query" + }) + + -- Enable highlighting and indentation using Neovim's built-in APIs + vim.api.nvim_create_autocmd("FileType", { + pattern = { "*.yml", "*.sql", "Dockerfile*", "CMakeLists*", "*.py", "*.c", "*.cpp", "*.h", "*.hpp" }, + callback = function() + -- Replaces highlight = { enable = true } + vim.treesitter.start() + + -- Replaces indent = { enable = true } + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, }) end } |
