From 76be6160050e52c85f892f757d38e374db0e1117 Mon Sep 17 00:00:00 2001 From: Thiago-Assis-T Date: Sun, 10 Sep 2023 12:16:02 -0300 Subject: [PATCH] stuff --- init.lua | 3 ++- lua/plugins/lsp/formatter.lua | 8 ++++---- lua/plugins/telescope.lua | 26 +++++++++++++++++--------- lua/remaps.lua | 9 --------- 4 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 lua/remaps.lua diff --git a/init.lua b/init.lua index 1d1a74f..0b8bfdc 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' require('plugins') require('colors') -require('remaps') require('settings') diff --git a/lua/plugins/lsp/formatter.lua b/lua/plugins/lsp/formatter.lua index 6062055..c839d2e 100644 --- a/lua/plugins/lsp/formatter.lua +++ b/lua/plugins/lsp/formatter.lua @@ -33,16 +33,16 @@ require('formatter').setup({ require('formatter.filetypes.css').prettier, }, javascript = { - require('formatter.filetypes.javascript').eslint, + require('formatter.filetypes.javascript').eslint_d, }, javascriptreact = { - require('formatter.filetypes.javascriptreact').eslint, + require('formatter.filetypes.javascriptreact').eslint_d, }, typescript = { - require('formatter.filetypes.typescript').eslint, + require('formatter.filetypes.typescript').eslint_d, }, typescriptreact = { - require('formatter.filetypes.typescriptreact').eslint, + require('formatter.filetypes.typescriptreact').eslint_d, }, json = { require('formatter.filetypes.json').prettier, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index c2740e8..df7e7b1 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,10 +1,18 @@ -require('telescope').setup({ - extensions = { - file_browser = { - theme = 'dropdown', - hijack_netrw = true, - }, - }, -}) +require('telescope').setup({}) require('telescope').load_extension('fzf') -require('telescope').load_extension('file_browser') +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({ + winblend = 10, + previewer = false, + })) +end, { desc = '[/] Fuzzily search in current buffer' }) + +vim.keymap.set('n', 'ft', require('telescope.builtin').git_files, { desc = '[F]ind gi[T]' }) +vim.keymap.set('n', 'ff', require('telescope.builtin').find_files, { desc = '[F]ind [F]iles' }) +vim.keymap.set('n', 'fh', require('telescope.builtin').help_tags, { desc = '[F]ind [H]elp' }) +vim.keymap.set('n', 'fw', require('telescope.builtin').grep_string, { desc = '[F]ind [W]ord' }) +vim.keymap.set('n', 'fg', require('telescope.builtin').live_grep, { desc = '[F]ind [G]rep' }) +vim.keymap.set('n', 'fd', require('telescope.builtin').diagnostics, { desc = '[F]ind [D]iagnostics' }) diff --git a/lua/remaps.lua b/lua/remaps.lua deleted file mode 100644 index d3d163f..0000000 --- a/lua/remaps.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' -local opts = { silent = true, noremap = true } --- Telescope Remaps: -vim.api.nvim_set_keymap('n', 'ff', 'Telescope find_files', opts) -vim.api.nvim_set_keymap('n', 'ft', 'Telescope git_files', opts) -vim.api.nvim_set_keymap('n', 'fd', 'Telescope diagnostics', opts) -vim.api.nvim_set_keymap('n', 'fp', 'Telescope grep_string', opts) -vim.api.nvim_set_keymap('n', 'fb', 'Telescope file_browser', opts)