From a8ea70cb0592f207f22dfb9e3beb2603adbd9ebf Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sat, 15 Jul 2023 01:40:37 +0530 Subject: nvim: Adding catpuccin theme and telescope nvim --- .config/nvim/lua/justsaumit/plugins.lua | 5 ++- .config/nvim/lua/justsaumit/telescope-config.lua | 52 +++++++++++++++++++++++ .config/nvim/lua/justsaumit/treesitter-config.lua | 2 +- .config/nvim/lua/justsaumit/which-key-config.lua | 6 ++- 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .config/nvim/lua/justsaumit/telescope-config.lua (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/justsaumit/plugins.lua b/.config/nvim/lua/justsaumit/plugins.lua index 6a34a50..ae8b42b 100644 --- a/.config/nvim/lua/justsaumit/plugins.lua +++ b/.config/nvim/lua/justsaumit/plugins.lua @@ -51,13 +51,14 @@ return packer.startup(function(use) --ColorSchemes use "folke/tokyonight.nvim" use "tiagovla/tokyodark.nvim" + use { "catppuccin/nvim", as = "catppuccin" } use { 'AlphaTechnolog/pywal.nvim', as = 'pywal' } --Web-devicons use "kyazdani42/nvim-web-devicons" --Lualine use {'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true }} --Bufferline - use {'akinsho/bufferline.nvim', tag = "v2.*", requires = 'kyazdani42/nvim-web-devicons'} + use {'akinsho/bufferline.nvim', tag = "v2.*", requires = 'nvim-tree/nvim-web-devicons'} --Nvim-tree File explorer for nvim use {'nvim-tree/nvim-tree.lua', requires = { 'nvim-tree/nvim-web-devicons'}} --Whick-key - displays a popup with possible key bindings @@ -66,7 +67,7 @@ return packer.startup(function(use) -- use 'windwp/nvim-ts-autotag' --Markdown + Zenmode --Telescope --- use {'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = { {'nvim-lua/plenary.nvim'} }} + use {'nvim-telescope/telescope.nvim', tag = '0.1.2', requires = { {'nvim-lua/plenary.nvim'} }} --cmp -- use 'hrsh7th/nvim-cmp' --cmp plugins diff --git a/.config/nvim/lua/justsaumit/telescope-config.lua b/.config/nvim/lua/justsaumit/telescope-config.lua new file mode 100644 index 0000000..e678792 --- /dev/null +++ b/.config/nvim/lua/justsaumit/telescope-config.lua @@ -0,0 +1,52 @@ +local actions = require('telescope.actions') +require('telescope').setup { + defaults = { + layout_config = { + width = 0.75, + prompt_position = "top", + preview_cutoff = 120, + horizontal = {mirror = false}, + vertical = {mirror = false} + }, + find_command = { + 'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' + }, + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + file_sorter = require'telescope.sorters'.get_fuzzy_file, + file_ignore_patterns = { + "node_modules", "build", "dist", "yarn.lock", ".local", ".rustup", ".mozilla",".git" + }, + generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, + path_display = {}, + winblend = 0, + border = {}, + borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'}, + color_devicons = true, + use_less = true, + set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil, + file_previewer = require'telescope.previewers'.vim_buffer_cat.new, + grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, + qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, + buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + [""] = actions.smart_send_to_qflist + actions.open_qflist, + [""] = actions.close, + [""] = actions.select_default + actions.center + }, + n = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + [""] = actions.smart_send_to_qflist + actions.open_qflist + } + } + } +} diff --git a/.config/nvim/lua/justsaumit/treesitter-config.lua b/.config/nvim/lua/justsaumit/treesitter-config.lua index 17dbc62..d2f477f 100644 --- a/.config/nvim/lua/justsaumit/treesitter-config.lua +++ b/.config/nvim/lua/justsaumit/treesitter-config.lua @@ -1,6 +1,6 @@ require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" - ensure_installed = { "bash", "c", "cpp","lua", "rust", "python", "go","html", "javascript", "latex", "markdown", "solidity", "sxhkdrc" }, + ensure_installed = { "bash", "c", "cpp", "lua", "rust", "python", "go","html", "javascript", "typescript", "latex", "markdown", "solidity", "sxhkdrc" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, diff --git a/.config/nvim/lua/justsaumit/which-key-config.lua b/.config/nvim/lua/justsaumit/which-key-config.lua index b438f7e..25ec150 100644 --- a/.config/nvim/lua/justsaumit/which-key-config.lua +++ b/.config/nvim/lua/justsaumit/which-key-config.lua @@ -4,8 +4,10 @@ local mappings = { Z = {":wq", "Save and Quit"}, w = {":w", "Save"}, x ={":bdelete", "Close"}, - f = { ":Telescope find_files", "Telescope Find Files" }, - g = { ":Telescope live_grep", "Telescope Live Grep" } + f = { ":Telescope find_files", "Telescope Find Files" }, + h = { ":Telescope find_files hidden=true", "Telescope Find Files" }, + g = { ":Telescope live_grep", "Telescope Live Grep" }, + r = { ":Telescope oldfiles", "Recent files" } } local opts = {prefix = ''} wk.register(mappings, opts) -- cgit v1.2.3