diff --git a/nvim/lua/config/floaterm.lua b/nvim/lua/config/floaterm.lua index bca27c4..97091b8 100644 --- a/nvim/lua/config/floaterm.lua +++ b/nvim/lua/config/floaterm.lua @@ -1,8 +1,7 @@ local g = vim.g -g.floaterm_width = 0.98 -g.floaterm_height = 0.90 -g.floaterm_position = 'bottom' +g.floaterm_width = 0.9 +g.floaterm_height = 0.9 g.floaterm_autoclose = 1 g.floaterm_opener = 'edit' g.floaterm_borderchars = '─│─│╭╮╯╰' diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua new file mode 100644 index 0000000..904e817 --- /dev/null +++ b/nvim/lua/config/telescope.lua @@ -0,0 +1,23 @@ +require('telescope').setup({ + defaults = { + layout_strategy = 'horizontal', + layout_config = { + preview_width = 0.5, + prompt_position = 'bottom', + width = 0.9, + height = 0.9, + }, + }, + extensions = { + fzf = { + fuzzy = true, -- 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" + }, + }, +}) + +-- To get fzf loaded and working with telescope, you need to call +-- load_extension, somewhere after setup function: +require('telescope').load_extension('fzf') diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index b773ab4..1678c39 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -61,16 +61,16 @@ map('n', '', 'bn') map('n', '\\', 'vl') map('n', '-', 'sj') --- fzf-lua -map('n', ',', 'lua require("fzf-lua").files()') -map('n', '.', 'lua require("fzf-lua").buffers()') -map('n', '/', 'lua require("fzf-lua").search_history()') -map('n', ';', 'lua require("fzf-lua").command_history()') -map('n', '`', 'lua require("fzf-lua").files({ cwd = "~/" })') -map('n', 'a', 'lua require("fzf-lua").live_grep()') -map('n', 'b', 'lua require("fzf-lua").git_branches()') -map('n', 'c', 'lua require("fzf-lua").git_bcommits()') -map('n', ']', 'lua require("fzf-lua").lines()') +-- Telescope +map('n', '\'', 'Telescope git_files') +map('n', ',', 'Telescope find_files') +map('n', '.', 'Telescope buffers') +map('n', '/', 'Telescope search_history') +map('n', ';', 'Telescope command_history') +map('n', 'a', 'Telescope live_grep') +map('n', 'b', 'Telescope git_branches') +map('n', 'c', 'Telescope git_bcommits') +map('n', ']', 'Telescope current_buffer_fuzzy_find') -- lsp and diagnostics map('n', 'gd', 'lua vim.lsp.buf.definition()') diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 8cb3b49..ac52651 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -26,21 +26,21 @@ require('lazy').setup({ -- The colorscheme of choice { 'ellisonleao/gruvbox.nvim', priority = 1000 }, - -- TODO: telescope vs. fzf integration - -- modern neovim with treesitter, lsp, null-ls and cmp + -- modern neovim with treesitter, lsp, null-ls, cmp and vsnip -- remember to install all those tools since we do not use mason -- see ../../install/3_vimux.sh + { 'hrsh7th/vim-vsnip', init = get_config('vsnip') }, + { 'jose-elias-alvarez/null-ls.nvim', init = get_config('null-ls'), dependencies = { 'nvim-lua/plenary.nvim' } }, { 'neovim/nvim-lspconfig', init = get_config('lspconfig') }, { - 'nvim-treesitter/nvim-treesitter', - init = get_config('treesitter'), - build = ':TSUpdate', - }, - { - 'jose-elias-alvarez/null-ls.nvim', - init = get_config('null-ls'), - dependencies = { 'nvim-lua/plenary.nvim' }, + 'nvim-telescope/telescope.nvim', + tag = '0.1.1', + init = get_config('telescope'), + dependencies = { 'nvim-lua/plenary.nvim' } }, + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + { 'nvim-treesitter/nvim-treesitter', init = get_config('treesitter'), build = ':TSUpdate' }, + { 'rafamadriz/friendly-snippets', dependencies = { 'hrsh7th/vim-vsnip' } }, { 'hrsh7th/nvim-cmp', init = get_config('cmp'), @@ -51,14 +51,10 @@ require('lazy').setup({ 'hrsh7th/cmp-calc', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', - 'hrsh7th/cmp-vsnip', -- see snippet engine of choice below + 'hrsh7th/cmp-vsnip', }, }, - -- snippet engine of choice - { 'hrsh7th/vim-vsnip', init = get_config('vsnip') }, - { 'rafamadriz/friendly-snippets', dependencies = { 'hrsh7th/vim-vsnip' } }, - -- editing enhancements { 'AndrewRadev/splitjoin.vim' }, { 'echasnovski/mini.ai', version = '*' }, @@ -71,7 +67,6 @@ require('lazy').setup({ -- git and other external tools integration { 'christoomey/vim-tmux-navigator'}, { 'editorconfig/editorconfig-vim' }, - { 'ibhagwan/fzf-lua', dependencies = { 'kyazdani42/nvim-web-devicons' }, init = get_config('fzf') }, { 'lewis6991/gitsigns.nvim', config = true }, { 'voldikss/vim-floaterm', init = get_config('floaterm') }, { 'wincent/terminus' },