From cdec52268af26932560d1d3dc814a320602f6310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 4 Mar 2021 08:12:31 +0100 Subject: [PATCH] Add telescope to neovim --- symlinks/config/nvim/after/plugin/fzf.vim | 3 - symlinks/config/nvim/lua/init/plugins.lua | 111 +++++++++--------- symlinks/config/nvim/lua/plugin/telescope.lua | 14 +++ 3 files changed, 69 insertions(+), 59 deletions(-) delete mode 100644 symlinks/config/nvim/after/plugin/fzf.vim create mode 100644 symlinks/config/nvim/lua/plugin/telescope.lua diff --git a/symlinks/config/nvim/after/plugin/fzf.vim b/symlinks/config/nvim/after/plugin/fzf.vim deleted file mode 100644 index bcb659b..0000000 --- a/symlinks/config/nvim/after/plugin/fzf.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Map FZF to CtrlP -nnoremap :Files -nnoremap :Rg diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/init/plugins.lua index 0a1341e..8e5cefa 100644 --- a/symlinks/config/nvim/lua/init/plugins.lua +++ b/symlinks/config/nvim/lua/init/plugins.lua @@ -2,77 +2,76 @@ return require('packer').startup { function(use) use 'wbthomason/packer.nvim' - -- General plugins - use 'tpope/vim-sensible' - use 'tpope/vim-endwise' - use 'tpope/vim-surround' - use 'tpope/vim-fugitive' - use 'tpope/vim-vinegar' - use 'tpope/vim-obsession' - use 'tpope/vim-dadbod' - use 'airblade/vim-gitgutter' - use 'godlygeek/tabular' - use { 'Shougo/vimproc.vim', run = 'make' } - use 'vim-scripts/utl.vim' - use { 'mbbill/undotree', cmd = 'UndotreeToggle' } - use { 'junegunn/fzf', run = function() vim.fn['fzf#install']() end } - use 'junegunn/fzf.vim' - use 'mhinz/vim-grepper' - use 'direnv/direnv.vim' - use 'tpope/vim-speeddating' - use 'flazz/vim-colorschemes' + -- Tpope general improvements + use 'tpope/vim-sensible' -- Sane defaults + use 'tpope/vim-endwise' -- Add closing statements automatically for if, function etc + use 'tpope/vim-surround' -- Surround with ', ", etc + use 'tpope/vim-fugitive' -- Git integration + use 'tpope/vim-vinegar' -- Netrw improvements + use 'tpope/vim-obsession' -- Session.vim management + use 'tpope/vim-dadbod' -- Database access + use 'tpope/vim-speeddating' -- and for dates + use 'tpope/vim-dispatch' -- Dispatch command + use 'tpope/vim-projectionist' -- Project config file! + use 'tpope/vim-unimpaired' -- Additional [ and ] mappings + use 'tpope/vim-repeat' -- Better . repeat + use 'tpope/vim-commentary' -- Commenting motion + use 'tpope/vim-sleuth' -- Intendation heuristics + + -- General improvements + use 'airblade/vim-gitgutter' -- Git signs + use 'godlygeek/tabular' -- Tabular command for alignment + -- use { 'Shougo/vimproc.vim', run = 'make' } -- Not really used + use 'vim-scripts/utl.vim' -- Universal text linking + use { 'mbbill/undotree', cmd = 'UndotreeToggle' } -- Undos in a tree for easy access + use 'mhinz/vim-grepper' -- Grepper command - improved grepping throughout project + use 'radenling/vim-dispatch-neovim' -- vim-dispatch for neovim - uses terminal + use 'wellle/targets.vim' -- Additional targets for inside and around motions + use 'flazz/vim-colorschemes' -- All popular colorschemes -- Tools - use 'tpope/vim-dispatch' - use 'radenling/vim-dispatch-neovim' - use 'vim-test/vim-test' - use 'dense-analysis/ale' - use 'tpope/vim-projectionist' - use 'ervandew/supertab' - use 'mfussenegger/nvim-dap' - - -- Vim improvements - use 'wellle/targets.vim' - use 'tpope/vim-unimpaired' - use 'tpope/vim-repeat' - use 'tpope/vim-commentary' - use 'tpope/vim-sleuth' + use 'direnv/direnv.vim' -- Integration with Direnv + use 'vim-test/vim-test' -- Running tests from vim + use 'dense-analysis/ale' -- Asynchronous Lint Engine - used for linting, not for LSP + use 'nathunsmitty/nvim-ale-diagnostic' -- Neovim LSP + ALE integration + use 'mfussenegger/nvim-dap' -- Debug Adapter Protocol + use 'theHamsta/nvim-dap-virtual-text' -- Virtual text display for DAP -- Snippets if vim.g.loaded_python3_provider ~= 0 then - use 'SirVer/ultisnips' - use 'honza/vim-snippets' + use 'SirVer/ultisnips' -- Snippets in python format + use 'honza/vim-snippets' -- Collection of snippets for UltiSnips end -- Language support - use 'sheerun/vim-polyglot' - use 'c-brenn/phoenix.vim' - use 'tpope/vim-rails' - use 'tpope/vim-salve' - use 'tpope/vim-fireplace' - use 'vimwiki/vimwiki' - use 'ledger/vim-ledger' + use 'sheerun/vim-polyglot' -- All popular languages + use 'tpope/vim-rails' -- Enables all rails command through vim and integrates with projectionist + use 'c-brenn/phoenix.vim' -- Similar to vim-rails, but for phoenix + use 'tpope/vim-salve' -- Clojure integration with projectionist + use 'tpope/vim-fireplace' -- Clojure REPL and integration + use 'vimwiki/vimwiki' -- Vimwiki - personal wiki in vim + use 'ledger/vim-ledger' -- Support for ledger-cli format -- Treesitter - use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } - use 'nvim-treesitter/playground' - use 'theHamsta/nvim-dap-virtual-text' + use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } -- Treesitter integration + use 'nvim-treesitter/playground' -- TSPlaygroundToggle - access treesitter data -- LSP -- use 'tjdevries/nlua.nvim' - use 'neovim/nvim-lspconfig' - use 'alexaandru/nvim-lspupdate' - use 'nvim-lua/completion-nvim' - use 'nvim-treesitter/completion-treesitter' - use 'nvim-lua/lsp_extensions.nvim' - - -- Extras - use 'nathunsmitty/nvim-ale-diagnostic' + use 'neovim/nvim-lspconfig' -- Easy LSP Config + use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers + use 'nvim-lua/completion-nvim' -- LSP completion integration + use 'nvim-treesitter/completion-treesitter' -- Treesitter completion integration + use 'nvim-lua/lsp_extensions.nvim' -- LSP extensions (like closing labels for Dart) -- Lua support - use 'tjdevries/astronauta.nvim' - use 'nvim-lua/popup.nvim' - use 'nvim-lua/plenary.nvim' + use 'tjdevries/astronauta.nvim' -- Support for lua ftplugins and plugins + use 'nvim-lua/popup.nvim' -- Popup API integration - needed for some plugins + use 'nvim-lua/plenary.nvim' -- Lua helpers + + -- Telescope + use 'nvim-telescope/telescope.nvim' -- Fuzzy searcher + use 'nvim-telescope/telescope-dap.nvim' -- DAP integration for Telescope end } diff --git a/symlinks/config/nvim/lua/plugin/telescope.lua b/symlinks/config/nvim/lua/plugin/telescope.lua new file mode 100644 index 0000000..c805532 --- /dev/null +++ b/symlinks/config/nvim/lua/plugin/telescope.lua @@ -0,0 +1,14 @@ +------------------------------------------------------------------------------- +-- - Telescope configuration - +------------------------------------------------------------------------------- + +require('telescope').setup{ +} + +require('telescope').load_extension('dap') + +default_opts = {noremap = true} + +local function set_keymap(...) vim.api.nvim_set_keymap(...) end +set_keymap('n', '', "lua require('telescope.builtin').find_files()", default_opts) +set_keymap('n', '', "lua require('telescope.builtin').live_grep()", default_opts)