nvim telescope ui-select and remaps

This commit is contained in:
Tiago Sousa 2024-03-07 18:08:13 +00:00
parent 2c60ab3c36
commit b03e5af9cb
Signed by: tiago
SSH key fingerprint: SHA256:odOD9vln9U7qNe1R8o3UCbE3jkQCkr5/q5mgd5hwua0
4 changed files with 50 additions and 27 deletions

View file

@ -1,7 +1,20 @@
return {
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"tpope/vim-surround",
"tpope/vim-repeat",
"laytan/cloak.nvim",
{
"stevearc/dressing.nvim",
opts = {
select = {
enable = false,
},
},
},
"nvim-lua/plenary.nvim",
"tpope/vim-surround",
"tpope/vim-repeat",
"laytan/cloak.nvim",
{
"jbyuki/instant.nvim",
config = function()
vim.g.instant_username = "tsousa"
end,
},
}

View file

@ -1,19 +1,30 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
require('telescope').setup({
defaults = require('telescope.themes').get_ivy({
file_ignore_patterns = { "node_modules" },
}),
})
"nvim-telescope/telescope.nvim",
event = "VimEnter",
dependencies = {
"nvim-telescope/telescope-ui-select.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
},
config = function()
require("telescope").setup({
defaults = require("telescope.themes").get_ivy({
file_ignore_patterns = { "node_modules" },
}),
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
},
},
})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<leader>pg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>gf', builtin.git_files, {})
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
require("telescope").load_extension("ui-select")
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
vim.keymap.set("n", "<leader>pg", builtin.live_grep, {})
vim.keymap.set("n", "<leader>gf", builtin.git_files, {})
vim.keymap.set("n", "<leader>vh", builtin.help_tags, {})
end,
}

View file

@ -1,5 +1,3 @@
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
@ -22,10 +20,10 @@ vim.keymap.set("v", "<leader>d", "\"_d")
vim.keymap.set("n", "Q", "<nop>")
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
vim.keymap.set("n", "]q", "<cmd>cnext<CR>zz")
vim.keymap.set("n", "[q", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "]l", "<cmd>lnext<CR>zz")
vim.keymap.set("n", "[l", "<cmd>lprev<CR>zz")
vim.keymap.set("n", "<leader>s", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>")
--vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })

View file

@ -57,3 +57,4 @@ vim.opt.shortmess:append("c")
vim.opt.colorcolumn = "80"
vim.g.mapleader = " "
vim.g.maplocalleader = ' '