From d9aba24302e2780895bdcc755005d87d642582d0 Mon Sep 17 00:00:00 2001 From: Fernando Bueno Date: Sun, 30 Jun 2024 20:19:01 -0400 Subject: [PATCH] restores --- init.lua | 12 ++++++++++-- lua/custom/core/keymaps.lua | 36 ++++++++++++++++++------------------ lua/custom/plugins/init.lua | 26 +++++++++++++------------- 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/init.lua b/init.lua index b391e2c5..e5cd800e 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -430,12 +430,20 @@ require('lazy').setup({ ['ui-select'] = { require('telescope.themes').get_dropdown(), }, + ['media_files'] = { + -- filetypes whitelist + -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} + filetypes = {"png", "webp", "jpg", "jpeg"}, + -- find command (defaults to `fd`) + find_cmd = "rg" + } }, } -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension, 'media-files') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -952,7 +960,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/core/keymaps.lua b/lua/custom/core/keymaps.lua index 837584d4..6ddcb65e 100644 --- a/lua/custom/core/keymaps.lua +++ b/lua/custom/core/keymaps.lua @@ -63,43 +63,43 @@ keymap.set('n', '', ':BookmarkToggle') -- PLUGINS -- vim-maximizer --- keymap.set("n", "sm", ":MaximizerToggle") -- toggle split window maximization +keymap.set("n", "sm", ":MaximizerToggle") -- toggle split window maximization -- nvim-tree --- keymap.set("n", "e", ":NvimTreeToggle") -- toggle file explorer +keymap.set("n", "e", ":NvimTreeToggle") -- toggle file explorer -- telescope --- keymap.set("n", "ff", "Telescope find_files") -- find files within current working directory, respects .gitignore --- keymap.set("n", "fs", "Telescope live_grep") -- find string in current working directory as you type --- keymap.set("n", "fc", "Telescope grep_string") -- find string under cursor in current working directory --- keymap.set("n", "fb", "Telescope buffers") -- list open buffers in current neovim instance --- keymap.set("n", "fh", "Telescope help_tags") -- list available help tags +keymap.set("n", "ff", "Telescope find_files") -- find files within current working directory, respects .gitignore +keymap.set("n", "fs", "Telescope live_grep") -- find string in current working directory as you type +keymap.set("n", "fc", "Telescope grep_string") -- find string under cursor in current working directory +keymap.set("n", "fb", "Telescope buffers") -- list open buffers in current neovim instance +keymap.set("n", "fh", "Telescope help_tags") -- list available help tags --- keymap.set("n", "t", "Telescope vim_bookmarks current_file") --- keymap.set("n", "tt", "Telescope vim_bookmarks all") +keymap.set("n", "t", "Telescope vim_bookmarks current_file") +keymap.set("n", "tt", "Telescope vim_bookmarks all") -- telescope git commands (not on youtube nvim video) --- keymap.set("n", "gc", "Telescope git_commits") -- list all git commits (use to checkout) ["gc" for git commits] --- keymap.set("n", "gfc", "Telescope git_bcommits") -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] --- keymap.set("n", "gb", "Telescope git_branches") -- list git branches (use to checkout) ["gb" for git branch] --- keymap.set("n", "gs", "Telescope git_status") -- list current changes per file with diff preview ["gs" for git status] +keymap.set("n", "gc", "Telescope git_commits") -- list all git commits (use to checkout) ["gc" for git commits] +keymap.set("n", "gfc", "Telescope git_bcommits") -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] +keymap.set("n", "gb", "Telescope git_branches") -- list git branches (use to checkout) ["gb" for git branch] +keymap.set("n", "gs", "Telescope git_status") -- list current changes per file with diff preview ["gs" for git status] -- restart lsp server (not on youtube nvim video) --- keymap.set("n", "rs", ":LspRestart") -- mapping to restart lsp if necessary +keymap.set("n", "rs", ":LspRestart") -- mapping to restart lsp if necessary -- move local opts = { noremap = true, silent = false } -- Normal-mode commands keymap.set('n', '', ':MoveLine(-1)', opts) keymap.set('n', '', ':MoveLine(1)', opts) --- keymap.set('n', '', ':MoveHChar(-1)', opts) --- keymap.set('n', '', ':MoveHChar(1)', opts) +keymap.set('n', '', ':MoveHChar(-1)', opts) +keymap.set('n', '', ':MoveHChar(1)', opts) -- Visual-mode commands keymap.set('v', '', ':MoveBlock(1)', opts) keymap.set('v', '', ':MoveBlock(-1)', opts) --- keymap.set('v', '', ':MoveHBlock(-1)', opts) --- keymap.set('v', '', ':MoveHBlock(1)', opts) +keymap.set('v', '', ':MoveHBlock(-1)', opts) +keymap.set('v', '', ':MoveHBlock(1)', opts) -- Harpoon keymap.set("n", "a", function() require("harpoon.mark").add_file() end, opts) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 12daa21f..3154a0a4 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,27 +2,27 @@ require("custom.core.keymaps") require("custom.core.options") return { - 'nvim-lua/popup.nvim', - 'christoomey/vim-tmux-navigator', + -- 'christoomey/vim-tmux-navigator', + 'nvim-lua/popup.nvim', -- used by other plugins 'szw/vim-maximizer', -- maximizes and restores current window 'tpope/vim-surround', -- add, delete, change surroundings (it's awesome) 'vim-scripts/ReplaceWithRegister', -- replace with register contents using motion (gr + motion) 'kyazdani42/nvim-web-devicons', -- vs-code like icons - 'hrsh7th/cmp-buffer', -- source for text in buffer, - 'hrsh7th/cmp-path', -- source for file system paths - 'rafamadriz/friendly-snippets', -- useful snippets - { "glepnir/lspsaga.nvim", branch = "main" }, -- enhanced lsp uis - 'jose-elias-alvarez/typescript.nvim', -- additional functionality for typescript server (e.g. rename file & update imports) - 'onsails/lspkind.nvim', -- vs-code like icons for autocompletion - 'jose-elias-alvarez/null-ls.nvim', -- configure formatters & linters - 'jayp0521/mason-null-ls.nvim', -- bridges gap b/w mason & null-ls - { "windwp/nvim-ts-autotag", after = "nvim-treesitter" }, -- autoclose tags 'fedepujol/move.nvim', -- move line/block up/down + -- 'hrsh7th/cmp-buffer', -- source for text in buffer, + -- 'hrsh7th/cmp-path', -- source for file system paths + 'rafamadriz/friendly-snippets', -- useful snippets + -- { "glepnir/lspsaga.nvim", branch = "main" }, -- enhanced lsp uis + -- 'jose-elias-alvarez/typescript.nvim', -- additional functionality for typescript server (e.g. rename file & update imports) + -- 'onsails/lspkind.nvim', -- vs-code like icons for autocompletion + -- 'jose-elias-alvarez/null-ls.nvim', -- configure formatters & linters + -- 'jayp0521/mason-null-ls.nvim', -- bridges gap b/w mason & null-ls + { "windwp/nvim-ts-autotag", after = "nvim-treesitter" }, -- autoclose tags 'ThePrimeagen/harpoon', -- the name is... ThePrimeagen 'MattesGroeger/vim-bookmarks', -- vim-bookmarks 'tom-anders/telescope-vim-bookmarks.nvim', -- telescope-vim-bookmarks 'tpope/vim-unimpaired', -- vim-unimpared - -- 'nvim-telescope/telescope-media-files.nvim', - 'nvim-telescope/telescope-ui-select.nvim', + -- 'nvim-telescope/telescope-media-files.nvim', -- doesnt work for windows 'nvim-telescope/telescope-file-browser.nvim', } +