summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/init.lua1
-rw-r--r--.config/nvim/lua/justsaumit/keymaps.lua2
-rw-r--r--.config/nvim/lua/justsaumit/plugins.lua4
-rw-r--r--.config/nvim/lua/justsaumit/telescope-config.lua50
-rw-r--r--.config/nvim/lua/justsaumit/which-key-config.lua4
-rw-r--r--.config/nvim/plugin/packer_compiled.lua5
6 files changed, 64 insertions, 2 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index e6343da..b0c01a8 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -9,4 +9,5 @@ require("justsaumit.nvim-tree-config")
require("justsaumit.lastplace-config")
require("justsaumit.autopairs")
require("justsaumit.which-key-config")
+require("justsaumit.telescope-config")
print ("while(!(succeed = try() ) );")
diff --git a/.config/nvim/lua/justsaumit/keymaps.lua b/.config/nvim/lua/justsaumit/keymaps.lua
index 2a29f46..5b06bdc 100644
--- a/.config/nvim/lua/justsaumit/keymaps.lua
+++ b/.config/nvim/lua/justsaumit/keymaps.lua
@@ -20,6 +20,8 @@ vim.g.maplocalleader = " "
keymap("n", "<C-s>", ":w<CR>", opts)
--Toggle nvim-tree
keymap("n", "<m-e>", ":NvimTreeToggle<CR>", opts)
+--Disable C-e
+keymap("n", "<c-e>", ":<CR>", opts)
-- Better window navigation for split
keymap("n", "<C-h>", "<C-w>h", opts)
diff --git a/.config/nvim/lua/justsaumit/plugins.lua b/.config/nvim/lua/justsaumit/plugins.lua
index 8c075ec..9d2b36e 100644
--- a/.config/nvim/lua/justsaumit/plugins.lua
+++ b/.config/nvim/lua/justsaumit/plugins.lua
@@ -61,9 +61,11 @@ return packer.startup(function(use)
--Nvim-tree File explorer for nvim
use {'kyazdani42/nvim-tree.lua', requires = { 'kyazdani42/nvim-web-devicons'}}
--Whick-key - displays a popup with possible key bindings
- use {'folke/which-key.nvim'}
+ use 'folke/which-key.nvim'
--HTML
use 'windwp/nvim-ts-autotag'
+--Telescope
+use {'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = { {'nvim-lua/plenary.nvim'} }}
--cmp
-- use 'neovim/nvim-lspconfig'
-- use 'hrsh7th/cmp-nvim-lsp'
diff --git a/.config/nvim/lua/justsaumit/telescope-config.lua b/.config/nvim/lua/justsaumit/telescope-config.lua
new file mode 100644
index 0000000..c1bb44d
--- /dev/null
+++ b/.config/nvim/lua/justsaumit/telescope-config.lua
@@ -0,0 +1,50 @@
+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 = {},
+ 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 = {
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+ ["<esc>"] = actions.close,
+ ["<CR>"] = actions.select_default + actions.center
+ },
+ n = {
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
+ }
+ }
+ }
+}
diff --git a/.config/nvim/lua/justsaumit/which-key-config.lua b/.config/nvim/lua/justsaumit/which-key-config.lua
index 11bb49c..b438f7e 100644
--- a/.config/nvim/lua/justsaumit/which-key-config.lua
+++ b/.config/nvim/lua/justsaumit/which-key-config.lua
@@ -3,7 +3,9 @@ local mappings = {
q = {":q<CR>", "Quit"},
Z = {":wq<CR>", "Save and Quit"},
w = {":w<CR>", "Save"},
- x ={":bdelete<CR>", "Close"}
+ x ={":bdelete<CR>", "Close"},
+ f = { ":Telescope find_files<cr>", "Telescope Find Files" },
+ g = { ":Telescope live_grep<cr>", "Telescope Live Grep" }
}
local opts = {prefix = '<leader>'}
wk.register(mappings, opts)
diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua
index 2c4489e..3b04a32 100644
--- a/.config/nvim/plugin/packer_compiled.lua
+++ b/.config/nvim/plugin/packer_compiled.lua
@@ -129,6 +129,11 @@ _G.packer_plugins = {
path = "/home/saumit/.local/share/nvim/site/pack/packer/start/pywal",
url = "https://github.com/AlphaTechnolog/pywal.nvim"
},
+ ["telescope.nvim"] = {
+ loaded = true,
+ path = "/home/saumit/.local/share/nvim/site/pack/packer/start/telescope.nvim",
+ url = "https://github.com/nvim-telescope/telescope.nvim"
+ },
["tokyodark.nvim"] = {
loaded = true,
path = "/home/saumit/.local/share/nvim/site/pack/packer/start/tokyodark.nvim",