From 7e56b36a467d44507a61c4fad0968c97fa34bb11 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Tue, 7 Sep 2021 19:22:58 -0600 Subject: add ctags and telescope-fzf-native --- init.lua | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 374aecc..b8992af 100644 --- a/init.lua +++ b/init.lua @@ -73,11 +73,18 @@ end -- Along with the highlight definition for ColorColumn above, these options -- will set colored marks at certain line lengths -cmd([[au BufEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100)]]) -cmd([[au BufEnter *.py let w:m2=matchadd('Error', '\%121v', 100)]]) -cmd([[au BufLeave *.py call clearmatches()"]]) +cmd [[ +au BufEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100) +au BufEnter *.py let w:m2=matchadd('Error', '\%121v', 100) +au BufLeave *.py call clearmatches() +]] +-- Custom commands +cmd [[ +command! MakeTagsPython !ctags --exclude=venv --languages=python --python-kinds=-i -R . +]] + options = { noremap = true } @@ -93,6 +100,7 @@ map('n', 'fj', 'Telescope jumplist', options) map('n', 'f/', 'Telescope live_grep', options) map('n', 'fa', 'Telescope grep_string', options) map('n', 'fg', "lua require('telescope.builtin').git_status()", options) +map('n', 'ft', "lua require('telescope.builtin').tags({layout_strategy='center', only_sort_tags=true, show_line=true})", options) map('n', 'du', 'diffupdate', options) map('n', 'dd', 'diffget', options) @@ -286,10 +294,23 @@ return require('packer').startup(function() use 'tpope/vim-repeat' use { 'nvim-telescope/telescope.nvim', - requires = { {'nvim-lua/plenary.nvim'} }, + requires = { + {'nvim-lua/plenary.nvim'}, + {'glepnir/lspsaga.nvim'}, + {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, + }, config = function() actions = require("telescope.actions") require("telescope").setup{ + extensions = { + fzf = { + fuzzy = false, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + } + }, defaults = { mappings = { i = { @@ -339,6 +360,7 @@ return require('packer').startup(function() buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker } } + require('telescope').load_extension('fzf') end, } use 'FooSoft/vim-argwrap' -- cgit v1.2.3